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.
npx skills add sandeepmvl/rails-skills --skill 04-rspec-testing-pyramidgit clone --depth 1 https://github.com/sandeepmvl/rails-skillsWrote 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.
[](https://agentmods.dev/skills/sandeepmvl/rails-skills/04-rspec-testing-pyramid)<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/04-rspec-testing-pyramid"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/04-rspec-testing-pyramid/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.
<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/04-rspec-testing-pyramid"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/04-rspec-testing-pyramid.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00149 | $0.04242 |
| Opus 5 | $0.00075 | $0.02121 |
| Sonnet 5 | $0.00030 | $0.00848 |
| Haiku 4.5 | $0.00015 | $0.00424 |
Grade A, and why
rspec-testing-pyramid 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 12d 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.
How it starts
The opening of the file, as written. The whole thing — 431 lines — stays where its author put it; the contents beside it link to each section on GitHub.
RSpec Testing Pyramid
Build a fast, deterministic Rails test suite. AI agents over-write system specs (slow, flaky), under-write request specs (the sweet spot), and reach for hard-coded
id: 1instead of factories. This skill encodes the layer choices senior Rails devs make.
Why this matters
A bad test suite is worse than no test suite. It slows CI, surfaces false positives, and trains devs to ignore failures. AI agents default to system specs because they read most like the user's intent — but a 200-spec system suite that runs 30 minutes and is 5% flaky is a productivity catastrophe.
The opinion
Pyramid shape: lots of model + request specs (fast, deterministic), few system specs (slow, only critical user flows). Use FactoryBot, not fixtures. RSpec hooks: prefer
letoverbeforefor setup that's used by some tests;let!only when the side-effect must precede the example. Stub external HTTP — use VCR for cassette-replay, WebMock for hand-rolled stubs. System specs with Cuprite over Selenium (faster, no driver install).
Counter-position: Minitest + Rails fixtures is what DHH and the Rails core team use. It's faster to load and forces simpler tests. For greenfield apps that won't ship to a large dev team, Minitest is fine. We pick RSpec because most ecosystem libraries (FactoryBot, Shoulda Matchers, VCR) target RSpec first and the team-size break-even is around 3+ engineers.
The pyramid (Rails-specific)
┌──────────────┐
│ system specs │ ← 5-10% of specs. Critical user flows only.
│ (Cuprite) │ Slow (1-5s each). Run separately in CI.
└──────┬───────┘
│
┌────────┴─────────┐
│ request specs │ ← 25-35% of specs. Full HTTP cycle,
│ (rack-test) │ no JS. Routes + controller + view.
└────────┬──────────┘ Fast (10-50ms each).
│
┌──────────┴───────────┐
│ model specs + │ ← 50-60% of specs.
│ service specs + │ Pure Ruby, in-memory or single DB.
│ helper specs │ Fastest (1-10ms each).
└───────────────────────┘
What ships with it
4 files 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.
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.
- 12d ago First seen · 431 lines · 149 tokens per session scan A 5100544a6a8b
rspec-testing-pyramid is a skill published in the GitHub repository sandeepmvl/rails-skills (21 stars, last pushed 3mo ago), licensed MIT. It adds 149 tokens to every session and 4,242 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-30.
Other skills, from other repositories
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…
rspec
RSpec testing best practices for Ruby and Rails applications, covering test organization, data management, and isolation patterns.
ruby
Ruby development guidelines covering idiomatic code style, Ruby 3.x features, testing with RSpec, and best practices for building maintainable Ruby applications.
testunit-skill
Generates Test::Unit tests in Ruby. Classic xUnit-style testing with assert methods and test case classes. Use when user mentions "Test::Unit", "assertequal Ruby", "Ruby test-unit". Triggers on: "Test::Unit", "Ruby test-unit", "assertequal Ruby" (not RSpec).
rspec
This skill should be used when the user asks to "write specs", "create spec", "add RSpec tests", "fix failing spec", or mentions RSpec, describe blocks, it blocks, expect syntax, test doubles, or matchers. Should also be used when editing spec.rb files, working in spec/ directory, planning implementation phases that…
rails-testing
Ruby on Rails testing best practices for writing effective, maintainable test suites with RSpec. This skill should be used when writing, reviewing, or refactoring Rails tests to ensure proper test design, data management, and coverage patterns. Triggers on tasks involving RSpec specs, model tests, request specs…