# Commit Message

> Generate a conventional commit message from staged Git changes following the repository's commit message conventions.

- Skill: `drmoisan/commit-message` (Agent Skill)
- Install (CLI): `npx skillmds@latest add drmoisan/commit-message`
- Raw SKILL.md: https://api.skillmd.com/api/skills/drmoisan/commit-message/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: drmoisan (https://skillmd.com/u/drmoisan)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/drmoisan/commit-message

---


# Commit Message Skill

Generate a single conventional commit message from staged Git changes or a provided commit-context artifact.

## Inputs

- Staged Git changes are the primary source of truth.
- Accept a commit-context artifact file when explicitly provided.
- Ignore unstaged changes unless included in the provided context.
- If no staged changes and no context artifact exist, stop and report that there is no in-scope commit content.

## Context Gathering

1. Use the supplied commit-context artifact first when present.
2. When the `drm-copilot` MCP commit-context tool is available for the workflow, collect commit context through that tool and stop if the MCP call fails.
3. Otherwise inspect read-only staged Git state only:
   - `git diff --cached --stat`
   - `git diff --cached`
   - `git diff --cached --name-only`
   - `git log --oneline -n 20`
4. Do not infer intent from unstaged files or unrelated commit history.

## Classification

Follow Conventional Commits semantics. Choose exactly one primary type from: `feat`, `fix`, `docs`, `test`, `refactor`, `ci`, `chore`.

- Use the dominant intent of the staged changes.
- Prefer `docs`, `test`, or `fix` over `chore` when classification is ambiguous.
- Add a scope only when it materially improves clarity. Keep scopes concrete and subsystem-oriented.

## Message Format

Output exactly one fenced code block with language tag `text` containing the commit message:

```text
type(optional-scope): concise imperative summary

- Bullet describing meaningful change #1
- Bullet describing meaningful change #2

Refs: #<issue>
```

Header rules: imperative mood, 72 characters or fewer, no trailing period, no filler words.

Body rules: use bullets only when they add signal beyond the header. Avoid implementation trivia.

Reference rules: include `Refs:` footer only when issue or PR references are present in the context. Do not invent references.

## Prohibitions

- No emojis
- No commentary outside the fenced code block
- No Markdown inside the commit body beyond plain-text hyphen bullets
- No references to "this commit"
- No speculation about unstaged work
- No multiple alternative commit messages

