tdd-refactor

Refactor Rails models, controllers, services, and specs while preserving behavior.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/reckerswartz/resume_builder --skill tdd-refactor-reckerswartz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd-refactor
Source: https://github.com/reckerswartz/resume_builder/tree/main/.devin/skills/tdd-refactor
Command: npx skills add https://github.com/reckerswartz/resume_builder --skill tdd-refactor-reckerswartz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Improves Rails code structure during the TDD refactor phase without changing behavior.

Core Features & Use Cases

  • Enforces a strict Red→Green→Refactor cycle with a single-change-at-a-time discipline.
  • Provides a guided workflow for refactoring controllers, models, services, and specs while keeping tests green.
  • Includes a mandatory Git sync gate to ensure main remains up-to-date.

Quick Start

Refactor a target Ruby/Rails module while preserving behavior and running the full test suite after each small change.

Frequently Asked Questions about tdd-refactor

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

FAQPage Schema
How do I refactor Rails code without breaking existing tests?▼

To refactor Rails code without breaking existing tests, follow a strict Red-Green-Refactor cycle and run the full RSpec test suite before and after each single change to guarantee behavior preservation.

What is the best way to structure a Rails refactoring workflow with TDD?▼

The best way to structure a Rails refactoring workflow with TDD is enforcing a one-change-at-a-time discipline across models, controllers, and services, ensuring the full test suite stays green at every step.

How does the Git sync gate work during a Rails TDD refactor?▼

The Git sync gate ensures your local main branch remains aligned with the remote repository before starting a TDD refactor, preventing merge conflicts from invalidating your green test suite.

Can I use this TDD refactor workflow for Rails services and controllers?▼

Yes, you can use this TDD refactor workflow for Rails services, controllers, models, and specs, applying end-to-end structural improvements while maintaining strict test validation throughout the process.

Why does my RSpec suite break when refactoring multiple Rails modules at once?▼

Your RSpec suite breaks when refactoring multiple Rails modules at once because changes cascade unpredictably; applying one change at a time with full test validation isolates failures and keeps tests green.

When do I need to run the full test suite during a Rails TDD refactor?▼

You need to run the full test suite during a Rails TDD refactor both before starting and immediately after every single code change to ensure no behavior shifts occurred during structural improvements.