name: "commit" description: "Analyze git changes, stage as needed, generate a Conventional Commit message, and create a commit." argument-hint: "[optional commit intent]" user-invocable: true
Skill: Smart Git Commit
Use this skill when the user runs /commit or asks to commit changes.
Instructions
-
Analyze Context:
- Run
git statusto identify modified, added, or deleted files. - Run
git diffto inspect changes in unstaged files. - Run
git diff --cachedto inspect changes in staged files.
- Run
-
Stage Changes:
- If there are unstaged changes, run
git add -Ato stage all changes unless the user explicitly requested a partial commit.
- If there are unstaged changes, run
-
Generate Commit Message:
- Analyze diffs to understand the intent of changes.
- Draft a message following Conventional Commits:
<type>(<scope>): <description> [optional body] - Type 使用英文:
feat,fix,docs,style,refactor,perf,test,build,ci,chore。 - Scope 为可选,应反映受影响的功能区域。
- 标题示例格式:
feat(world): WorldStore/RegionCache 架构与 runtime chunk streaming - 正文尽量使用中文编写,描述具体变更细节和原因。
-
Execute Commit:
- Run
git commit -m "generated_message". - If a body is needed, use multiple
-mflags.
- Run
-
Report:
- Inform the user of the commit message used and commit result.
Related skills
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
Claude CodeCursoradvanced
890
234
3,180
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
claudeCursorWindsurfbeginner
259
72
1,081
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.
claudeCursorWindsurfintermediate
156
44
941