skills/practices/tdd/SKILL.md
Test-driven development process — write failing test, implement to pass, refactor. Use when implementing any feature or fixing bugs.
npx skillsauth add devjarus/coding-agent 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.
TDD is a discipline: you do not write implementation code until a failing test demands it.
Repeat for every behavior.
Name tests by the behavior they verify, not by the method they call.
test_calculate()test_total_includes_tax_for_taxable_items()Every test follows three phases:
// Arrange — set up inputs and dependencies
// Act — call the unit under test
// Assert — verify the outcome
Keep each phase visually distinct (blank lines or comments).
TDD is a discipline, not a religion. Two situations where you may skip the cycle:
In all other cases, follow RED-GREEN-REFACTOR.
testing
Multi-source research method — decompose a question, fan out parallel investigators, interleaved-think each result, verify claims adversarially, synthesize a cited answer. Use for breadth-heavy research, stack comparisons, "which approach wins" questions.
testing
Decide when to use unit vs integration vs e2e tests, and when to mock vs use the real thing per dependency. Dependency injection is the enabler — without it you end up monkey-patching imports. Apply when writing tests of any kind.
development
Patterns for sharing types, API contracts, and validation schemas between frontend and backend. Use when multiple domains consume the same data shapes to prevent contract drift.
tools
Patterns for apps with external clients — singleton clients, factories, connection pools, retry/timeout wrappers, graceful shutdown, service-layer organization. Apply when an app talks to DBs/APIs/caches/queues.