tdd-cycle

Guide Ruby on Rails developers through the Red-Green-Refactor TDD cycle with RSpec.

Updated Nov 1, 2025
One-click install
npx skills add https://github.com/nschneble/rails-superstack --skill tdd-cycle-nschneble
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-cycle
Source: https://github.com/nschneble/rails-superstack/tree/main/.agents/skills/tdd-cycle
Command: npx skills add https://github.com/nschneble/rails-superstack --skill tdd-cycle-nschneble

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides developers through a structured TDD workflow, helping teams adopt Red-Green-Refactor to implement features with confidence and better test coverage.

Core Features & Use Cases

  • Structured TDD workflow: Red, Green, and Refactor steps with a clear progression.
  • Checklist-driven process: Step-by-step guidance and progress tracking for test-driven development.
  • Applicable to Ruby on Rails environments: Supports applications using RSpec and feature-rich test suites.

Quick Start

Start with a failing spec, then implement minimal code to pass, and finally refactor while keeping 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 implement test-driven development in Ruby on Rails using RSpec?

Test-driven development in Ruby on Rails using RSpec is implemented through a structured Red-Green-Refactor workflow. You start with a failing spec, write minimal code to pass it, then refactor while keeping tests green for confident feature delivery.

What is the Red-Green-Refactor cycle and how does it guide feature implementation?

The Red-Green-Refactor cycle is a test-driven development process where you write a failing test, implement the minimum code to make it pass, and then refactor the codebase. It provides structured, checklist-driven progress tracking for implementing features.

How do I structure an RSpec workflow for unit, model, and integration testing in Rails?

You structure an RSpec workflow for unit, model, and integration testing by applying a checklist-driven TDD loop. This enforces writing failing tests first, implementing minimal passing code, and refactoring systematically across the test suite.

Do I need prior Rails and RSpec knowledge to use a structured TDD workflow?

Yes, prior knowledge of Rails, Ruby, and RSpec is required to use this structured TDD workflow. The process assumes familiarity with these technologies to enforce the Red-Green-Refactor loop and execute feature-rich test suites effectively.

What is the best way to track progress through the TDD Red-Green-Refactor loop?

The best way to track progress through the TDD Red-Green-Refactor loop is using a checklist-driven process. This provides step-by-step guidance for each testing phase, ensuring structured progression and better test coverage during development.

When should I refactor code during the TDD cycle?

You should refactor code during the TDD cycle only after your tests are green. The Refactor step allows you to improve the codebase while keeping tests green, ensuring existing functionality remains intact and test coverage stays reliable.