test-driven-development

Enforce red-green-refactor TDD workflows in Rails applications using RSpec.

Updated Jul 10, 2026
One-click install
npx skills add https://github.com/vonchristian/sirib --skill test-driven-development-vonchristian
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/vonchristian/sirib/tree/main/.opencode/skills/test-driven-development
Command: npx skills add https://github.com/vonchristian/sirib --skill test-driven-development-vonchristian

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires rails, rspec, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a structured, red-green-refactor TDD workflow for Rails applications, helping developers implement features, fix bugs, or change behavior with a focus on test-driven development practices.

Core Features & Use Cases

  • Strict TDD Workflow: Enforces the creation of failing tests before production code, ensuring tests cover necessary functionality.
  • Outside-In Development: Starts with high-level feature specs and refines to unit tests, ensuring a user-centric approach.
  • Red-Green-Refactor: Utilizes the classic TDD cycle to write tests, write code, and refactor iteratively.
  • betterspecs.org Style Guide: Adheres to best practices for RSpec tests, ensuring clarity and maintainability.
  • Use Case: A developer is tasked with adding a new feature to a Rails application. This Skill guides them through writing a failing test, implementing the code, and refactoring as needed.

Quick Start

Use the test-driven-development skill to create a test for the new feature you're implementing in your Rails application.

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 test-driven development in a Rails application?▼

To implement test-driven development in Rails, you write a failing RSpec test first, write the minimum production code to pass it, and then refactor. This enforces a strict red-green-refactor TDD cycle for new features and bug fixes.

What is the red-green-refactor workflow in RSpec?▼

The red-green-refactor workflow in RSpec involves writing a failing test (red), implementing the minimum code to make it pass (green), and then cleaning up the code without changing behavior (refactor). It ensures tests cover necessary functionality iteratively.

Can I use this TDD workflow for fixing bugs and changing behavior in Rails?▼

Yes, you can use this TDD workflow to fix bugs and change behavior in Rails. It guides developers through writing a failing test that captures the desired fix or change, implementing the code, and refactoring to ensure the new behavior is covered.

Does this Rails TDD approach follow outside-in development?▼

Yes, this Rails TDD approach follows outside-in development by starting with high-level feature specs to ensure a user-centric approach. It then refines down to unit tests, ensuring the entire stack is tested from the user's perspective.

Do I need RSpec to enforce a strict TDD workflow in Rails?▼

Yes, you need RSpec to use this specific TDD workflow in Rails. The skill requires RSpec as a dependency and adheres to the betterspecs.org style guide to ensure clarity and maintainability of the test suite.

What are the best practices for writing RSpec tests in a TDD cycle?▼

Best practices for writing RSpec tests in a TDD cycle involve adhering to the betterspecs.org style guide. This ensures test clarity and maintainability while strictly following the red-green-refactor process for all implemented features and fixes.