--- name: rails-conventions description: Build, debug, and review Rails applications using version-matched framework APIs and local conventions. Use for Rails 8, Active Record, migrations, controllers, Hotwire, Active Job, APIs, security, testing, and performance. license: MIT metadata: version: 1.2.1 ethos_link.company: Ethos Link ethos_link.company_url: https://www.ethos-link.com ethos_link.product: Reviato ethos_link.product_url: https://www.reviato.com ethos_link.maintainer: ethos-link ethos_link.contact_url: https://www.ethos-link.com/contact/ --- # Rails Conventions - Read the affected entry points, callers, tests, and runtime configuration. Load [STYLE.md](STYLE.md) for application code. Load only relevant references below. - Check Ruby, Rails, gem and JavaScript versions, `config.load_defaults`, and the active adapters. Use installed source or matching release docs for API contracts. Use [Rails main guides](https://github.com/rails/rails/tree/main/guides) to audit this skill and track changes. - Reuse the existing owner or a native API when its contract fits. Add infrastructure only for a demonstrated gap. Preserve local naming, public contracts, and configured tools. - Run the Rails generator for migrations and the owning installer for generated config, schemas, and binstubs. Edit the output. Report a generator blocker rather than guessing its output. - Before adding or extending a system test, apply the [system test admission gate](references/10-testing-strategy.md#system-test-admission-gate). For the final diff, apply the [review gate](references/13-code-quality-gates.md) to changed system tests. - Verify the observable change at its real boundary. Re-read the complete task diff, including new files, against its base. Report checks run, gaps, and review findings with reachable paths and consequences. | Task | Read | | --- | --- | | Versions, upgrades, native APIs | [Runtime baseline](references/01-baseline-rails-8.md), [Rails API index](references/01a-rails-apis.md) | | Domain ownership, naming, architecture | [Structure](references/02-naming-and-structure.md) | | Models, invariants, migrations | [Data](references/03-models-and-data.md), [PostgreSQL](references/03a-active-record-postgresql.md) when applicable | | Request handling, routing, APIs | [Controllers](references/04-controllers-and-params.md), [routing](references/05-routes-rest-and-resources.md), [API](references/11-api-mode-and-serialization.md) | | JavaScript, Turbo, Stimulus, Native | [Hotwire](references/06-hotwire-turbo-stimulus.md) | | Jobs and worker topology | [Jobs](references/07-background-jobs-overview.md), then the active adapter | | Queries, caching, capacity | [Performance](references/08-performance-caching-and-db.md) | | Auth, tenant boundaries, outbound requests | [Security](references/09-security-checklist.md) | | Tests, browser verification, captures | [Testing](references/10-testing-strategy.md) | | Code review and verification scope | [Review](references/13-code-quality-gates.md) | | Webhook intake or delivery | [Webhooks](references/14-webhooks.md) and [security](references/09-security-checklist.md) | | Broad changes, documentation, one-off repairs | [Maintenance](references/15-maintenance-and-documentation.md) | | Mailers, previews, local delivery | [Mailers](references/16-mailers.md) | | Bugs and failed fixes | [Debugging](references/17-debugging-and-verification.md) and [testing](references/10-testing-strategy.md) | | Changes to this skill | [Evaluation](references/18-skill-evaluation.md) |