commit

dylangolow 的头像作者 dylangolow

创建结构良好的git提交,采用传统格式。

📖 中文导读:创建结构良好的git提交,采用传统格式。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: commit description: Creates well-structured git commits with conventional format allowed-tools: Bash, Read, Grep

Commit Skill

When to Use

  • User asks to commit changes
  • After completing a task that modified files
  • When user says "commit this" or similar

Workflow

  1. Check status

    git status
    git diff --staged
    
  2. Review changes

    • Understand what was modified
    • Group related changes logically
    • Identify if multiple commits are needed
  3. Stage files

    • Stage only related changes together
    • Never stage secrets or credentials
    • Skip generated files unless intentional
  4. Write commit message Format: type(scope): description

    Types:

    • feat - New feature
    • fix - Bug fix
    • refactor - Code restructuring
    • docs - Documentation only
    • test - Adding/fixing tests
    • chore - Maintenance tasks
  5. Commit

    • Use descriptive message focusing on "why" not "what"
    • Keep first line under 72 characters
    • Add body for complex changes

Examples

# Feature
git commit -m "feat(auth): add password reset flow"

# Bug fix
git commit -m "fix(api): handle null response from external service"

# Refactor
git commit -m "refactor(utils): extract date formatting to shared helper"

Do NOT

  • Commit without user confirmation
  • Include "Generated by Claude" attribution (unless requested)
  • Force push or amend without asking
  • Commit .env files or secrets