writing-commit-messages

Generate conventional Git commit messages with formatted subjects and bodies.

13|6|Updated Feb 23, 2013
One-click install
npx skills add https://github.com/abhinav/home --skill writing-commit-messages-abhinav
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-commit-messages
Source: https://github.com/abhinav/home/tree/main/.claude/skills/writing-commit-messages
Command: npx skills add https://github.com/abhinav/home --skill writing-commit-messages-abhinav

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps craft clear, conventional Git commit messages and pull request descriptions. It enforces a structured subject/body format, imperative mood, and line-length constraints, ensuring messages are readable and maintainable across the project.

Core Features & Use Cases

  • Format guidance: Subject must use an allowed kind (feat, fix, docs, style, refactor, test, chore) and be in the imperative mood.
  • Body guidance: The body follows semantic line breaks and describes the changes without duplicating the diff.
  • Co-Authored-By: If the bot contributed, it can append a Co-Authored-By trailer.
  • Pull request descriptions: Provides guidance to craft concise PR descriptions from the context.

Quick Start

Before a commit, load Skill(writing-commit-messages) to draft the message, then ask Skill(committing) to perform the commit with that message. Example: subject: "feat: add user login validation" and a concise body.

Frequently Asked Questions about writing-commit-messages

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

FAQPage Schema
How do I write a conventional commit message?

Conventional commit messages follow a structured format: a subject line with an optional kind (feat, fix, docs, style, refactor, test, chore) in imperative mood, under 72 characters, followed by a blank line and a body describing the change. This format makes commit history readable and enables automated tooling.

What's the correct way to format a commit subject line?

Use imperative mood, start with an allowed kind (feat, fix, docs, style, refactor, test, chore), keep it under 72 characters, and avoid duplicating the diff. Example: 'feat: add user login validation' communicates the change clearly and concisely.

Can I use co-authored-by in my commit messages?

Yes. Append a Co-Authored-By trailer to the commit message body to attribute contributions. This is useful when multiple people collaborate on a commit and need proper credit in the project history.

How do I structure the body of a commit message?

The body uses semantic line breaks, explains the rationale and context for the change without repeating the diff, and maintains readability. Avoid empty bodies—if no body is needed, write a clear subject line only.

What commit message format should I use for pull request descriptions?

Apply the same conventional commit structure: concise subject line with kind and imperative mood, followed by a body that explains the changes. This ensures consistency across commits and pull requests in your project.

When should I use different commit kinds like feat, fix, or chore?

Use 'feat' for new features, 'fix' for bug fixes, 'docs' for documentation changes, 'style' for formatting, 'refactor' for code restructuring, 'test' for test additions, and 'chore' for maintenance tasks. The kind categorizes the type of change for clarity and tooling.