Skip to content
Skills Library
Programming · Testing

testing

/testing

Authoring Ruby/Rails/Grape/Sidekiq tests: request specs, factories, anti-flake. Triggers: \"RSpec patterns\", \"factory setup\", \"flaky test\". Do NOT use for: running tests, executing rspec.

Author
slbug ↗
Licence
MIT
Last repository change
01.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 01.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Authoring Ruby/Rails/Grape/Sidekiq tests: request specs, factories, anti-flake. Triggers: \"RSpec patterns\", \"factory setup\", \"flaky test\". Do NOT use for: running tests, executing rspec.

Triggers from the description

RSpec patterns\factory setup\flaky test\
Original author description

Authoring Ruby/Rails/Grape/Sidekiq tests: request specs, factories, anti-flake. Triggers: \"RSpec patterns\", \"factory setup\", \"flaky test\". Do NOT use for: running tests, executing rspec.

How it works

  1. Good Defaults
  2. Gotchas
  3. References
Original SKILL.md headings · 37 lines, 200 words
SKILL.md preview
---
name: testing
description: "Authoring Ruby/Rails/Grape/Sidekiq tests: request specs, factories, anti-flake. Triggers: \"RSpec patterns\", \"factory setup\", \"flaky test\". Do NOT use for: running tests, executing rspec."
user-invocable: false
effort: medium
---
# 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 in this package (6)
  • SKILL.md 2 KB
  • references/discipline.md 2 KB
  • references/factory-patterns.md 7 KB
  • references/mock-patterns.md 6 KB
  • references/rspec-patterns.md 6 KB
  • references/system-testing.md 8 KB

Versions

RepositoryScoreLicence
This page · slbug/claude-ruby-grape-rails100MIT
iuliandita/skills100MIT
wrongstack/wrongstack100MIT
langwatch/langwatch100Apache-2.0
mcouthon/agents100MIT
nteract/nteract100BSD-3-Clause
kettleofketchup/DraftForge100GPL-3.0
skillberry-ai/cap-evolve100Apache-2.0
TheBeardedBearSAS/claude-craft100MIT

Database snapshot: 13.11.2026 · package version 5dbb1224d69b (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100rails-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…
  • 100rspec
    Comprehensive RSpec testing for Ruby and Rails applications. Covers model specs, request specs, system specs, factories, mocks, and TDD workflow. Automatically triggers on RSpec-related keywords and testing scenarios.
  • 100intent-detection
    Routing Ruby/Rails/Grape/Sidekiq/AR/Sequel/Hotwire work to the correct /rb: command BEFORE doing it. Pushy gateway, never blocks. Triggers: \"my Rails app\", \"which command\", multi-step task. Do NOT use when user typed /rb:<name>.
  • 95rspec-testing
    This skill should be used when writing, reviewing, or improving RSpec tests for Ruby on Rails applications. Use this skill for all testing tasks including model specs, controller specs, system specs, component specs, service specs, and integration tests. The skill provides…
  • 100rspec
    Expert RSpec testing assistance covering Ruby BDD testing, mocks, expectations, and let/subject helpers. Use when writing Rails/Ruby tests, testing controllers/models, or running `bundle exec rspec`.
  • 90rb:learn
    Capturing in-flight lessons when the user corrects your approach or teaches a pattern: ActiveRecord, Rails, Grape, Sidekiq mistakes during work. Writes lightweight learning notes.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.