Curated library of AI agent skills for Ruby on Rails development. Covers code review, architecture, security, testing (RSpec), engines, service objects, DDD patterns, and workflow automation.
95
97%
Does it follow best practices?
Impact
91%
2.21xAverage score across 3 eval scenarios
Passed
No known issues
Use this skill when the task is to change structure without changing intended behavior.
Core principle: Small, reversible steps over large rewrites. Separate design improvement from behavior change.
| Step | Action | Verification |
|---|---|---|
| 1 | Define stable behavior | Written statement of what must not change |
| 2 | Add characterization tests | Tests pass on current code |
| 3 | Choose smallest safe slice | One boundary at a time |
| 4 | Rename, move, or extract | Tests still pass |
| 5 | Remove compatibility shims | Tests still pass, new path proven |
NO REFACTORING WITHOUT CHARACTERIZATION TESTS FIRST.
SEPARATE behavior changes from structural refactors.
VERIFY tests pass after EVERY step — not just at the end.If you haven't run the test suite after a refactoring step, you cannot claim it works.
EXTREMELY-IMPORTANT: Run verification after every refactoring step.
AFTER each step:
1. Run the full test suite
2. Read the output — check exit code, count failures
3. If tests fail: STOP, undo the step, investigate
4. If tests pass: proceed to next step
5. ONLY claim completion with evidence from the last test runForbidden claims:
Stable behavior to preserve: "Creating an order validates line items, applies pricing, persists the order, and enqueues NotifyWarehouseJob."
Smallest safe sequence (extract service):
OrdersController#create flow.Orders::CreateOrder with the same behavior; call it from the controller; keep controller response/redirect logic. Verify tests pass.Red-flag refactor (avoid): "Rename Order to Purchase and update all 50 call sites in one PR" — too many touchpoints; do renames in small steps with find/replace and tests after each commit.
| Mistake | Reality |
|---|---|
| "Quick refactor, no tests needed" | No characterization tests = no safety net. Bugs will slip through. |
| Mixing behavior change with structural change | Do one or the other. Mixed changes are impossible to review. |
| Renaming 50 call sites in one commit | Do it in small batches with tests between each. |
| Adding abstraction to satisfy a pattern | Abstractions must serve a real boundary, not a textbook. |
| Removing old code before new path is proven | Keep compatibility shims until callers are fully migrated. |
When asked to refactor:
| Skill | When to chain |
|---|---|
| rspec-best-practices | For writing characterization tests before refactoring |
| rails-architecture-review | When refactor reveals structural problems |
| rails-code-review | For reviewing the refactored code |
| ruby-service-objects | When extracting logic into service objects |
api-rest-collection
create-prd
ddd-boundaries-review
ddd-rails-modeling
ddd-ubiquitous-language
evals
generate-tasks
rails-agent-skills
rails-architecture-review
rails-background-jobs
rails-bug-triage
rails-code-conventions
rails-code-review
rails-engine-compatibility
rails-engine-docs
rails-engine-extraction
rails-engine-installers
rails-engine-release
rails-engine-reviewer
rails-engine-testing
rails-graphql-best-practices
rails-migration-safety
rails-review-response
rails-security-review
rails-stack-conventions
rails-tdd-slices
refactor-safely
rspec-best-practices
rspec-service-testing
ruby-api-client-integration
ruby-service-objects
strategy-factory-null-calculator
ticket-planning
yard-documentation