ai/skills/aidd-tdd/SKILL.md
Systematic test-driven development with proper test isolation. Use when implementing code changes, writing tests, or when TDD process guidance is needed.
npx skillsauth add paralleldrive/aidd aidd-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.
Act as a top-tier software engineer with serious TDD discipline to systematically implement software using the TDD process.
type assert = ({ given: string, should: string, actual: any, expected: any }) {
given and should must clearly state the functional requirements from an acceptance perspective, and should avoid describing literal values.
Tests must demonstrate locality: The test should not rely on external state or other tests.
Ensure that the test answers these 5 questions { 1. What is the unit under test? (test should be in a named describe block) 2. What is the expected behavior? ($given and $should arguments are adequate) 3. What is the actual output? (the unit under test was exercised by the test) 4. What is the expected output? ($expected and/or $should are adequate) 5. How can we find the bug? (implicitly answered if the above questions are answered correctly) }
Tests must be:
For each unit of code, create a test suite, one requirement at a time:
In most testing frameworks, there is a describe function and possibly a nested test or it wrapper.
Use the string in the describe function to name the unit under test.
Use the string in the test function to offer a brief category for the test, e.g. "new account creation".
Because of conflicts with the assert function API and description, avoid the it wrapper entirely, if possible.
For Vitest/Riteway tests:
Constraints { Unless directed otherwise, always colocate tests with the code they are testing. Carefully think through correct output. Avoid hallucination. This is very important to ensure software works as expected and that user safety is protected. Please do your best work. When testing app state logic, always use selectors to read from the state. NEVER read directly from state objects. Avoid writing tests for expected types/shapes. It would be redundant with type checks.
Mocking is a code smell. { mocks in unit tests => build both a mocked and an integration candidate; run /aidd-churn to compare total code impact; the winning approach must (1) lower or match the composite score AND (2) meaningfully exercise the functional requirement of the unit under test — not just verify mock calls. Cheaper substitutes (e.g. echo instead of a real LLM) are preferred when they satisfy both conditions. Mocks are only justified when real integration is (a) technically infeasible or (b) prohibitively expensive — meaning irrecoverable real-world side effects, physical infrastructure unavailable in CI, or per-run cost that makes the test suite economically non-viable. } }
State { testFramework = Riteway Library + Vitest libraryStack // e.g. React + Redux + Redux Saga }
documentation
Top tier author skill for delivering essential truths with the persuasive power to inspire positive change. Use when writing, reviewing, editing, or scoring any content.
development
Guide for crafting high-quality AIDD skills. Use when creating, reviewing, or refactoring skills in ai/skills/ or aidd-custom/skills/.
testing
Reflective Thought Composition. Structured thinking pipeline for complex decisions, design evaluation, and deep analysis. Use when quality of reasoning matters more than speed of response.
tools
Teaches agents how to write correct riteway ai prompt evals (.sudo files) for multi-step flows that involve tool calls. Use when writing prompt evals, creating .sudo test files, or testing agent skills that use tools such as gh, GraphQL, or external APIs.