skills/tdd/SKILL.md
--- name: tdd description: Test-driven development loop — red-green-refactor: write failing test, make it pass, refactor, repeat until all features covered --- # TDD Test-driven development following the red-green-refactor loop. Write a failing test first, make it pass with minimal implementation, then refactor for quality. Repeat until all features are covered. ## When to Use - Building new features where correctness is critical - Fixing bugs — write a test that reproduces the bug first, th
npx skillsauth add Thomashighbaugh/opencode skills/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.
Test-driven development following the red-green-refactor loop. Write a failing test first, make it pass with minimal implementation, then refactor for quality. Repeat until all features are covered.
Do not use when:
vibe-code insteadTest quality checklist:
Implementation rules:
Refactoring checklist:
@executor runs the red-green-refactor loop@code-reviewer can review test quality and coverage@architect can review design decisions after implementationexpect(true).toBe(true)) is not a valid RED phase.Red-green-refactor TDD loop.
tools
Create valid, type-safe TypeScript tools for OpenCode — generates correct boilerplate, typed interfaces, and handler stubs. Use when building new tools for global config or per-project .opencode/tools/.
testing
Explore multiple solution branches in parallel, evaluate each, and recommend the best path. Use when the user explicitly invokes /ideation tree-of-thoughts or asks for "tree of thought" / "branching exploration".
testing
Run multiple independent reasoning passes and find consensus. Use when the decision is critically important, the stakes are high, or the user explicitly requests "run it multiple times" / "check consistency" / "self-consistency".
testing
Optimization by PROmpting — generate candidate prompt variations, test each against a benchmark, and report the best performer. Use when the user invokes /ideation opro or asks for "prompt optimization" / "OPRO".