commit-with-why

Generate structured commit messages with What/Why/How sections from staged diffs.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Hyd3-14/dotfiles --skill commit-with-why
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commit-with-why
Source: https://github.com/Hyd3-14/dotfiles/tree/main/home/.agents/skills/commit-with-why
Command: npx skills add https://github.com/Hyd3-14/dotfiles --skill commit-with-why

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill reduces cognitive load when crafting meaningful commits by automatically generating a clear subject and What/Why/How sections from the staged changes.

Core Features & Use Cases

  • Generates a concise Subject line from the diff scope.
  • Produces What/Why explanations to justify changes and guard against scope creep.
  • Supports multi-file changes and provides optional How guidance for non-obvious steps.

Quick Start

Provide the staged diff and a brief change purpose, then invoke the commit-with-why skill to generate the commit message.

Frequently Asked Questions about commit-with-why

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

FAQPage Schema
How do I generate structured git commit messages from staged diffs?

You can auto-generate structured commit messages by providing the staged diff and a brief change purpose to produce a Subject line and What/Why/How bullet points. The tool extracts scope from the diff to ensure consistent message formatting.

What is the best way to write commit messages that explain why changes were made?

Using a structured What/Why/How commit message format is the best way to explain why changes were made. This approach separates change descriptions from justifications, guarding against scope creep and reducing cognitive load during code reviews.

Does this commit message generator support multiple file changes in one diff?

Yes, this commit message generator supports multiple file changes within a single staged diff. It processes the entire diff to extract the overall scope and generates a unified message with optional How guidance for non-obvious steps across all modified files.

Can I use this tool for ambiguous code changes without a clear commit intent?

Yes, you can use this tool for ambiguous code changes by providing a brief change purpose alongside the staged diff. The tool processes the diff scope and your context to populate the What and Why sections, clarifying intent for complex updates.

When should I not use automated commit message generation?

You should not use automated commit message generation when your staged changes contain sensitive data, as the tool explicitly avoids exposing sensitive information. Manual review remains recommended for commits requiring strict security compliance or custom formatting.