draft-commit-message

Draft Git commit messages from staged changes or diffs.

6|Updated Jul 9, 2019
One-click install
npx skills add https://github.com/sluongng/dotfiles --skill draft-commit-message-sluongng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: draft-commit-message
Source: https://github.com/sluongng/dotfiles/tree/main/config/claude/skills/draft-commit-message
Command: npx skills add https://github.com/sluongng/dotfiles --skill draft-commit-message-sluongng

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Draft, rewrite, and review Git commit messages using the Git project's MyFirstContribution guidance. It turns staged changes, diffs, or plain-English summaries into a commit message that follows a conventional format: a subject line with a component prefix, imperative mood, a 50-character-or-less subject, a blank line before the body, and a body that explains the why/context.

Core Features & Use Cases

  • Draft consistent subjects that comply with the 50-character limit and the "<component>: <imperative summary>" format.
  • Infer the component prefix from touched paths and commit history to produce meaningful subjects.
  • Generate a complete, review-ready commit message that preserves trailers such as Signed-off-by and provides rationale in the body.

Quick Start

Draft a commit message for the current staged changes following the MyFirstContribution format.

Frequently Asked Questions about draft-commit-message

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

FAQPage Schema
How do I draft a git commit message from a staged diff?

To draft a commit message from staged changes, the Skill analyzes your git diff and generates a message with a component prefix, imperative subject under 50 characters, and a body explaining the context. It preserves trailers like Signed-off-by for patches.

What is the conventional format for a Git project commit message?

The conventional Git commit message format requires a subject line structured as '<component>: <imperative summary>' limited to 50 characters, a blank line, and a body explaining the why and context. Trailers such as Signed-off-by are appended at the end.

How do I infer the correct component prefix for my commit message?

The component prefix is inferred by analyzing the narrowest dominant area of change from your touched paths and commit history. This ensures the generated commit message subject accurately reflects the specific code area modified.

Can I generate a plain-English summary into a structured commit message?

Yes, you can convert a plain-English summary into a structured commit message. The Skill formats your summary into the imperative mood, applies the component prefix, enforces the 50-character subject limit, and builds a contextual body.

Does this commit message generator preserve Signed-off-by trailers for code review?

Yes, the commit message generator preserves trailers like Signed-off-by. It ensures the final message is review-ready for a pull request or patch by maintaining standard Git project formatting and required sign-offs.