用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/arbazkhan971/godmode --skill test命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | test |
| description | TDD loop. RED-GREEN-REFACTOR until coverage target met. |
/godmode:test, "write tests", "test coverage"# Measure current coverage
npx vitest --coverage 2>&1 | tail -5
# Or: pytest --cov=src --cov-report=term | grep TOTAL
# Or: go test -cover ./...
coverage = measure_coverage()
target = user_target OR 80
current_iteration = 0
WHILE coverage < target:
current_iteration += 1
# 1. FIND — coverage report, untested lines
# Priority: happy > error > edge > integration
# 2. RED — write ONE test. It MUST fail.
# IF passes immediately: wrong test, delete
# 3. GREEN — write minimum code -> PASS
# 4. REFACTOR — remove test duplication
# Run ALL tests. IF unrelated breaks -> revert
# 5. COMMIT: git add {file} && git commit
# 6. MEASURE: coverage = measure_coverage()
# 7. LOG to .godmode/test-results.tsv
IF current_iteration % 5 == 0:
print "Iter {N}: {coverage}% (target: {target}%)"
Print: "Coverage: {start}% -> {final}% in {N} iters"
Print: Test: coverage {start}% -> {final}% (target: {target}%). {N} tests added in {iters} iterations. Status: {DONE|PARTIAL}.
test: cover {function/path}.SKILL.md §14. Principles prelude, pre-commit audit (agents/tester.md step 11a), terse/stdio/tokens, DispatchContext validation, Progressive Disclosure routing, discard cost hierarchy all fire by default.should_{verb}_when_{condition}.KEEP if: coverage increased AND all existing tests pass
DISCARD if: coverage unchanged OR existing test broke
On discard: git reset --hard HEAD~1
Log reason. Move to next uncovered path.
Tests must cover behavior, not implementation. If a test breaks when internals change but behavior is preserved → test is overfitted. Rewrite it.
STOP when FIRST of:
- coverage >= target (default 80%)
- 50 iterations reached (safety limit)
- 3 consecutive iterations with <0.5% gain
- >5 consecutive discards on different paths
| Failure | Action |
|---|---|
| Test passes immediately | Delete. Rewrite to test specific uncovered behavior. |
| Coverage unchanged | Check coverage report line-by-line. May hit covered paths. |
| Unrelated test breaks | Revert. Check shared state or import side effects. Fix isolation. |
| Coverage plateaus | Switch to integration tests. Check for dead code inflating denominator. |
Append to .godmode/test-results.tsv:
iteration\ttest_file\tlines_covered\tcoverage_before\tcoverage_after\tdelta\tstatus
Status: kept, discarded, plateau.