Deterministic 5-level Ruby/Rails PR review checklist for production risk and architectural depth.
Use this skill when the user asks for a Ruby (Rails API system) code review, refactor guidance, or PR feedback. The goal is to catch failure modes before they ship—not just fix style.
For each review, walk levels in order and produce findings grouped by level. Apply these gates:
Objective: enforce Ruby idioms, readability, and consistency.
Checks:
data, obj, thing, tmp; purpose-named identifiers.&&/|| appropriately, avoid present?/Rails-only helpers in hot paths, avoid awkward defensive nil checks when Ruby truthiness is sufficient.W5H (required for non-trivial changes):
Objective: ensure correct behavior for realistic inputs and boundary conditions.
Mandatory checks:
nil propagation).Questions:
Objective: ensure boundaries are real and abstractions are earned.
Rules:
Review heuristics:
Position, Policy, Validator)?Objective: ensure correctness under load, failures, and concurrency.
Focus:
Failure modes:
Objective: make the change safe to ship.
Required checks:
Exit criteria:
For each finding, include: