{"slug":"architecture-review-criteria","title":"architecture-review-criteria","summary":"Use when reviewing DESIGN artefacts (event models, ADRs, component diagrams, context maps, interface contracts) for quality, DDD compliance, and architectural correctness. Contains gate definitions and scoring rubric for the solution-architect-reviewer lenses.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-11-29T00:42:28.247969Z","repo":{"url":"https://github.com/SebastienDegodez/skraft-plugin","stars":17,"forks":3,"license":"GPL-3.0","updatedAt":"2026-11-29T00:18:21Z"},"bodyHtml":"<hr>\n<h2>name: architecture-review-criteria\ndescription: Use when reviewing DESIGN artefacts (event models, ADRs, component diagrams, context maps, interface contracts) for quality, DDD compliance, and architectural correctness. Contains gate definitions and scoring rubric for the solution-architect-reviewer lenses.</h2>\n<h1>Architecture Review Criteria</h1>\n<h2>Overview</h2>\n<p>17 gates across 3 lenses, plus 1 cross-cutting escalation gate, applied by the <code>solution-architect-reviewer</code> agent to DESIGN artefacts. Gates enforce DDD correctness, Clean Architecture compliance, fitness for the stories in scope, cross-artefact consistency, the refusal of any ADR the eligibility gate does not admit, conditional security criteria, the ban on deciding an open product <code>Unknown:</code>, and the integrity of the human-escalation protocol.</p>\n<p><strong>Applied by:</strong> <code>solution-architect-reviewer</code>\n<strong>Applied to:</strong> ADRs, event models, component diagrams, context maps, interface contracts, consistency matrices, supersession plans, supersession registry, blocker files\n<strong>Prior phase required:</strong> DESIGN artefacts from <code>solution-architect</code></p>\n<hr>\n<h2>Gate Definitions</h2>\n<p><strong>Ratification timing.</strong> The review runs before human ratification (<code>architecture-decisions</code> → Ratification Contract), so every ADR the DESIGN pass under review wrote is still <code>Proposed</code>. Wherever a gate below requires an <code>Accepted</code> ADR, a <code>Proposed</code> ADR of the pass under review satisfies it. Wherever a gate forbids an <code>Accepted</code> ADR, it forbids a <code>Proposed</code> ADR of that pass too. <code>Accepted</code> is required only at the ratification checkpoint, never by this review.</p>\n<p><strong>Structural scan.</strong> The DESIGN structural signatures run as <code>structural-scan.mjs</code>; G1 and G14 read its JSON report, never a hand-typed grep.</p>\n<h3>Lens 1 — consistency-lens</h3>\n<p>Evaluates: ADRs + supersession registry + diagrams + contracts + consistency matrices + supersession plans + blockers</p>\n<table>\n<thead>\n<tr>\n<th>Gate</th>\n<th>Definition</th>\n<th>Pass condition</th>\n<th>Severity</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>G1</td>\n<td>Every structural commitment — whether visible in a diagram OR detected in the existing codebase by <code>structural-scan.mjs</code> (<code>ICommandBus\\|IQueryBus\\|CommandBus\\|QueryBus</code>, <code>IEventStore\\|EventStream\\|Apply\\(.*Event</code>, <code>Saga\\|ProcessManager\\|ICorrelatedBy</code>; cross-context ACL by manual review) — is traced to an ADR (<code>Accepted</code>, or <code>Proposed</code> in the pass under review) or to a row of the matrix eligibility-gate table (verdict, deciding question, where the choice is written). Zero ADRs is a valid outcome; a gate-refused candidate never needs an ADR.</td>\n<td>Every structural element in diagrams AND every commitment the structural scan detects has an ADR or a gate row.</td>\n<td>BLOCKER</td>\n</tr>\n<tr>\n<td>G2</td>\n<td>No two ADRs contradict each other. If one supersedes another, the supersession is recorded BOTH (a) inside the new ADR's body as <code>**Supersedes:** ADR-{MMM}</code> AND (b) as a row in the append-only <code>docs/adr/supersessions.md</code> registry. The superseded ADR file itself is never edited.</td>\n<td>Zero contradicting <code>Accepted</code> decisions; for every supersession link, both registry row and new-ADR body line exist.</td>\n<td>BLOCKER</td>\n</tr>\n<tr>\n<td>G10</td>\n<td>A <code>consistency-matrix-{story}.md</code> exists for every story under design, and its <code>consistency-gate</code> line is <code>PASS</code>. The back-propagation journal explains every rewrite.</td>\n<td>One matrix per story, all marked PASS, journals filled.</td>\n<td>BLOCKER</td>\n</tr>\n<tr>\n<td>G12</td>\n<td>Every row in a <code>supersession-plan-{story}.md</code> is realised: (a) new ADR contains the <code>**Supersedes:**</code> body line, (b) registry row exists in <code>docs/adr/supersessions.md</code>, (c) no descriptive artefact still cites the superseded ADR as its source of truth.</td>\n<td>All three conditions hold for every planned supersession.</td>\n<td>BLOCKER</td>\n</tr>\n<tr>\n<td>G14</td>\n<td>No ADR encodes the verdict in the FILENAME: filenames must name the topic (<code>adr-NNN-event-sourcing.md</code>), never carry a verdict suffix (<code>*-rejected.md</code>, <code>*-accepted.md</code>, <code>*-deprecated.md</code>, <code>*-superseded.md</code>). The verdict belongs in the <code>Status:</code> frontmatter (<code>Proposed \\| Accepted \\| Rejected \\| Deprecated \\| Superseded</code>). A <code>Status: Rejected</code> ADR is admissible IFF a story or measurable force in this batch raised the question (per G9 traceability) AND the <code>Alternatives Rejected</code> section lists the option that was adopted instead. A <code>Rejected</code> ADR with no triggering story is a non-decision artefact.</td>\n<td>Zero verdict-bearing filenames; every <code>Status: Rejected</code> ADR traces to a triggering story and names the adopted alternative.</td>\n<td>BLOCKER</td>\n</tr>\n<tr>\n<td>G16</td>\n<td>When <code>contracts-{story}.md</code> introduces an interface/hook that is comparable to an existing one already accepted for a similar responsibility (same category of consumer — e.g. two React hooks each wrapping a query interface, two repository implementations for sibling aggregates), its state/return/error shape follows the same convention (loading/error/data shape, Result-vs-throw, naming of the exposed fields) unless an ADR explicitly documents and justifies the divergence.</td>\n<td>Every comparable pair of interfaces/hooks in <code>contracts-{story}.md</code> shares its shape convention, OR the divergence is covered by an <code>Accepted</code> ADR or a <code>Proposed</code> ADR of the pass under review.</td>\n<td>HIGH</td>\n</tr>\n</tbody>\n</table>\n<h3>Lens 2 — architecture-compliance-lens</h3>\n<p>Evaluates: diagrams + contracts + event models</p>\n<table>\n<thead>\n<tr>\n<th>Gate</th>\n<th>Definition</th>\n<th>Pass condition</th>\n<th>Severity</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>G3</td>\n<td>Dependency rule: Domain and Application layers have no dependencies on Infrastructure or API layers.</td>\n<td>Zero imports of Infrastructure or API types in Domain or Application contracts.</td>\n<td>BLOCKER</td>\n</tr>\n<tr>\n<td>G4</td>\n<td>All application interfaces (repositories, gateways, event publishers) are defined in the Domain or Application layer — the layer the contracts record — and never in Infrastructure. A repository interface in Domain is valid.</td>\n<td>Zero infrastructure-defined interfaces in contracts. Every I* interface is tagged Domain or Application, and diagrams agree.</td>\n<td>BLOCKER</td>\n</tr>\n<tr>\n<td>G5</td>\n<td>Each aggregate enforces its own invariants. No aggregate enforces invariants that belong to another aggregate.</td>\n<td>Zero cross-aggregate invariant references in contracts or diagrams.</td>\n<td>HIGH</td>\n</tr>\n<tr>\n<td>G6</td>\n<td>Context map declares every inter-context relationship with an explicit pattern (ACL, Conformist, Shared Kernel, Partnership, Open Host Service, Published Language) AND every label is admissible: (a) no relationship labelled <code>Conformist</code> has a <strong>Core</strong> subdomain as its downstream; (b) no relationship labelled <code>Conformist</code> is in fact a published contract consumed with a local copy or translation (that is OHS/PL upstream + ACL downstream, see V-DDD-09 / V-DDD-10).</td>\n<td>Zero unlabelled arrows between bounded contexts in context-map.md AND zero inadmissible labels.</td>\n<td>HIGH</td>\n</tr>\n</tbody>\n</table>\n<h3>Lens 3 — fitness-lens</h3>\n<p>Evaluates: diagrams + contracts + stories + ADRs</p>\n<table>\n<thead>\n<tr>\n<th>Gate</th>\n<th>Definition</th>\n<th>Pass condition</th>\n<th>Severity</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>G7</td>\n<td>Every story from DISCUSS maps to at least one trigger (Command or Query) in the event model. Pure-read stories use a Query; state-changing stories use a Command. A trigger enters from outside the use case (a user, another context, the clock, the application start): a step inside one use case is no trigger and needs no Command or Query.</td>\n<td>All story IDs from stories-.md appear in at least one event model slice as a Command or Query.</td>\n<td>HIGH</td>\n</tr>\n<tr>\n<td>G8</td>\n<td>Every <strong>Command</strong> has at least one domain event for its successful outcome. Queries are exempt from this gate. No dangling commands. A rejection that changes no state is an error result of the Command, not a domain event; a rejection the business records or reacts to is a domain event. Neither is required.</td>\n<td>Zero Commands without a domain event for their successful outcome. Queries do not need events.</td>\n<td>HIGH</td>\n</tr>\n<tr>\n<td>G9</td>\n<td>No aggregate, repository, domain event, bounded context, Event Sourcing adoption, or Saga is introduced without a traceable story justification.</td>\n<td>Zero unjustified architectural elements. Every element traces back to a story ID.</td>\n<td>MEDIUM</td>\n</tr>\n<tr>\n<td>G11</td>\n<td>Every ADR adopting a complexity-adding pattern from <code>{CQRS, Event Sourcing, Saga, eventual consistency, micro-service split, ACL}</code> cites at least one admissible force in its Context AND has a <code>\"do without the pattern\"</code> row in <code>Alternatives Rejected</code>. <code>\"Consistency with existing code\"</code> alone is not admissible.</td>\n<td>Admissible force present + <code>\"do without\"</code> alternative evaluated for every complexity-adding ADR.</td>\n<td>HIGH</td>\n</tr>\n<tr>\n<td>G15</td>\n<td>Every <code>Proposed</code> ADR of the pass under review passes <code>adr-eligibility-gate</code> (Q1–Q5): none restates the baseline, a choice an existing doc or <code>Accepted</code> ADR settles, a context relationship, a choice confined to one bounded context, a future need or the Command/Query classification. Each lists its ranked priorities before its options and judges every option against them.</td>\n<td>Zero ADRs failing the gate; the finding cites the deciding question and its fix is deleting the ADR and writing the choice in place.</td>\n<td>HIGH</td>\n</tr>\n<tr>\n<td>G17</td>\n<td>Triggered only when the stories involve authentication or authorization, personal data, or an externally exposed interface: the contracts name who may invoke each exposed Command and Query, mark personal-data fields, validate external input at the boundary, and carry no secret.</td>\n<td>All four hold, or the trigger is absent (<code>not applicable</code>).</td>\n<td>HIGH</td>\n</tr>\n<tr>\n<td>G18</td>\n<td>No artefact decides an <code>Unknown:</code> of the research product questions that has no <code>Decision:</code> line under it, and none states a business rule absent from the stories, the recorded decisions and the code.</td>\n<td>Zero design elements depending on an open <code>Unknown:</code> or an unstated rule.</td>\n<td>BLOCKER</td>\n</tr>\n</tbody>\n</table>\n<hr>\n<h3>Cross-cutting — escalation gate</h3>\n<p>Evaluates: every <code>decision-drift-*.md</code> file under <code>.copilot-tracking/skraft-plans/{projectSlug}/blockers/{date}/</code></p>\n<table>\n<thead>\n<tr>\n<th>Gate</th>\n<th>Definition</th>\n<th>Pass condition</th>\n<th>Severity</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>G13</td>\n<td>Every blocker file under <code>blockers/{date}/</code> has a sibling <code>-resolution.md</code> file containing the human's chosen answer. Open blockers (no sibling) mean the human owes an answer; the review is <strong>not</strong> the place to skip past that.</td>\n<td>For every <code>decision-drift-{story}-{NNN}.md</code>, a sibling <code>decision-drift-{story}-{NNN}-resolution.md</code> exists.</td>\n<td>BLOCKER (short-circuit)</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Behaviour:</strong> If G13 fails, the reviewer returns <code>REJECTED</code> immediately and does NOT evaluate any other gate. The verdict's <code>synthesis.blocking_findings</code> lists the open blocker files; the orchestrator's next action must be human escalation, not retry.</p>\n<hr>\n<h2>Severity Definitions</h2>\n<table>\n<thead>\n<tr>\n<th>Severity</th>\n<th>Definition</th>\n<th>Impact</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>BLOCKER</strong></td>\n<td>Fundamental violation that invalidates the architecture. Cannot proceed to DISTILL.</td>\n<td>Forces <code>rejected</code> verdict</td>\n</tr>\n<tr>\n<td><strong>HIGH</strong></td>\n<td>Significant flaw that will cause problems in DISTILL or implementation. Requires correction.</td>\n<td>Forces <code>changes_requested</code> verdict</td>\n</tr>\n<tr>\n<td><strong>MEDIUM</strong></td>\n<td>Design smell or sub-optimal choice. Correction recommended before DISTILL.</td>\n<td>Forces <code>changes_requested</code> verdict</td>\n</tr>\n<tr>\n<td><strong>LOW</strong></td>\n<td>Minor inconsistency or style issue. Can be noted and tracked.</td>\n<td>May still yield <code>approved</code> with notes</td>\n</tr>\n</tbody>\n</table>\n<hr>\n<h2>Verdict Derivation Table</h2>\n<table>\n<thead>\n<tr>\n<th>Condition</th>\n<th>Verdict</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Any blocker file under <code>blockers/{date}/</code> has no sibling <code>-resolution.md</code> (G13)</td>\n<td><code>REJECTED</code> — escalation pending, human must answer</td>\n</tr>\n<tr>\n<td>≥1 BLOCKER finding</td>\n<td><code>rejected</code></td>\n</tr>\n<tr>\n<td>≥1 HIGH finding, 0 BLOCKERs</td>\n<td><code>changes_requested</code></td>\n</tr>\n<tr>\n<td>MEDIUM findings only, 0 HIGH, 0 BLOCKER</td>\n<td><code>changes_requested</code></td>\n</tr>\n<tr>\n<td>LOW findings only</td>\n<td><code>approved</code> (with notes)</td>\n</tr>\n<tr>\n<td>Zero findings</td>\n<td><code>approved</code></td>\n</tr>\n</tbody>\n</table>\n<hr>\n<h2>DDD Compliance Rules Summary</h2>\n<ol>\n<li>Aggregates are identified by the invariants they enforce, not by their data</li>\n<li>Cross-aggregate references use IDs only — never object references</li>\n<li>Domain events are raised by aggregate roots, not application services</li>\n<li>Repository interfaces live in Domain when it persists an aggregate, Application for a CRUD entity or a read model — never Infrastructure; the contracts record the layer</li>\n<li>Bounded context boundaries map to language boundaries — if the same word means different things, there is a boundary</li>\n<li>Context map relationships are explicit and labelled — implicit dependencies are forbidden</li>\n<li>Subdomains are classified (Core/Supporting/Generic) and the investment level is justified</li>\n<li>A Core subdomain is never the downstream of a <code>Conformist</code> relationship — it protects its Ubiquitous Language via an ACL. Consuming a published contract (ViewModel/event/DTO) with a local copy or translation is OHS/PL + ACL, never Conformist, regardless of how trivial the translation is</li>\n</ol>\n<hr>\n<h2>YAGNI Detection Heuristics</h2>\n<p>Apply during G9 evaluation:</p>\n<table>\n<thead>\n<tr>\n<th>Element</th>\n<th>Question to ask</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>New bounded context</td>\n<td>Which story requires this context to be separate?</td>\n</tr>\n<tr>\n<td>New aggregate</td>\n<td>Which invariant must hold across successive or concurrent changes of one identity, and which story produces them? An invariant checked once at construction belongs to a self-validating value object or a first-class collection.</td>\n</tr>\n<tr>\n<td>Repository</td>\n<td>Which aggregate does it persist? A source read once, at start, sits behind an Application loading interface.</td>\n</tr>\n<tr>\n<td>Domain event</td>\n<td>Which story observes it, or which business fact does it record? A rejection that changes no state is an error result.</td>\n</tr>\n<tr>\n<td>Event Sourcing</td>\n<td>Which story requires audit trail or temporal queries?</td>\n</tr>\n<tr>\n<td>Saga</td>\n<td>Which cross-aggregate workflow spans multiple stories?</td>\n</tr>\n<tr>\n<td>ACL</td>\n<td>Which conflicting model in the upstream context makes translation necessary, OR is the downstream a Core subdomain protecting its Ubiquitous Language?</td>\n</tr>\n</tbody>\n</table>\n<p>If the answer is \"none\" or \"future needs\" — flag as G9 MEDIUM violation.</p>\n<hr>\n<h2>References</h2>\n<ul>\n<li><a href=\"references/gate-definitions.md\">gate-definitions.md</a> — Detailed checklist per gate (G1–G16; G15, G17 and G18 are defined in full above) with step-by-step checks</li>\n<li><a href=\"references/ddd-violations.md\">ddd-violations.md</a> — 10 DDD violation patterns detectable in artefacts</li>\n<li><a href=\"references/clean-arch-violations.md\">clean-arch-violations.md</a> — 8 Clean Architecture violations detectable in contracts and diagrams</li>\n<li><a href=\"references/verdict-rubric.md\">verdict-rubric.md</a> — Verdict derivation, confidence levels, and 3 example review verdicts</li>\n</ul>\n","files":[{"path":"references/clean-arch-violations.md","sizeBytes":9012,"isText":true},{"path":"references/ddd-violations.md","sizeBytes":12915,"isText":true},{"path":"references/gate-definitions.md","sizeBytes":23666,"isText":true},{"path":"references/verdict-rubric.md","sizeBytes":7711,"isText":true},{"path":"SKILL.md","sizeBytes":14047,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-11-29T00:43:37.586707Z","sha256":"4D00EB7135C621F4530775B296CDAF0288935DB7EF2C46E181E1FA07710E9676","sizeBytes":23988},"review":null,"source":{"repositoryUrl":"https://github.com/SebastienDegodez/skraft-plugin","path":"plugins/skraft-framework/skills/architecture-review-criteria","license":"GPL-3.0","commit":"c6117c6236a25490bf1916b131866069740c9b22","subtreeSha":"C5CD46203D3FC62814F0FAFACBBDCB8564C42E0B7D21A2EFAAEAF5AF3752E432","lastSyncedAt":"2026-11-29T00:42:27.348488Z"},"reviewedAt":"2026-11-29T00:46:16.071817Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/SebastienDegodez/skraft-plugin/tree/main/plugins/skraft-framework/skills/architecture-review-criteria"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install sebastiendegodez-skraft-plugin@llmmart"},{"target":"git","command":"git clone https://github.com/SebastienDegodez/skraft-plugin.git"}]}