Commit Message Generator

VerifiedSafe

Generates clear commit messages by analyzing git diffs. Use when writing commit messages or creating commits.

Sby Skills Guide Bot
DevelopmentBeginner
7/25/2026
Claude CodeCursorWindsurf
#commit-message#git#conventional-commits#version-control

Recommended for

Automated summary

Automatically generates conventional commit messages by analyzing Git diffs and staged changes.

Strengths

  • Produces well-structured messages with type, scope, and clear subject
  • Analyzes the diff to understand the nature and context of changes
  • Automatically creates the commit with proper command
  • Follows conventional commit rules (length, imperative mood, etc.)

Limitations

  • May misinterpret complex or unconventional changes
  • Requires Git to be available and changes to be staged
  • Automatically adds a 'Co-Authored-By' line that may not always be desired
When to use it

Use this skill when you need to create a professional, structured commit message from already staged changes.

When not to use it

Do not use it for very simple single-line commits or when you prefer to write the message yourself.

Security analysis

Safe
Quality score90/100

The skill only uses git status, diff, log, and commit commands. No destructive or exfiltration actions. The Co-Authored-By email is harmless.

No concerns found

How this analysis is made

Examples

Generate commit message for staged changes
Generate a commit message for my staged changes
Create a commit with a descriptive message
Help me commit my changes with a good message
Write commit for a new feature
Write a commit message for this feature I just finished

name: commit-message description: Generates clear commit messages from git diffs. Use when writing commit messages, reviewing staged changes, or when the user asks to create a commit. allowed-tools: Bash, Read user-invocable: true

Commit Message Generator

Generate clear, conventional commit messages by analyzing git diffs and staged changes.

Instructions

When asked to generate or create a commit message:

  1. Analyze Current State

    • Run git status to see what files are staged and unstaged
    • Run git diff --cached to review staged changes
    • Run git log --oneline -10 to understand the project's commit message style
  2. Understand the Changes

    • Read the diff carefully to understand what changed
    • Identify the type of change (feature, fix, refactor, etc.)
    • Determine the scope/area affected (component, file, feature)
    • Understand the "why" behind the changes, not just the "what"
  3. Generate the Commit Message

Use this format:

<type>(<scope>): <subject>

<body>

Co-Authored-By: ai <caizongding@gmail.com>

Commit Types

  • feat: New feature or functionality
  • fix: Bug fix
  • refactor: Code refactoring (no behavior change)
  • perf: Performance improvement
  • style: Styling or formatting changes
  • docs: Documentation updates
  • test: Adding or updating tests
  • chore: Maintenance, dependencies, configuration
  • build: Build system or dependency changes
  • ci: CI/CD configuration changes

Writing Rules

  • Subject line: Use imperative mood ("add" not "added" or "adds")
  • Length: Subject ≤ 50 characters, body lines ≤ 72 characters
  • Clarity: Be specific and descriptive
  • Scope: Use relevant scope like todos, auth, ui, api, etc.
  • Body: Explain WHY, not WHAT (the diff shows what)
  1. Present the Message

    • Show the generated commit message clearly
    • Explain your reasoning if the change is complex
  2. Create the Commit Automatically

    • Use heredoc format for proper multiline message:
    git commit -m "$(cat <<'EOF'
    <type>(<scope>): <subject>
    
    <body>
    
    Co-Authored-By: ai <caizongding@gamil.com>
    EOF
    )"
    

Examples

Example 1: New Feature

Scenario: User added a dark mode toggle to settings

feat(settings): add dark mode toggle

Implement dark mode toggle with localStorage persistence. The toggle
respects system preferences on first load and provides smooth transitions
between themes using CSS variables.

Co-Authored-By: ai <caizongding@gamil.com>

Example 2: Bug Fix

Scenario: Fixed hydration mismatch in todo list

fix(hydration): prevent SSR/client mismatch in todo list

Use two-phase hydration pattern to avoid mismatch errors. Now loading
from localStorage in useEffect after component mounts rather than
during initial render.

Co-Authored-By: ai <caizongding@gamil.com>

Example 3: Refactoring

Scenario: Extracted logic into custom hook

refactor(hooks): extract todo storage logic into useTodoStorage

Move localStorage sync logic into reusable hook for better testability
and separation of concerns. No functional changes to user-facing behavior.

Co-Authored-By: ai <caizongding@gamil.com>

Example 4: Performance Optimization

Scenario: Added memoization to expensive calculation

perf(todos): memoize completed count calculation

Wrap todo completion calculation in useMemo to prevent unnecessary
recalculation on every render. Improves performance with large todo lists.

Co-Authored-By: ai <caizongding@gamil.com>

Example 5: Style Changes

Scenario: Improved responsive layout

style(layout): improve mobile responsive design

Adjust grid layout to stack vertically on small screens with better
padding and spacing. Enhance glassmorphism effects for improved contrast.

Co-Authored-By: ai <caizongding@gamil.com>

Best Practices

Do ✅

  • Analyze the full diff before writing the message
  • Match the project's existing commit style
  • Use specific, actionable language
  • Explain the reasoning in the body
  • Keep each commit focused on one logical change
  • Use conventional commit format consistently

Don't ❌

  • Use vague messages like "fix bug" or "update code"
  • Mix multiple unrelated changes in one commit
  • Write overly long subject lines
  • Forget to add Co-Authored-By attribution
  • Skip the body for non-trivial changes
  • Use past tense or gerunds

Special Cases

Breaking Changes

Add an exclamation mark (!) after the type and include BREAKING CHANGE in body:

feat(api)!: change todo response format

BREAKING CHANGE: Todo API now returns different structure.
Before: { id, title, done }
After: { id, text, completed, createdAt }

Update all API consumers to use new format.

Co-Authored-By: ai <caizongding@gamil.com>

Multiple Related Changes

Use bullet points in the body:

feat(todos): add filtering and sorting

- Add filter buttons for all/active/completed states
- Implement sort by date or alphabetically
- Persist filter/sort preferences in localStorage

Co-Authored-By: ai <caizongding@gamil.com>

Fixing Issues

Reference issue numbers:

fix(auth): resolve login redirect loop

Fixes #123

Detect token expiration properly and redirect to login without
creating an infinite loop.

Co-Authored-By: ai <caizongding@gamil.com>

Verification Checklist

Before committing, verify:

  • [ ] Type is correct (feat, fix, refactor, etc.)
  • [ ] Scope accurately describes affected area
  • [ ] Subject line uses imperative mood
  • [ ] Subject line is ≤ 50 characters
  • [ ] Body explains WHY, not just WHAT
  • [ ] Body lines are ≤ 72 characters
  • [ ] Co-Authored-By is included
  • [ ] Message follows project conventions
  • [ ] Commit is atomic (one logical change)

Integration with Workflow

This skill works seamlessly with Claude Code's commit workflow:

  1. User makes changes and stages them with git add
  2. User asks "Create a commit" or "Generate commit message"
  3. This skill activates automatically
  4. Analyzes diff and generates conventional commit message
  5. Creates commit with proper attribution

The skill respects the project's existing conventions by analyzing recent commit history.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/commit-message-generator-mryiqhmh/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/commit-message-generator-mryiqhmh' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/commit-message-generator-mryiqhmh/download' --output '.skill-downloads/commit-message-generator-mryiqhmh/SKILL.md.part' && mv '.skill-downloads/commit-message-generator-mryiqhmh/SKILL.md.part' '.skill-downloads/commit-message-generator-mryiqhmh/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash, Read

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/commit-message-generator-mryiqhmh/SKILL.md' && test -s '.skill-downloads/commit-message-generator-mryiqhmh/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/commit-message' && cp -R '.skill-downloads/commit-message-generator-mryiqhmh' '.claude/skills/commit-message'

Cursor
test -f '.skill-downloads/commit-message-generator-mryiqhmh/SKILL.md' && test -s '.skill-downloads/commit-message-generator-mryiqhmh/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/commit-message' && cp -R '.skill-downloads/commit-message-generator-mryiqhmh' '.cursor/skills/commit-message'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/commit-message-generator-mryiqhmh'

openskills read 'commit-message-generator-mryiqhmh'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/commit-message-generator-mryiqhmh/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills