tdd

Guides red-green-refactor workflows for behavior-first test-driven development.

Updated Jul 17, 2026
One-click install
npx skills add https://github.com/kartikkabadi/skills --skill tdd-kartikkabadi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/kartikkabadi/skills/tree/main/tdd
Command: npx skills add https://github.com/kartikkabadi/skills --skill tdd-kartikkabadi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build or fix software by using test-driven development, so you can validate behavior early, reduce regressions, and keep implementation aligned with user-facing requirements.

Core Features & Use Cases

  • Behavior-first testing: Focuses tests on public interfaces and observable outcomes instead of private implementation details.
  • Red-green-refactor workflow: Guides you through one test at a time, then the minimal code needed to pass, and only then cleanup.
  • Integration-style verification: Encourages tests that exercise real code paths and survive internal refactors.
  • Use case: When adding a new checkout flow or fixing a bug in a service, this Skill helps you define the most important behaviors, verify them incrementally, and avoid brittle test suites.

Quick Start

Use the tdd skill to help me plan the first behavior to test and implement it with a red-green-refactor loop.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement test-driven development for a new feature?

Test-driven development for a new feature uses a red-green-refactor workflow: write one behavior-focused test that fails, implement the minimal code to pass it, then refactor. This validates public interfaces early and reduces regressions while keeping code aligned with requirements.

What's the best way to write integration tests that survive internal refactors?

Integration tests survive refactoring best when they focus on observable outcomes and public interfaces rather than private implementation details. Behavior-driven testing exercises real code paths to verify stable public contracts, keeping suites resilient during cleanup phases.

How does red-green-refactor workflow work for fixing bugs?

Red-green-refactor for bug fixes starts by writing a failing test that reproduces the specific bug behavior. You then write the minimal implementation to make it pass, and refactor only after the test is green, ensuring the fix is verified incrementally.

Do I need to test private implementation details when using behavior-driven testing?

Behavior-driven testing does not require testing private implementation details. It focuses on validating public interfaces and observable outcomes, which keeps tests stable and avoids brittle suites that break during internal code refactoring.

Can I use test-first development for integration test planning?

Test-first development applies to integration test planning by guiding incremental test creation that exercises real code paths. It helps define the most important behaviors first, ensuring stable public-interface verification across feature implementation and bug fixes.