AgentSkillsCN

Git Commit Helper

Git Commit 助手

SKILL.md

Git Commit Helper

Generate well-formatted, conventional commit messages based on the staged changes.

Commit Message Format

code
<type>(<scope>): <subject>

<body>

<footer>

Types

  • feat: New feature
  • fix: Bug fix
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Performance improvement
  • test: Adding or updating tests
  • docs: Documentation changes
  • chore: Maintenance tasks, dependencies
  • style: Code style changes (formatting, semicolons, etc.)
  • ci: CI/CD changes
  • build: Build system or dependencies

Guidelines

  1. Subject Line (max 50 chars)

    • Use imperative mood ("add" not "added")
    • Don't capitalize first letter
    • No period at the end
    • Be concise but descriptive
  2. Body (wrap at 72 chars)

    • Explain WHAT and WHY, not HOW
    • Separate from subject with blank line
    • Include motivation for the change
    • Contrast with previous behavior
  3. Footer

    • Reference issues: Fixes #123, Closes #456
    • Breaking changes: BREAKING CHANGE: description

Process

  1. Review git diff --staged
  2. Identify the primary change type
  3. Determine appropriate scope (module, package, component)
  4. Generate commit message following the format
  5. Ensure message accurately reflects the changes

Example

code
feat(api): add job search endpoint with filters

Add new /api/jobs/search endpoint that supports filtering
by title, location, salary range, and experience level.
Includes pagination support and returns structured JSON.

Closes #42