git-best-practices

Generate structured git commit messages with headers and detailed bodies.

Updated Jul 29, 2025
One-click install
npx skills add https://github.com/T1nker-1220/.claude --skill git-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-best-practices
Source: https://github.com/T1nker-1220/.claude/tree/main/skills/git-best-practices
Command: npx skills add https://github.com/T1nker-1220/.claude --skill git-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates vague or incomplete commit messages that hinder code review, debugging, and understanding project history, leading to wasted time and increased technical debt.

Core Features & Use Cases

  • Comprehensive Commit Structure: Enforces a detailed header (type, scope, description) and a mandatory body explaining the problem, root cause, solution, and changes for fixes, or an overview, components, and implementation for features.
  • Pre-Commit Verification: Guides you to always verify changes using git status and git diff --staged before generating any commit message, ensuring accuracy and completeness.
  • Detailed Requirements by Type: Provides specific content requirements for different commit types (feat, fix, refactor, docs), ensuring all necessary context is captured.
  • Use Case: After staging your changes, activate this skill to generate a professional, detailed commit message that tells the complete story of your modifications, making future code reviews and debugging effortless.

Quick Start

Example: Feature commit message

feat(auth): add JWT token validation

New Functionality: Implement JWT validation middleware with token expiry checking and refresh token support.

Changes:

  • Created jwt-middleware.ts
  • Updated auth-service.ts to use middleware

Impact: Enhances security and session management.

Frequently Asked Questions about git-best-practices

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

FAQPage Schema
How do I write better commit messages for code reviews?

Commit messages should follow a structured format with a concise header (type, scope, description) and a detailed body explaining the problem, root cause, solution, and changes. This ensures reviewers understand context and intent, reducing review cycles and improving code quality.

What should a detailed commit message include?

A complete commit message includes a header with commit type (feat, fix, refactor, docs, style, test, chore, perf), scope, and description, plus a body with sections for Problem, Root Cause, Solution, and Changes Made. This structure captures the full context needed for future debugging and maintenance.

How do I verify my changes before committing?

Run `git status` to see staged and unstaged files, then use `git diff --staged` to review exact changes before generating your commit message. This verification prevents incomplete or incorrect commits and ensures your message accurately reflects what you're committing.

What's the difference between commit types like feat, fix, and refactor?

Commit types classify changes: feat adds functionality, fix resolves bugs, refactor improves code without changing behavior, docs updates documentation, style adjusts formatting, test adds tests, chore handles maintenance, and perf optimizes performance. Using the correct type keeps your version control history organized and searchable.

Can I use commit messages to improve debugging and project history?

Yes. Detailed commit messages that explain problems, root causes, and solutions create a searchable historical record. When debugging, developers can use `git log` and `git blame` to understand why changes were made, reducing time spent investigating issues.

Does this approach work for team collaboration?

Structured commit messages are essential for teams. They provide consistent context across contributors, make code reviews faster, simplify onboarding, and reduce technical debt by ensuring the reasoning behind changes is documented for all team members.