commit-conventions
Enforces Conventional Commits format and branch naming conventions, validating commit message structure (type/scope/description header), suggesting branch name patterns (feature/*, fix/*, hotfix/*), and enforcing breaking change notation. Use when the user is about to commit, creating a branch, reviewing commit history, preparing a pull request, setting up commit linting, or asking about commit message format, branch naming, or Conventional Commits.
Enforce consistent commit messages and branch naming using Conventional Commits and kebab-case branch names.
Commit Workflow
-
Name branches by type — Follow the branch naming format in the
git-namingrule. If no rule is installed, see branch-naming.md. -
Check existing conventions — Before applying defaults, look for
.commitlintrc,commitlint.config.js,.czrc,CONTRIBUTING.md, or recent commit history. If the repo has established conventions, follow those instead. -
Review changes — Run
git statusandgit diff. -
Verify atomicity — One logical change per commit. If you need "and" in the message, split into multiple commits. When asked to "commit all" or "commit everything", first review the diff for unrelated changes. If multiple logical changes are present, propose a split with one commit per concern and confirm the grouping before proceeding.
-
Stage specific files — Do not use
git add .orgit add -A. Stage each file individually to avoid committing unrelated changes. -
Write the commit message — Follow the
git-namingrule for format. If no rule is installed, see commit-format.md.Key rules:
- Imperative mood, lowercase, no trailing period
- Max 72 characters for the header
- Body required when the reasoning matters — decisions, refactors, non-trivial fixes
- Header-only is fine when the diff tells the full story
- Breaking changes always require a body explaining the impact and migration path
- Separate header, body, and footer with blank lines
-
Commit.
-
Validate — Run
git log -1to confirm the format. If incorrect, rungit commit --amendto fix.
Branch Workflow
-
Check existing conventions — Look for branch protection rules, CI config, or existing branch patterns.
-
Create the branch — Follow the
git-namingrule for format. If no rule is installed, see branch-naming.md. -
Create from main, delete after merge.
Example Scenario
User: "commit these changes"
- Skill checks for
.commitlintrc— none found, uses defaults - Runs
git statusandgit diffto understand the changes - Changes touch auth middleware — suggests scope
auth - Writes:
fix(auth): handle expired tokens during reconnect - Stages specific files, commits, validates with
git log -1
Common Failures
- Repo already has conventions — applying Conventional Commits over an existing format creates inconsistent history. Always check first (step 1).
- Scope too broad or missing —
fix: stufftells nothing.fix(auth): resolve token expiry race conditiontells the story. - Body on trivial commits — a one-line typo fix doesn't need three paragraphs of reasoning.
- Non-atomic commits — bundling unrelated changes makes history useless. If you need "and", split.
Gotchas
- No "WIP" or "temp" commits — use
git commit --amendorgit rebase -ito clean up before opening a pull request - Use
git mvfor file renames to preserve history
SKILL.md | | Raw
Git Conventions
Enforce consistent commit messages and branch naming using Conventional Commits and kebab-case branch names.
Commit Workflow
-
Name branches by type — Follow the branch naming format in the
git-namingrule. If no rule is installed, see branch-naming.md. -
Check existing conventions — Before applying defaults, look for
.commitlintrc,commitlint.config.js,.czrc,CONTRIBUTING.md, or recent commit history. If the repo has established conventions, follow those instead. -
Review changes — Run
git statusandgit diff. -
Verify atomicity — One logical change per commit. If you need "and" in the message, split into multiple commits. When asked to "commit all" or "commit everything", first review the diff for unrelated changes. If multiple logical changes are present, propose a split with one commit per concern and confirm the grouping before proceeding.
-
Stage specific files — Do not use
git add .orgit add -A. Stage each file individually to avoid committing unrelated changes. -
Write the commit message — Follow the
git-namingrule for format. If no rule is installed, see commit-format.md.Key rules:
- Imperative mood, lowercase, no trailing period
- Max 72 characters for the header
- Body required when the reasoning matters — decisions, refactors, non-trivial fixes
- Header-only is fine when the diff tells the full story
- Breaking changes always require a body explaining the impact and migration path
- Separate header, body, and footer with blank lines
-
Commit.
-
Validate — Run
git log -1to confirm the format. If incorrect, rungit commit --amendto fix.
Branch Workflow
-
Check existing conventions — Look for branch protection rules, CI config, or existing branch patterns.
-
Create the branch — Follow the
git-namingrule for format. If no rule is installed, see branch-naming.md. -
Create from main, delete after merge.
Example Scenario
User: "commit these changes"
- Skill checks for
.commitlintrc— none found, uses defaults - Runs
git statusandgit diffto understand the changes - Changes touch auth middleware — suggests scope
auth - Writes:
fix(auth): handle expired tokens during reconnect - Stages specific files, commits, validates with
git log -1
Common Failures
- Repo already has conventions — applying Conventional Commits over an existing format creates inconsistent history. Always check first (step 1).
- Scope too broad or missing —
fix: stufftells nothing.fix(auth): resolve token expiry race conditiontells the story. - Body on trivial commits — a one-line typo fix doesn't need three paragraphs of reasoning.
- Non-atomic commits — bundling unrelated changes makes history useless. If you need "and", split.
Gotchas
- No "WIP" or "temp" commits — use
git commit --amendorgit rebase -ito clean up before opening a pull request - Use
git mvfor file renames to preserve history
references/branch-naming.md | | Raw
Branch Naming
Format
type/short-description
type/issue-number-short-description
Types
feature/, fix/, refactor/, docs/, test/, chore/,
hotfix/
Rules
- Lowercase, kebab-case (hyphens, not underscores)
- 2-5 words, short but descriptive
- Include issue number when applicable:
fix/123-memory-leak - Create from main, delete after merge
Examples
feature/payment-integration
fix/789-session-timeout
refactor/api-error-handling
docs/setup-instructions
chore/upgrade-dependencies
hotfix/security-vulnerability
references/commit-format.md | | Raw
Commit Message Format
Header
type(scope): description
- Scope: Optional. Area of the codebase affected.
- Description: Imperative mood, lowercase first word, no trailing period.
- Length: Max 72 characters for the entire header line.
Types
feat, fix, docs, style, refactor, test, chore,
perf, ci, build
Body
Optional for simple, self-evident changes (typo fixes, dependency bumps, single-line config changes). Required when:
- The change involves a decision or trade-off
- The fix isn't immediately obvious from the diff
- The change affects behavior in non-obvious ways
- Someone might ask "why did they do it this way?"
Leave a blank line between header and body. Wrap at 72-74 characters.
Footer
Fixes #123— closes the issue when mergedCloses #456— same as FixesRelates to #789— references without closingBREAKING CHANGE: description— for breaking changesCo-authored-by: Name <email>— for co-authors
Examples
Simple commit:
feat(dashboard): add loading spinner to dashboard page
Bug fix with body and footer:
fix(auth): fix race condition in authentication middleware
The middleware was checking token validity before the database
connection was fully established, causing intermittent 401 errors
during server startup.
Adds a connection readiness check before token validation with
retry and exponential backoff (max 3 attempts).
Fixes #142
commit-conventions enforces Conventional Commits format and structured staging during the commit workflow.
Why the skill checks for existing repo conventions first
Repos may already have .commitlintrc or established
formats. Overwriting them causes friction with existing
CI. Check first, defer to what exists.
Why the skill bans git add .
Bulk staging hides unrelated changes in a commit. Forcing file-by-file staging makes the agent conscious of what each commit contains. This prevents accidental secret commits and mixed-concern diffs.
Why the skill validates after committing
Post-commit validation (git log -1) creates a
self-correction loop. If the message is malformed,
the agent can amend immediately. Catching errors
after the fact is cheaper than preventing them with
complex pre-validation.
Why format rules live in git-naming, not here
The skill handles workflow (when/how to commit), the rule handles format (what the message looks like). Separation means updating format conventions doesn't require touching the workflow skill.
[1.3.1] - 2026-06-11
Added
- RATIONALE.md explaining design decisions
[1.3.0] - 2026-05-18
Added
- Branch naming step (step 1) referencing
git-namingrule - Guidance for handling "commit all" requests with multiple logical changes
- Explicit requirement for commit body on breaking changes with impact and migration path
- Blank line separation rule for header/body/footer
Changed
- Strengthened staging instruction: explicitly prohibit
git add .andgit add -A, require staging each file individually - Workflow steps renumbered (now 1–8 instead of 1–7)
- Commit format and branch naming now delegate to
git-namingrule with fallback to references - Removed inline format examples from workflow body (delegated to references)
[1.2.0] - 2026-04-30
Added
- "Check existing conventions" as step 1 in both workflows
- Example scenario showing end-to-end commit flow
- Common failures section
- references/commit-format.md with full header/body/footer spec
- references/branch-naming.md with format, types, and examples
Changed
- Restructured as workflow-first skill — format details moved to references/
- Description now includes situations alongside actions
- Separate commit and branch workflows
Removed
- Inline commit format specification (moved to references/)
- Inline branch naming specification (moved to references/)
[1.1.1] - 2026-04-26
Fixed
- Applied markdown-consistency rule: added language specifiers to code blocks, blank lines around headings in changelog
[1.1.0] - 2026-04-25
Added
- Validation step (
git log -1) and error recovery (git commit --amend) to workflow
Changed
- Adopted lowercase convention for commit descriptions (Angular/commitlint standard)
- Compacted types table into inline list
- Improved description with specific actions and trigger terms
- Expanded body guidance with clearer criteria for when reasoning matters
- Trimmed redundant explanations and removed third example
Fixed
- CHANGELOG.md formatting (added missing category header)
[1.0.0] - 2026-04-16
Added
- Conventional Commits format with optional scope
- Commit types: feat, fix, docs, style, refactor, test, chore, perf, ci, build
- Header, body, and footer guidelines with examples
- Branch naming: type/short-description in kebab-case
- Commit workflow for agents