Architecture review lens

From event4u-app/agent-config · View interactive version

Architecture review lens is an AI agent skill from the GitHub repository event4u-app/agent-config. Use when a diff may break system boundaries, dependency direction, or cross-service contracts — fifth judge dispatched by /review-changes alongside the four standard judges.

How to use this skill

Skill file

architecture-review-lens

Fifth judge in the /review-changes family. Reviews a diff for

architectural fit, not correctness, security, tests, or style.

Catches what the other four miss: layer violations, wrong

dependency direction, leaking abstractions, and broken cross-service

contracts. Sibling of CODE0

et al. — never overlaps.

When to use

the domain layer?", or "is this leaking storage details?".

Do NOT use when:

CODE0.

CODE0.

CODE0.

to CODE0 first.

Procedure

1. Anchor on the system shape

Read the codebase's stated architecture (ADRs, AGENTS.md, module

docs). If no shape is documented, infer it from folder structure

and surface the gap. You are judging the diff against **the stated

shape**, not a fantasy ideal.

2. Inspect each changed file for fit

For every changed file, answer:

| Question | Smell when "no" |

|---|---|

| Does this file live in the right layer? | Layer violation |

| Are imports flowing in the allowed direction? | Inverted dependency |

| Does this leak a storage / framework detail? | Leaky abstraction |

| Is the public API of the module still the same? | Contract drift |

| Does a cross-service call respect its contract? | Contract break |

Each smell is a finding with a file:line citation.

3. Check the seams

Pay special attention to:

Cross-module / cross-service additions are the highest-leverage

findings — surface them even at low individual severity.

4. Issue a verdict per the judge contract

| Verdict | When |

|---|---|

| apply | No architectural concerns; diff fits the stated shape |

| revise | Findings exist; diff lands after the listed fixes |

| reject | Architectural shape itself must be reconsidered (rare) |

reject requires citing which ADR or stated shape would need to

change — never reject for taste.

5. Validate the verdict

Verify before emitting: every finding has a file:line citation and

a smell label from the taxonomy; the verdict matches the worst

finding (revise if any finding exists, apply only when none);

reject cites the ADR or stated shape that would need to change.

Ensure no finding restates a concern owned by another judge.

Output format

The verdict block carries these ordered fields:

  1. Judge: — fixed value architecture-review-lens
  2. Model: and Target: — model id from .agent-settings.yml and diff range
  3. Verdict: — exactly one of apply / revise / reject
  4. Issues: — numbered list, each with file:line, smell label, suggested fix
Judge:  architecture-review-lens
Model:  <model id from .agent-settings.yml>
Target: <branch / diff range>

Verdict: apply | revise | reject

Issues:
1. 🔴 <finding>           file:line
   Smell: layer-violation | inverted-dep | leak | contract-drift | contract-break
   Suggested fix: <one sentence>
2. 🟡 ...
3. 🟢 ...

Gotcha

break it, do NOT raise a finding — recommend an ADR via

decision-record and approve the diff.

to judge-code-quality.

finding before issuing it.

Do NOT

other judges.

would need to change.

diff did not introduce them; this is a diff-judge, not a

codebase-audit.

to see which lens raised each one.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.