Commit Message Skill for Claude Code
Reads the staged diff and writes a commit message that says what changed and why. It never commits for you.
- Claude Code
- Git
2 files5.7 KB.zip
An annotated SKILL.md to fill in, plus a reference file that shows how to keep the main file short.
By Matthews WongUpdated Checked against Claude Code 2.1.323 docs
Key takeaway
A skill folder you rename and fill in. The frontmatter shows a description written the way that triggers: what the skill does, then when to use it, in the words a real request contains. The body gives you the sections a working skill needs, and reference.md shows where long detail goes so SKILL.md stays short.
Exactly what the download contains. Read it first, then copy or download.
---
name: my-skill
description: Writes release notes from merged pull requests in the house format. Use when the user asks for release notes, a changelog entry, "what changed in this release", or names a version tag to summarize.
---
<!--
HOW TO FILL THIS IN (delete this comment when you are done)
1. Rename the folder and the `name` above to the same lowercase-hyphen name.
The name is what you type after the slash, as in /my-skill.
2. Rewrite `description`. It is the only part Claude sees before the skill
is used, so it decides whether the skill triggers. Pattern:
sentence 1 = what the skill does,
sentence 2 = "Use when ..." with the words a real request contains.
Put the main use case first. Avoid a colon followed by a space inside
the value, or wrap the whole value in quotes, so the YAML stays valid.
3. Replace every [bracketed] part below. Delete sections you do not need.
4. Keep this file short. Move long detail to reference.md and link to it.
-->
# [Skill title]
[One or two sentences: the job this skill does and the result it produces.]
## When to use
- [A request that should trigger it, in the words a person would use]
- [A second request, phrased differently]
- Not for: [a nearby task this skill should leave alone]
## Steps
Follow these in order for the whole task.
1. [Gather what you need first: which files to read, which command to run]
2. [Do the main work. One action per step]
3. [Check the result: the command or test that proves it]
4. [Report, using the format under "What to report"]
## Rules
- [A rule that must hold every time, written as a plain instruction]
- [A thing never to do, with the reason in a few words]
- If [something required] is missing, stop and ask. Do not guess.
## Examples
Input: [a short, realistic request]
Output:
```text
[The exact shape of a good result. Short is fine.]
```
## What to report
- [What was done, in one line]
- [What was checked, and the real output of that check]
- [Anything left undone or uncertain]
## Additional resources
- For [the detailed format, field list or edge cases], see
[reference.md](reference.md). Read it only when the task needs that detail.
# [Skill title]: reference
This file is not loaded with the skill. Claude opens it only when SKILL.md
points here and the task needs the detail. Put anything long or rarely needed
in a file like this one, so the main file stays short.
Good candidates for a reference file:
- A full format or field list
- Edge cases and how to handle each one
- A long set of examples
- A lookup table
## [Format or field list]
| Field | Required | Notes |
| --------- | -------- | --------------------------------- |
| [field-1] | yes | [what goes here, with an example] |
| [field-2] | no | [when to include it] |
## Edge cases
- [Situation]: [what to do]
- [Situation]: [what to do]
## More examples
Input: [a harder request]
Output:
```text
[The expected result]
```
The archive holds one folder, my-skill. Unzip it into .claude/skills/ in your project so the file sits at .claude/skills/my-skill/SKILL.md, or into ~/.claude/skills/ to have it in every project on your machine.
Give the folder and the name field the same lowercase name with hyphens, such as release-notes. That name is the command you type after the slash.
Keep the pattern: one sentence on what the skill does, then Use when with the phrases people really type. Claude decides from this text alone whether to load the skill, so put the main use case first.
Replace each bracketed part, remove sections you do not need, and delete the how-to comment at the top. Move anything long into reference.md and keep the link to it.
In Claude Code, ask What skills are available? or open /skills and look for your skill. If the skills folder did not exist when the session started, run /reload-skills. Then type the slash command, and also try a plain request that should trigger it.
The docs describe the field as what the skill does and when to use it, and Claude uses it to decide when to apply the skill. The template's description is a worked example of that pattern, with trigger phrases in the second sentence.
name and description are both part of the Agent Skills format, so the same file is valid outside Claude Code too. Claude Code accepts more fields, such as disable-model-invocation and allowed-tools; add them only when you need them.
When to use, numbered steps, rules, one example and what to report. The most important instructions sit near the top, because after a long conversation is compacted Claude Code may keep only the start of an invoked skill.
SKILL.md links to reference.md and says what is in it. Claude opens that file only when the task calls for the detail, so a long format or a table of edge cases adds nothing to the context until then.
Short answers before you download it.
Free lessons and articles on this site that explain the ideas behind it.
Primary sources checked on the research date. Follow them for the current version.
Reads the staged diff and writes a commit message that says what changed and why. It never commits for you.
2 files5.7 KB.zip
Reads the branch diff and fills a PR template: why, what changed, real test results, risks and rollback.
2 files5.8 KB.zip
A 70-line starter CLAUDE.md: project, stack, commands, hard rules, how to verify work and what not to do.
1 file2.1 KB.md