Conventional Commit
Overview
Inspect the current git worktree, group related changes into the smallest reasonable set of commits, and write conventional commit messages that describe intent clearly. Prefer one commit per logical change; when the diff spans multiple concerns, split it into separate commits by scope or change type.
Workflow
- Run the repo's formatter first, if it declares one (package scripts, CI config), so formatting noise doesn't land in the commits.
- Inspect the worktree with
git status --short,git diff --stat, and targetedgit diffreads. - Build a short commit plan before staging anything. For each planned commit, identify:
- the files or hunks that belong together
- the conventional commit
type - the optional
scope - the one-line summary
- Stage one logical group at a time. Prefer path-based staging such as
git add path/to/file. - Verify the staged diff with
git diff --cached --statandgit diff --cached. - Create the commit.
- Repeat for the remaining groups until the intended changes are committed.
Grouping Rules
- Keep changes together only when they serve the same intent.
- Split commits by subsystem or concern when the diff mixes unrelated work.
- Keep code and tests together when the tests validate that same behavior change.
- Keep generated files with their source change when they are required for a valid commit.
- Separate formatting-only, dependency-only, docs-only, or cleanup-only changes unless they are mechanically required by the main change.
- Prefer multiple small commits over one large mixed commit.
Use these default grouping heuristics when there are many changes:
featorfixchanges in the application coderefactorchanges that do not alter behaviortestadditions or repairs that are independent from feature workdocsupdateschore,build, orcichanges- migrations or schema updates, paired with the code that depends on them
If a single file contains unrelated edits and they cannot be separated safely with non-destructive staging, stop and tell the user which file is mixed instead of guessing.
Conventional Commit Format
Use:
type(scope): summary
Rules:
- Use lowercase commit types.
- Keep the summary in imperative mood.
- Keep the subject line concise and without a trailing period.
- Add
!only for breaking changes. - Omit
scopewhen it does not add clarity. - Add a body only when rationale, context, or breaking-change guidance matters.
Preferred types:
feat: user-facing behavior or new capabilityfix: bug fixrefactor: internal restructuring without behavior changedocs: documentation onlytest: test-only changeschore: maintenance workbuild: build tooling or dependenciesci: automation or pipeline changesperf: performance improvementstyle: formatting-only changesrevert: revert a previous commit
Staging Guidance
- Prefer
git add <paths...>when a full file belongs to one commit. - Use partial staging only when necessary to separate unrelated edits inside the same file.
- Do not stage unrelated local changes that were not part of the requested work.
- Before committing, confirm the staged snapshot matches the planned message.
- After each commit, re-run
git status --shortso the next commit starts from the remaining diff.
Output Expectations
When using this skill, report the commit plan before making commits whenever the grouping is non-trivial. For each planned commit, include:
- commit message
- files or areas included
- why the group is logically separate
If the repository is already dirty with unrelated changes, preserve them and commit only the requested scope.
Examples
feat(auth): add email sign-in cardfix(theme): persist selected color moderefactor(routes): split landing page sectionsdocs(readme): update local setup stepschore(repo): add commit skill
For a large mixed diff, prefer a sequence such as:
feat(auth): add login formtest(auth): cover login form validationdocs(auth): document local auth setup