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.
Skills similaires
Expert Next.js App Router
Developpement
Un skill qui transforme Claude en expert Next.js App Router.
Claude CodeCursoradvanced
890
234
3,180
Générateur de README
Developpement
Crée des README.md professionnels et complets pour vos projets.
claudeCursorWindsurfbeginner
259
72
1,081
Rédacteur de Documentation API
Developpement
Génère de la documentation API complète au format OpenAPI/Swagger.
claudeCursorWindsurfintermediate
156
44
941