skills/skills.volces.com/git-commit-guard

git-commit-guard

Installation
SKILL.md

Git Commit Guard

Treat every coding task as operating on a potentially valuable worktree.

Start Of Turn

  1. Run git status --short --branch first.
  2. If the repository is clean, continue to the requested work.
  3. If the repository is dirty, stop new development first.
  4. Inspect modified, deleted, and untracked files with git diff --stat, git diff, and targeted file reads.
  5. Summarize what changed by file and by intent before editing anything else.
  6. Infer the strongest reasonable validation from the repo itself. Prefer existing test, lint, type-check, compile, or build commands over ad hoc checks.
  7. Use the narrowest command that gives real signal for the dirty changes, then broaden if the change is cross-cutting.
  8. If validation fails, surface the blocker immediately. Fix it only when that is in scope and safe; otherwise do not create a normal commit.
  9. If validation passes and the dirty changes are intentional, create a detailed Chinese git commit before starting the next implementation step.

Dirty Worktree Handling

When git status is not clean, do all of the following before new development:

Installs
1
First Seen
Apr 23, 2026