AgentSkillsCN

lazy-commit

利用常规提交格式,将未提交的变更整理成结构清晰的原子级Git提交。在被要求提交、暂存、创建提交、清理未提交的工作,或为推送做好变更准备时使用。能够将相关变更归类为逻辑清晰的提交,并撰写恰当的提交信息。

SKILL.md
--- frontmatter
name: lazy-commit
description: Create well-structured atomic git commits from uncommitted changes using conventional commit messages. Use when asked to commit, stage, create commits, clean up uncommitted work, or prepare changes for push. Handles grouping related changes into logical commits and writing proper commit messages.

Lazy Commit

Create atomic commits for each logical change with conventional commit messages.

Commit Process

  1. Assess state

    bash
    git status --porcelain
    git diff --stat
    git diff --cached --stat
    
  2. Analyze changes

    bash
    git diff
    git diff --cached
    
    • Review content of each change
    • Identify related changes that belong together
  3. Group into logical commits

    • Each commit = ONE logical change
    • Related files committed together
    • Order: dependencies first, then dependents
  4. Create commits

    bash
    git add <specific-files>
    git commit -m "<type>: <brief description>"
    

Conventional Commit Types

TypeUse
feat:New feature
fix:Bug fix
refactor:Code restructuring (no behavior change)
docs:Documentation
style:Formatting (no code change)
test:Tests
chore:Maintenance, deps, config

Message Guidelines

  • Under 72 characters
  • Imperative mood ("add" not "added")
  • Specific but concise
  • No period at end

Examples:

  • feat: add user authentication endpoint
  • fix: resolve null pointer in config parser
  • refactor: extract validation logic to separate module

Push (Optional)

Only push if explicitly requested:

bash
git push origin <current-branch>