Git Commit
Draft a Conventional Commit message from the staged diff only. Return the proposed message text, but never run git commit.
Workflow
- Check whether there are staged changes.
git status --short
git diff --cached --stat
git diff --cached
If nothing is staged, stop and tell the user to stage the intended files first. Do not fall back to git diff.
- Build a deep, recursive understanding of the staged code changes before classifying them.
- Trace each staged hunk through the surrounding code, tests, configuration, docs, API contracts, and generated artifacts when that context is necessary to understand the actual change.
- Keep the analysis grounded in
git diff --cached; do not inspect unstaged work to fill gaps.
- If the staged diff cannot support a confident message, say what is unclear instead of guessing.
- Infer the commit type from the staged diff.
feat: new user-facing capability
fix: bug fix or regression fix
docs: documentation-only change
style: formatting or non-behavioral style change
refactor: internal code restructuring without behavior change
perf: performance improvement
test: test-only addition or update
build: build tooling or dependency change
ci: CI workflow or automation change
chore: maintenance work that does not fit the types above
- Infer the scope only when it is obvious from the staged paths or module names.
- Good scopes are short and specific, such as
auth, search, web, or extension.
- Omit the scope when it is ambiguous.
- Draft the message.
- Use the Conventional Commit subject format:
<type>[optional scope]: <description>
- Keep the subject in imperative mood and present tense.
- Keep the subject under 72 characters.
- Keep the description factual and grounded in the staged diff.
- Add a concise body description when it is necessary to clarify the staged change beyond the subject.
- Do not invent motivations, side effects, or files that are not visible in the staged changes.
- Add
! or a BREAKING CHANGE: footer only when the staged diff clearly shows a breaking change.
- Do not add an emoji prefix unless the user explicitly asks for one.
Output Rules
- Default to one best commit message, not multiple options.
- Output only the final commit message text.
- Do not prefix the answer with explanations, bullets, labels, or
git commit -m.
- Do not wrap the message in quotes or code fences unless the user asks.
- Add a body description or footer only when it materially helps explain the change, breaking impact, migration step, or issue reference.
Example single-line output:
fix(auth): handle expired session refresh
Safety
- Never run
git add, git restore, git reset, git commit, or git commit --amend.
- Never inspect unstaged changes with
git diff or other working tree fallbacks.
- If the staged changes mix unrelated concerns, tell the user to split the commit instead of forcing one misleading message.
- If staged paths or diff content suggest secrets, such as
.env, credentials, or private keys, warn the user before proposing a message.
1---2name: git-commit3description: Draft a Conventional Commit message from the currently staged Git changes. Use when the user wants a commit message suggestion, asks to summarize staged work into a commit, or needs a Conventional Commit subject/body without actually running `git commit`. This skill must only inspect staged changes and must not stage files, inspect unstaged work, or create the commit.4---56# Git Commit78Draft a Conventional Commit message from the staged diff only. Return the proposed message text, but never run `git commit`.910## Workflow11121. Check whether there are staged changes.1314```bash15git status --short16git diff --cached --stat17git diff --cached18```1920If nothing is staged, stop and tell the user to stage the intended files first. Do not fall back to `git diff`.21222. Build a deep, recursive understanding of the staged code changes before classifying them.2324- Trace each staged hunk through the surrounding code, tests, configuration, docs, API contracts, and generated artifacts when that context is necessary to understand the actual change.25- Keep the analysis grounded in `git diff --cached`; do not inspect unstaged work to fill gaps.26- If the staged diff cannot support a confident message, say what is unclear instead of guessing.27283. Infer the commit type from the staged diff.2930- `feat`: new user-facing capability31- `fix`: bug fix or regression fix32- `docs`: documentation-only change33- `style`: formatting or non-behavioral style change34- `refactor`: internal code restructuring without behavior change35- `perf`: performance improvement36- `test`: test-only addition or update37- `build`: build tooling or dependency change38- `ci`: CI workflow or automation change39- `chore`: maintenance work that does not fit the types above40414. Infer the scope only when it is obvious from the staged paths or module names.4243- Good scopes are short and specific, such as `auth`, `search`, `web`, or `extension`.44- Omit the scope when it is ambiguous.45465. Draft the message.4748- Use the Conventional Commit subject format: `<type>[optional scope]: <description>`49- Keep the subject in imperative mood and present tense.50- Keep the subject under 72 characters.51- Keep the description factual and grounded in the staged diff.52- Add a concise body description when it is necessary to clarify the staged change beyond the subject.53- Do not invent motivations, side effects, or files that are not visible in the staged changes.54- Add `!` or a `BREAKING CHANGE:` footer only when the staged diff clearly shows a breaking change.55- Do not add an emoji prefix unless the user explicitly asks for one.5657## Output Rules5859- Default to one best commit message, not multiple options.60- Output only the final commit message text.61- Do not prefix the answer with explanations, bullets, labels, or `git commit -m`.62- Do not wrap the message in quotes or code fences unless the user asks.63- Add a body description or footer only when it materially helps explain the change, breaking impact, migration step, or issue reference.6465Example single-line output:6667`fix(auth): handle expired session refresh`6869## Safety7071- Never run `git add`, `git restore`, `git reset`, `git commit`, or `git commit --amend`.72- Never inspect unstaged changes with `git diff` or other working tree fallbacks.73- If the staged changes mix unrelated concerns, tell the user to split the commit instead of forcing one misleading message.74- If staged paths or diff content suggest secrets, such as `.env`, credentials, or private keys, warn the user before proposing a message.