rspec-conventions

rspec-conventions is a skill for Claude Code from rootstrap/rails_api_base. It costs 82 tokens per session (1,124 once invoked), scanned A, original, MIT.

A set of conventions for RSpec, Ruby's testing framework, including how to structure tests, create test data, and use mocks and matchers.

In plain words
What is it for?
Use it when writing, reviewing, or editing RSpec test files and factories for models, requests, and other test types.
Why use it?
It gives tests a consistent style and helps reviewers spot unclear or incomplete cases.

Skill for Claude Code

Written for Claude Code: paths in frontmatter.

Good fit Use it when writing, reviewing, or editing RSpec test files and factories for models, requests, and other test types.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rootstrap/rails_api_base/rspec-conventions
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add rootstrap/rails_api_base --skill rspec-conventions
Clone the repo
git clone --depth 1 https://github.com/rootstrap/rails_api_base

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rspec-conventions

README.md
[![agentmods](https://agentmods.dev/badge/skills/rootstrap/rails_api_base/rspec-conventions/github.svg)](https://agentmods.dev/skills/rootstrap/rails_api_base/rspec-conventions)
Your own site
<a href="https://agentmods.dev/skills/rootstrap/rails_api_base/rspec-conventions"><img src="https://agentmods.dev/badge/skills/rootstrap/rails_api_base/rspec-conventions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rspec-conventions

Your own site · 80×15
<a href="https://agentmods.dev/skills/rootstrap/rails_api_base/rspec-conventions"><img src="https://agentmods.dev/badge/skills/rootstrap/rails_api_base/rspec-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,124 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00082 $0.01124
Opus 5.5 $0.00033 $0.00450
Sonnet 5.5 $0.00016 $0.00225
Haiku 4.5 $0.00008 $0.00112

Measured 1mo ago against content hash a8f2321362f4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rspec-conventions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/rspec-conventions/SKILL.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RSpec Conventions (Rootstrap)

Apply these whenever producing or modifying RSpec test code. Full guide: https://github.com/rootstrap/tech-guides/blob/master/ruby/rspec/style_guide.md

Complements ruby-conventions — language-level Ruby style still applies.

Structure & Formatting

  • No blank line directly after describe/context/feature opening.
  • Leave one blank line after let/subject groups and after before/after blocks.
  • Group let and subject together; separate them from before/after with a blank line.
  • One blank line around each it block.
  • Use before (not before(:each)); before(:all) should be rare and explicit.

describe & context

  • describe '#method' for instance methods, describe '.method' for class methods.
  • context descriptions must start with when or with, forming a grammatical sentence.
    context 'when the display name is not present'
    
  • Every context should have a matching opposite/negative case — a lone context is a smell.
  • Don't end it descriptions with a conditional ("...if X") — wrap in a context instead.

it / Examples

  • Never start it with "should" / "should not". State behavior directly.
    it 'returns the summary'   # not: 'should return the summary'
    
  • One expectation per it block (split multi-assertion examples).
  • Avoid generating examples via iterators; use shared examples instead.
    shared_examples 'responds successfully' do
      it 'returns 200' do ... end
    end
    it_behaves_like 'responds successfully'
    

let & subject

  • Prefer let over before { @x = ... } for test data (lazy, no instance vars).
  • let is lazy (evaluated on first reference) and cached within a single example, not across examples. Use let! when you need eager evaluation before each example.
  • Use let for values shared across several (not necessarily all) its in a context; avoid overuse — it hurts readability.
  • Use subject when describing a single primary object.
    subject { create(:article) }
    

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 88 lines · 82 tokens per session scan A a8f2321362f4

Subscribe to this mod's changes

rspec-conventions is a skill published in the GitHub repository rootstrap/rails_api_base (633 stars, last pushed today), licensed MIT. It adds 82 tokens to every session and 1,124 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.