Review Architecture
Quick Reference
| Area |
What to check |
| Controllers |
Coordinate only — no domain logic |
| Models |
Own persistence + cohesive domain rules, not orchestration |
| Services |
Create real boundaries, not just moved code |
| Callbacks |
Small and unsurprising — no hidden business logic |
| Concerns |
One coherent capability per concern |
| External integrations |
Behind dedicated collaborators |
HARD-GATE (Authoritative Verification Rule)
DO NOT list findings that do not survive code-level confirmation.
Verify each High-severity finding by reading the actual code to confirm it is a real structural problem.
If verification reveals it is not genuine, downgrade it or remove it entirely.
If no source files were provided or read, do not invent High findings. Return an
architecture review checklist or assumptions block instead, and say code-level
confirmation is required before reporting findings.
SECRET SAFETY: code-level evidence must never reproduce secrets, tokens, API
keys, passwords, private keys, session cookies, or credential values. If a file
contains a hard-coded secret, report only the file/path, symbol name, credential
type, and a redacted fingerprint such as `[REDACTED_API_KEY]`; do not quote the
literal value.
Core Process
Use this skill when the task is to review or improve the structure of a Rails application or library.
Core principle: Prioritize boundary problems over style. Prefer simple objects and explicit flow over hidden behavior.
Review Order
- Identify the main entry points: controllers, jobs, models, services.
- Check where domain logic lives.
- Inspect model responsibilities, callbacks, and associations.
- Inspect controller size and orchestration.
- Read every concern, helper, and presenter: does it do one coherent thing, or does it mix auditing + notifications + emails + external API calls? Mixed concerns are High or Medium severity depending on blast radius. Treat any concern used by only one class as a candidate for deletion — inline it instead.
- Check whether abstractions clarify the design or only move code around.
- Verify each High-severity finding per the HARD-GATE above — confirm real structural problem, redact any credential-like values found.
Severity Levels
High-Severity Findings
- Business logic hidden in callbacks or broad concerns
- Controllers orchestrating multi-step domain workflows inline
- Models coupled directly to HTTP, jobs, mailers, or external APIs
- Abstractions that add indirection without a clear responsibility
- Cross-layer constant reach that makes code hard to change
Medium-Severity Findings
- Duplicated workflow logic across controllers or jobs
- Scopes or class methods carrying too much query or policy logic
- Helpers or presenters leaking domain behavior
- Service objects wrapping trivial one-liners
- Concerns combining unrelated responsibilities — check EVERY concern in the app
Output Style
- Scope: State that the task is an architecture/structure review, not style review, and identify the Rails entry points inspected.
- Order: Begin with entry points. Then write findings ordered by review area.
- Boundary-first lens: Prioritize where domain logic lives, whether flow is explicit, and whether abstractions clarify the design or only move code around.
- Finding Structure: Every finding uses a four-field structure:
**Severity:** High
**Affected file:** app/controllers/orders_controller.rb — OrdersController#create
**Risk:** Controller runs a 5-step domain workflow. Partial state on failure; untestable without HTTP.
**Improvement:** Extract to Orders::CreateOrder.call(params). Controller handles response/redirect only.
- High-severity verification: For every High finding, state the concrete code-level evidence read (per HARD-GATE). Redact any secret-like literal. Never use representative file paths or fabricated line numbers as evidence.
- Completeness: For each finding include severity, affected files or area, why the structure is risky, and the smallest credible improvement. Then list open assumptions and recommended next refactor steps.
- Language: Must be in English unless explicitly requested otherwise.
Integration
| Skill |
When to chain |
| code-review |
For smaller scopes and PR reviews |
Extended Resources (Progressive Disclosure)
Load these files only when their specific content is needed:
- assets/examples.md — Use when you need complete architecture review examples with findings and recommendations
- assets/findings_schema.json — Use when you need the structured JSON schema for architecture review findings output
1---2name: review-architecture3description: Use when reviewing Rails structure, fat models or controllers, or service boundaries. Trigger words: architecture, fat model, fat controller, boundaries, tech debt.4license: MIT5---67# Review Architecture89## Quick Reference1011| Area | What to check |12|------|---------------|13| Controllers | Coordinate only — no domain logic |14| Models | Own persistence + cohesive domain rules, not orchestration |15| Services | Create real boundaries, not just moved code |16| Callbacks | Small and unsurprising — no hidden business logic |17| Concerns | One coherent capability per concern |18| External integrations | Behind dedicated collaborators |1920## HARD-GATE (Authoritative Verification Rule)2122```text23DO NOT list findings that do not survive code-level confirmation.24Verify each High-severity finding by reading the actual code to confirm it is a real structural problem.25If verification reveals it is not genuine, downgrade it or remove it entirely.26If no source files were provided or read, do not invent High findings. Return an27architecture review checklist or assumptions block instead, and say code-level28confirmation is required before reporting findings.29SECRET SAFETY: code-level evidence must never reproduce secrets, tokens, API30keys, passwords, private keys, session cookies, or credential values. If a file31contains a hard-coded secret, report only the file/path, symbol name, credential32type, and a redacted fingerprint such as `[REDACTED_API_KEY]`; do not quote the33literal value.34```3536## Core Process3738Use this skill when the task is to review or improve the structure of a Rails application or library.3940**Core principle:** Prioritize boundary problems over style. Prefer simple objects and explicit flow over hidden behavior.4142### Review Order43441. Identify the main entry points: controllers, jobs, models, services.452. Check where domain logic lives.463. Inspect model responsibilities, callbacks, and associations.474. Inspect controller size and orchestration.485. Read every concern, helper, and presenter: does it do one coherent thing, or does it mix auditing + notifications + emails + external API calls? Mixed concerns are High or Medium severity depending on blast radius. **Treat any concern used by only one class as a candidate for deletion — inline it instead.**496. Check whether abstractions clarify the design or only move code around.507. **Verify each High-severity finding** per the HARD-GATE above — confirm real structural problem, redact any credential-like values found.5152### Severity Levels5354#### High-Severity Findings5556- Business logic hidden in callbacks or broad concerns57- Controllers orchestrating multi-step domain workflows inline58- Models coupled directly to HTTP, jobs, mailers, or external APIs59- Abstractions that add indirection without a clear responsibility60- Cross-layer constant reach that makes code hard to change6162#### Medium-Severity Findings6364- Duplicated workflow logic across controllers or jobs65- Scopes or class methods carrying too much query or policy logic66- Helpers or presenters leaking domain behavior67- Service objects wrapping trivial one-liners68- Concerns combining unrelated responsibilities — check EVERY concern in the app6970## Output Style71721. **Scope**: State that the task is an architecture/structure review, not style review, and identify the Rails entry points inspected.732. **Order**: Begin with entry points. Then write findings ordered by review area.743. **Boundary-first lens**: Prioritize where domain logic lives, whether flow is explicit, and whether abstractions clarify the design or only move code around.754. **Finding Structure**: Every finding uses a four-field structure:76 ```text77 **Severity:** High78 **Affected file:** app/controllers/orders_controller.rb — OrdersController#create79 **Risk:** Controller runs a 5-step domain workflow. Partial state on failure; untestable without HTTP.80 **Improvement:** Extract to Orders::CreateOrder.call(params). Controller handles response/redirect only.81 ```825. **High-severity verification**: For every High finding, state the concrete code-level evidence read (per HARD-GATE). Redact any secret-like literal. Never use representative file paths or fabricated line numbers as evidence.836. **Completeness**: For each finding include severity, affected files or area, why the structure is risky, and the smallest credible improvement. Then list open assumptions and recommended next refactor steps.847. **Language**: Must be in English unless explicitly requested otherwise.8586## Integration8788| Skill | When to chain |89|-------|---------------|90| **code-review** | For smaller scopes and PR reviews |9192## Extended Resources (Progressive Disclosure)9394Load these files only when their specific content is needed:9596- **[assets/examples.md](assets/examples.md)** — Use when you need complete architecture review examples with findings and recommendations97- **[assets/findings_schema.json](assets/findings_schema.json)** — Use when you need the structured JSON schema for architecture review findings output