Coding prompts · How to use a skill

write-commit-message-prompt

A prompt that turns your staged changes or a short description of them into a clear Conventional Commits message with a type, scope, imperative subject, a why-focused body and breaking-change footer. Use when the user wants a commit message written, asks how to describe their changes, or follows conventional commits.

Version 1.0 · Updated 2026-10-31

View raw SKILL.md

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/write-commit-message-prompt/raw' -o ~/'.claude/skills/write-commit-message-prompt/SKILL.md'

Cursor (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/write-commit-message-prompt/raw' -o '.cursor/skills/write-commit-message-prompt/SKILL.md'

Codex and other Agent Skills tools (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/write-commit-message-prompt/raw' -o '.agents/skills/write-commit-message-prompt/SKILL.md'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

Write a commit message (prompt)

When to use

  • You finished a change and need a clear commit message.
  • Your project uses Conventional Commits (feat:, fix:, chore: and so on).
  • You want commit history that explains why, not just what.

Steps

  1. Stage your change, then run git diff --staged and copy the output (or describe the change in a sentence).
  2. Paste it into the prompt below in place of {{DIFF OR DESCRIPTION}}.
  3. Check the type and scope, then commit with git commit -F message.txt or paste it into your editor.

Prompt

Write a commit message following the Conventional Commits specification for the changes below.

1. Format: <type>[optional scope][!]: <description>, then a blank line, an optional body and optional footers.
2. Types: feat, fix, docs, style, refactor, test, chore, ci, perf, build, revert.
3. Add a scope in parentheses when it helps, e.g. feat(api):.
4. Description: imperative mood ("add", not "added"), lowercase, no period, about 50 characters.
5. Body: explain what changed and why, not how. Wrap near 72 characters.
6. Breaking change: add ! after the type or scope and a "BREAKING CHANGE:" footer.
7. Footers like "Refs: #123" only if I gave you an issue number.
8. If the changes do several unrelated things, say so and suggest how to split them.

Output only the commit message, with no code fences or explanation.

CHANGES:
{{DIFF OR DESCRIPTION}}

How to adapt

  • Team uses a different style? Replace rules 1-4 with an example of a good commit from your repo.
  • For a pull request title, ask for "the subject line only".

Gotchas

  • Check the diff for secrets (API keys, tokens, .env values) before pasting it into any AI tool, and before committing.
  • Works with any git host (GitHub, GitLab, Bitbucket) and any chat AI. No tool lock-in.

Done when

  • The subject follows type(scope): description in under about 50 characters.
  • The body says why the change was made.

Example prompt

"Write a commit message for this diff."

---

Based on the "Conventional Commit Message Generator" prompt by jeff-nasseri on prompts.chat (CC0 1.0, public domain).

Adapted from jeff-nasseri (prompts.chat, 'Conventional Commit Message Generator') (Public domain (CC0 1.0) - prompt contributed to prompts.chat by jeff-nasseri), CC0 1.0. Adapted by TheSkillVault: restructured as numbered rules, added a secrets check, steps and done-when sections.

Licence: CC0 1.0. Attribution when you reuse it: Based on work by jeff-nasseri (prompts.chat, 'Conventional Commit Message Generator') (Public domain (CC0 1.0) - prompt contributed to prompts.chat by jeff-nasseri, CC0 1.0), https://github.com/f/prompts.chat/blob/2fe67135becdc605c6dcb2bacb7ce49bdb27c362/prompts.csv; adapted by TheSkillVault, https://theskillvault.ai