Use when reviewing Rails application structure, identifying fat models or controllers, auditing callbacks, concerns, service extraction, domain boundaries, or general Rails architecture decisions. Covers controller orchestration, model responsibilities, and abstraction quality.
92
91%
Does it follow best practices?
Impact
91%
1.49xAverage score across 3 eval scenarios
Passed
No known issues
Use this skill when the task is to review or improve the structure of a Rails application or library.
Core principle: Prioritize boundary problems over style. Prefer simple objects and explicit flow over hidden behavior.
| Area | What to check |
|---|---|
| Controllers | Coordinate only — no domain logic |
| Models | Own persistence + cohesive domain rules, not orchestration |
| Services | Create real boundaries, not just moved code |
| Callbacks | Small and unsurprising — no hidden business logic |
| Concerns | One coherent capability per concern |
| External integrations | Behind dedicated collaborators |
High-severity finding (controller doing too much):
# Bad: domain workflow in controller
class OrdersController < ApplicationController
def create
order = Order.new(order_params)
Inventory.check!(order.line_items)
Pricing.apply_promotions!(order)
order.save!
NotifyWarehouseJob.perform_later(order.id)
redirect_to order
end
endOrdersController#create. Risk: Controllers should coordinate, not run multi-step domain workflows. Improvement: Extract to Orders::CreateOrder.call(params) and have the controller call it and handle response/redirect.Good (single responsibility):
class OrdersController < ApplicationController
def create
result = Orders::CreateOrder.call(order_params)
result[:success] ? redirect_to(result[:order]) : render(:new, status: :unprocessable_entity)
end
end| Mistake | Reality |
|---|---|
| "Fat model is fine, controllers should be skinny" | Both should be focused. Extract to services, not models. |
| "One concern per model keeps it clean" | Concerns that combine unrelated behavior are worse than inline code. |
| "Service objects for everything" | Trivial one-liner wrappers add indirection without value. |
| Callbacks for business workflows | Callbacks should be persistence-level. Use explicit service calls. |
| "It works, so the architecture is fine" | Working code with poor boundaries becomes unmaintainable. |
Write findings first.
For each finding include:
Then list open assumptions and recommended next refactor steps.
| Skill | When to chain |
|---|---|
| ddd-boundaries-review | When the architecture issue is really about bounded contexts, ownership, or language leakage |
| ddd-rails-modeling | When the review identifies unclear domain modeling choices inside a context |
| rails-code-review | For detailed code-level review after architecture review |
| refactor-safely | When architecture review identifies extraction candidates |
| ruby-service-objects | When recommending service extraction |
| rails-security-review | When architecture review reveals security boundary concerns |
ae8ea63
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.