tdd-cycle

Guide Test-Driven Development through RED, GREEN, and REFACTOR phases in Rails-like codebases.

1|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/LaunchPadLab/ai-bank --skill tdd-cycle-launchpadlab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-cycle
Source: https://github.com/LaunchPadLab/ai-bank/tree/main/claude/skills/tdd-cycle
Command: npx skills add https://github.com/LaunchPadLab/ai-bank --skill tdd-cycle-launchpadlab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The tdd-cycle skill helps you avoid guessing by turning feature implementation into a disciplined loop of writing a failing test first, making it pass with the smallest change, and then improving the code without breaking behavior.

Core Features & Use Cases

  • Red-Green-Refactor workflow: Use RED to capture the desired behavior in a failing test, GREEN to implement the minimum code to pass, and REFACTOR to clean up while keeping tests green.
  • Test type selection by scenario: Choose the right test location and style (model, controller, system, service, or job) based on what the feature actually touches.
  • Practical verification and anti-pattern guidance: Validate that the RED step truly fails, ensure GREEN truly passes, and avoid common pitfalls like testing implementation details or creating brittle/slow tests.

Quick Start

Use tdd-cycle with component-name to implement a feature by writing a failing RED test, coding the smallest GREEN implementation to pass it, and then refactoring while keeping the tests green.

Frequently Asked Questions about tdd-cycle

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

FAQPage Schema
How do I practice test-driven development in Rails?

Test-driven development in Rails uses a Red-Green-Refactor cycle: write a failing RED test capturing desired behavior, implement minimal GREEN code to pass it, then safely REFACTOR while keeping tests green.

What is the best way to write unit tests before implementing features?

The best way is the Red-Green-Refactor workflow: capture desired behavior in a failing RED test, write the smallest GREEN implementation to pass it, then improve code structure while verifying tests stay green.

How do I choose the right test type for my Rails feature?

Choose test location based on what the feature touches: model tests for data logic, controller or system tests for requests, and service or job tests for specialized behavior verification across Rails components.

Why do my test-driven development tests keep breaking when I refactor?

Tests break during refactoring when they verify implementation details rather than behavior. Focus tests on observable outcomes and run them iteratively after each small code change to catch failures immediately.

Can I use this TDD workflow for Rails services and jobs?

Yes, the workflow applies to building features across Rails models, controllers, services, and jobs. It requires test failure confirmation, minimal code changes, iterative refactoring with repeated test runs, and final whole-scope verification.

What are common anti-patterns to avoid in test-driven development?

Common anti-patterns include testing implementation details instead of behavior and creating brittle or slow tests. Validate that RED steps truly fail and GREEN steps truly pass to maintain a reliable verification loop.