rspec

rspec is a skill for Claude Code from aks-builds/quality-skills. It costs 132 tokens per session (3,114 once invoked), scanned A, original, MIT.

A Ruby framework for writing and running behavior-focused tests. It organizes examples with constructs such as descriptions, contexts, expectations, shared examples, and test data factories.

In plain words
What is it for?
Use it for unit, model, request, and system tests in Rails, Sinatra, Hanami, or plain Ruby projects. It can work with tools for generated test data, blocked or recorded network calls, and browser interaction.
Why use it?
It gives Ruby teams a structured way to express expected behavior and keep repeated setup manageable. Its surrounding tools can isolate HTTP calls, record responses, and drive browser-based tests.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the quality-skills plugin — 57 skills shipped together

Good fit Use it for unit, model, request, and system tests in Rails, Sinatra, Hanami, or plain Ruby projects. It can work with tools for generated test data, blocked or recorded network calls, and browser interaction.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aks-builds/quality-skills/rspec
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 aks-builds/quality-skills --skill rspec
Clone the repo
git clone --depth 1 https://github.com/aks-builds/quality-skills

Made for: Claude Code.

Or install quality-skills, the plugin that ships this one along with the rest of its 57 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/aks-builds/quality-skills/rspec/github.svg)](https://agentmods.dev/skills/aks-builds/quality-skills/rspec)
Your own site
<a href="https://agentmods.dev/skills/aks-builds/quality-skills/rspec"><img src="https://agentmods.dev/badge/skills/aks-builds/quality-skills/rspec/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/aks-builds/quality-skills/rspec"><img src="https://agentmods.dev/badge/skills/aks-builds/quality-skills/rspec.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 132 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,114 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.
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.00132 $0.03114
Opus 5 $0.00066 $0.01557
Sonnet 5 $0.00026 $0.00623
Haiku 4.5 $0.00013 $0.00311

Measured 9d ago against content hash c050759fc402, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

rspec 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 9d 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.

skills/rspec/SKILL.md · 336 lines

How it starts

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

RSpec

You are an expert in RSpec — Ruby's de facto behavior-driven test framework — and the surrounding ecosystem (FactoryBot, VCR, WebMock, Capybara, rspec-rails). Your goal is to help engineers structure specs cleanly, manage test data and time, mock effectively, and integrate with Rails / Sinatra / Hanami. Don't fabricate RSpec matchers, expectation method names, or gem APIs. When uncertain, point the reader to rspec.info and the relevant gem docs.

Initial Assessment

Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:

  • RSpec major version — RSpec 3.x is current. Older suites on RSpec 2 have meaningful API differences.
  • Framework — Rails (use rspec-rails), Sinatra, Hanami, pure Ruby library.
  • Test data — FactoryBot (formerly factory_girl) is the de facto factory library; fixtures still appear in legacy Rails apps.
  • HTTP mockingwebmock (block real HTTP) and vcr (record-and-replay) are the standard pairing.
  • Browser tests — Capybara + a driver (Selenium / Cuprite / Apparition). For non-Rails system tests, the stack is similar.
  • Test scope — model / request / system specs, or pure Ruby unit specs.

If the file does not exist, ask: Ruby version, framework, RSpec version, FactoryBot or fixtures, browser-test stack if any.


Why RSpec

  • Expressive describe / context / it structure — reads close to spec language.
  • Rich matcher DSLexpect(x).to eq(y), to include(...), to change { ... }.by(1).
  • let / subject — lazy fixtures, scoped per example.
  • Shared examples and contexts — reuse common behavior across describes.
  • Tight Rails integrationrspec-rails provides request specs, system specs, model specs.

When not to use RSpec:

  • Non-Ruby code → use the host language's testing tool.
  • Team prefers stdlib Minitest for less metaprogramming overhead → Minitest is also valid in Ruby, especially in Rails ecosystem (DHH's preference).

Read the full file on GitHub · 336 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 336 lines · 132 tokens per session scan A c050759fc402

Subscribe to this mod's changes

rspec is a skill published in the GitHub repository aks-builds/quality-skills (2 stars, last pushed 5d ago), licensed MIT. It adds 132 tokens to every session and 3,114 once invoked, about $0.0007 per session on Opus 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-31.

Related

Other skills, from other repositories

test-case-writer

Use when someone asks to generate test cases, write test cases from a user story, create test cases from a BRD, design test cases from a mockup or wireframe, or produce a test case table from requirements.

ukkuru/testmetry-skills · 50 tokens

rails-expert

Rails 7+ specialist that optimizes Active Record queries with includes/eagerload, implements Turbo Frames and Turbo Streams for partial page updates, configures Action Cable for WebSocket connections, sets up Sidekiq workers for background job processing, and writes comprehensive RSpec test suites. Use when building…

Jeffallan/claude-skills · 104 tokens

112-java-maven-plugins

Use when you need to add or configure Maven plugins in your pom.xml — including quality tools (enforcer, surefire, failsafe, jacoco, pitest, spotbugs, pmd), security scanning (OWASP), code formatting (Spotless), version management, container image build (Jib), build information tracking, and benchmarking (JMH) …

jabrena/plinth · 149 tokens

rspec-conventions

Rootstrap RSpec conventions. Use when writing, reviewing, or editing RSpec test files (spec//spec.rb, spec/railshelper.rb, spec/spechelper.rb, spec/support//.rb) or factories. Covers describe/context structure, let/subject, matchers, factories, mocking/stubbing, shared examples, and spec types (model, request…

rootstrap/rails_api_base · 82 tokens

ruby

Ruby development guidelines covering idiomatic code style, Ruby 3.x features, testing with RSpec, and best practices for building maintainable Ruby applications.

Mindrally/skills · 32 tokens

rspec

RSpec testing best practices for Ruby and Rails applications, covering test organization, data management, and isolation patterns.

Mindrally/skills · 24 tokens