From rails-agent-skills
Creates or refactors Rails engines with proper structure, namespace isolation, host-app contracts, and dummy app integration tests.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rails-agent-skills:create-engineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill when the task is to create, scaffold, or refactor a Rails engine, Rails plugin, or engine gem.
Use this skill when the task is to create, scaffold, or refactor a Rails engine, Rails plugin, or engine gem.
Keep this skill focused on structure and design. Use adjacent skills for installer details, deep test coverage, release workflow, or documentation work.
| Engine Type | When to Use |
|---|---|
| Plain gem | No Rails hooks or app directories needed; pure Ruby library |
| Railtie | Needs Rails initialization hooks but not models/controllers/routes/views |
| Engine | Needs Rails autoload paths, initializers, migrations, assets, jobs, or host integration |
| Mountable engine | Needs its own routes, controllers, views, assets, and namespace boundary |
Before engine work is complete, confirm all of the following:
STRUCTURE & CONTRACT:
1. Root file requires only version, configuration, and engine.
2. Public engines use isolate_namespace; configuration exposes .configure block.
3. Host model references are configurable strings (e.g., "User"), never hard-coded ::User.
4. Host-app contract is documented (see Host App Contract section).
SAFETY CHECKS:
5. Engine code never auto-applies migrations at boot (no db:migrate, ActiveRecord::Migrator, or config.paths['db/migrate'] in initializers).
6. Initializers are idempotent and safe in development reloads.
7. Assets and generators are namespaced and idempotent.
VERIFICATION COMMANDS:
8. Dummy app exists: `ls spec/dummy` or `ls test/dummy` should return the app directory.
9. Integration tests pass: `bundle exec rspec` or `bundle exec rake test` exits 0.
10. Routes load correctly: `bundle exec rails routes` inside dummy app shows engine routes.
11. No hard-coded host constants: `grep -r "::User\|::Employee" lib/ app/` returns nothing.
12. No migration auto-apply patterns: `grep -r "db:migrate\|ActiveRecord::Migrator\|config.paths\['db/migrate'\]" lib/` returns nothing.
rails plugin new my_engine --mountable # mountable engine
rails plugin new my_engine --full # full engine (non-isolated)
rails plugin new my_engine # plain Railtie/gem
bundle exec rake inside the engine must pass.bundle exec rails routes.If the user does not specify the engine type, infer it from the requested behavior and say which type you chose.
When asked to create or scaffold a Rails engine, your output answer.md MUST follow this style:
.gemspec and Rakefile contents, correctly namespaced under the engine namespace.bundle exec rake inside the engine passes (exits 0), with a simulated passing output block.| Skill | When to chain |
|---|---|
| test-engine | Dummy app setup, integration tests, regression coverage |
| review-engine | Findings-first audits, structural review |
| document-engine | README, installation guide, host-app contract documentation |
| create-engine-installer | Generator-heavy setup, install scripts, copy migrations |
| generate-api-collection | When the engine exposes HTTP endpoints (generate/update Postman collection) |
npx claudepluginhub igmarin/rails-agent-skills --plugin rails-agent-skillsGuides Rails engine development with a phased workflow: scaffolding, testing, isolation, code review, and release. Use when creating, extracting, or maintaining Rails engines.
Creates expert-level Ruby on Rails generators for models, services, controllers, and full-stack features. Useful for custom scaffolds, code generation tools, or Rails/Thor automation.
Writes idiomatic Ruby code with metaprogramming, Rails patterns, and performance optimization. Specializes in Rails, gem development, and testing with RSpec/Minitest.