Skip to main content
skill CX Codex

writing-commit-messages — Claude Code skill: conventional commits

This skill gives the agent a fixed format for commit messages: type, scope, body, footer. Useful when the model writes the commits, not you.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add spencerpauly/awesome-cursor-skills --skill writing-commit-messages -a claude-code
Open on GitHub

What writing-commit-messages does

The skill spells out the <type>(<optional scope>): <subject> layout and a table of types: feat, fix, refactor, docs, test, chore, perf, style, ci, revert. Subject lines stay under 50 characters, use imperative mood, skip the trailing period and keep the first letter lowercase after the prefix. For the body it tells the agent to explain why the change happened instead of restating the diff.

Breaking changes get their own section: an exclamation mark after the type plus a BREAKING CHANGE: footer with migration notes. There is also guidance on when to commit — one logical change per commit, no refactoring mixed into feature work, no half-working code (use git stash), commit often on branches and squash before merge.

The skill is plain text: a single SKILL.md, no scripts, no dependencies. It works only as far as the agent follows instructions, since nothing validates the message. In a repo that already runs commitlint, expect disagreements over subject length or the allowed type list.

What it helps with

  • keep commit messages in one conventional format across the team
  • pick the right type for a change: feat, fix or chore
  • explain the reason for a change in the commit body
  • flag a breaking change and add migration notes
  • split refactoring and new features into separate commits

Example prompts for the agent

  • Write a conventional commit message for these changes
  • Split the current diff into logical commits and write a message for each
  • This is a breaking change — write the commit with a BREAKING CHANGE footer

How to install writing-commit-messages

1Skills CLI (Vercel)

npx skills add spencerpauly/awesome-cursor-skills --skill writing-commit-messages -a claude-code

2Manually: put the files in place

~/.claude/skills/writing-commit-messages/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/writing-commit-messages/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about writing-commit-messages

How do I install writing-commit-messages in Claude?

Run npx skills add spencerpauly/awesome-cursor-skills --skill writing-commit-messages -a claude-code. The skill file then lands at ~/.claude/skills/writing-commit-messages/SKILL.md.

What does writing-commit-messages do?

It hands the agent a set of commit rules: type and scope in the header, a length limit on the subject, a body that explains why, and a footer for breaking changes and issue references.

How is this different from commitlint?

This is an instruction for the model, not a CI check. It shapes the message the agent writes, but it will not block a commit that breaks the format.

Source text

SKILL.md · CC0-1.0
---
name: writing-commit-messages
description: Write clear, conventional commit messages with proper type prefixes, scopes, and body content.
user-invocable: true
---

# Writing Commit Messages

Write commit messages that are useful for humans and machines.

## Format

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

<optional body>

<optional footer>
```

### Subject Line Rules

- **50 characters or less** for the subject
- Use imperative mood: "add feature" not "added feature" or "adding feature"
- Don't capitalize the first letter after the type prefix
- No period at the end

### Types

| Type | When to use |
|------|-------------|
| `feat` | New user-facing feature |
| `fix` | Bug fix |
| `refactor` | Code restructuring without behavior change |
| `docs` | Documentation changes |
| `test` | Adding or updating tests |
| `chore` | Build, CI, tooling, deps |
| `perf` | Performance improvement |
| `style` | Formatting, whitespace (not CSS) |
| `ci` | CI/CD pipeline changes |
| `revert` | Reverting a previous commit |

### Scope (Optional)

The area of the codebase affected:
- `feat(auth): add OAuth2 login flow`
- `fix(api): handle null response from payments endpoint`
- `refactor(db): extract query builder into module`

### Body (When Needed)

Explain **why**, not what (the diff shows what):

```
fix(checkout): prevent duplicate order submissions

The submit button was not disabled after the first click,
allowing users to create multiple orders. This caused
duplicate charges in Stripe.
```

### Footer (When Needed)

```
BREAKING CHANGE: rename `getUserById` to `findUser`

Closes #456
Co-authored-by: Name <email>
```

## Examples

Good:
```
feat(dashboard): add real-time notification bell
fix: resolve race condition in WebSocket reconnect
refactor(api): consolidate error handling middleware
test: add integration tests for payment webhook
chore: upgrade TypeScript to 5.4
```

Bad:
```
fixed stuff
WIP
update
changes
asdf
```

## When to Commit

- Each commit should represent one logical change
- Don't mix refactoring with feature work in the same commit
- Don't commit half-working code (use `git stash` instead)
- Commit early and often on feature branches, squash before merge if needed

## Breaking Changes

If the commit introduces a breaking change:
1. Add `!` after the type: `feat(api)!: change auth token format`
2. Add `BREAKING CHANGE:` in the footer with migration instructions

© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills

Similar skills

All skills for Git and GitHub →

From the same set60

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor