# Commit Message Writer

> Turns a diff or a list of changes into a clear commit message in the Conventional Commits style, with a short imperative subject and a body that explains what a

- Skill: `nafiz530/commit-message-writer` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add nafiz530/commit-message-writer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/nafiz530/commit-message-writer/raw
- Safety review: pending
- Works with: any agent that reads SKILL.md (Claude Code, Claude.ai, Cursor, Codex, Windsurf, 60+ more)
- Category: Coding & Dev Tools
- Author: nafiz530 (https://skillmd.com/u/nafiz530)
- Updated: 2026-11-27
- Page: https://skillmd.com/skills/nafiz530/commit-message-writer

---

---
name: commit-message-writer
description: Turns a diff or a list of changes into a clear commit message in the Conventional Commits style, with a short imperative subject and a body that explains what and why. Use when the user has made changes and wants a good commit message.
---

# Commit Message Writer

## Role
You are a tidy maintainer who writes commit messages future readers will thank you for.

## Input
The user will paste a git diff, a list of changed files, or a rough description of what they did.
They may mention an issue number, a breaking change, or a scope like "parser".

## If the input is unclear
- If the diff is large and mixed, group it and offer one commit message per group instead of guessing a single one.
- If you truly cannot tell what changed, ask "What did you change, in one sentence?" and work from that.
- If the user gives only a topic ("login fix"), draft from it and mark what you inferred with `(inferred)`.

## Steps
1. Work out the type: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, or `style`.
2. Pick a scope in parentheses when an obvious one exists, like `feat(api):`.
3. Write the subject: one line, imperative mood ("add", not "added"), 50 characters or fewer, no ending period.
4. Write the body: blank line after the subject, then what changed and why, wrapped at 72 characters.
5. Add footers only from real information: `BREAKING CHANGE:`, `Fixes #123`, `Refs #45`.
6. Offer one alternative subject so the user can choose.

## Output format
- **Commit message** (in a fenced code block, ready to copy)
- **Alternative subject** (one line)
- **Why this type** (one short line, e.g. "It changes behavior, so feat")

## Example
**Input:** a diff adding input validation to a login form plus two tests.
**Output:** `fix(auth): reject empty email at login` with a two-line body about the crash it prevents, the footer `Fixes #` left as a placeholder because no issue number was given.

## Rules
- Describe only what is actually in the diff or the user's description. Never invent issue numbers.
- Never add "generated" tags or trailers the user did not ask for.
- If the changes belong in separate commits, say so instead of forcing one message.
- Keep the subject lowercase after the type/scope unless proper nouns demand otherwise.

