RS

rspec-unit-testing-standards

Defines mandatory and recommended rules for RSpec structure, naming, and stubbing patterns.

Install

mkdir -p .claude/skills/rspec-unit-testing-standards && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10446" && unzip -o skill.zip -d .claude/skills/rspec-unit-testing-standards && rm skill.zip

Installs to .claude/skills/rspec-unit-testing-standards

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Defines RSpec unit testing rules for this project covering structure, naming, setup patterns, stubbing, doubles, coverage, and test reliability. Use when writing, reviewing, or auditing RSpec specs under spec/unit/.
215 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • →Validate RSpec unit tests
  • →Audit test suite quality
  • →Enforce RSpec structure rules
  • →Check branch coverage
  • →Verify test determinism

How it works

The skill enforces RSpec standards by checking spec file structure, naming conventions, and setup patterns against defined MUST/SHOULD rules.

Inputs & outputs

You give it
spec/unit/path/to_spec.rb
You get back
Compliance report and coverage status

When to use rspec-unit-testing-standards

  • →Reviewing RSpec test code
  • →Setting up new unit tests
  • →Auditing test suite quality

About this skill

RSpec unit testing standards

The rules for unit specs live in the rspec-unit-testing-standards skill of the jcouball-testing plugin, which loads its rspec-base-standards skill first. This file holds only what is specific to ruby-git, so fixes to the rules land once, in the plugin, instead of drifting between two full copies. ruby-git's changes to the conventions every spec follows are in its RSpec base standards file.

Contents

How to use this skill

Invoke /jcouball-testing:rspec-unit-testing-standards and apply the changes below throughout its workflow. If you arrived here because that skill told you to read this file, do not invoke it again — its rules are already in context; apply the changes below and continue.

If the plugin is not installed, install it first:

claude plugin marketplace add jcouball/agent-plugins
claude plugin install jcouball-testing@jcouball

In an agent that cannot install or invoke Claude Code plugins, read the unit skill and the base skill directly from the plugin source and apply the same changes on top, with the RSpec base standards file's changes applied to the base skill. In Copilot Chat, attach this file, that base standards file, and the two plugin sources to your context and proceed the same way.

These changes were written against version 0.2.1 of the jcouball-testing plugin, which the links above point to. When the plugin is upgraded, check each change below against the new rules, then move the links to the new version.

Changes and additions for ruby-git

  • The coverage run. bundle exec rake spec:unit is the command that the coverage check in the plugin's Verification section, and its "What the tools check" section, leave to the project override. A full run fails below 100% line or branch coverage, and CI fails the pull request with it. How to read a focused run, and the one kind of branch that the rule on unit specs covering every line and branch lets a coverage directive exclude, are in the Test coverage policy in CONTRIBUTING.md.
  • Class families. Git::Commands::* specs also follow the Command test conventions, and Git::Repository module specs follow the Facade test conventions. Those are the class-family conventions the plugin's Step 0 refers to. Where one departs from a plugin rule, the convention wins, in either direction, whether or not it names the rule it departs from. It may prescribe what a plugin rule forbids, such as a fixed section at the end of #call or an example the conventions require. It may also forbid what a plugin rule permits, such as the command conventions' rule against using another command class in a spec. A review of such a spec produces the plugin's per-rule table first, then the class-family skill's own output for its conventions.

Related skills

When not to use it

  • →Integration or E2E testing
  • →Legacy spec cleanup without plan

Prerequisites

bundle

Limitations

  • →Requires manual verification of MUST rules
  • →Legacy specs may require incremental cleanup

How it compares

Unlike generic linting, this skill enforces project-specific RSpec architectural rules like described_class usage and branch coverage thresholds.

Compared to similar skills

rspec-unit-testing-standards side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
rspec-unit-testing-standards (this skill)06moReviewIntermediate
ruby-coder59moNo flagsIntermediate
rails-testing111moNo flagsBeginner
ruby-pro17moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry