tdd

Guide engineers through Red-Green-Refactor test-driven development cycles.

Updated Aug 14, 2024
One-click install
npx skills add https://github.com/kokatsu/dotfiles --skill tdd-kokatsu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/kokatsu/dotfiles/tree/main/.config/claude/skills/tdd
Command: npx skills add https://github.com/kokatsu/dotfiles --skill tdd-kokatsu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides engineers through test-driven development workflows using the Red-Green-Refactor cycle to instill disciplined, test-backed implementation practices.

Core Features & Use Cases

  • Red-Green-Refactor guided cycles for each feature to ensure tests drive design.
  • Emphasizes testing public interfaces and incremental refactoring to maintain behavior and maintainable code.
  • Provides a repeatable process and best practices for teams adopting TDD across projects.

Quick Start

Call the tdd skill with a feature description to begin the Red-Green-Refactor cycle.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is the Red-Green-Refactor cycle in test-driven development?

The Red-Green-Refactor cycle in test-driven development is a process where you write a failing test, make it pass with minimal code, and then incrementally refactor while maintaining behavior. This cycle drives design through tests.

How do I start test-driven development for a new feature?

To start test-driven development for a new feature, invoke the TDD process with a feature description. This initiates a guided Red-Green-Refactor cycle that emphasizes testing public interfaces to produce iterative, test-backed implementations.

Does test-driven development work for incremental refactoring across existing codebases?

Yes, test-driven development works for incremental refactoring across existing codebases. The guided process emphasizes testing public interfaces and maintaining behavior, ensuring code remains maintainable during structured refactoring tasks.

What's the best way to ensure tests drive software design?

The best way to ensure tests drive software design is following structured Red-Green-Refactor cycles. By writing tests for public interfaces first, the implementation naturally adapts to required behaviors, producing maintainable, test-backed code.

When should I not use test-driven development?

You should not use test-driven development for exploratory prototyping where public interfaces are unknown. The process requires defining expected behaviors upfront, making it less suitable for rapid spikes or throwaway code without clear testing principles.