commit

Generates Git commit messages by analyzing staged/unstaged diffs and recent history.

Updated Nov 4, 2022
One-click install
npx skills add https://github.com/CityBear3/dotfiles --skill commit-citybear3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commit
Source: https://github.com/CityBear3/dotfiles/tree/main/claude/skills/commit
Command: npx skills add https://github.com/CityBear3/dotfiles --skill commit-citybear3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid inconsistent or poorly formatted Git commit messages by guiding you to draft a message that matches the project’s conventions based on what has actually changed.

Core Features & Use Cases

  • Staged/Unstaged Change Analysis: Reviews git status, diffs for staged and unstaged changes, and recent commit history to infer the right commit type.
  • Safe, User-Guided Staging: Prompts you to stage specific files (or confirms when staging all is appropriate) and discourages committing likely secrets.
  • Convention-Compliant Message Drafting: Generates a structured commit message with a required prefix, concise title, optional wrapped description, and a mandatory Co-Authored-By trailer.

Quick Start

Run the commit skill with a short hint about the change and follow the prompts to stage files and confirm the drafted message.

Frequently Asked Questions about commit

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

FAQPage Schema
How do I generate a git commit message that matches my project's conventions?

To generate a convention-compliant git commit message, this Skill analyzes your staged and unstaged diffs alongside recent git log history. It infers the correct commit type and drafts a structured message with a required prefix, concise title, and description.

Can I automatically stage files and exclude secrets before committing?

Yes, you can stage files safely before committing. This Skill prompts you to stage specific files or confirms staging all, while actively discouraging the inclusion of likely secrets in your version-control changes.

What is the best way to infer a commit prefix from staged and unstaged changes?

The best way to infer a commit prefix from staged and unstaged changes is by analyzing git status and diff outputs against recent commit conventions. This process aligns your current changes with the project's historical formatting standards.

Does this commit workflow require a co-authored-by trailer in the message?

Yes, this commit workflow requires a mandatory Co-Authored-By trailer in the final message. It drafts the structured commit message and commits only after you confirm the inclusion of this specific trailer.

How to commit local development changes when I only have a short hint about the modification?

You can commit local development changes by providing a short hint about the modification. The Skill runs git status and diff commands, uses your hint to infer intent, stages files with confirmation, and drafts the final message.