Claude-skill-registry conventional-commit
Generates git commit messages following Conventional Commits 1.0.0 specification with semantic types (feat, fix, etc.), optional scope, and breaking change annotations. Use when committing code changes or creating commit messages.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/conventional-commit" ~/.claude/skills/majiayu000-claude-skill-registry-conventional-commit && rm -rf "$T"
skills/data/conventional-commit/SKILL.mdConventional Commit Generator
Generate commit messages following Conventional Commits 1.0.0.
Workflow
-
Run
andgit status
to analyze changesgit diff HEAD -
Stage files: user-specified only, or
for allgit add -A -
Determine type and scope from changes
-
Generate commit message incorporating user hints
-
Commit using HEREDOC format to preserve formatting:
git commit -m "$(cat <<'EOF' <type>(<scope>): <description> <body> <footer> EOF )" -
Output:
<hash> <subject>
Scope Boundaries
DO: Analyze git changes, generate messages, stage files, commit
DO NOT: Modify code, push (unless asked), create branches, amend without request
Commit Format
<type>[optional scope][!]: <description> [optional body] [optional footer(s)]
Type Selection
| Change | Type | SemVer |
|---|---|---|
| New feature | | MINOR |
| Bug fix | | PATCH |
| Performance improvement | | PATCH |
| Code restructuring (no behavior change) | | - |
| Code style/formatting (no logic change) | | - |
| Adding/updating tests | | - |
| Documentation only | | - |
| Build system/dependencies | | - |
| CI/CD configuration | | - |
| Reverts a previous commit | | - |
| Other maintenance tasks | | - |
Note: Only
andfeathave SemVer implications. Breaking changes (any type with exclamation mark orfixfooter) trigger MAJOR.BREAKING CHANGE
Subject Line
- Max length: 72 characters (50 recommended for readability)
- Format:
ortype(scope): descriptiontype: description - Mood: Imperative present tense ("add" not "added" or "adds")
- Case: Lowercase first letter
- Punctuation: No trailing period
Scope
Scope provides context about which part of the codebase is affected. Use a noun describing the module, component, or area.
Common scope patterns:
- Component/module:
,feat(auth):
,fix(parser):refactor(api): - File/area:
,docs(readme):
,test(unit):build(webpack): - Feature:
,feat(dark-mode):fix(checkout):
Body
- Separate from subject with one blank line
- Explain what and why, not how
- Can contain multiple paragraphs (separate with blank lines)
- Wrap at 72 characters
Footer
Footers follow git trailer format with
:<space> or <space># separator.
Common footers:
- Breaking API changeBREAKING CHANGE: <description>
orRefs: #123
- Reference issuesRefs: JIRA-456
orCloses: #123
- Close issuesFixes: #123
- Credit co-authorsCo-authored-by: Name <email>
- Credit reviewersReviewed-by: Name <email>
- AcknowledgmentAcked-by: Name
Note: Footer tokens use
instead of spaces (e.g.,-notReviewed-by). Exception:Reviewed byallows space.BREAKING CHANGE
Breaking Changes
Two ways to indicate breaking changes (can use both for emphasis):
-
Exclamation mark: Add exclamation mark before colon in subject
feat(api)!: remove deprecated endpoints -
Footer: Add
orBREAKING CHANGE:
in footerBREAKING-CHANGE:feat(api): redesign authentication flow BREAKING CHANGE: OAuth tokens now expire after 1 hour instead of 24 hours.
Examples
Simple feature:
feat: add email notifications for new messages
Bug fix with scope:
fix(cart): prevent ordering with empty shopping cart
Documentation update:
docs(api): add authentication examples to README
Breaking change with body and footer:
feat(api)!: redesign user authentication endpoints Migrate from session-based auth to JWT tokens for better scalability. The new system supports refresh tokens and configurable expiration. BREAKING CHANGE: /api/login now returns JWT instead of session cookie. Clients must include Authorization header with Bearer token. Refs: JIRA-1337
Revert commit:
revert: let us never again speak of the noodle incident Refs: 676104e, a215868
Multi-scope change (use most significant):
feat(auth): add OAuth2 support with Google provider Adds Google OAuth2 login flow with automatic account linking. Co-authored-by: Jane Doe <jane@example.com> Closes: #42
Anti-patterns
Avoid these common mistakes:
| Bad | Good | Reason |
|---|---|---|
| | Be specific |
| | Use present tense |
| Don't commit WIP | Commit complete units |
| | No trailing period |
| | Use imperative mood |
| | Types are lowercase |
| | Be descriptive |