commit
Create micro-commits (minimal incision) with at least one validation signal per commit.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Commit
Intent
Carve changes into surgical commits: one coherent change, minimal blast radius, and at least one feedback signal before committing.
When to use
- “Split this into micro commits.”
- “Stage only the minimal change and commit it.”
- “Keep the commits tiny, keep checks passing.”
Workflow (Surgeon’s principle)
1) Scope the incision
- Identify the smallest change that can stand alone.
- Isolate unrelated edits; avoid drive-by refactors/formatting unless required for correctness.
2) Stage surgically (non-interactive-first)
Inspect:
-
git status -sb -
git diff
Stage what you intend (prefer file-level staging in non-interactive harnesses):
-
git add <paths...> -
git restore --staged <paths...>
Verify:
-
git diff --cachedmatches the intended incision.
If you truly need hunk-level staging but your environment can’t do interactive staging, ask the user to stage hunks locally or provide a patch you can apply.
3) Validate the micro scope
- Optional helper:
scripts/micro_scope.py(staged vs unstaged size). - If the staged diff is multi-concern, split it before running checks.
4) Close the loop (required)
- Select the tightest available signal and run it.
- If the repo’s test/check command is not discoverable, ask for the preferred command.
- Reference:
references/loop-detection.md.
5) Commit
- Use a terse message; optimize for clarity, not poetry.
- Commit only after at least one signal passes.
6) Repeat
Repeat until the working tree is clean or the remaining changes are intentionally deferred.
Guardrails
- Don’t widen scope without asking.
- Prefer the smallest check that meaningfully exercises the change.
- Don’t claim completion without a passing signal.
Resources
-
scripts/micro_scope.py -
references/loop-detection.md
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!