test-driven-development

Enforce a red-green-refactor TDD workflow for Rails applications.

17|1|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/thoughtbot/rails-consultant --skill test-driven-development-thoughtbot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/thoughtbot/rails-consultant/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/thoughtbot/rails-consultant --skill test-driven-development-thoughtbot

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill eliminates the uncertainty of untested code and the fragility of manual testing by enforcing a rigorous, disciplined red-green-refactor workflow.

Core Features & Use Cases

  • Outside-In Workflow: Guides you to start with high-level feature specs and drop down to lower-level unit tests only when the failure demands it.
  • Iron Law Enforcement: Ensures no production code is written without a preceding failing test, preventing technical debt and ensuring comprehensive coverage.
  • Use Case: When implementing a new user registration flow, this skill ensures you write the feature spec first, then drop down to request and model specs as needed, guaranteeing every layer is verified before completion.

Quick Start

Use the test-driven-development skill to guide the implementation of a new feature by writing a failing feature spec first.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I implement strict test-driven development in a Rails application?

Strict test-driven development in Rails requires enforcing a red-green-refactor workflow where no production code is written without a preceding failing test. This skill implements that iron law by systematically verifying code layer-by-layer.

What is the outside-in testing workflow for Rails?

The outside-in testing workflow starts with high-level feature specs and drops down to lower-level unit tests only when a failure demands it. This top-down strategy ensures every application layer is verified before completion.

How do I write RSpec feature specs before writing implementation code?

Writing RSpec feature specs first requires starting with high-level user flow expectations, then dropping to request and model specs only as needed. This prevents technical debt and guarantees comprehensive coverage.

Can I use this TDD workflow for refactoring existing Rails code?

Yes, this TDD workflow applies to refactoring existing Rails code by enforcing systematic layer-by-layer verification. It eliminates the fragility of manual testing by ensuring high code quality and test coverage.

Why does outside-in TDD start with feature specs instead of model specs?

Outside-in TDD starts with feature specs to guide top-down design, dropping to lower-level unit tests only when the failure demands it. This ensures you build exactly what the feature requires without over-engineering.