agentleFS
martinstreichermartinstreicher/claude-skills/rspec/Skill.md

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

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. instructure/canvas-lms★ 6.9ksame name
    2. Mindrally/skills★ 275same name
    3. G1Joshi/Agent-Skills★ 15same name
    4. tuannv14/claude-team-toolkit★ 1same name
    5. 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.

  • In this repository2 other files it gives its agents.

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
  1. Very specific:

    Use :aggregate_failures for multiple expectations in RSpec.

    line 13
  2. Very specific:

    Prefer let! over before blocks for creating test data.

    line 15
  3. Distinctive:

    When possible, set a subject with a variable name to reduce repetition in expect statements.

    line 17
  4. Distinctive:

    If test-prof is installed, apply these rules:

    line 26
  5. Very specific:

    Use test-prof matchers for better test coverage and performance.

    line 27
  6. Distinctive:

    Do not nest describe blocks more than two levels deep.

    line 33

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
Skill.md

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_failures for multiple expectations in RSpec.
  • Prefer let! over before blocks 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-prof matchers for better test coverage and performance.
    • Try to use let_it_be instead of let! for shared test data.
  • 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?

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.