AgentSkillsCN

commit

为本项目生成规范化的 Commit 消息。自动分析已暂存的 Git 更改,并根据类型与范围生成格式规范的 Commit 消息。适用于提交更改或运行 /commit 命令时使用。

SKILL.md
--- frontmatter
name: commit
description: Generate conventional commit messages for this project. Analyzes staged git changes and creates properly formatted commit messages with type and scope. Use when committing changes or running /commit.
allowed-tools:
  - Bash
  - Read

Conventional Commits Skill

Generate git commit messages following the Conventional Commits v1.0.0 specification.

Format

code
<type>(<scope>[,<scope>...]): <description>

[optional body]

[optional footer(s)]

Quick Reference

Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore

Project Scopes: core, node, html-renderer, rollup, vite, demos, release

Multi-scope: When changes span multiple packages, combine scopes with commas: feat(core,node): add shared utility

See reference.md for full specification and guidelines. See examples.md for practical examples.

Workflow

  1. Run git status to get an overview of modified files
  2. Run git log --oneline -5 to see recent commit style
  3. Run git diff --cached only if more details are needed to understand the changes
  4. Determine appropriate type based on the nature of changes
  5. Identify scope from affected package(s) — if changes span multiple packages, combine scopes (e.g., core,node)
  6. For breaking changes or new APIs: Check if downstream packages need their workspace dependency constraints updated (see reference.md)
  7. Write concise description in imperative mood
  8. Add body if explanation of what/why is needed
  9. Always include Co-Authored-By: Claude <noreply@anthropic.com> footer
  10. Validate message: echo '<subject line>' > /tmp/commit-msg && pnpm exec commitlint --edit /tmp/commit-msg
  11. Stage files and commit — if commitlint fails (hook or manual), fix the message and retry