From rails-agent-skills
Reviews Ruby on Rails apps for Domain-Driven Design boundaries, bounded contexts, language leakage, cross-context orchestration, and unclear ownership. Detects coupling and recommends smallest credible improvements.
npx claudepluginhub igmarin/rails-agent-skills --plugin rails-agent-skillsThis skill uses the workspace's default tool permissions.
Use this skill when the main problem is not syntax or style, but unclear domain boundaries.
Reviews Rails app architecture: identifies fat models/controllers, audits callbacks/concerns, recommends service extractions, domain boundaries, and severity-classified fixes.
Applies Domain-Driven Design to model software around business domains using bounded contexts, aggregates, ubiquitous language, domain events, and context mapping. For domain modeling, monolith splitting, and microservice boundaries.
Analyzes bounded context boundaries in PHP DDD projects. Detects cross-context coupling, shared kernel violations, context mapping issues, ubiquitous language inconsistencies. Generates context map diagrams and boundary recommendations.
Share bugs, ideas, or general feedback.
Use this skill when the main problem is not syntax or style, but unclear domain boundaries.
Core principle: Fix context leakage before adding more patterns.
| Area | What to check |
|---|---|
| Bounded contexts | Distinct language, rules, and ownership |
| Context leakage | One area reaching across another's concepts casually |
| Shared models | Same object name used with conflicting meanings |
| Orchestration | Use cases coordinating multiple contexts without a clear owner |
| Ownership | Who owns invariants, transitions, and side effects |
DO NOT recommend splitting code into new contexts unless the business boundary is explicit enough to name.
DO NOT treat every large module as a bounded context automatically.
ALWAYS identify the leaked language or ownership conflict before proposing structural changes.
ddd-rails-modeling when a context is clear enough to model tactically, or to refactor-safely when boundaries need incremental extraction.Write findings first.
For each finding include:
Then list open questions and recommended next skills.
Use ripgrep to find cross-context references before reading code manually:
# Find references from one context into another
rg 'Billing.*Fleet|Fleet.*Billing' app/
# Find cross-namespace constant usage
rg 'Billing::[A-Z]' app/services/fleet/
rg 'Fleet::[A-Z]' app/services/billing/
# Find callbacks that touch foreign concepts
rg 'after_(create|update|save).*Job|after_(create|update|save).*Mailer' app/models/
| Skill | When to chain |
|---|---|
| ddd-ubiquitous-language | When the review is blocked by fuzzy or overloaded terminology |
| ddd-rails-modeling | When a context is clear and needs entities/value objects/services modeled cleanly |
| rails-architecture-review | When the same problem also needs a broader Rails structure review |
| refactor-safely | When the recommended improvement needs incremental extraction instead of a rewrite |
Consult this section when you need a concrete model for structuring a finding.
Scenario: A Fleet::Vehicle model has an after_save callback that calls Billing::Invoice.generate_for(self). The Fleet context is directly triggering billing logic, leaking into Billing's responsibility.
Sample finding block:
Severity: High
Contexts involved: Fleet, Billing
Leaked term / ownership conflict: Fleet::Vehicle owns invoice generation trigger; Billing should own when invoices are created.
Why the current boundary is risky: Changes to billing rules require modifying a Fleet model, coupling release cycles and obscuring business rules.
Smallest credible improvement: Replace the callback with a domain event (VehicleCheckedIn) published by Fleet and subscribed to by Billing. Fleet emits facts; Billing decides what to do with them.
Consult this section when a proposed boundary change feels off but you cannot name why.