From gierd
Use when the user explicitly requests extraction opportunities across every OOP pattern lens (e.g. "/oop", "find OOP refactoring opportunities", "check all extraction patterns"). The Rails Way is still the default — this skill finds where it stops being enough.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gierd:oopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The Rails Way is still the default. Models, scopes, concerns, and helpers handle the vast majority of Rails code. These patterns are tools, not architecture — each one earns its place only when the simpler Rails idiom stops being enough. An app full of service objects, form objects, and repositories is an anemic domain model. Start with fat models, thin controllers; extract only when the pressu...
The Rails Way is still the default. Models, scopes, concerns, and helpers handle the vast majority of Rails code. These patterns are tools, not architecture — each one earns its place only when the simpler Rails idiom stops being enough. An app full of service objects, form objects, and repositories is an anemic domain model. Start with fat models, thin controllers; extract only when the pressure is clear.
| Pattern | Reference | Load When |
|---|---|---|
| Value Objects | references/value-objects.md | composed_of, custom attribute types, value-with-behavior |
| Null Objects | references/null-objects.md | replacing nil checks with full-interface stand-ins |
| Concerns & Mixins | references/concerns-and-mixins.md | shared behavior across 2+ models |
| Presenters | references/presenters.md | SimpleDelegator/decorator wrappers for display logic |
| Query Objects | references/query-objects.md | complex AR queries beyond scopes |
| Form Objects | references/form-objects.md | ActiveModel::Model for multi-model/wizard forms |
| Service Objects | references/service-objects.md | last-resort POROs for cross-aggregate operations |
| Policy Objects | references/policy-objects.md | per-resource per-action authorization (Pundit-compatible) |
| Repository Pattern | references/repository-pattern.md | when swapping data sources behind models |
When invoked as a sweep, identify which patterns are present or problematic in the code, map to the relevant reference(s) above, and dispatch one subagent per matched pattern. Each subagent loads this skill, reads the matched reference, and reviews the code against the pattern. Aggregate findings.
Dispatch one parallel subagent per pattern. Each subagent answers: "Is there code here that would benefit from extracting into this pattern?" See dispatching-parallel-agents for the dispatch primitive.
| Reference | Looks for |
|---|---|
| references/value-objects.md | Repeated formatting/validation of domain values; Money, EmailAddress-shaped concepts inline |
| references/null-objects.md | Defensive &. and if x.present? chains around nilable collaborators |
| references/concerns-and-mixins.md | Behavior duplicated across 2+ models or controllers |
| references/presenters.md | Display logic crammed into helpers or views |
| references/query-objects.md | Complex AR queries that have outgrown scopes |
| references/form-objects.md | Multi-model forms, virtual attributes, wizard steps |
| references/service-objects.md | Genuinely cross-aggregate operations buried in models or controllers |
| references/policy-objects.md | Authorization checks scattered across controllers and models |
| references/repository-pattern.md | (Rare) Domain code coupled to a specific data source that needs swapping |
Each subagent receives:
Each subagent returns either:
file:line citation, current shape, proposed pattern, one-line trade-offGroup opportunities by file, then by pattern. For each include:
Skip patterns with no opportunities — don't list "no findings" rows.
*Service classes is the anemic domain model antipattern. Service objects are last resort, not default architecture.rails-antipatterns finds smells; oop finds extraction opportunities. They overlap on smells like service-object-soup (extraction into this pattern is sometimes the wrong move) and anemic-domain-model (extraction out of services into models). When invoked together, run them in parallel and merge findings, deduplicating where the same code is flagged from both lenses.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub gierd-inc/dev-skills --plugin gierd