skills/team/tdd/SKILL.md
The canonical RED-GREEN-REFACTOR inner loop. Enforces behavioral, structure-insensitive tests and prohibits horizontal slicing. Use when writing any new code test-first, managing TDD phase transitions, or as the inner loop for qrspi-implement, qraspi-implement, or any other implementation skill. Do NOT use to audit existing test suites — use evaluate-tests instead.
npx skillsauth add michaelalber/ai-toolkit 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.
"Write tests that are sensitive to behavior changes, insensitive to structure changes." — Kent Beck
Every test must satisfy both before leaving RED:
| Property | A compliant test... | A violation looks like |
|----------|---------------------|------------------------|
| Behavioral | fails when the observable outcome breaks | assert repo.save.called — verifies a method was called, not what the system produced |
| Structure-insensitive | survives a rename-only or extract-method refactor | assert order._total == 100 — reads internal state; breaks on any rename |
The most common TDD failure in AI-generated code:
# WRONG — horizontal slice
def test_register(): ...
def test_login(): ...
def test_logout(): ...
# ... then all implementation
class Auth: ...
# RIGHT — vertical slice
def test_register(): ... # one test
class Auth: # minimal code to pass it
def register(): ...
# refactor → commit → next test
def test_login(): ...
Horizontal slicing produces tests that were never red, implementations that were never minimal, and refactoring that was never constrained by a safety net. Never accumulate unimplemented tests.
test-scaffold<tdd-state>
phase: RED | GREEN | REFACTOR
iteration: N
current_test: [test name]
failure_reason: [semantic description — not "syntax error"]
tests_passing: true | false
</tdd-state>
The one canonical loop (GREEN/REFACTOR depth in references/ above). Companions are modes and audits, not alternatives:
| Need | Skill |
|------|-------|
| AI drives all phases autonomously (defers here for mechanics) | tdd-agent |
| Audit test quality or TDD compliance after the fact | evaluate-tests |
| .NET test conventions — xUnit / AAA / mocks | test-scaffold |
| RED before/after examples | Behavioral Examples |
development
Interviews the user relentlessly about a plan, decision, or idea — one question at a time, each with a recommended answer. Shared engine behind "grill-me" and "grill-with-docs". Use on any "grill" trigger phrase or to stress-test thinking. Do NOT use to build the plan; it ends at shared understanding, not implementation.
testing
Runs a relentless interview to sharpen a plan or design, capturing the decisions as ADRs and a glossary along the way. Use when the user wants to be grilled AND wants the session to leave durable domain documentation behind. Do NOT use for a throwaway stress-test with no artifacts; use grill-me instead.
tools
OWASP-based security review of Vue/TypeScript front-ends. Detects framework (Vite/Vue CLI/Nuxt), entry points, and data flows; scans the OWASP Top 10 (2025) mapped to Vue client-side risks (raw-HTML XSS via v-html, URL/protocol injection, bundled secrets, insecure token storage, dependency CVEs, missing CSP, open redirects, router guard bypass); emits an exec summary plus graded findings. Use to audit Vue for vulnerabilities. Not for architecture grading (vue-architecture-checklist).
tools
Analyzes legacy Vue codebases and produces actionable modernization plans. Primary migration paths include Options API to Composition API, Vue 2 to Vue 3, Vue CLI to Vite, JavaScript to TypeScript, Vue Test Utils/Karma/Mocha to Vitest + Vue Testing Library, legacy Vuex to Pinia, and removed-in-Vue-3 pattern cleanup (filters, event bus, `$listeners`). Does NOT perform the migration — assesses, quantifies risk, and plans.