ror-better-specs
Installation
SKILL.md
Contains Shell Commands
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
Better Specs (Rails/RSpec)
Use this skill to apply Better Specs guidance to Rails spec writing and reviews.
Workflow (use on every request)
- Identify spec type and scope: model, request, feature/system, job, mailer, service, lib.
- Load only the rule files that match the question.
- Apply guidance in this order: structure → naming → setup → expectations → speed.
- Provide fixes as concrete edits or short examples (do/don’t).
- When refactoring, preserve intent and minimize setup bloat.
Spec-type guidance (default expectations)
- Model/unit specs: prefer
describe '#method'or'.method', lean setup, single expectations. - Request/feature specs: allow multiple expectations per example if setup dominates.
- Controller specs: keep minimal; prefer request/feature specs for behavior.
Common pitfalls to catch
- Vague
describestrings (e.g., “when user is admin”). - Long
itdescriptions that repeat context. - Heavy
beforeblocks and instance variables instead oflet. - Over-mocking internal collaborators.
- Large factories/fixtures that hide intent.
- Multiple unrelated expectations in a single example.
Rule map (load as needed)
rules/what-is-better-specs.mdfor scope, intent, and background.rules/describe-methods.mdfor naming methods indescribe.rules/use-contexts.mdfor structuring contexts with when/with/without.rules/short-description.mdfor keeping descriptions short.rules/single-expectation.mdfor single-assertion guidance and exceptions.rules/all-possible-cases.mdfor valid/edge/invalid coverage.rules/expect-vs-should.mdforexpectsyntax andis_expected.rules/use-subject.mdforsubjectand named subjects.rules/use-let-and-let-bang.mdforletvslet!.rules/mock-or-not-to-mock.mdfor mock usage boundaries.rules/create-the-data-you-need.mdfor minimal data setup.rules/use-factories.mdfor factories over fixtures and unit-test caveats.rules/easy-to-read-matchers.mdfor readable matchers.rules/shared-examples.mdfor DRYing duplicated specs.rules/test-what-you-see.mdfor integration emphasis and controller testing.rules/do-not-use-should.mdfor example phrasing and syntax.rules/continuous-testing.mdfor Guard-based workflow.rules/faster-tests-preloading-rails.mdfor preloading Rails with tradeoffs.rules/stubbing-http-requests.mdfor WebMock/VCR usage.rules/formatter.mdfor Fuubar and formatter setup.rules/contributing.mdfor contributing guidance.
Review checklist (copy/paste friendly)
describenames use./#correctly and match the method/constant.contextphrases read as “when/with/without/if …”.itdescriptions are short and don’t repeat the context.expectsyntax used; noshouldin examples.- One expectation per unit example (exceptions allowed in request/feature).
subject/letused; avoidbefore+ instance vars.- Minimal data; factories over fixtures.
- Matchers are readable.
- Mock only at boundaries.
Output style (keep consistent)
- Lead with the most important fix.
- Provide a bad vs good example when helpful.
- Keep snippets short and runnable.
Weekly Installs
1
Repository
mzygar/ruby-skillsFirst Seen
Feb 27, 2026
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1