Automatically generates high-quality conventional commit messages by analyzing your staged Git changes. No more staring at a blank commit message wondering what to write - this skill reads your git diff, understands the context, and creates a properly formatted commit message following the Conventional Commits specification.
This skill analyzes your staged changes and generates commit messages that follow the Conventional Commits format:
text
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
It intelligently detects:
Use this skill whenever you're about to commit code:
git addgit revert auto-messages)git diff --staged to see what you're about to commitType Detection:
feat: - New files in src/, new functions/classes, new exportsfix: - Changes to existing logic, bug-related file names, error handlingdocs: - Changes to .md files, JSDoc/comments, README updatestest: - Changes to test files, spec files, test utilitiesrefactor: - Code restructuring without behavior change, renaming, cleanupstyle: - Formatting, linting fixes, whitespace, semicolonsperf: - Performance optimizations, caching, algorithm improvementsbuild: - package.json, webpack, build scripts, dependenciesci: - GitHub Actions, .yml files, CI configchore: - Tooling, configs, gitignore, minor maintenanceScope Detection:
src/components/Button.tsx → (button)src/auth/login.ts → (auth)(api), (ui), (db), (tests), (docs)Breaking Change Detection:
BREAKING CHANGE: footerYou run:
bash
# Stage your changes
git add src/components/UserProfile.tsx
# Ask Claude:
"Generate a commit message for my staged changes"
Claude analyzes:
diff
+ export function UserProfile({ userId }: Props) {
+ const user = useUser(userId);
+ return <div>{user.name}</div>;
+ }
Generated message:
text
feat(user-profile): add user profile component
Implements new UserProfile component that displays user information
based on userId prop. Integrates with useUser hook for data fetching.
You run:
bash
git add src/api/auth.ts
# Ask Claude:
"Create a commit message"
Claude analyzes:
diff
- if (token == null) {
+ if (token === null || token === undefined) {
throw new Error('Invalid token');
}
Generated message:
text
fix(auth): use strict equality check for token validation
Fixes bug where token with value 0 or empty string would incorrectly
pass validation. Now uses strict equality to properly check for null
or undefined values.
You run:
bash
git add src/api/users.ts
# Ask Claude:
"Generate commit message"
Claude analyzes:
diff
- export async function getUser(id: string): Promise<User> {
+ export async function getUser(id: string, options?: GetUserOptions): Promise<UserResponse> {
Generated message:
text
feat(api)!: add options parameter to getUser function
Extends getUser API to accept optional configuration object for
including related data. Return type changed to UserResponse for
better type safety.
BREAKING CHANGE: getUser now returns UserResponse instead of User.
Update all callers to access user data via response.data property.
You run:
bash
git add README.md docs/api.md
# Ask Claude:
"Generate commit"
Generated message:
text
docs: update API documentation and README
- Add authentication examples to API docs
- Update installation instructions in README
- Fix typos in configuration section
You run:
bash
git add package.json package-lock.json
# Ask Claude:
"Make commit message"
Claude analyzes:
diff
- "react": "^17.0.2"
+ "react": "^18.2.0"
Generated message:
text
build(deps): upgrade react to v18.2.0
Updates React from v17 to v18 for improved concurrent rendering
features and automatic batching. No breaking changes in our usage.
While this skill uses Conventional Commits by default, you can customize the style in your conversation:
text
"Generate a commit message following Angular style"
"Create a commit using Gitmoji format with emojis"
"Write a detailed commit message with bullet points in the body"
If you're working in a monorepo or specific module:
text
"Generate commit messages with scope 'frontend' for this session"
"All my commits should have scope 'api'"
If your branch name includes issue numbers:
bash
# Branch: feature/USER-123-add-profile
# Generated message will include:
#
# feat(user-profile): add user profile component
#
# Closes USER-123
conventional-changelog to automate release notessemantic-release to version from commitstext
<type>[optional scope][optional !]: <description>
[optional body]
[optional footer(s)]
feat: - New feature for users (triggers MINOR version)fix: - Bug fix for users (triggers PATCH version)docs: - Documentation only changesstyle: - Formatting, missing semicolons, etc. (no code change)refactor: - Code change that neither fixes a bug nor adds a featureperf: - Performance improvementtest: - Adding or updating testsbuild: - Changes to build system or dependenciesci: - Changes to CI configuration files and scriptschore: - Other changes that don't modify src or test filesrevert: - Reverts a previous commitAdd ! after type/scope OR include BREAKING CHANGE: in footer:
text
feat(api)!: remove deprecated endpoints
BREAKING CHANGE: The /v1/users endpoint has been removed.
Use /v2/users instead.
Cause: You haven't run git add yet.
Solution:
bash
# Stage your changes first
git add .
# Or stage specific files
git add src/components/Button.tsx
# Then ask for commit message
Cause: Changes are ambiguous or too broad.
Solution: Provide more context:
text
"Generate a commit message - this change fixes a memory leak in the cache"
"Create a commit - this adds JWT authentication support"
Cause: File patterns don't clearly indicate intent.
Solution: Specify the type:
text
"Generate a 'fix' commit message"
"Create a 'refactor' commit for these changes"
Cause: File path doesn't match your project structure.
Solution: Specify the scope:
text
"Generate commit with scope 'auth'"
"Create commit message for the API module"
Solution: Ask Claude to add co-author footer:
text
"Generate commit and add co-author: Jane Doe <jane@example.com>"
Result:
text
feat(user): add profile page
Co-authored-by: Jane Doe <jane@example.com>
Validate generated messages:
bash
npm install -g @commitlint/cli @commitlint/config-conventional
# .commitlintrc.json
{
"extends": ["@commitlint/config-conventional"]
}
Enforce validation on commit:
bash
npm install -g husky
# .husky/commit-msg
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no -- commitlint --edit "$1"
Automate versioning and changelog:
bash
npm install -g semantic-release
# Automatically generates:
# - Version numbers from commit types
# - CHANGELOG.md from commit messages
# - Git tags
# - GitHub releases
Generate changelog manually:
bash
npm install -g conventional-changelog-cli
conventional-changelog -p angular -i CHANGELOG.md -s
text
update stuff
fix bug
wip
changes
asdf
updated component
text
feat(auth): implement JWT token refresh mechanism
Adds automatic token refresh before expiration to prevent
session interruptions. Includes retry logic and error handling.
fix(api): prevent race condition in user data fetch
Adds mutex lock to ensure sequential processing of concurrent
user data requests. Fixes issue where stale data could overwrite
fresh data.
docs(readme): add installation instructions for Windows
Includes PowerShell-specific commands and troubleshooting
section for common Windows installation issues.
When you stage multiple files:
bash
git add src/components/Button.tsx src/components/Input.tsx src/styles/forms.css
Claude will:
forms or components)For monorepos, specify the workspace:
text
"Generate commit for the @myapp/frontend package"
"Create commit scoped to the api workspace"
Result:
text
feat(frontend): add dark mode toggle
or
feat(api): add rate limiting middleware
Claude uses your branch name for additional context:
feature/USER-123 → Adds "Closes USER-123" footerfix/login-error → Prefers fix typedocs/api-reference → Prefers docs typetext
fix(mm): prevent use-after-free in page cache
The page cache could reference freed memory under heavy load.
Add proper reference counting to prevent the issue.
Fixes: abc1234 ("mm: optimize page cache")
Reported-by: security@kernel.org
text
feat(hooks): add useTransition hook
Adds new concurrent rendering hook for deferring state updates.
Includes TypeScript types and comprehensive test coverage.
Related: #18796
This skill adapts to your project's style while maintaining conventional commits structure.
Pro Tip: After using this skill for a week, you'll start writing better commit messages naturally - it's a great learning tool!
License: MIT-0 (Public Domain)