Generate Commit Message
Create a commit message for the repository's current staged changes.
Workflow
Inspect the git index without changing it:
git status --short
git diff --cached --stat
git diff --cached
Base the message only on staged changes. Ignore unstaged and untracked changes except to avoid mixing them into the
staged summary.
If there are no staged changes, output a plaintext code block containing exactly:
chore: no staged changes
Message Rules
Use Conventional Commit format:
<type>(optional-scope): <imperative summary>
Allowed types: feat, fix, docs, chore, refactor, test, build, ci.
Put the most important staged change first.
If there is room on the same line, include minor staged changes after the primary change.
Keep the subject concise and readable. Prefer one line unless extra context is genuinely needed.
Use imperative mood: add, fix, update, remove, refactor, not added, fixes, or updated.
Do not mention file paths unless they are the clearest useful scope.
Optional Body
Add body text only when it is important and genuinely needed for context, such as a breaking behavior change, migration
note, or significant secondary changes that do not fit in the subject.
When a body is needed:
- Keep it short.
- Use markdown list bullets instead of paragraphs.
- Include only important staged changes.
Example:
feat(auth): add passkey enrollment and tighten session renewal
- Requires a new WebAuthn origin setting in production.
- Moves legacy session cleanup behind the renewal path.
Output Contract
Output nothing except one plaintext code block containing the exact commit message.
Do not add explanations, labels, summaries, caveats, follow-up questions, or text outside the code block.
1---2name: generate-commit-message3description: Generate a Conventional Commit message from the repository's staged Git changes. Use when asked to write a commit message, title, or summary. Return only the message in a plaintext code block. Does not stage files or create commits.4---56# Generate Commit Message78Create a commit message for the repository's current staged changes.910## Workflow11121. Inspect the git index without changing it:1314 ```bash15 git status --short16 git diff --cached --stat17 git diff --cached18 ```19202. Base the message only on staged changes. Ignore unstaged and untracked changes except to avoid mixing them into the21 staged summary.223. If there are no staged changes, output a plaintext code block containing exactly:2324 ```text25 chore: no staged changes26 ```2728## Message Rules2930- Use Conventional Commit format:3132 ```text33 <type>(optional-scope): <imperative summary>34 ```3536- Allowed types: `feat`, `fix`, `docs`, `chore`, `refactor`, `test`, `build`, `ci`.37- Put the most important staged change first.38- If there is room on the same line, include minor staged changes after the primary change.39- Keep the subject concise and readable. Prefer one line unless extra context is genuinely needed.40- Use imperative mood: `add`, `fix`, `update`, `remove`, `refactor`, not `added`, `fixes`, or `updated`.41- Do not mention file paths unless they are the clearest useful scope.4243## Optional Body4445Add body text only when it is important and genuinely needed for context, such as a breaking behavior change, migration46note, or significant secondary changes that do not fit in the subject.4748When a body is needed:4950- Keep it short.51- Use markdown list bullets instead of paragraphs.52- Include only important staged changes.5354Example:5556```text57feat(auth): add passkey enrollment and tighten session renewal5859- Requires a new WebAuthn origin setting in production.60- Moves legacy session cleanup behind the renewal path.61```6263## Output Contract6465Output nothing except one plaintext code block containing the exact commit message.6667Do not add explanations, labels, summaries, caveats, follow-up questions, or text outside the code block.