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.zipInstalls 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/.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
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:unitis 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 inCONTRIBUTING.md. - Class families.
Git::Commands::*specs also follow the Command test conventions, andGit::Repositorymodule 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#callor 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
- RSpec base standards — ruby-git's changes to the conventions every spec follows
- RSpec integration testing standards
— the rules for specs under
spec/integration/ - Command test conventions and Facade test conventions — the class-family conventions built on these rules
- Testing guide — the vocabulary these rules are written in and the reasoning behind them
- Development workflow — the TDD process that governs when and how tests are written
- PR readiness review — the final check of test compliance before a pull request opens
When not to use it
- →Integration or E2E testing
- →Legacy spec cleanup without plan
Prerequisites
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| rspec-unit-testing-standards (this skill) | 0 | 6mo | Review | Intermediate |
| ruby-coder | 5 | 9mo | No flags | Intermediate |
| rails-testing | 1 | 11mo | No flags | Beginner |
| ruby-pro | 1 | 7mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by ruby-git
View all by ruby-git →You might also like
ruby-coder
majesticlabs-dev
This skill guides writing of new Ruby code following modern Ruby 3.x syntax, Sandi Metz's 4 Rules for Developers, and idiomatic Ruby best practices. Use when creating new Ruby files, writing Ruby methods, or refactoring Ruby code to ensure adherence to clarity, simplicity, and maintainability standards.
rails-testing
etewiah
Help with Rails testing including unit tests, integration tests, fixtures, and debugging test failures. Use when working on tests or debugging test issues.
ruby-pro
sickn33
Write idiomatic Ruby code with metaprogramming, Rails patterns, and performance optimization. Specializes in Ruby on Rails, gem development, and testing frameworks. Use PROACTIVELY for Ruby refactoring, optimization, or complex Ruby features.
skill-rails-upgrade
sickn33
Analyze Rails apps and provide upgrade assessments
lint
i3ringit
Use this agent when you need to run linting and code quality checks on Ruby and ERB files. Run before pushing to origin.
editor
betagouv
when generating content for ruby or slim files, follow the style and conventions of the existing codebase. Use the existing code as a guide for formatting, naming, and structure. When asked to write new code, prefer to reuse patterns and styles already present in the codebase.