What problem does it solve?
Rails developers often struggle to decide when and where to extract code, leading to bloated models, fat controllers, premature abstractions, or service objects that wrap a single update call. This Skill provides clear thresholds and decision rules for organizing Rails code.
Core Features & Use Cases
- Extraction Thresholds: Concrete signals for when to extract, such as controller actions exceeding ~10 lines or models exceeding ~100 lines.
- Decision Tree: A structured flow for routing code to model scopes, query objects, service objects, concerns, presenters, or ViewComponents.
- Settled Debates: Opinionated guidance on concerns vs service objects, STI vs polymorphic associations, and callbacks vs explicit calls.
- Use Case: When a controller action grows to 15 lines spanning two models and an external API call, use this Skill to determine it belongs in a service object with a transaction rather than a concern or inline code.
Quick Start
Ask the AI where a piece of Rails business logic should go and whether it should be extracted into a service, concern, or query object.