tdd

Guide software implementation through the RED-GREEN-REFACTOR cycle with failing tests first.

Updated Dec 20, 2025
One-click install
npx skills add https://github.com/chronista-club/claude-plugin-chronista-style --skill tdd-chronista-club
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/chronista-club/claude-plugin-chronista-style/tree/main/tdd
Command: npx skills add https://github.com/chronista-club/claude-plugin-chronista-style --skill tdd-chronista-club

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a disciplined approach to software development by ensuring that code is written only after corresponding tests have been created and have failed, preventing regressions and ensuring code quality.

Core Features & Use Cases

  • Test-Driven Development (TDD): Guides users through the RED-GREEN-REFACTOR cycle.
  • Discipline Enforcement: Prevents common rationalizations that undermine TDD principles.
  • Use Case: Before implementing a new user authentication feature, use this skill to write tests for valid login, invalid password, and missing username scenarios, then implement the code to pass these tests.

Quick Start

Use the tdd skill to implement the 'calculate_discount' function following the RED-GREEN-REFACTOR cycle.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I practice test-driven development for new features?

Test-driven development requires writing a failing test before implementation, then writing production code to pass it, and finally refactoring. This enforces the RED-GREEN-REFACTOR cycle to prevent regressions and ensure code quality.

What is the RED-GREEN-REFACTOR cycle in TDD?

The RED-GREEN-REFACTOR cycle is a test-driven development process where you first write a failing test (RED), implement code to make it pass (GREEN), then refactor the code while keeping tests green for better quality.

How do I fix bugs using TDD without introducing regressions?

Fix bugs using TDD by first writing a test that reproduces the bug and fails, then implementing the fix to make it pass. This discipline prevents regressions and ensures the underlying issue is resolved.

Why does test-driven development fail when skipping the failing test step?

Test-driven development fails when skipping the failing test step because it undermines discipline and allows rationalizations that compromise code quality. Verifying the test fails first ensures it actually validates the production code.

Can I refactor code before tests pass in test-driven development?

You cannot refactor before tests pass in test-driven development. The methodology requires a passing test (GREEN) before any refactoring begins, ensuring structural improvements do not alter behavior or introduce regressions.

When do I need test-driven development for software implementation?

You need test-driven development for software implementation when you want to prevent regressions and enforce code quality discipline. It ensures every feature is validated by failing tests before production code is written.