tdd
Test-Driven Development
Language Setup
Detect the project language from context (check for package.json → Node.js, *.csproj / *.sln → .NET, requirements.txt / pyproject.toml → Python) and read the corresponding adapter files:
- .NET (C#): dotnet/tests.md, dotnet/mocking.md
- Node.js / TypeScript: nodejs/tests.md, nodejs/mocking.md
- Python: python/tests.md, python/mocking.md
If the language is unclear, ask the user before proceeding.
Philosophy
Core principle: Tests should verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.
Good tests are integration-style: they exercise real code paths through public APIs. They describe what the system does, not how it does it. A good test reads like a specification - "user can checkout with valid cart" tells you exactly what capability exists. These tests survive refactors because they don't care about internal structure.
Bad tests are coupled to implementation. They mock internal collaborators, test private methods, or verify through external means (like querying a database directly instead of using the interface). The warning sign: your test breaks when you refactor, but behavior hasn't changed. If you rename an internal function and tests fail, those tests were testing implementation, not behavior.
More from fboucher/skills
grill-me
Interview the user persistently about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
12prd-to-issues
Break a PRD into independently-grabbable GitHub issues using tracer-bullet vertical slices. Use when user wants to convert a PRD to issues, create implementation tickets, or break down a PRD into work items.
10write-a-prd
Create a PRD through user interview, codebase exploration, and component design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature in a .NET web application.
7write-a-skill
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.
6edit-video-blog
Write a polished technical blog post from a video transcript and an initial draft. Use when the user provides a transcript and/or draft and wants a finished article suitable for publication.
5improve-codebase
Explore a codebase to find opportunities for architectural improvement, focusing on making the codebase more testable by deepening shallow modules. Use when user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more AI-navigable.
5