/commit-message
Generate commit messages from staged changes. Trigger with "suggest commit message", "generate commit message", "what should the commit say?", "write commit message".
$ npx -y skills add wasabeef/claude-code-cookbook --skill commit-message --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/commit-message
Context preview
The summary Claude sees to decide when to auto-load this skill.
Generate commit messages from staged changes. Trigger with "suggest commit message", "generate commit message", "what should the commit say?", "write commit message".
SKILL.md
commit-message.SKILL.mddescription: 'Generate commit messages from staged changes. Trigger with "suggest commit message", "generate commit message", "what should the commit say?", "write commit message".'
allowed-tools:
- Bash(git diff *)
- Bash(git log *)
- Read
Generate commit messages from staged changes
Generates commit messages from staged changes (git diff --staged). This command only creates messages and copies them to your clipboard—it doesn't run any git commands.
Usage
/commit-message [options]
Options
- `--format <format>` : Choose message format (conventional, gitmoji, angular)
- `--lang <language>` : Set language explicitly (en)
- `--breaking` : Include breaking change detection
Basic Examples
# Generate message from staged changes (language auto-detected)
# The top suggestion is automatically copied to your clipboard
/commit-message
# Specify language explicitly
/commit-message --lang ja
/commit-message --lang en
# Include breaking change detection
/commit-message --breaking
Prerequisites
**Important**: This command only works with staged changes. Run `git add` first to stage your changes.
# If nothing is staged, you'll see:
$ /commit-message
No staged changes found. Please run git add first.
Automatic Clipboard Feature
The top suggestion gets copied to your clipboard as a complete command: `git commit -m "message"`. Just paste and run it in your terminal.
**Implementation Notes**:
- Run `pbcopy` in a separate process from the message output
- Use `printf` instead of `echo` to avoid unwanted newlines
Automatic Project Convention Detection
**Important**: If project-specific conventions exist, they take priority.
1. CommitLint Configuration Check
Automatically detects settings from the following files:
- `commitlint.config.js`
- `commitlint.config.mjs`
- `commitlint.config.cjs`
- `commitlint.config.ts`
- `.commitlintrc.js`
- `.commitlintrc.json`
- `.commitlintrc.yml`
- `.commitlintrc.yaml`
- `package.json` with `commitlint` section
# Search for configuration files
find . -name "commitlint.config.*" -o -name ".commitlintrc.*" | head -1
2. Custom Type Detection
Example of project-specific types:
// commitlint.config.mjs
export default {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [
2,
"always",
[
"feat",
"fix",
"docs",
"style",
"refactor",
"test",
"chore",
"wip", // work in progress
"hotfix", // urgent fix
"release", // release
"deps", // dependency update
"config", // configuration change
],
],
},
};3. Detecting Language Settings
// When project uses Japanese messages
export default {
rules: {
"subject-case": [0], // Disabled for Japanese support
"subject-max-length": [2, "always", 72], // Adjusted character limit for Japanese
},
};4. Existing Commit History Analysis
# Learn patterns from recent commits
git log --oneline -50 --pretty=format:"%s"
# Type usage statistics
git log --oneline -100 --pretty=format:"%s" | \
grep -oE '^[a-z]+(\([^)]+\))?' | \
sort | uniq -c | sort -nr
Automatic Language Detection
Automatically switches between Japanese/English based on:
1. **CommitLint configuration** language settings 2. **git log analysis** automatic detection 3. **Project file** language settings 4. **Changed file** comment and string analysis
Default is English. Generates in Japanese if detected as Japanese project.
Message Format
Conventional Commits (Default)
<type>: <description>
**Important**: Always generates single-line commit messages. Does not generate multi-line messages.
**Note**: Project-specific conventions take priority if they exist.
Standard Types
**Required Types**:
- `feat`: New feature (user-visible feature addition)
- `fix`: Bug fix
**Optional Types**:
- `build`: Build system or external dependency changes
- `chore`: Other changes (no release impact)
- `ci`: CI configuration files and scripts changes
- `docs`: Documentation only changes
- `style`: Changes that don't affect code meaning (whitespace, formatting, semicolons, etc.)
- `refactor`: Code changes without bug fixes or feature additions
- `perf`: Performance improvements
- `test`: Adding or fixing tests
Output Example (English Project)
$ /commit-message
📝 Commit Message Suggestions
━━━━━━━━━━━━━━━━━━━━━━━━━
✨ Main Candidate:
feat: implement JWT-based authentication system
📋 Alternatives:
1. feat: add user authentication with JWT tokens
2. fix: resolve token validation error in auth middleware
3. refactor: extract auth logic into separate module
✅ `git commit -m "feat: implement JWT-based authentication system"` copied to clipboard
**Implementation Example (Fixed)**:
# Copy commit command to clipboard first (no newline)
printf 'git commit -m "%s"' "$COMMIT_MESSAGE" | pbcopy
# Then display message
cat << EOF
📝 Commit Message Suggestions
━━━━━━━━━━━━━━━━━━━━━━━━━
✨ Main Candidate:
$COMMIT_MESSAGE
📋 Alternatives:
1. ...
2. ...
3. ...
✅ \`git commit -m "$COMMIT_MESSAGE"\` copied to clipboard
EOF
Output Example (Japanese Project)
$ /commit-message
📝 Commit Message Suggestions
━━━━━━━━━━━━━━━━━━━━━━━━━
✨ Main Candidate:
feat: JWT authentication system implemented
📋 Alternatives:
1. feat: add user authentication with JWT tokens
2. fix: resolve token validation error in auth middleware
3. docs: separate auth logic into different module
✅ `git commit -m "feat: JWT authentication system implemented"` copied to clipboard
Operation Overview
1. **Analysis**: Analyze content of `git diff --staged` 2. **Generation**: Generate appropriate commit message 3. **Copy**: Automatically copy main candidate to clipboard
**Note**: This command does not execute git add or git commit. It only generates com
Read more
description: 'Generate commit messages from staged changes. Trigger with "suggest commit message", "generate commit message", "what should the commit say?", "write commit message".' allowed-tools: - Bash(git diff *) - Bash(git log *) - Read
Generate commit messages from staged changes
Generates commit messages from staged changes (git diff --staged). This command only creates messages and copies them to your clipboard—it doesn't run any git commands.
Usage
/commit-message [options]
Options
- `--format <format>` : Choose message format (conventional, gitmoji, angular)
- `--lang <language>` : Set language explicitly (en)
- `--breaking` : Include breaking change detection
Basic Examples
# Generate message from staged changes (language auto-detected) # The top suggestion is automatically copied to your clipboard /commit-message # Specify language explicitly /commit-message --lang ja /commit-message --lang en # Include breaking change detection /commit-message --breaking
Prerequisites
**Important**: This command only works with staged changes. Run `git add` first to stage your changes.
# If nothing is staged, you'll see: $ /commit-message No staged changes found. Please run git add first.
Automatic Clipboard Feature
The top suggestion gets copied to your clipboard as a complete command: `git commit -m "message"`. Just paste and run it in your terminal.
**Implementation Notes**:
- Run `pbcopy` in a separate process from the message output
- Use `printf` instead of `echo` to avoid unwanted newlines
Automatic Project Convention Detection
**Important**: If project-specific conventions exist, they take priority.
1. CommitLint Configuration Check
Automatically detects settings from the following files:
- `commitlint.config.js`
- `commitlint.config.mjs`
- `commitlint.config.cjs`
- `commitlint.config.ts`
- `.commitlintrc.js`
- `.commitlintrc.json`
- `.commitlintrc.yml`
- `.commitlintrc.yaml`
- `package.json` with `commitlint` section
# Search for configuration files find . -name "commitlint.config.*" -o -name ".commitlintrc.*" | head -1
2. Custom Type Detection
Example of project-specific types:
// commitlint.config.mjs
export default {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [
2,
"always",
[
"feat",
"fix",
"docs",
"style",
"refactor",
"test",
"chore",
"wip", // work in progress
"hotfix", // urgent fix
"release", // release
"deps", // dependency update
"config", // configuration change
],
],
},
};3. Detecting Language Settings
// When project uses Japanese messages
export default {
rules: {
"subject-case": [0], // Disabled for Japanese support
"subject-max-length": [2, "always", 72], // Adjusted character limit for Japanese
},
};4. Existing Commit History Analysis
# Learn patterns from recent commits git log --oneline -50 --pretty=format:"%s" # Type usage statistics git log --oneline -100 --pretty=format:"%s" | \ grep -oE '^[a-z]+(\([^)]+\))?' | \ sort | uniq -c | sort -nr
Automatic Language Detection
Automatically switches between Japanese/English based on:
1. **CommitLint configuration** language settings 2. **git log analysis** automatic detection 3. **Project file** language settings 4. **Changed file** comment and string analysis
Default is English. Generates in Japanese if detected as Japanese project.
Message Format
Conventional Commits (Default)
<type>: <description>
**Important**: Always generates single-line commit messages. Does not generate multi-line messages.
**Note**: Project-specific conventions take priority if they exist.
Standard Types
**Required Types**:
- `feat`: New feature (user-visible feature addition)
- `fix`: Bug fix
**Optional Types**:
- `build`: Build system or external dependency changes
- `chore`: Other changes (no release impact)
- `ci`: CI configuration files and scripts changes
- `docs`: Documentation only changes
- `style`: Changes that don't affect code meaning (whitespace, formatting, semicolons, etc.)
- `refactor`: Code changes without bug fixes or feature additions
- `perf`: Performance improvements
- `test`: Adding or fixing tests
Output Example (English Project)
$ /commit-message 📝 Commit Message Suggestions ━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Main Candidate: feat: implement JWT-based authentication system 📋 Alternatives: 1. feat: add user authentication with JWT tokens 2. fix: resolve token validation error in auth middleware 3. refactor: extract auth logic into separate module ✅ `git commit -m "feat: implement JWT-based authentication system"` copied to clipboard
**Implementation Example (Fixed)**:
# Copy commit command to clipboard first (no newline) printf 'git commit -m "%s"' "$COMMIT_MESSAGE" | pbcopy # Then display message cat << EOF 📝 Commit Message Suggestions ━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Main Candidate: $COMMIT_MESSAGE 📋 Alternatives: 1. ... 2. ... 3. ... ✅ \`git commit -m "$COMMIT_MESSAGE"\` copied to clipboard EOF
Output Example (Japanese Project)
$ /commit-message 📝 Commit Message Suggestions ━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Main Candidate: feat: JWT authentication system implemented 📋 Alternatives: 1. feat: add user authentication with JWT tokens 2. fix: resolve token validation error in auth middleware 3. docs: separate auth logic into different module ✅ `git commit -m "feat: JWT authentication system implemented"` copied to clipboard
Operation Overview
1. **Analysis**: Analyze content of `git diff --staged` 2. **Generation**: Generate appropriate commit message 3. **Copy**: Automatically copy main candidate to clipboard
**Note**: This command does not execute git add or git commit. It only generates com
A collection of commands, roles, and automation scripts for Claude Code. Automate your workflow without unnecessary confirmations, allowing you to focus on what matters.
Repo: wasabeef/claude-code-cookbook
Other skills on claude-code-cookbook.
- /analyze-dependencies
Analyze project dependencies and evaluate architectural health. Trigger with "analyze dependencies", "detect circular dependencies", "architecture issues?", "check module coupling", "find layer violations". Generates dependency matrix, fan-in/fan-out analysis, and prioritized
Open skill - /analyze-performance
Performance analysis based on Core Web Vitals with UX scoring. Trigger with "analyze performance", "improve speed", "check Core Web Vitals", "page speed", "improve LCP", "identify performance issues".
Open skill - /check-fact
Verify information accuracy against codebase and documentation. Trigger with "is this correct?", "fact check", "verify this", "is this accurate?".
Open skill - /check-prompt
Evaluate and improve AI prompt quality. Trigger with "check this prompt", "evaluate prompt quality", "improve this prompt".
Open skill - /context7
Search technical documentation via Context7 MCP. Trigger with "check the docs", "look up documentation", "how to use this library?", "API reference".
Open skill - /design-patterns
Suggest design patterns and evaluate SOLID principles. Trigger with "suggest design patterns", "which patterns apply?", "check SOLID principles", "detect anti-patterns", "evaluate code design".
Open skill

