Library / Git commit messages

Claude Engineering Claude SKILL.md

Git commit messages

Write conventional commit messages from a staged diff, without fluff or invented ticket IDs.

Install in Claude Code

Create a folder whose name matches the skill name field (git-commit-messages/). Save the text below as SKILL.md inside it. Personal skills go in ~/.claude/skills/git-commit-messages/. Project skills go in .claude/skills/git-commit-messages/. Claude Code discovers them from the filesystem.

Upload on claude.ai

Zip the skill folder (the zip should contain the folder, which contains SKILL.md) and upload it in Claude’s Skills settings. Anthropic’s current platform docs list custom uploads on Pro, Max, Ultra, Team, and Enterprise plans when code execution is enabled. Check the Claude Help Center for the latest plan details. Read the files before you turn a skill on.

Use with the Claude API

Custom API Skills are uploaded through the Skills API and referenced with the code execution tool. Skills do not sync automatically from Claude Code or claude.ai — install this folder again on the surface where you need it. See Anthropic’s Agent Skills overview.

---
name: git-commit-messages
description: Writes concise conventional commit messages by inspecting a provided git diff or staged changes. Use when the user asks for a commit message, help committing, or a summary of staged changes.
---

# Git commit messages

## Goal
Write a commit message that matches the diff the user provided. Describe the change, not the author's feelings about the change.

## Format
Use Conventional Commits:

```text
type(scope): short summary

Optional body explaining why, not what the diff already shows.
Optional footer (Breaking change, or a ticket ID only if the user supplied one).
```

Common types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `ci`, `build`, `revert`.

## Workflow
1. Read the diff or `git status` / `git diff` output. If no diff is present, ask the user to paste it or allow you to inspect the repo. Do not invent changes.
2. Choose one primary type. If the diff mixes unrelated concerns, say so and propose splitting commits before writing a catch-all message.
3. Infer a short scope from the main area (`auth`, `api`, `ui`, `docs`) when it is obvious; omit the scope when it is not.
4. Write the summary in imperative mood, about 50–72 characters: `fix(auth): reject expired session tokens`.
5. Add a body only when the why is not obvious: tradeoffs, a bug's user-facing impact, or a migration note.
6. Mention breaking changes explicitly.

## Examples
Input: added JWT validation middleware and a login route.
Output:
```text
feat(auth): validate JWT sessions on protected routes

Reject expired or malformed tokens before handlers run so
API clients receive a 401 instead of a partial response.
```

Input: corrected timezone conversion in a reporting query.
Output:
```text
fix(reports): convert report timestamps in UTC

Dates were formatted in the server local zone, which shifted
daily totals for users outside that zone.
```

## Rules
- Never invent ticket numbers, reviewers, or co-authors.
- Do not include files-changed lists unless the user asks.
- If the diff is dangerous (`git reset`, force push, secret files), warn before writing a message that would help commit those files.
- Offer 1 default message and, when helpful, 1 shorter alternative.

You may copy and adapt this free skill for personal or commercial use. If you republish it, please credit Skillory with a link. Audit any skill — including this one — before enabling it in an environment with access to private data.