Enforce disciplined, file-by-file Git commits using strict verbs, scoped brackets, and short messages. Use when staging, refactoring, fixing, or cleaning code. Especially useful for refactors, audits, and review-friendly history.
Every commit must:
Commits are documentation, not narration.
<verb>(<scope>): <short message>
refactor(main): simplify request validationfix(auth): handle missing token edge casechore(logging): remove unused formatterdocs(api): clarify pagination paramsOnly use one of the following:
refactor -> structural change, no behavior changefix -> bug fixfeat -> new user-facing capabilitychore -> tooling, cleanup, non-prod logicdocs -> documentation onlytest -> tests onlyperf -> performance improvementstyle -> formatting, lint-only changesIf unsure -> default to refactor.
(<scope>))The scope MUST be one of:
auth, users, payments)api, service, schema, db)main, dev)settings, config, router)Avoid vague scopes:
miscstuffupdateOne commit = one file
If multiple files are staged:
Multi-file commits are allowed only if:
git status
git diff
git add path/to/file.py
Before committing:
Stage exactly one file and commit it. Do not wait for approval unless the user explicitly asks to review first.
git add path/to/file.py
git commit -m "refactor(main): extract config loading"
When using refactor:
Good:
refactor(api): extract request parsing
Bad:refactor(api): fix bug and improve speedWhen this skill is active:
If multiple files are changed:
Do NOT allow:
If detected -> stop and correct.
User:
I refactored auth/deps.py
Assistant:
Suggested commit:
refactor(auth): isolate dependency resolution
User: Commit it
Assistant:
auth/deps.py is stagedIf this commit appeared alone in a pull request, would a reviewer immediately understand why it exists from the message?
If not -> rewrite.
You are doing three high-leverage things here: