Rails Convention Engineer
Follow this workflow and load only the references needed for the task.
Execution Workflow
- Inspect the codebase before proposing changes.
- Match existing conventions unless the user requests a migration.
- Use Rails conventions and plain Ruby first.
- Prefer small, reversible changes with tests.
- Report tradeoffs explicitly when choosing architecture.
Mandatory Codebase Scan
Always read these files first when available:
Gemfile
config/application.rb
config/routes.rb
config/environments/*.rb (at least current target env)
app/models/ (2-5 representative models)
app/controllers/ (2-5 representative controllers)
test/ or spec/
- process/deploy entrypoints (
Procfile*, bin/jobs, config/deploy*.yml, CI config)
Record and follow observed patterns:
- test framework
- authentication/authorization style
- frontend stack (Hotwire, React, hybrid)
- queue backend and runtime topology
- API conventions and serialization style
Background Job Backend Policy
Never assume Solid Queue just because the app is Rails 8.
Detect backend in this order:
config.active_job.queue_adapter
Gemfile gems (good_job, solid_queue, others)
- worker runtime commands and deployment wiring
Apply these rules:
- If
good_job is active, keep good_job conventions.
- If
solid_queue is active, keep solid_queue conventions.
- If both gems exist, treat the configured adapter as authoritative.
- Do not migrate queue backend implicitly as part of unrelated tasks.
- Write backend-agnostic
ApplicationJob code unless backend features are explicitly requested.
Reference Routing
Load references based on the task:
- Code style, formatting, naming conventions, and fail-fast policy:
STYLE.md
- Baseline Rails 8 defaults and upgrade constraints:
references/01-baseline-rails-8.md
- Naming, layering, and code organization:
references/02-naming-and-structure.md
- Active Record, migrations, and data modeling:
references/03-models-and-data.md
- Controllers, params, and request flow:
references/04-controllers-and-params.md
- REST resources and routes:
references/05-routes-rest-and-resources.md
- Hotwire, Turbo, and Stimulus patterns:
references/06-hotwire-turbo-stimulus.md
- Job architecture and adapter detection:
references/07-background-jobs-overview.md
- GoodJob-specific patterns:
references/07a-background-jobs-good_job.md
- Solid Queue-specific patterns:
references/07b-background-jobs-solid_queue.md
- Performance and caching strategy:
references/08-performance-caching-and-db.md
- Security review checklist:
references/09-security-checklist.md
- Test strategy and quality gates:
references/10-testing-strategy.md
- API-only and mixed-mode API patterns:
references/11-api-mode-and-serialization.md
- 37signals-inspired style profile:
references/12-37signals-inspired-profile.md
- Code quality thresholds and detection patterns:
references/13-code-quality-gates.md
Authentication Patterns
Prefer Rails 8.1 built-in authentication. When implementing custom auth:
- Use password-based authentication with bcrypt via
has_secure_password.
- Use magic link codes (not full magic link URLs) for account confirmation and email verification.
- Follow 37signals naming:
Identity (global email-based), User (per-account membership), Session.
- Rate limit authentication endpoints aggressively.
- Store sessions via signed cookies with
httponly and same_site: :lax.
Output Contract
For implementation tasks, produce:
- Required schema changes with migrations.
- Model/controller/view/job code following local conventions.
- Tests matching local framework.
- Brief risk notes (security, performance, rollout concerns).
For review tasks, prioritize:
- Correctness and behavioral regressions.
- Security and data integrity.
- Performance and operability.
- Test gaps.
1---
2name: rails-conventions
3description: Rails 8.x application architecture, implementation, and review guidance for production codebases. Use when building or reviewing Ruby on Rails 8 features across models, controllers, routes, Hotwire, jobs, APIs, performance, security, and testing. Trigger for requests mentioning Rails 8, Active Record, Active Job, GoodJob, Solid Queue, Turbo/Stimulus, REST resources, migrations, code quality, naming, and production readiness.
4license: MIT
5compatibility: Compatible with any agent runtime that supports the Agent Skills SKILL.md convention and optional references directory loading.
6metadata:
7 source: https://skillmd.com/skills/aibot88/rails-conventions
8 ethos_link.company: Ethos Link
9 ethos_link.company_url: https://www.ethos-link.com
10 ethos_link.product: Reviato
11 ethos_link.product_url: https://www.reviato.com
12 ethos_link.maintainer: ethos-link
13 ethos_link.contact_url: https://www.ethos-link.com/contact/
14---
15
16# Rails Convention Engineer
17
18Follow this workflow and load only the references needed for the task.
19
20## Execution Workflow
21
221. Inspect the codebase before proposing changes.
232. Match existing conventions unless the user requests a migration.
243. Use Rails conventions and plain Ruby first.
254. Prefer small, reversible changes with tests.
265. Report tradeoffs explicitly when choosing architecture.
27
28## Mandatory Codebase Scan
29
30Always read these files first when available:
31
32- `Gemfile`
33- `config/application.rb`
34- `config/routes.rb`
35- `config/environments/*.rb` (at least current target env)
36- `app/models/` (2-5 representative models)
37- `app/controllers/` (2-5 representative controllers)
38- `test/` or `spec/`
39- process/deploy entrypoints (`Procfile*`, `bin/jobs`, `config/deploy*.yml`, CI config)
40
41Record and follow observed patterns:
42
43- test framework
44- authentication/authorization style
45- frontend stack (Hotwire, React, hybrid)
46- queue backend and runtime topology
47- API conventions and serialization style
48
49## Background Job Backend Policy
50
51Never assume Solid Queue just because the app is Rails 8.
52
53Detect backend in this order:
54
551. `config.active_job.queue_adapter`
562. `Gemfile` gems (`good_job`, `solid_queue`, others)
573. worker runtime commands and deployment wiring
58
59Apply these rules:
60
61- If `good_job` is active, keep `good_job` conventions.
62- If `solid_queue` is active, keep `solid_queue` conventions.
63- If both gems exist, treat the configured adapter as authoritative.
64- Do not migrate queue backend implicitly as part of unrelated tasks.
65- Write backend-agnostic `ApplicationJob` code unless backend features are explicitly requested.
66
67## Reference Routing
68
69Load references based on the task:
70
71- Code style, formatting, naming conventions, and fail-fast policy: `STYLE.md`
72- Baseline Rails 8 defaults and upgrade constraints: `references/01-baseline-rails-8.md`
73- Naming, layering, and code organization: `references/02-naming-and-structure.md`
74- Active Record, migrations, and data modeling: `references/03-models-and-data.md`
75- Controllers, params, and request flow: `references/04-controllers-and-params.md`
76- REST resources and routes: `references/05-routes-rest-and-resources.md`
77- Hotwire, Turbo, and Stimulus patterns: `references/06-hotwire-turbo-stimulus.md`
78- Job architecture and adapter detection: `references/07-background-jobs-overview.md`
79- GoodJob-specific patterns: `references/07a-background-jobs-good_job.md`
80- Solid Queue-specific patterns: `references/07b-background-jobs-solid_queue.md`
81- Performance and caching strategy: `references/08-performance-caching-and-db.md`
82- Security review checklist: `references/09-security-checklist.md`
83- Test strategy and quality gates: `references/10-testing-strategy.md`
84- API-only and mixed-mode API patterns: `references/11-api-mode-and-serialization.md`
85- 37signals-inspired style profile: `references/12-37signals-inspired-profile.md`
86- Code quality thresholds and detection patterns: `references/13-code-quality-gates.md`
87
88## Authentication Patterns
89
90Prefer Rails 8.1 built-in authentication. When implementing custom auth:
91
92- Use password-based authentication with bcrypt via `has_secure_password`.
93- Use magic link codes (not full magic link URLs) for account confirmation and email verification.
94- Follow 37signals naming: `Identity` (global email-based), `User` (per-account membership), `Session`.
95- Rate limit authentication endpoints aggressively.
96- Store sessions via signed cookies with `httponly` and `same_site: :lax`.
97
98## Output Contract
99
100For implementation tasks, produce:
101
1021. Required schema changes with migrations.
1032. Model/controller/view/job code following local conventions.
1043. Tests matching local framework.
1054. Brief risk notes (security, performance, rollout concerns).
106
107For review tasks, prioritize:
108
1091. Correctness and behavioral regressions.
1102. Security and data integrity.
1113. Performance and operability.
1124. Test gaps.