What problem does it solve?
AI-generated Rails RSpec test suites are often slow, flaky, and ignore team conventions: they overuse system specs, hardcode test data instead of using factories, hit real external APIs, and lack proper setup for parallel testing or coverage tracking, leading to wasted CI time and ignored test failures.
Core Features & Use Cases
- Testing Pyramid Enforcement: Guides teams to prioritize fast model and request specs over slow system specs, cutting test suite runtime and reducing flakiness.
- FactoryBot Best Practices: Provides idiomatic patterns for sequences, traits, and associations to create maintainable test data that avoids uniqueness validation failures and brittle setup.
- Full Tooling Integration: Includes drop-in templates for spec_helper.rb, rails_helper.rb, and .rspec, plus patterns for VCR/WebMock to stub external APIs, Cuprite for fast headless system specs, transactional test database strategies, parallel testing setup, and SimpleCov coverage thresholds.
- Real-World Use Case: For example, if your team's RSpec suite takes 25 minutes to run and has intermittent flaky system specs, this skill guides you to convert non-JS system specs to request specs, add parallel testing for large suites, and fix N+1 queries that slow down spec execution.
Quick Start
Use the rspec-testing-pyramid skill to refactor your slow, flaky Rails RSpec test suite into a fast, deterministic testing pyramid with proper FactoryBot usage and VCR stubs for external API calls.