skills/test/SKILL.md
TDD loop. RED-GREEN-REFACTOR until coverage target met.
npx skillsauth add arbazkhan971/godmode testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
/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"
<!-- tier-3 -->
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.
development
Web performance optimization. Lighthouse, bundle analysis, code splitting, image optimization, critical CSS, fonts, service workers, CDN.
development
Webhook design, delivery, retry, HMAC verification, event subscriptions, dead letter queues.
development
Vue.js mastery. Composition API, Pinia, Vue Router, Nuxt SSR/SSG, Vite optimization, testing.
development
Evidence gate. Run command, read full output, confirm or deny claim. No trust, only proof.