Guides modern Rails 8 code architecture decisions and patterns. Use when deciding where to put code, choosing between patterns (service objects vs concerns vs query objects), designing feature architecture, refactoring for better organization, or when user mentions architecture, code organization, design patterns, or layered design.
93
92%
Does it follow best practices?
Impact
97%
1.40xAverage score across 3 eval scenarios
Passed
No known issues
Service object pattern with Result objects
Result object returned
100%
100%
Result has data/error/code
50%
100%
Typed error codes
0%
100%
Namespaced service naming
0%
100%
Single #call method
100%
100%
Constructor injection
50%
100%
Errors caught and wrapped
100%
100%
Transaction for multi-model writes
0%
100%
Skinny controller
100%
100%
Controller checks result code
25%
100%
Correct file placement
75%
100%
Result file exists
0%
100%
Multi-tenancy scoping and query objects
Account-scoped queries
0%
100%
No unscoped queries
100%
100%
Query object created
100%
100%
Constructor accepts account
0%
100%
Query file placement
100%
100%
Uses .includes() for N+1
100%
100%
Skinny controller
80%
100%
Query returns relation
25%
100%
Aggregation logic in query
100%
100%
Correct SQL aggregation
83%
75%
Architectural layer selection and refactoring
Service extracted
100%
100%
Service in app/services/
100%
100%
Controller is thin
100%
75%
Query object for search
70%
100%
Query scoped through account
62%
100%
Presenter for display
70%
100%
Geocoding moved out of callback
50%
62%
Validations stay in model
100%
100%
Scopes stay in model
100%
100%
Refactoring plan explains layers
100%
100%
No premature abstractions
87%
87%
Service returns Result
100%
100%
15fdeaf
Table of Contents
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.