| name | commit-message-format |
| description | Enforces the repository commit message format whenever the user asks to commit, amend, squash, or create git history. Use before every git commit command to prevent malformed commit messages. |
Commit Message Format
Use this skill for every request that creates or changes git commits.
Required Format
This repository uses Conventional Commits:
<type>[optional scope]: <description>
Allowed type values:
feat - user-facing feature
fix - bug fix
docs - documentation only
style - formatting only, no behavior change
refactor - code change that is neither a feature nor a bug fix
perf - performance improvement
test - tests only
build - build system or dependency changes
ci - CI/CD changes
chore - maintenance that does not fit another type
revert - reverts a previous commit
Rules:
-
The first line MUST match:
^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-z0-9-]+\))?!?: .+
-
Use lowercase type and scope.
-
Put a space after the colon.
-
Use an imperative, concise description.
-
Do not end the subject with a period.
-
If there is a breaking change, use ! before the colon and explain it in the body.
Before Committing
- Run
git status --short.
- Review staged or unstaged changes enough to select the correct type.
- Draft the message in the required format.
- Validate the subject against the regex above.
- Only then run
git commit.
Examples
Good:
git commit -m "feat: add account switcher extension"
git commit -m "refactor: reorganize account switcher source layout"
git commit -m "docs: add pi package installation guide"
git commit -m "chore: add commit message skill"
Bad:
git commit -m "Prepare pi package installation"
git commit -m "updated files"
git commit -m "Fix bug."
If a Message Is Wrong
If the latest local commit has the wrong format and has not been pushed, fix it with:
git commit --amend -m "<correct conventional commit message>"
Never create another malformed commit to fix a malformed commit.