rspec
Skill0 starsChanged 9 months agoMITView on GitHub
name: RSpec Coding Preferences description: Preferences for developing and maintaining RSpec code dependencies: ruby>=3.4.8, mise, rspec, test-prof Apply these rules when developing and maintaining RSpec test suites. - When possible, set a subject with a variable name to reduce repetition in expect statements. - Align the left brace of multiple, contiguous (no blank line between) let and let! statements to make the code more readable. - Separate a multiline let or let! statement with a blank line. Multiline let or…
5 other projects use a version of this.
Adopted by
Most recently taken up by
- mukco/claude-skillstheir own version, first seen Oct 15, 2026
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
- Mindrally/skillstheir own version, first seen Oct 8, 2026
- instructure/canvas-lmstheir own version, first seen Oct 8, 2026
- tuannv14/claude-team-toolkittheir own version, first seen May 5, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- instructure/canvas-lms★ 6.9ksame name
- Mindrally/skills★ 275same name
- G1Joshi/Agent-Skills★ 15same name
- tuannv14/claude-team-toolkit★ 1same name
- mukco/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Use :aggregate_failures for multiple expectations in RSpec.
- Very specific: line 15
Prefer let! over before blocks for creating test data.
- Distinctive: line 17
When possible, set a subject with a variable name to reduce repetition in expect statements.
- Distinctive: line 26
If test-prof is installed, apply these rules:
- Very specific: line 27
Use test-prof matchers for better test coverage and performance.
- Distinctive: line 33
Do not nest describe blocks more than two levels deep.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Metadata
name: RSpec Coding Preferences description: Preferences for developing and maintaining RSpec code dependencies: ruby>=3.4.8, mise, rspec, test-prof
When to Apply
Apply these rules when developing and maintaining RSpec test suites.
Rules for RSpec Usage
- Use
:aggregate_failuresfor multiple expectations in RSpec. - Prefer
let!overbeforeblocks for creating test data. - When possible, set a subject with a variable name to reduce repetition in expect statements.
- Align the left brace of multiple, contiguous (no blank line between) let and let! statements to make the code more readable.
- Separate a multiline let or let! statement with a blank line. Multiline let or let! statements should prefer do/end rather than braces.
- If test-prof is installed, apply these rules:
- Use
test-profmatchers for better test coverage and performance. - Try to use let_it_be instead of let! for shared test data.
- Use
- Divide tests into two sections: one for normal operation (happy path) and one for error handling and edge cases.
- Do not nest describe blocks more than two levels deep. The first level is RSpec.describe, the outermost block. There can be an additional describe block for each section. Innermost blocks should use context or it blocks.
- It is acceptable to create a folder to decompose large test suites further. For example, a test suite for a controller can be organized in a folder, with a file for each action.
Things to Consider
- Would the test suite benefit from the addition of FactoryBot, Shoulda, Faker, or other testing libraries?
- Does the RSpec configuration record failed tests so --only-failures can be used to re-run only a portion of the suite?
- Does the configuration record and report the slowest tests in the suite?
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

