One-click install
npx skills add https://github.com/avoidthekitchen/avilingo-v2 --skill tdd-avoidthekitchen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/avoidthekitchen/avilingo-v2/tree/main/.agents/skills/tdd
Command: npx skills add https://github.com/avoidthekitchen/avilingo-v2 --skill tdd-avoidthekitchen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development prevents regressions and ensures delivered behavior by driving implementation from failing tests through a disciplined red-green-refactor loop. It helps teams avoid fragile, implementation-coupled tests and focuses engineering effort on observable, user-facing behavior.

Core Features & Use Cases

  • Tracer-bullet workflow: Write one failing test, implement the minimal code to pass, then repeat to build features iteratively.
  • Integration-style tests: Prefer tests that exercise public interfaces and real code paths so tests survive internal refactors.
  • Design for testability: Guidance on deep modules, dependency injection, and small interfaces to make mocking and isolation practical at system boundaries.
  • Refactor discipline: Only refactor after green, with a checklist for duplication, long methods, and module depth.
  • Use cases: Introducing new features, fixing bugs with confidence, adding integration tests for critical flows, and improving legacy code incrementally.

Quick Start

Guide the user through a single red-green-refactor cycle by asking which behavior to specify, writing one failing test for that behavior, implementing the minimal code to pass the test, and then running refactors.

Frequently Asked Questions about tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I start test-driven development using red-green-refactor?

Start test-driven development by writing one failing test for a specific behavior, implementing the minimal code to pass it, then refactoring safely. This iterative cycle ensures features are built incrementally and reliably while preventing regressions.

What is the best way to write integration tests that survive internal refactoring?

The best way to write integration tests is to exercise public interfaces and real code paths rather than mocking internal collaborators. This approach ensures tests verify observable behavior and remain resilient during structural refactors.

When should I avoid mocking internal collaborators during unit testing?

Avoid mocking internal collaborators during unit testing when specifying behaviors through public interfaces. Mocking internal components couples tests to implementation details, making them fragile and likely to break during valid refactoring cycles.

Can I refactor code before my tests are green in TDD?

No, in TDD you must only refactor after reaching green. Running refactors only after tests pass ensures you preserve verified behavior while eliminating duplication, long methods, and deep module issues safely.

Does test-driven development work for fixing bugs in legacy code?

Yes, test-driven development works for fixing bugs in legacy code by incrementally adding integration tests for critical flows. Writing failing tests for bugs builds confidence and preserves observable behavior during subsequent improvements.