# Cm

> >

- **Type:** Skill
- **Install:** `agentstack add skill-ctx42-skills-cm`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ctx42](https://agentstack.voostack.com/s/ctx42)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ctx42](https://github.com/ctx42)
- **Source:** https://github.com/ctx42/skills/tree/master/craft/skills/cm

## Install

```sh
agentstack add skill-ctx42-skills-cm
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Commit Message Formatting

## Invocation

- With commit hash: generate from that commit's diff.
- Otherwise: generate from the current staged/unstaged diff.

Always derive the message from the diff only.

## Arguments

Detect from the user's words; they combine (e.g. `micro apply`). Default (none
given): full-length message, presented without committing.

Verbosity — mutually exclusive, default full length:

- `micro` → summary line **only**, no body. Add `!` + `BREAKING CHANGE:` footer
  only when the change is breaking.

- `mini` → summary line plus **one** short paragraph explaining the single
  most important *why*. `Refs:` only if a breaking change applies.

Commit control:

- `apply` → commit the generated message directly via heredoc without asking —
  `git commit`, or `git commit --amend` for a hash invocation.

## Describe changes only

Write for any reader of `git log`, not for someone who sat in planning or
review. They only see the diff and the message.

- State **what** changed and **why** in product/code terms (bugs fixed,
  behavior, API, tests).

- Match detail to reader impact. Describe user-facing changes (behavior, API,
  bug fixes, CLI/output) precisely; give mechanical cleanups (lint, formatting,
  renames, dep bumps, test tweaks) a one-sentence summary, not a per-edit
  account. When a commit mixes both, lead with the user-facing change and fold
  the cleanup into one closing sentence.

- A body is optional. If the summary line already conveys the change and
  there is nothing user-facing to explain, omit the body entirely rather
  than manufacturing detail.

- Do **not** reference internal process the reader cannot know — remediation
  phases, review plans, skill names, "as discussed", ticket/session context,
  project milestones ("phase 1"), or `tmp/*-plan.md` paths — unless the diff
  itself only touches those files.

- Prefer concrete symbols and files: `` `TargetNameFromContext` ``,
  `` `Prepare` ``, not umbrella slogans that hide the actual edits.

If the diff mixes unrelated edits (e.g. IDE config + library fix), say so in
the body or ask to split commits—still without process jargon.

## Structure

```
[()][!]: 

[body]

[BREAKING CHANGE: ]
[Refs: , ...]
```

## Summary Line

- Type: `feat`, `fix`, `refactor`, `perf`, `test`, `docs`, `style`, `build`,
  `ci`, `chore`, `revert`
- Scope: optional, short noun
- Description: imperative, lowercase, no period, ideally ≤ 50 chars (hard 72)

## Breaking Changes

If the change affects exported symbols or observable behavior for callers:

- Add `!` in the summary.

- Add mandatory `BREAKING CHANGE:` footer describing the impact and migration.

## Body (Kernel Style)

- Wrap at 72 columns.
- Imperative mood.
- Explain **why** the change was made (the diff shows what).
- Use backticks for symbol references: `` `xrr.FieldErrors` ``,
  `` `WithCause` ``.
- When referencing prior commits: `Commit  ("summary") ...`

**High-clarity standard**: Write bodies with godoc-level precision — the
smallest body that fully explains the user-facing change and its motivation.

## Footers

Only two are allowed:

- `BREAKING CHANGE: ...` (when `!` is used)
- `Refs: [, ...]`

Omit all other trailers.

Never add an AI `Co-Authored-By` trailer (e.g.
`Co-Authored-By:  `).

## Output

Present the full message in a fenced code block with **zero leading whitespace**
on every line.

The message is deliverable. Run `git commit` / `git commit --amend` (via
heredoc) only when the invocation asks to commit or amend — the `apply`
argument, or wording like "and amend it". Otherwise, never propose committing;
the user decides when.

Report tersely: no preamble or narration; state each fact once; don't restate
output the user can already see.

## Self-learning

Read this skill's lessons and obey them: sibling `LESSONS.md`, else
`$HOME/.agent-data/ctx42-skills/lessons/craft/cm.md` when this
directory is read-only. On a correction or self-caught mistake, append a
one-line rule to whichever is writable (creating it) and report where.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ctx42](https://github.com/ctx42)
- **Source:** [ctx42/skills](https://github.com/ctx42/skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ctx42-skills-cm
- Seller: https://agentstack.voostack.com/s/ctx42
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
