skills/test/SKILL.md
Test-driven development methodology (RED-GREEN-REFACTOR). Use when implementing features, fixing bugs, or changing behavior - write failing test first, then minimal code to pass.
npx skillsauth add srnnkls/tropos 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.
Write the test first. Watch it fail. Write minimal code to pass.
Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.
Always use for:
Exceptions (confirm with user):
Workflow Integration:
implement skill (it runs the scope execution pipeline)implement skill (it dispatches tester + implementer subagents)NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Wrote code before the test? Delete it. Start over. No exceptions.
Write one minimal test showing what should happen.
Requirements:
MANDATORY. Never skip.
Run the test. Confirm:
Test passes immediately? You're testing existing behavior. Fix the test.
Write the simplest code to pass the test.
DO: Just enough to pass, simple implementation DON'T: Add features, refactor other code, add configurability
MANDATORY.
Run the test. Confirm:
Only after green:
Keep tests green. Don't add behavior.
Next failing test for next behavior.
| Excuse | Reality | |--------|---------| | "Too simple to test" | Simple code breaks. Test takes 30 seconds. | | "I'll test after" | Tests passing immediately prove nothing. | | "Already manually tested" | Ad-hoc is not systematic. No record, can't re-run. | | "Deleting X hours is wasteful" | Sunk cost fallacy. Unverified code is debt. | | "Need to explore first" | Fine. Throw away exploration, then TDD. | | "Test hard to write" | Hard to test = hard to use. Simplify design. |
All of these mean: Delete code. Start with TDD.
Before marking work complete:
When implementing as a subagent, you MUST output this evidence block:
tdd_evidence:
tests_written:
- name: "test_feature_x"
file: "tests/test_x.py"
red_output: "FAILED - [actual failure message]"
green_output: "PASSED - 1 passed in 0.05s"
implementation_files:
- path: "src/feature.py"
all_tests_pass: true
test_command: "pytest tests/test_x.py -v"
final_output: "[full test output]"
This is REQUIRED for SubagentStop hook verification.
Domain skills inject specifics into this generic methodology:
When invoked via a domain skill, follow the domain-specific test guidance provided.
Use with:
implement (debug operation) - Write failing test to reproduce bug before fixingimplement (execute operation) - Subagents follow TDD for each taskimplement (verify operation) - Run tests before claiming completiontools
External code-review harness (`peer` zsh tool): canonical model registry, idle-stall watchdog, and self-parallelising fan-out to codex/gemini. Use when dispatching external (non-Claude) reviewers from the review or implement pipelines — call `peer run`/`peer <harness>` instead of `codex exec`/`gcloud`+Vertex directly.
testing
Unified validation dispatcher. Auto-detects validation type from argument or presents selection menu. Routes to test, implement (verify), or hooks-test.
development
Create new Claude Code skills following project patterns and best practices. Use when building new skills, extracting reusable capabilities, or converting commands to skills.
tools
Unified scope lifecycle. Auto-detects operation from argument or presents selection menu. Routes to create, review, update, done, or list.