RSpec Coding Preferences

Standardizes RSpec coding conventions for Ruby test suites.

Updated Feb 14, 2026
One-click install
npx skills add https://github.com/martinstreicher/claude-skills --skill rspec-coding-preferences
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: RSpec Coding Preferences
Source: https://github.com/martinstreicher/claude-skills/tree/main/rspec
Command: npx skills add https://github.com/martinstreicher/claude-skills --skill rspec-coding-preferences

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardizes RSpec coding practices to improve consistency and maintainability of test suites.

Core Features & Use Cases

  • Establish conventions for test structure, let/let!, subject naming, and aggregate_failures
  • Improve readability and maintainability by reducing repetition and enforcing organization
  • Enable smooth adoption in teams by providing a clear set of rules for happy-path vs edge-case tests

Quick Start

Apply these RSpec coding preferences to ensure consistent, maintainable test suites.

Frequently Asked Questions about RSpec Coding Preferences

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

FAQPage Schema
What are the best RSpec coding practices for structuring let, let!, and subject?▼

The best RSpec coding practices standardize let, let!, and subject naming to ensure test consistency. Rules cover reducing repetition, organizing shared data with let_it_be, and limiting nested describes for reliable happy-path and edge-case tests.

How do I use aggregate_failures and test-prof in Ruby testing?▼

Use aggregate_failures and test-prof in Ruby testing to standardize test execution and performance. Applying these RSpec conventions specifies exact rules for aggregation usage and integrates test-prof for profiling and optimizing test suites.

Does this RSpec coding standard work with existing Ruby test suites?▼

Yes, these RSpec coding standards apply to Ruby projects using RSpec. They provide a clear set of rules for test structure, folder organization, and shared data conventions to enable smooth adoption and improve maintainability across existing test suites.

When should I limit nested describes in RSpec for better test clarity?▼

Limit nested describes in RSpec when clarity and reliability are critical. These coding conventions restrict deeply nested describes to ensure readable test structures, helping teams distinguish happy-path tests from edge-case tests without confusion.

How do I organize RSpec test folders and shared data conventions?▼

Organize RSpec test folders and shared data by applying standardized coding conventions. Rules specify folder organization structures, preferred let_it_be usage for shared data, and limitations on nested describes to maintain a clear and maintainable test suite.