govern execution hygiene for software projects. use when the user wants help enforcing git commit discipline, deciding whether work is ready to commit, gener...
Coding
Dev Git Guard
Try itEnforce a git-first workflow for repository coding tasks. Use when Codex is working inside a local git repository to inspect, modify, debug, refactor, implem...
What it does
Enforce a git-first workflow for repository coding tasks. Use when Codex is working inside a local git repository to inspect, modify, debug, refactor, implem...
The skill document
Git Commit Guard
Treat every coding task as operating on a potentially valuable worktree.
Start Of Turn
- Run
git status --short --branchfirst. - If the repository is clean, continue to the requested work.
- If the repository is dirty, stop new development first.
- Inspect modified, deleted, and untracked files with
git diff --stat,git diff, and targeted file reads. - Summarize what changed by file and by intent before editing anything else.
- Infer the strongest reasonable validation from the repo itself. Prefer existing test, lint, type-check, compile, or build commands over ad hoc checks.
- Use the narrowest command that gives real signal for the dirty changes, then broaden if the change is cross-cutting.
- If validation fails, surface the blocker immediately. Fix it only when that is in scope and safe; otherwise do not create a normal commit.
- 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:
- Review whether the changes look coherent, risky, incomplete, or broken.
- Inspect tests related to the changed files when feasible.
- Call out uncertainty if unrelated edits may have been mixed together.
- Preserve the user's existing work. Do not discard, overwrite, or silently clean up unrelated changes.
During Work
- Keep unrelated changes in separate commits whenever practical.
- Do not mix pre-existing dirty changes with new feature work without reviewing both scopes.
- Before starting a new logical phase that depends on a clean base, commit the validated current state.
- Avoid destructive git commands unless the user explicitly asks for them.
Verification Standard
Before committing existing dirty changes, prefer this order:
- Targeted tests for touched modules or packages
- Fast lint, type-check, or compile commands relevant to touched files
- Broader project test commands if the repository is small or the change is cross-cutting
Before the final commit, run a broader validation pass whenever practical:
- Full or broader unit test coverage
- Lint
- Type check
- Build or compile
- Targeted smoke test for the implemented flow
If the full sweep is not feasible, state exactly what was run and what was not run.
End Of Turn
- Re-read the final diff before the last commit.
- If files changed during the turn, run the strongest reasonable final validation.
- If the requested development is finished, or the conversation is likely ending, prefer comprehensive validation over a narrow spot check.
- If validation passes, stage the final diff and create a detailed Chinese git commit before sending the final response.
- If no files changed, do not create an empty commit.
- Confirm
git statusis clean after the final commit. - If the repository is not a git repo, say that this skill is not applicable.
Commit Policy
- Write every commit message in Chinese.
- Use a concise subject line plus a detailed body.
- Explain what changed, why it changed, implementation details, verification status, and any known limitation or follow-up.
- If a commit preserves user changes before new work begins, say that explicitly so the history remains auditable.
- When drafting the message, read
references/commit-template.mdfor the preferred structure and examples.
Recommended type values:
featfixrefactortestdocschore
Response Behavior
- Mention early when the worktree is dirty and what you are reviewing.
- Tell the user what you verified before each commit.
- Surface failures immediately with the likely cause.
- After each commit, report the commit purpose clearly in Chinese.
- In the final response, include the validation that ran, the commit hash or hashes created during the turn, and any residual risk.
Related skills
Use when the user explicitly asks to prepare, review, or create a Git commit, including "提交", "提交代码", "帮我提交", "commit", "git commit", "确认提交", or requests a commit message.
Review agentic software-development plans and release readiness for Codex, GitHub, and ClawHub work. Use when a user asks for scoped delivery planning, imple...
4-stage code-change workflow: research → plan → user review → implement (TDD). Topics — steps (Step 0-3: resume + research + plan + review + branch), implement (Step 4: TDD + build + commit), pr (capture + PR with image/GIF/video). For issue implementation, tracked tasks, new features. TDD default (opt out --no-tdd). github-flow auto-companion on GitHub repos. Use when: "coding workflow", "research plan implement", "write plan", "plan md", "user review", "code plan", "code changes", "PR with screenshots", "pull request", "capture and PR".
Run Git operations — commits, branches, merges, rebases, conflict resolution, and recovery — with safety rules enforced.
engineering execution guardrails for coding, implementing features, fixing bugs, debugging failures, reviewing diffs, refactoring code, simplifying overbuilt...