commit-msg

Generate conventional commit messages from the current Git diff.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/leodiegues/skills --skill commit-msg-leodiegues
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commit-msg
Source: https://github.com/leodiegues/skills/tree/main/skills/commit-msg
Command: npx skills add https://github.com/leodiegues/skills --skill commit-msg-leodiegues

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents vague or incorrect commit messages by deriving a conventional commit directly from the actual staged diff instead of guessing.

Core Features & Use Cases

  • Diff-first message generation: Reads git diff --staged (or git diff) to ground the commit in what actually changed.
  • Scope detection for monorepos: Derives <scope> from nearest boundary patterns like apps/<name>/, packages/<name>/, services/<name>/, libs/<name>/, modules/<name>/, or src/<module>/, including Nx project naming.
  • Type selection that matches intent: Chooses feat, fix, refactor, docs, test, chore, ci, perf, build, or style based on behavior and the diff.
  • Conventional commit formatting rules: Enforces subject line constraints (imperative, lowercase, ≤72 chars) plus optional body/footer guidance.

Quick Start

Use the commit-msg skill to generate a conventional commit message from your current staged changes before you run git commit.

Frequently Asked Questions about commit-msg

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

FAQPage Schema
How do I generate conventional commit messages from a git diff?

You can generate conventional commit messages from a git diff by analyzing staged or unstaged changes to infer the commit type, scope, and a precise subject. This grounds the message in actual file modifications rather than guessing the intent.

How does conventional commit scope detection work for Nx monorepos?

Conventional commit scope detection for Nx monorepos works by deriving the scope from nearest boundary patterns like apps, packages, services, or libs directories. It matches these boundaries to Nx project naming configurations for accurate scoping.

Can I use conventional commits for root-level files in a monorepo?

Yes, you can use conventional commits for root-level files in a monorepo. The generation process includes sensible handling for root-level files and multi-scope changes, ensuring accurate commit messages even when modifications occur outside standard directory boundaries.

What is the best way to format conventional commit subjects from staged changes?

The best way to format conventional commit subjects from staged changes is enforcing subject line constraints such as imperative mood, lowercase, and a maximum of 72 characters. Optional body and footer guidance should follow standard Conventional Commits rules.

How does diff analysis choose between fix, feat, and refactor commit types?

Diff analysis chooses between fix, feat, and refactor commit types by evaluating the actual behavior changes and file modifications shown in the diff. It selects the type that accurately matches the development intent behind the staged code alterations.

Why do my conventional commit messages not match my actual code changes?

Conventional commit messages may not match actual code changes if they are written without analyzing the git diff first. Reading the staged diff ensures the commit type, scope, and subject precisely reflect the modified files and behavior.