| name | conventional-commit |
| description | Write a Conventional Commits subject for the staged changes and commit them. Use when committing staged work with a typed, scoped message. |
| metadata | {"author":"Médéric HURIER (Fmind)","source":"github.com/fmind/dotfiles/tree/main/skills/conventional-commit","created":"2026-06-23T00:00:00.000Z","updated":"2026-07-06T00:00:00.000Z"} |
Create Conventional Commit
Create a Conventional Commits message for the staged changes in this repository and commit them.
Workflow
- Inspect the staged state:
git diff --cached --name-only — staged files.
git diff --cached --stat — diff stat.
git diff --cached — full patch.
- If nothing is staged, say so and stop.
- Read the staged files or nearby context if the patch is ambiguous.
- Write one Conventional Commits subject:
- Form:
<type>(<scope>): <description> where <type> is feat, fix, chore, docs, refactor, test, perf, ci, build, style, or revert. <scope> is optional.
- Imperative mood (
add, not added).
- Under 72 characters total.
- Precise scope when it helps; omit if it adds no signal.
- For a breaking change, append
! after the type/scope, e.g. feat(api)!: drop v1 endpoint.
- Run
git commit -m "<subject>" with that exact subject, then read the short hash from the commit output (or git rev-parse --short HEAD).
- After success, print only these two lines:
Subject: <subject>
Commit: <hash>
- If the commit fails (pre-commit hook, no staged changes), show the failure briefly and stop. Do not amend.
Gotchas
- Keep the final response plain text and compact.
- Never run
git push from this skill.
Documentation