commit-context

Generate Conventional Commits messages from conversation context and diffs.

4|Updated May 5, 2026
One-click install
npx skills add https://github.com/mthli/skills --skill commit-context
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commit-context
Source: https://github.com/mthli/skills/tree/main/commit-context
Command: npx skills add https://github.com/mthli/skills --skill commit-context

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ccusage, npx.

What problem does it solve?

It prevents vague or incomplete git commit messages by deriving a commit narrative from the actual conversation context, so future readers can understand the motivation behind the diff.

Core Features & Use Cases

  • Generates story-driven commit messages: builds a Conventional Commits-style summary plus a short 2–5 line body focused on task intent and rationale.
  • Captures structured decision history: optionally writes MODULE-tagged # Decisions blocks keyed to a .claude/MODULES.md module registry for consistent downstream distillation.
  • Adds session cost context: pulls token usage for the current session via ccusage and appends it to the commit message when available.

Quick Start

Ask for it in chat, e.g. use /commit-context when you want a commit message built from the current session and diff.

Frequently Asked Questions about commit-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write git commit messages that explain the why instead of just the what?

To write git commit messages that explain the why, you can generate story-driven Conventional Commits narratives directly from your current conversation context. This approach reads your code diffs and builds a commit body focused on task intent and rationale for future readers.

How does a module registry track development decisions for commit messages?

A module registry tracks decisions by writing MODULE-tagged blocks keyed to a `.claude/MODULES.md` file. This captures structured decision history during your session, ensuring consistent downstream distillation of why specific code changes were made.

Can I include Claude Code token usage in my git commit messages?

Yes, you can include Claude Code token usage in your commit messages by pulling session cost context via the `ccusage` dependency. The skill automatically appends this usage data to the final Conventional Commits formatted output when available.

Do I need to manually create a module registry before generating commit context?

No, you do not need to manually create a module registry. The process can optionally bootstrap the `.claude/MODULES.md` registry and `CLAUDE.md` file once, with your explicit approval, if they are not already present in your repository.

What is the best way to automate Conventional Commits formatting for staged and unstaged changes?

The best way to automate Conventional Commits formatting is to derive the commit narrative from actual interactive development session context. It analyzes both staged and unstaged diffs to output a summary plus a short body explaining the motivation behind the changes.

Why should I use conversation context instead of just reading diffs for commit messages?

You should use conversation context because diffs only show what changed, while session context provides the motivation. Deriving the commit narrative from the actual conversation prevents vague messages and helps future readers understand the intent behind the code.