Commit Message Generator
Description
Analyze staged changes and generate conventional commit messages. Supports Conventional Commits, GitHub-style, and custom formats. Can also review existing commit history for consistency.
Triggers
- "Generate commit message", "Write commit message", "Commit this"
- "What should I commit?", "Review my changes"
- "Commit message for this PR", "Squash and rewrite commits"
Instructions
Step 1: Analyze Changes
- Run
git diff --cachedto see staged changes - If nothing staged, run
git diffandgit statusto show unstaged changes - For PR reviews, use
git log --oneline origin/main..HEADto see all commits
Step 2: Categorize Changes
Map changes to conventional commit types:
feat: New feature, new API endpoint, new componentfix: Bug fix, error handling, edge caserefactor: Code restructure without behavior changeperf: Performance improvementdocs: Documentation onlystyle: Formatting, whitespace, semicolonstest: Adding/updating testschore: Build, CI, dependencies, toolingci: CI/CD configuration changesrevert: Reverting a previous commit
Step 3: Generate Message
Format (Conventional Commits):
<type>(<scope>): <subject>
<body>
<footer>
Rules:
- Subject: imperative mood, lowercase, no period, max 72 chars
- Body: explain what and why, not how, wrap at 72 chars
- Footer: breaking changes (
BREAKING CHANGE:), issue refs (Closes #123) - If multiple unrelated changes, suggest splitting into separate commits
Step 4: Multi-commit Suggestion
If staged changes span multiple concerns:
Suggested split:
1. feat(auth): add OAuth2 login flow
2. fix(api): handle null response in user endpoint
3. chore(deps): update axios to 1.7.0
Run these commands:
git reset HEAD
git add src/auth/oauth.py
git commit -m "feat(auth): add OAuth2 login flow"
git add src/api/users.py
git commit -m "fix(api): handle null response in user endpoint"
git add package.json package-lock.json
git commit -m "chore(deps): update axios to 1.7.0"
PR Description Mode
When asked to write a PR description:
- Read all commits in the branch
- Categorize by type
- Generate:
- Summary (2-3 sentences)
- Changes (grouped by category)
- Testing notes
- Breaking changes (if any)
- Checklist
Output Format
Provide 3 options: concise (subject only), standard (subject + body), detailed (subject + body + footer). Default to standard unless user specifies otherwise.
Constraints
- Never auto-commit without user confirmation
- For sensitive changes (secrets, auth), add a warning in the footer
- If changes are too large (>20 files), suggest a descriptive PR instead
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.