Skip to content

Instantly share code, notes, and snippets.

@rvanbaalen
Last active January 29, 2026 02:38
Show Gist options
  • Select an option

  • Save rvanbaalen/50769263f3b96f58c27aed4d4e11dc54 to your computer and use it in GitHub Desktop.

Select an option

Save rvanbaalen/50769263f3b96f58c27aed4d4e11dc54 to your computer and use it in GitHub Desktop.
conventional-commits skill for Claude Code

Conventional Commits Skill for Claude Code

Commit changes using micro commits with conventional commit messages.

What It Does

  1. Analyzes all changes in your working directory (git status, git diff)
  2. Groups related files into logical commits
  3. Proposes each commit with files, summary, and conventional commit message
  4. Waits for your approval before committing
  5. Offers to push when all commits are made

Auto-Invocation

This skill is manually invoked with /conventional-commits or when you ask Claude to commit your changes.

Installation

Using Claude Skills Installer

claude-skill-gists install 50769263f3b96f58c27aed4d4e11dc54

Or run the interactive installer:

curl -fsSL https://gist.githubusercontent.com/rvanbaalen/2e4c2840d06de810f771a4514f97c6da/raw/claude-skills.js -o /tmp/claude-skills.js && node /tmp/claude-skills.js

Manual Installation

mkdir -p ~/.claude/skills/conventional-commits
curl -o ~/.claude/skills/conventional-commits/SKILL.md https://gist.githubusercontent.com/rvanbaalen/50769263f3b96f58c27aed4d4e11dc54/raw/SKILL.md

Then restart Claude Code.

Key Features

  • Respects project-specific conventions from CLAUDE.md or AGENTS.md
  • Groups related changes into atomic commits
  • Uses standard conventional commit types (feat, fix, docs, refactor, etc.)
  • Interactive approval workflow for each commit
  • Never adds Co-authored-by or Generated-by trailers

Conventional Commit Types

Type Description
feat A new feature
fix A bug fix
docs Documentation only changes
style Formatting, semicolons, etc.
refactor Code change that neither fixes a bug nor adds a feature
perf Performance improvement
test Adding or correcting tests
build Build system or external dependencies
ci CI configuration changes
chore Other changes

License

MIT License - Created by Robin van Baalen

name description
conventional-commits
Commit changes using micro commits with conventional commit messages. Analyzes git diff, groups related files, and proposes commits for approval. Use when the user wants to commit their changes or invokes /commit.

You're going to commit the changes in the current branch using micro commits with conventional commit messages.

Follow this procedure:

0. Check for Project-Specific Conventions

Look for custom commit conventions in the project's instruction files:

  • CLAUDE.md in the project root
  • AGENTS.md in the project root
  • .claude/CLAUDE.md

If these files contain commit message conventions, scopes, or formatting rules, follow them. Project-specific rules override the defaults below.

1. Analyze Changes

Run git status and git diff to understand all changes in the working directory:

  • git status to see modified, added, and deleted files
  • git diff to see unstaged changes
  • git diff --cached to see staged changes

2. Group Related Changes

Analyze the changes and group files that logically belong together into separate commits. Consider:

  • Files that implement a single feature together
  • Files that fix a single bug together
  • Configuration changes that belong together
  • Test files with their corresponding implementation files
  • Refactoring changes that are isolated from feature work

Each group should represent ONE logical change that can be described in a single conventional commit.

3. For Each Group, Propose Using This Template

# Files:
- path/to/file-one.ext
- path/to/file-two.ext

# Changes
[Single line summary of what these changes do]

# Commit message
[type]([optional scope]): [description]

[optional body - only if needed for complex changes]

Approve? yes/no

Conventional Commit Types:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (formatting, semicolons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files

4. Process User Response

  • If yes: Stage only the listed files and execute the commit
    git add path/to/file-one.ext path/to/file-two.ext
    git commit -m "commit message here"
  • If no or user provides feedback: Incorporate feedback and propose again using the same template

5. Repeat

Continue proposing commits for remaining changes until all changes are committed.

6. Offer to Push

Once all commits are made, ask the user:

All changes committed. Would you like to push the branch?

If yes, run git push (with -u origin branch-name if needed for new branches).


Important Rules

  • NEVER add "Co-authored-by" trailers
  • NEVER add "Generated by" or similar attribution
  • Keep commit messages concise but descriptive
  • Use imperative mood in the description ("add feature" not "added feature")
  • Scope is optional but helpful for larger codebases
  • Breaking changes should include an exclamation mark after the type/scope, for example: feat!: or feat(api)!:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment