tdd

Enforce a red-green-refactor test-driven development loop for software projects.

1|Updated Aug 12, 2023
One-click install
npx skills add https://github.com/nktfh100/nixos-config --skill tdd-nktfh100
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/nktfh100/nixos-config/tree/main/claude/skills/tdd
Command: npx skills add https://github.com/nktfh100/nixos-config --skill tdd-nktfh100

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Solves the problem of unclear requirements and brittle code by enforcing a disciplined test-driven development loop.

Core Features & Use Cases

  • Enforces the red-green-refactor cycle to guide feature development and bug fixes.
  • Promotes integration-style tests that exercise public interfaces rather than internal details.
  • Provides a structured workflow (planning, tracer bullet, incremental loops, refactor guardrails) to reduce regressions.

Quick Start

Start a new feature by writing a failing test, implement the minimal code to pass, and refactor for maintainability.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is test-driven development and when should I use it?

Test-driven development is a discipline enforcing a red-green-refactor loop to solve unclear requirements and prevent brittle code. Use it during feature development and bug fixes to reduce regressions by writing failing tests first, implementing minimal code, and refactoring.

How do I apply the red-green-refactor cycle to a new software feature?

Apply the red-green-refactor cycle by following a structured workflow: start with planning and a tracer bullet, write a failing test, implement minimal code to pass it, and then refactor. This incremental loop reduces regressions and ensures solid code.

Does test-driven development require integration testing?

Test-driven development strongly promotes integration-style tests that exercise public interfaces rather than internal implementation details. This approach ensures tests validate actual software behavior and remain resilient during refactoring.

What's the best way to prevent regressions when fixing software bugs?

Prevent regressions by enforcing a test-driven development loop with refactor guardrails. Write a failing test that reproduces the bug, implement the minimal code to pass it, and refactor safely while emphasizing public interfaces and integration-style testing.

How does test-driven development handle refactoring without breaking existing tests?

Test-driven development uses refactor guardrails that emphasize exercising public interfaces over internal details. By relying on integration-style tests, you can safely refactor internal code structures without breaking the test suite, provided the public behavior remains unchanged.