A comprehensive, systematic review process for Ruby on Rails pull requests, enforcing Rails 8/Turbo 8 conventions, Basecamp coding guidelines, and deep technical checks for correctness, security, and performance.
To provide a rigorous, standard-setting review for Rails applications. This playbook ensures that every Pull Request aligns with the "Rails Omakase" philosophy, leverages modern Turbo 8 features (like Morphing), maintains high security/database standards, and includes robust test coverage.
pull_requests and code from the repository.Input: github_pr_url
Output: pr_context
Gate: none
On error: abort
AGENTS.md, CONTRIBUTING.md, README.md, or any /docs/architecture/ files.Input: pr_context
Output: intent_analysis
Gate: none
On error: abort
Input: pr_context
Output: file_analysis
Gate: none
On error: continue
github_read_file to see the full content of related files:
@variables and any Stimulus controllers or Turbo Frames involved.Input: file_analysis
Output: rails_convention_check
Gate: none
On error: continue
Enforce the following "Basecamp-style" conventions:
- Turbo 8 Morphing: Prefer Page Refresh Morphing (<meta name="turbo-refresh-method" content="morph">) for standard UI updates. If you see manual turbo_stream responses for simple state changes (like updating a counter or a list item), suggest a redirect/morph instead.
- Turbo Frames: Ensure frames are used for isolated interactivity (e.g., inline editing, lazy loading) and use dom_id(model) for stable IDs.
- Turbo Streams: Only use for multi-user real-time updates (via broadcasts_refreshes) or specific animations.
- Stimulus: Verify JS is used only as "sprinkles" for UI behavior. No business logic in Stimulus. Avoid keeping server-side state in the client.
Input: file_analysis
Output: arch_analysis
Gate: none
On error: continue
Enum, GlobalID) over custom reinventions.Input: file_analysis
Output: security_audit
Gate: none
On error: continue
Current.account.projects vs Project.all).permit vulnerabilities or missing required fields.Input: file_analysis
Output: db_safety_audit
Gate: none
On error: continue
.includes or .preload.validates calls have matching database-level NOT NULL or UNIQUE constraints where applicable.Input: file_analysis
Output: async_report
Gate: none
On error: continue
after_save that trigger slow external API calls or deep state changes that should be in a Service or Job.ActiveRecord::Base.transaction.Input: file_analysis
Output: test_coverage_report
Gate: none
On error: continue
nil cases, invalid inputs, and unauthorized access.Input: file_analysis
Output: ops_impact_report
Gate: none
On error: continue
flash messages or "toast" notifications after actions.Input: all_steps_output
Output: review_report
Gate: none
On error: abort
Prioritize findings over style comments. Output findings ordered by severity:
Format:
[severity] short title
- Why: Why this is a problem
- Where: File path and context
- Impact: What behavior could break
- Fix: Suggested fix or direction
Severity Levels:
- P0: Critical (Security vulnerability, data loss, immediate crash).
- P1: High (Major bug, broken flow, significant regression risk).
- P2: Medium (Correctness issue, N+1 query, maintainability problem).
- P3: Minor (Style nit, worthwhile follow-up, minor optimization).
If no issues are found, state "No issues found" and briefly list any assumptions or testing gaps.