Document Engine
Use this skill when writing or maintaining documentation for Rails engines.
Core Process & Constraints
| Step |
Section |
Focus |
| 1 |
Installation |
gem add, bundle, run install generator — show minimum working path first |
| 2 |
Host Assumptions |
Explicitly state any host model, job backend, or auth integration assumptions |
| 3 |
Configuration |
All options with defaults, required vs optional |
| 4 |
Mounting |
Explicit mount MyEngine::Engine, at: '/path' in routes — show once only |
| 5 |
Usage |
Copyable code for typical workflows |
| 6 |
Migrations |
Install generator, one-time setup, upgrade-impacting changes |
Hard gate: All generated documentation MUST satisfy steps 1, 2, and 3 above before proceeding to optional sections.
README snippet (install + mount):
## Installation
Add to your Gemfile:
gem 'my_engine'
Run:
bundle install
rails generate my_engine:install
This creates `config/initializers/my_engine.rb`. Mount the engine in `config/routes.rb`:
mount MyEngine::Engine, at: '/admin'
Configuration section:
## Configuration
In `config/initializers/my_engine.rb`:
MyEngine.configure do |config|
config.user_class = "User" # required: host model for current user
config.widget_count = 10 # optional, default 10
end
Extended Resources
See CHECKLIST.md for the full recommended README shape and documentation gap checklist. Critical gaps tracked there: installation steps, all config options with defaults, explicit mount path, migration timing, host model/auth assumptions.
- assets/configuration.md — detailed config option catalog with type info, validation rules, and all supported defaults
- assets/examples.md — realistic end-to-end usage examples covering common host-app integration workflows
- assets/installation.md — step-by-step install and generator reference including post-install setup tasks
Output Style
- Keep sections short and task-oriented.
- Validate against CHECKLIST.md: a checklist item passes when the docs contain a corresponding section with at least one copyable code example or explicit prose statement; it fails when absent, incomplete, or lacking a concrete example. Fix each failing item, then re-run from the top. Do not finalize until all critical items pass.
- Section Delineation: Explicitly label mandatory "Hard-Gate" sections (Installation, Configuration, Host Assumptions) and "Optional" sections (Extension Points, Usage Examples).
- Upgrade Notes: Include at least one copyable code example in any Upgrade Notes section.
- Language — Must be in English unless explicitly requested otherwise.
Common pitfalls to avoid:
- Duplicate
mount MyEngine::Engine ... across multiple sections — show it only once in the primary installation/mounting section.
- Syntax errors in Ruby/Rails code examples — double-check route mounting and authentication blocks (e.g.,
authenticate :user, ->(u) { u.admin? } do).
Integration
| Skill |
When to chain |
| create-engine |
Host-app contract, structure, extension points to document |
| create-engine-installer |
Install generators, setup steps to document |
| release-engine |
Changelog, upgrade notes, version documentation |
| generate-api-collection |
When documenting or adding API endpoints (keep Postman collection in sync) |
1---2name: document-engine3description: Use when writing engine README, install, and configuration docs. Trigger words: engine README, install guide, engine docs.4license: MIT5---67# Document Engine89Use this skill when writing or maintaining documentation for Rails engines.1011## Core Process & Constraints1213| Step | Section | Focus |14|------|---------|-------|15| 1 | Installation | gem add, bundle, run install generator — **show minimum working path first** |16| 2 | Host Assumptions | Explicitly state any host model, job backend, or auth integration assumptions |17| 3 | Configuration | All options with defaults, required vs optional |18| 4 | Mounting | Explicit `mount MyEngine::Engine, at: '/path'` in routes — show once only |19| 5 | Usage | Copyable code for typical workflows |20| 6 | Migrations | Install generator, one-time setup, upgrade-impacting changes |2122> **Hard gate:** All generated documentation MUST satisfy steps 1, 2, and 3 above before proceeding to optional sections.2324**README snippet (install + mount):**2526```markdown27## Installation2829Add to your Gemfile:3031 gem 'my_engine'3233Run:3435 bundle install36 rails generate my_engine:install3738This creates `config/initializers/my_engine.rb`. Mount the engine in `config/routes.rb`:3940 mount MyEngine::Engine, at: '/admin'41```4243**Configuration section:**4445```markdown46## Configuration4748In `config/initializers/my_engine.rb`:4950 MyEngine.configure do |config|51 config.user_class = "User" # required: host model for current user52 config.widget_count = 10 # optional, default 1053 end54```5556## Extended Resources5758See [CHECKLIST.md](./CHECKLIST.md) for the full recommended README shape and documentation gap checklist. Critical gaps tracked there: installation steps, all config options with defaults, explicit mount path, migration timing, host model/auth assumptions.5960- [assets/configuration.md](assets/configuration.md) — detailed config option catalog with type info, validation rules, and all supported defaults61- [assets/examples.md](assets/examples.md) — realistic end-to-end usage examples covering common host-app integration workflows62- [assets/installation.md](assets/installation.md) — step-by-step install and generator reference including post-install setup tasks6364## Output Style65661. Keep sections short and task-oriented.672. Validate against CHECKLIST.md: a checklist item **passes** when the docs contain a corresponding section with at least one copyable code example or explicit prose statement; it **fails** when absent, incomplete, or lacking a concrete example. Fix each failing item, then re-run from the top. Do not finalize until all critical items pass.683. **Section Delineation**: Explicitly label mandatory "Hard-Gate" sections (Installation, Configuration, Host Assumptions) and "Optional" sections (Extension Points, Usage Examples).694. **Upgrade Notes**: Include at least one copyable code example in any Upgrade Notes section.705. Language — Must be in English unless explicitly requested otherwise.7172**Common pitfalls to avoid:**73- Duplicate `mount MyEngine::Engine ...` across multiple sections — show it only once in the primary installation/mounting section.74- Syntax errors in Ruby/Rails code examples — double-check route mounting and authentication blocks (e.g., `authenticate :user, ->(u) { u.admin? } do`).7576## Integration7778| Skill | When to chain |79|-------|----------------|80| create-engine | Host-app contract, structure, extension points to document |81| create-engine-installer | Install generators, setup steps to document |82| release-engine | Changelog, upgrade notes, version documentation |83| generate-api-collection | When documenting or adding API endpoints (keep Postman collection in sync) |