Omniscio

OmniscioSkills examplesCommit messages

A Claude Code commit message skill you can copy

One complete SKILL.md for the message format you own and reuse. How Claude asks for a commit without a skill at all, how to stop the git permission prompts, and what trailer Claude adds is the git commit guide.

Checked against Anthropic's documentation on November 25, 2026. By the Omniscio team. Updated .

When this skill fires, and why only when you say so

This one does not fire on its own. Its frontmatter sets disable-model-invocation: true, which Anthropic recommends for workflows with a side effect or a timing you care about — a commit is both. The description still names the job, but it is kept out of Claude's context, so Claude cannot start the skill on its own; you name it.

  • You run it with /commit-message after staging changes, optionally with a hint such as /commit-message fix login timeout.
  • Claude cannot start it because the flag hides it from automatic loading. If it tries anyway, Claude Code blocks the call and Claude suggests you run the command yourself.
  • If you want Claude to draft messages automatically, remove the flag, accept that it may run whenever you ask to commit, and keep the body's "ask first" rule.

The whole skill, ready to copy

Save this as SKILL.md inside a folder named commit-message, with the frontmatter as the file's first line.

---
name: commit-message
description: Writes a Conventional Commits message for the staged changes and shows it before anything is committed. Use when the user asks for a commit message or asks to commit staged changes.
disable-model-invocation: true
allowed-tools: Bash(git diff *)
---

## Staged changes

!`git diff --cached`

## Instructions

1. Read the staged diff above. If it is empty, say nothing is staged and stop.
2. Pick one type: feat, fix, docs, style, refactor, perf, test, build, ci or chore.
3. Write the message in this shape:
   - Subject: 72 characters or fewer, imperative mood, no full stop.
   - A blank line, then a body wrapped at 72 characters, only when the subject cannot carry what changed and why.
   - A final line naming a breaking change when one is present: BREAKING CHANGE: what breaks.
4. Show the message in one fenced block, then ask whether to commit with it.

Never run `git commit` unless the user answers yes in the current conversation.

What each part does

The four frontmatter fields, and the one that changes who can run it.
FieldWhat it does here
name: commit-messageSets the command in the / menu. Without it the folder name is the command
descriptionWhat the skill does and when to use it. It stays the label the /skills menu shows, even while the next field keeps it out of Claude's context
disable-model-invocation: trueClaude cannot start the skill on its own, and its description is not loaded into context. This is the field that makes a commit workflow safe
allowed-tools: Bash(git diff *)Pre-approves the skill's own git diff --cached command. Without it the injected command is checked against your permission rules and, outside auto mode, aborts the invocation before Claude sees the file
  • !`git diff --cached` injects the staged diff before Claude reads the file. Using --cached rather than HEAD is the point: the message describes what will actually go into the commit, not everything in the working tree.
  • The type list is the Conventional Commits vocabulary, the prefix convention that lets a changelog be generated from history. One type per commit keeps that history readable.
  • The 72-character subject cap is this skill's choice rather than a git rule; many teams use 50 for the subject and 72 for the body, and either fits a terminal without wrapping. The body is conditional because most commits do not need one.
  • "Ask first" is the instruction that keeps a manual skill manual even after you type it. The frontmatter controls who can start the skill; the body controls what it does when started. The yes is not a permission grant: only the diff is pre-approved, so the git commit that follows still follows your normal permission settings.

At about twenty lines this is one of the smallest useful skills you can write. The body loads once per invocation and stays in the conversation, so a short file costs little on every later turn.

Where to put it: personal or project

Personal follows you; project follows the repository.
ChoosePathWho gets it
Personal~/.claude/skills/commit-message/SKILL.mdYou, in every project on this machine, but not Cowork or cloud sessions
Project.claude/skills/commit-message/SKILL.mdThe whole team, once committed, which is usually what you want for a shared message convention

When both exist, the personal copy wins, so a team convention committed to the repository can be silently overridden by your home folder. Pick one home for a shared convention.

Edits are picked up within the session, except in bare mode, the fast launch that skips optional startup work. If a new skill does not appear, run /reload-skills. Live detection covers the SKILL.md text only.

How to confirm it loads

  1. Find the command. Type /commit-message. Because model invocation is off, it may not be offered to Claude, but you should still be able to run it.
  2. Open /skills. The skill should be listed. If it is missing, the path or the file name is wrong.
  3. Stage a change and run it. The reply should be one fenced message, then a question. If nothing is staged, it should say so.
  4. Prove it with the draft, not a commit. A loaded skill answers with a message you can read before deciding; never test it by letting it commit.

/skill-doctor reports what each skill costs and how often it is used, which is also the quickest way to spot a skill that is loaded but never invoked.

Common failures

The failure this skill exists to prevent is a commit message appearing when you did not ask for one. Leave the flag out and the skill becomes model-invocable: Claude can decide a change looks ready and start the workflow while answering something else. The body still refuses to commit without your yes, so the flag controls when the draft happens, not whether the commit is safe.

  • It says nothing is staged. That is correct: git diff --cached is empty. Stage the work with git add and run the skill again.
  • It aborts instead of answering. Outside a git repository, git diff --cached exits non-zero, and a failed injected command aborts the whole invocation. Run the skill inside the repository you mean to commit to.
  • The command is not recognised. Check the folder name and the name field, and check for a character Claude Code refuses in a name, such as a zero-width space.
  • The message ignores your convention. The type list and the shape live in the body; edit them there. With the flag set, the description is only a label.

Where this fits

How Claude Code commits, branches and opens a pull request without a skill, how to stop the permission prompts for git, and how to change or hide the trailer it adds is the Claude Code git commit guide. This skill only owns the wording of the message.

More complete examples, including the review checklist you can run before this one, are in the skills examples library, and the mechanism is in the skills guide.

Where these answers come from

Common questions

Why can't Claude start this skill on its own?

Because the frontmatter sets disable-model-invocation: true. Anthropic recommends that for workflows with side effects or timing you want to control, and its own example is a commit. Remove the line if you want automatic invocation and accept the risk.

Does it commit for me?

Only after you say yes. The body tells Claude to show the message and ask, and never to run git commit without your answer in the current conversation.

Why is the diff empty when I have changes?

The injected command reads the staged diff, git diff --cached. Unstaged edits are invisible to it by design, so stage them first with git add.

Where do I put a team-wide version?

In the repository at .claude/skills/commit-message/SKILL.md, committed. A personal copy at the same name wins over it, so make sure teammates do not keep both.