plugins/spectre-codex/skills/spectre-tdd/SKILL.md
Load this skill when executing TDD (Test-Driven Development) methodology. Use when implementing features via strict RED-GREEN-REFACTOR cycles, or when a prompt instructs execution via TDD.
npx skillsauth add codename-inc/spectre spectre-tddInstall 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.
Execute tasks using strict TDD (RED → GREEN → REFACTOR). Outcome: Tasks completed with Happy/Failure tests passing, minimal code shipped.
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Wrote code before the test? Delete it. Start over. Don't keep it as "reference." Don't "adapt" it. Delete means delete. Implement fresh from tests.
--testPathPattern, --findRelatedTests, or per-file lintRED: Happy — {test} → RED: Failure — {test} → GREEN: Minimal impl → REFACTOR: Tidy → COMMITfeat({task}): description)If any of these occur, delete code and start over with TDD:
| Red Flag | Why It's Wrong | |----------|----------------| | Code written before test | Violates Iron Law | | Test passes immediately | Testing existing behavior, not new | | Can't explain why test failed | Don't understand what you're testing | | "Just this once" thinking | Rationalization — TDD has no exceptions | | Keeping code "as reference" | You'll adapt it; that's tests-after |
| Problem | Solution | |---------|----------| | Don't know how to test | Write wished-for API first, then assert on it | | Test too complicated | Design too complicated — simplify interface | | Must mock everything | Code too coupled — use dependency injection | | Test setup huge | Extract helpers; still complex? Simplify design |
Before marking complete, verify:
testing
👻 | Independent multi-lens review of plan.md and/or tasks.md — finds overengineering, missing verification, hallucinated deps, weak references
data-ai
👻 | Unified planning entry point - researches, assesses complexity, routes to workflow - primary agent
data-ai
👻 | Transform requirements into executable tasks - primary agent
testing
👻 | Independent multi-lens review of plan.md and/or tasks.md — finds overengineering, missing verification, hallucinated deps, weak references