Use when reviewing a Rails engine, mountable engine, or Railtie. Covers namespace boundaries, host-app integration, safe initialization, migrations, generators, and dummy app test coverage. Prioritizes architectural risks.
90
88%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Use this skill when the task is to review an existing Rails engine or propose improvements.
Prioritize architectural risks over style comments. The main review targets are coupling, unclear host contracts, unsafe initialization, and weak integration coverage.
| Review Area | Key Checks |
|---|---|
| Namespace | isolate_namespace used; clear boundaries; no host constant leakage |
| Host integration | Configuration seams, adapters; no direct host model access |
| Init | No side effects at load time; reload-safe hooks in config.to_prepare |
| Migrations | Documented, copied via generator; no implicit or destructive steps |
| Dummy app | Present in spec/; used for integration tests; exercises real mount and config |
| Mistake | Reality |
|---|---|
| Reviewing code style before architecture | Style is low impact; coupling, host assumptions, and unsafe init cause production failures |
| Missing dummy app coverage check | Dummy app must exist and be used; engines without it cannot prove host integration works |
| Ignoring engine.rb | engine.rb often contains boot-time side effects; always inspect it |
isolate_namespace used when the engine owns routes/controllers/views.Flag these first:
config.to_prepare.Write findings first. For each finding include:
Then include:
If no meaningful findings exist, say so explicitly and mention any residual testing gaps.
isolate_namespace.config.to_prepare.High-severity finding (engine reaching into host):
# Bad: engine assumes host model
class MyEngine::SomeService
def call
User.find(current_user_id) # User is host app; engine is coupled
end
endMyEngine::SomeService. Risk: Engine depends on host User; breaks when used in another app. Fix: Introduce config: MyEngine.config.user_finder = ->(id) { User.find(id) } (or an adapter), and use that in the engine.Good (configuration seam):
# Good: engine uses configured dependency
class MyEngine::SomeService
def call
MyEngine.config.user_finder.call(current_user_id)
end
end| Skill | When to chain |
|---|---|
| rails-engine-author | When implementing suggested fixes or refactoring the engine |
| rails-engine-testing | When adding missing dummy-app or integration coverage |
| rails-engine-compatibility | When assessing Rails/Ruby version support or deprecation impact |
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.