git-commit-convention
Generates and reviews semantic commit messages based on staged changes.
Install
mkdir -p .claude/skills/git-commit-convention && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12909" && unzip -o skill.zip -d .claude/skills/git-commit-convention && rm skill.zipInstalls to .claude/skills/git-commit-convention
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Draft or review semantic commit messages from staged changes, including split signals, business-facing subjects, breaking-change markers, and repair commands such as `git add -p`, `git reset`, and `git commit --amend`.Key capabilities
- →Draft semantic commit messages from staged changes
- →Review semantic commit messages
- →Suggest split commits when staged changes cross semantic boundaries
- →Provide repair commands for git operations
- →Recommend amending the latest commit for minor corrections
- →Warn about failing quality gates before committing
How it works
The skill starts from staged content and analyzes it to draft semantic commit messages, offering guidance on splitting commits or amending existing ones based on detected intent and repository rules.
Inputs & outputs
When to use git-commit-convention
- →Drafting semantic commit messages
- →Repairing commit history
- →Staging code for clean commits
About this skill
Purpose
Draft or review semantic commit messages that match the staged change set instead of merely restating code motion.
Trigger / When to use
Use this skill when:
- the user asks for a commit message or wants help before
git commit - staged changes are ready and the agent should suggest one commit or several split commits
- the agent detects
git commitintent and should intercept with a compliant draft - a recent commit likely needs
--amendbecause of a typo, missed file, or footer fix
Do not use this skill when:
- the main task is naming a branch or deciding release/tagging policy
- there are no staged changes and the user is not asking for general commit policy
- the main question is repository-wide CI, testing, or reviewer policy instead of the commit itself
Inputs
- the staged files, staged hunks, and
git status - any recent conversation that explains the business intent behind the change
- the repository's allowed commit types and any scope mapping
- whether related issue or PR identifiers exist
- whether type-check, test, or pre-commit signals are already failing
- whether the latest commit is a better fit for
--amendthan a new commit
Process
- Start from staged content, not the whole working tree. If nothing is staged, stop and say so instead of inventing a commit.
- If the staging is partial and the semantic intent is unclear, ask whether the commit message should describe only the staged subset.
- Separate noise from business intent. If lockfiles, formatter rewrites, snapshots, or generated files are mixed into a business change, strongly recommend splitting them into a dedicated
chore:orstyle:commit. - Detect multiple semantic boundaries. If one staged set mixes unrelated intentions, recommend split commits and provide repair commands such as
git reset,git add -p, orgit restore --staged. - Choose the commit
typefrom business intent first: e.g.feat,fix,refactor,test,docs,chore,style,perf,ci,build, orrevert. - Choose
scopefrom the project's mapping when it exists. If the staged change truly spans multiple module boundaries in one intentional commit, allow a composite scope such asfeat(ui,api): ...; otherwise prefer splitting. - Write the subject in business language. Name the user-visible or domain effect, not only the code action; e.g.
fix(錯誤處理): 修正語意派例外鏈結遺失is better thanfix: add CustomException. - Require a commit body when the subject alone cannot explain why, when the change is a refactor or multi-step fix, or when edge-case handling or migration detail matters.
- Add a footer such as
Closes #123orRelates-to: #456when an issue or PR identifier exists. - If the change is breaking, require
!in the header and explain migration impact in the body. - Surface nearby quality failures early. If strict type-hint or test checks are already failing, include a warning in the commit recommendation instead of pretending the commit is release-safe.
- Output the proposed message text, a short rationale, and a runnable
git commitcommand, but never execute the commit without human confirmation. - If the latest commit only needs a narrow correction, prefer an
--amendrecommendation over creating an unnecessary follow-up commit.
Examples
- Positive: Split formatter noise away from a business fix, then draft
fix(錯誤處理): 修正語意派例外鏈結遺失with a body andRelates-tofooter. - Negative: Hide mixed lockfile and feature changes under one
feat: update files, or describe only code motion such asrefactor: rename classwhen the staged change actually fixes user-visible behavior.
Validation
Main decision path:
- Staging check — confirm
git statusshows staged changes before drafting; if nothing is staged AND the request is not a general commit-policy question, BLOCKED. - Semantic boundary check — identify whether staged set represents one intent or multiple; mixed-intent staging requires split recommendation before drafting a single commit.
- Type assignment — verify chosen type (
feat,fix,refactor, etc.) matches business intent, not code mechanics. - Breaking change check — if any public interface changes, require
!marker and body explanation. - Quality gate check — if type-check or test failures are known, include explicit warning in the draft output.
PASS: staged changes form a coherent intent, type and subject are correctly assigned, any breaking change is marked.<br>
SOFT FAIL: staging is partial or intent is ambiguous — continue with best-effort draft, flag the ambiguity explicitly, and ask the user to confirm scope.<br>
BLOCKED: no staged changes exist AND the request is not a general commit-policy question AND no --amend candidate is identified.
Failure Handling
- Nothing staged: stop immediately; state that no staged changes were found and ask the user to stage changes before proceeding.
- Ambiguous intent: produce a draft labelled
[DRAFT — scope unclear]with the clearest interpretation, then list alternative interpretations and ask the user to confirm. - Mixed semantic boundaries: produce split recommendations with repair commands rather than forcing one message; do not silently merge unrelated changes.
- Repository type list unavailable: fall back to the conventional-commits standard types; note the fallback in output.
- Breaking change uncertain: err toward requiring
!and a body; explain reasoning so the user can override.
Outputs
- one or more review-ready semantic commit drafts
- split or composite-scope guidance when the staged set crosses semantic boundaries
- repair commands such as
git add -p,git reset, orgit commit --amend - warnings when testing, typing, or other linked quality gates are already failing
Boundaries
- Do not auto-run
git commit. - Do not decide branch naming, PR approval, release tagging, or version synchronization.
- Do not bless a mixed-intent staged set as one commit when the semantic boundaries are clearly separate.
- Do not ignore breaking-change markers, missing issue footers, or body-needed cases just to keep the message short.
Local references
examples.md: semantic-style commit scenarios, split signals, anti-patterns, and repair-command playbooksreferences/type-selection.md: commit-type selection rules and business-language subject guidancereferences/scope-alignment.md: scope mapping, branch-to-scope alignment, and composite-scope rulesreferences/split-and-repair.md: partial-staging checks, noise isolation, and amend/reset/add-p repair paths
When not to use it
- →The main task is branch naming or release/tagging policy
- →There are no staged changes and the user is not asking for general commit policy
- →The main question is repository-wide CI, testing, or reviewer policy
Limitations
- →The skill does not auto-run git commit
- →The skill does not decide branch naming, PR approval, release tagging, or version synchronization
- →The skill does not bless a mixed-intent staged set as one commit when semantic boundaries are separate
How it compares
This workflow drafts compliant commit messages and suggests git repair commands, unlike manually writing a commit message without structured guidance.
Compared to similar skills
git-commit-convention side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| git-commit-convention (this skill) | 0 | 2mo | Review | Intermediate |
| tmux | 20 | 2mo | Review | Intermediate |
| jira | 11 | 6mo | No flags | Beginner |
| triaging-issues | 5 | 2mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by a129924
View all by a129924 →You might also like
tmux
openclaw
Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
jira
davila7
Use when the user mentions Jira issues (e.g., "PROJ-123"), asks about tickets, wants to create/view/update issues, check sprint status, or manage their Jira workflow. Triggers on keywords like "jira", "issue", "ticket", "sprint", "backlog", or issue key patterns.
triaging-issues
pytorch
Triages GitHub issues by routing to oncall teams, applying labels, and closing questions. Use when processing new PyTorch issues or when asked to triage an issue.
file-manager
Xxiii8322766509
文件管理技能。用于创建、移动、复制、删除文件和文件夹,整理目录结构。当用户需要管理文件、整理文件夹或批量处理文件时使用。
openspec-archive-change
studyzy
归档实验性工作流中已完成的变更。当用户想要在实现完成后最终确定并归档变更时使用。
slash-commands
parcadei
Create and use Claude Code slash commands - quick prompts, bash execution, file references