create-engine-installer
Skill26 starsChanged 4 months agoMITView on GitHub
Use when writing an install generator for a Rails engine (migrations, config). Trigger words: install generator, engine setup, copy migrations.
In this repository32 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- apply-code-conventionsSkill
- apply-stack-conventionsSkill
- code-reviewSkill
- create-engineSkill
- document-engineSkill
- extract-engineSkill
- generate-api-collectionSkill
- implement-authorizationSkill
- implement-background-jobSkill
- implement-graphqlSkill
- implement-hotwireSkill
- load-contextSkill
- optimize-performanceSkill
- plan-testsSkill
- rails-featureSkill
- rails-maintenanceSkill
- rails-reviewSkill
- refactor-codeSkill
- release-engineSkill
- review-architectureSkill
- review-engineSkill
- review-migrationSkill
- security-checkSkill
- seed-databaseSkill
- setup-environmentSkill
- test-engineSkill
- test-serviceSkill
- upgrade-engineSkill
- version-apiSkill
- write-testsSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
When building or reviewing an install generator, follow these steps in order.
- Distinctive: line 20
GENERATE: Run the generator against a clean host app.
- Distinctive: line 21
VERIFY: Check output files exist in the correct host paths.
- Distinctive: line 22
RERUN: Run the generator a second time.
- Distinctive: line 28
Document all required env vars alongside rollback steps.
- Distinctive: line 33
All generator actions must be safe to run multiple times.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create Engine Installer
Validation Workflow (HARD-GATE)
When building or reviewing an install generator, follow these steps in order. DO NOT ship a generator without completing steps 3 and 4.
- GENERATE: Run the generator against a clean host app. Show command + terminal output labeled Observed output for the first run. Confirm files are created in correct host paths (initializer at
config/initializers/, migrations atdb/migrate/, route mount inconfig/routes.rb). - VERIFY: Check output files exist in the correct host paths. List shell commands confirming the initializer, routes, and migrations exist.
- RERUN: Run the generator a second time; confirm no duplicate files, routes, or initializer blocks are inserted. Show command + terminal output labeled Observed output demonstrating idempotent behavior (skipping/conflict resolution). Use unique, scenario-specific values rather than copying verbatim from templates.
- TEST: Cover both single-run and rerun behavior in generator specs (see spec template below).
- DOCUMENT: List what was generated vs. what the user must do manually, including required env vars, rollback steps, and any install docs — verified against what the generator actually produces.
Key implementation rules:
- Configure only in initializers (avoid boot-time mutation).
- Document all required env vars alongside rollback steps.
- Provide sensible defaults that are easy to edit.
Idempotency Guards
All generator actions must be safe to run multiple times. Guard every file creation and injection at the point of use:
def create_initializer
return if File.exist?(File.join(destination_root, 'config/initializers/my_engine.rb'))
create_file 'config/initializers/my_engine.rb', <<~RUBY
MyEngine.configure do |config|
config.user_class = "User"
end
RUBY
end
def mount_route
# inject_into_file with force: false skips insertion if sentinel already present
inject_into_file 'config/routes.rb',
"\n mount MyEngine::Engine, at: '/admin'\n",
after: "Rails.application.routes.draw do",
force: false
endMinimal rerun spec:
it 'does not duplicate the route mount on rerun' do
2.times { run_generator }
expect(File.read(file('config/routes.rb')).scan('mount MyEngine::Engine').size).to eq(1)
endFor larger installers, extract extended guard patterns and spec templates into a dedicated companion file alongside the generator (e.g. lib/generators/my_engine/install/install_generator_patterns.rb) to keep the generator lean and this skill focused on workflow. Reference that file explicitly in your generator's comments so future maintainers know where to find the shared patterns.
Integration
| Skill | When to chain |
| create-engine | When designing the engine structure that installers will configure |
| document-engine | When documenting install steps or upgrade instructions |
| test-engine | When adding generator specs or dummy-app install coverage |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

