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.
98
99%
Does it follow best practices?
Impact
98%
1.38xAverage score across 26 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.
NEVER mix behavior changes with structural refactors in the same step.
ONE boundary per refactoring step — never extract two abstractions in the same step.
VERIFY tests pass after EVERY step — not just at the end.
If a public interface changes, document the compatibility shim and its removal condition.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 run —
report the last line of output (e.g. "5 examples, 0 failures")
Report test run output at EACH step — not only at the end. At least two separate evidence entries at different sequence points are required.Forbidden claims:
Write this before touching any production file. This is not optional — no refactoring step begins until this test exists and passes on the current (un-refactored) code.
# spec/requests/orders_spec.rb (or service/model spec — mirror the file being refactored)
# frozen_string_literal: true
RSpec.describe "Orders#create current behavior", type: :request do
describe "POST /orders" do
let(:valid_params) { { order: { product_id: 1, quantity: 2 } } }
it "creates order and enqueues warehouse notification" do
expect { post orders_path, params: valid_params }
.to change(Order, :count).by(1)
expect(NotifyWarehouseJob).to have_been_enqueued
end
end
endRun it: bundle exec rspec spec/requests/orders_spec.rb — it must pass on the current code before any refactoring begins. If it fails, stop and fix the test or the existing code first.
The default tiny slice when extracting controller orchestration:
Before (controller does orchestration):
def create
order = OrderCreator.new(params).call
NotifyWarehouseJob.perform_later(order.id)
redirect_to order_path(order)
endAfter (same behavior, extraction only):
def create
order = Orders::CreateOrder.call(params: params)
redirect_to order_path(order)
endUse support files for detailed guidance and examples:
When asked to refactor:
| Skill | When to chain |
|---|---|
| rspec-best-practices | For additional spec structure and shared examples after characterization tests are written |
| rails-architecture-review | When refactor reveals structural problems (details) |
| rails-code-review | For reviewing the refactored code (details) |
| ruby-service-objects | When extracting logic into service objects (details) |
api-rest-collection
create-prd
ddd-boundaries-review
ddd-rails-modeling
ddd-ubiquitous-language
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20
scenario-21
scenario-22
scenario-23
scenario-24
scenario-25
scenario-26
generate-tasks
mcp_server
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-skills-orchestrator
rails-stack-conventions
rails-tdd-slices
refactor-safely
rspec-best-practices
rspec-service-testing
ruby-service-objects
strategy-factory-null-calculator
ticket-planning
yard-documentation