Conventional Commit Writer
Use this skill whenever the user asks to write, review, or execute a git commit message based on actual code changes.
Workflow
-
Inspect the real diff first:
- Check
git statusandgit diff --staged. If nothing is staged, inspectgit diffand untracked files (git status --short), and ask or clarify if only specific files should be staged. - Never guess changes from file names alone; read the actual hunks so the commit message reflects what changed and why.
- Check
-
Choose the right Conventional Commit type:
feat: new user-facing or API capability (MINORbump).fix: bug fix or error handling repair (PATCHbump).docs: documentation-only changes (README.md,CHANGELOG.md, comments).refactor: code restructuring with no behavior change.perf: measurable performance improvement.test: adding or updating tests.ci: CI/CD workflow changes (.github/workflows/*).chore: build, tooling, dependencies, or maintenance tasks.- Add
!after type/scope (e.g.,feat!: ...) and aBREAKING CHANGE:footer if backward compatibility is broken (MAJORbump).
-
Format the commit message:
- Subject line:
<type>(<optional-scope>): <imperative summary>(keep under 72 characters, no trailing period). - Write in the language preferred by the repository/user (English or Indonesian consistently).
- Focus on impact and intent rather than listing filenames (e.g.,
fix(gateway): handle Weaviate timeout gracefullyinstead ofupdate pipeline.ts). - Add a short bulleted body only when the why or multi-part context is not obvious from the subject line.
- Preserve any required repository trailers (such as
Co-authored-by:if configured).
- Subject line:
-
Handle multi-concern diffs:
- If the diff mixes unrelated changes (e.g., a bug fix + a new feature + unrelated docs), recommend splitting into separate atomic commits so
commit-and-tag-versiongenerates a cleanCHANGELOG.md.
- If the diff mixes unrelated changes (e.g., a bug fix + a new feature + unrelated docs), recommend splitting into separate atomic commits so
-
Verify before finalizing:
- Confirm the subject matches
^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-z0-9-]+\))?!?: .+. - Never run
git commitorgit pushwithout explicit user intent or approval for the commit/push action.
- Confirm the subject matches