testing

testing is a skill for Claude Code from slbug/claude-ruby-grape-rails. It costs 52 tokens per session (493 once invoked), scanned A, original, MIT.

A guide to writing reliable Ruby and Rails tests with RSpec, factories, request tests, worker tests, and controls for time and randomness.

In plain words
What is it for?
Use it when designing or improving tests for Rails requests, service objects, database records, and background workers.
Why use it?
It helps prevent tests that fail because of shared state, changing timestamps, factory loops, or test-order differences.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the ruby-grape-rails plugin — 52 skills, 19 agents, 17 hooks shipped together

Good fit Use it when designing or improving tests for Rails requests, service objects, database records, and background workers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/slbug/claude-ruby-grape-rails/testing
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 slbug/claude-ruby-grape-rails --skill testing
Clone the repo
git clone --depth 1 https://github.com/slbug/claude-ruby-grape-rails

Made for: Claude Code.

Or install ruby-grape-rails, the plugin that ships this one along with the rest of its 52 skills, 19 agents, 17 hooks.

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 testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/slbug/claude-ruby-grape-rails/testing.svg)](https://agentmods.dev/skills/slbug/claude-ruby-grape-rails/testing)
Your own site
<a href="https://agentmods.dev/skills/slbug/claude-ruby-grape-rails/testing"><img src="https://agentmods.dev/badge/skills/slbug/claude-ruby-grape-rails/testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 493 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.00052 $0.00493
Opus 5 $0.00026 $0.00246
Sonnet 5 $0.00010 $0.00099
Haiku 4.5 $0.00005 $0.00049

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

Security

Grade A, and why

testing 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 4d 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.

plugins/ruby-grape-rails/skills/testing/SKILL.md · 43 lines

What it actually says

Testing

Good Defaults

  • request specs or API tests for transport behavior
  • focused unit tests for service/query objects
  • worker tests for enqueue and perform paths
  • factories or fixtures that stay small and deterministic
  • explicit time and randomness control in flaky paths

Gotchas

  • Factory cycles. create(:user) triggers create(:account) triggers create(:user) — silent infinite loop. Detect via FactoryBot's :build_stubbed strategy or explicit :user_without_account factory.
  • DatabaseCleaner truncation drift. truncation strategy doesn't reset sequences. Tests asserting on auto-increment IDs fail randomly. Use transaction or ActiveRecord::Base.connection.reset_pk_sequence!.
  • Time-sensitive flakies. Time.current in factory + expect(record.created_at).to eq Time.current — race on test runner clock. Use freeze_time or Timecop.freeze.
  • RSpec random order seed. Test passing alone but failing in suite is order-dependent. Reproduce with rspec --seed SEED_VALUE; fix via before(:each) do; reset_state; end or split tests.

References

Need Reference
verify-before-claiming-done discipline (Iron Law 21) ${CLAUDE_SKILL_DIR}/references/discipline.md
RSpec patterns (subject, let, contexts, shared examples) ${CLAUDE_SKILL_DIR}/references/rspec-patterns.md
FactoryBot patterns (build vs create, traits, sequences, transient) ${CLAUDE_SKILL_DIR}/references/factory-patterns.md
RSpec mocks, instance_double, allow vs expect ${CLAUDE_SKILL_DIR}/references/mock-patterns.md
Capybara + Turbo Stream + ActionCable system tests ${CLAUDE_SKILL_DIR}/references/system-testing.md
Files

What ships with it

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

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. 4d ago First seen · 43 lines · 52 tokens per session scan A 7e8d205223a5

Subscribe to this mod's changes

testing is a skill published in the GitHub repository slbug/claude-ruby-grape-rails (7 stars, last pushed 3d ago), licensed MIT. It adds 52 tokens to every session and 493 once invoked, about $0.0003 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-09-03.

Related

Other skills, from other repositories

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…

hoblin/claude-ruby-marketplace · 125 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

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

LambdaTest/agent-skills · 70 tokens

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…

pproenca/dot-skills · 103 tokens