commit-message
1
总安装量
1
周安装量
#44891
全站排名
安装命令
npx skills add https://github.com/ahgraber/skills --skill commit-message
Agent 安装分布
opencode
1
continue
1
github-copilot
1
claude-code
1
Skill 文档
Commit Message
Draft a Conventional Commit message from staged changes.
Critical Constraints
- Use only staged changes (
--cached/ staged SCM state) as input. - Resolve and use the repository root for all SCM calls.
- If no staged changes exist after one retry, stop and inform the user.
- Always include an
AI-assistant: <AGENT>footer. - Output only the final commit message in one markdown code block.
Workflow
- Resolve repository root.
Prefer workspace root when known; otherwise run
git rev-parse --show-toplevel. - Retrieve staged changes.
Prefer
get_changed_fileswithrepositoryPath: <repo-root>and staged state. If that tool is unavailable, use SCM tooling with explicit repo context. If SCM tooling is unavailable, usegit -C <repo-root> diff --cached. - Validate staged content exists. If empty, retry once with explicit repo root; if still empty, inform user and stop.
- Analyze the staged diff. Identify changed files, behavior impact, logical scope, and likely commit type.
- Incorporate user arguments/context when provided. Preserve explicit issue refs and constraints from user input.
- Draft the commit message using
references/conventional-commit-rules.md. - Return only the final message in a fenced code block, ready for
git commit -F -.
References
references/conventional-commit-rules.md– subject/body/footer rules and examples.