DevNullLtd/Yuzu / .codex/skills/tdd
tdd
UnverifiedApply Yuzu-specific test-driven development using tracer-bullet red-green-refactor cycles and the repo's Meson, gateway, proto, and ABI validation rules. Use when the user says `/tdd`, asks for TDD, red-green-refactor, or wants a feature/fix built test-first in Yuzu.
TDD
Use behavior-first tests through public interfaces. Prefer integration-style seams that exercise real stores, REST handlers, gateway paths, plugin boundaries, or command dispatch contracts. Avoid tests coupled to private implementation.
Before Red
- Read
CONTEXT.mdand relevant ADRs indocs/adr/. - Identify the public interface and the project term for the behavior.
- List the smallest vertical behavior slice that proves value.
- Choose the narrowest validation path through
$yuzu-build. - Invoke
$yuzu-proto,$yuzu-plugin-abi,$yuzu-meson, or$yuzu-windows-msvcif the slice crosses those boundaries.
Cycle
- Red: add one failing test for one observable behavior.
- Green: implement only enough code to pass that test.
- Verify: run the targeted suite with
meson test -C <builddir> --suite <suite> --print-errorlogsor the relevant gateway command. - Repeat for the next behavior.
- Refactor only while green.
Do not write all tests first. Use tracer bullets: one behavior, one test, one implementation.
Yuzu Test Hygiene
- Use
yuzu::test::unique_temp_path(prefix)orTempDbFilefor C++ test temp files and SQLite DBs. - Avoid hardcoded shared paths and clock/thread-hash uniqueness.
- For gateway EUnit, pass
--dir apps/yuzu_gw/test. - For direct Erlang isolation, remove the relevant
_build/testtree or run in a fresh BEAM. - For proto changes, include
buf lint protoandbuf breaking proto --against '.git#subdir=proto,ref=origin/main'when available. - For plugin ABI changes, add descriptor/loader coverage and preserve stable C ABI compatibility.
Done
Finish with the tests added, implementation green, targeted validation output summarized, and any broader /test --quick or governance follow-up called out.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |