rspec-agent

Generate RSpec tests for Rails models, controllers, services, and view components.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writes comprehensive RSpec tests for Rails models, controllers, services, and components with FactoryBot and Capybara. Use when writing tests, adding test coverage, or when user mentions RSpec, specs, testing, or test-driven development.

Core Features & Use Cases

  • Generates model specs with validations, associations, and scopes
  • Generates controller/request specs and service tests
  • Guides testing for queries, presenters, policies, and system specs
  • Integrates FactoryBot and Capybara to ensure realistic test data and end-to-end flows
  • Provides structured patterns and best-practices for organizing spec files

Quick Start

Describe a Rails domain object and generate a complete RSpec test suite with FactoryBot and Capybara.

Frequently Asked Questions about rspec-agent

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

FAQPage Schema
How do I generate RSpec tests for Rails models and controllers?

To generate RSpec tests for Rails models and controllers, describe your domain object to produce ready-to-run specs. The output covers validations, associations, scopes, and request tests automatically within your spec directory.

What is the best way to write system specs with Capybara and FactoryBot?

Writing system specs with Capybara and FactoryBot is best handled by describing your end-to-end user flows. This generates integration tests utilizing realistic test data and standard Rails testing patterns for robust coverage.

Can I use this to test Rails services, queries, and presenters?

Yes, you can test Rails services, queries, and presenters. The generation process creates structured spec files with best-practice patterns specifically targeting these application layers alongside models and controllers.

Does this approach support test-driven development for standard Rails patterns?

This approach fully supports test-driven development for standard Rails patterns. When you mention RSpec or testing, it produces comprehensive suites across app layers using FactoryBot and Capybara to ensure valid end-to-end flows.

How do I organize spec files for policies and view components in Rails?

To organize spec files for policies and view components in Rails, the generation process applies structured patterns and best-practices. It outputs prepared tests directly into the spec directory to maintain logical application layer separation.

Do I need a specific testing setup to automate Rails test generation?

You need a standard Rails testing setup with RSpec, FactoryBot, and Capybara installed. The generation process targets projects utilizing these specific dependencies to output ready-to-run test suites across application layers.