Code review
AuraScore 81/100

Domain Boundary and Clean Architecture Review Framework

Assess pull requests for architectural coupling, domain isolation, and dependency inversion compliance.

Deploy this template when refactoring legacy modules or onboarding changes into modular domain architectures. It establishes an architectural review scaffold to detect layering violations and leaky domain abstractions.

Template

Role: Staff Software Architect specializing in domain-driven design and modular software boundaries.

Context

  • Module name: {{module_name}}
  • Current framework: {{source_framework}}
  • Target architectural pattern: {{target_architecture}}
  • Component implementation: {{code_snippet}}
  • Coupling concerns: {{coupling_concerns}}
  • Inversion rules: {{dependency_inversion_rules}}

Task

Generate an architectural code review framework that assesses {{module_name}} against {{target_architecture}}, identifying leaky abstractions and dependency inversions to safeguard clean domain boundaries.

Method

  1. Deconstruct the incoming pull request against the layering requirements of {{target_architecture}}.
  2. Identify direct dependencies from core domain logic onto infrastructure or framework layers in {{source_framework}}.
  3. Audit all entity models to confirm domain invariants are encapsulated without exposing internal state.
  4. Evaluate interface boundaries against {{dependency_inversion_rules}} to ensure proper port-and-adapter isolation.
  5. Inspect service contracts for data transfer leaks, verifying that transport DTOs do not penetrate domain layers.
  6. Cross-reference discovered architectural anti-patterns with known {{coupling_concerns}}.
  7. Compile an architectural score and refactoring blueprint to decouple infrastructure dependencies.

Constraints

  • MUST strictly enforce the dependency direction dictated by {{target_architecture}}.
  • MUST NOT accept framework-specific annotations inside core domain entities.
  • Provide concrete interface definitions for any proposed boundary decouplings.
  • Keep architectural guidance pragmatic and bounded to {{module_name}}.

Output format

  • Boundary Architecture Health Assessment (1-2 paragraphs)
  • Layer Violation Inventory (Markdown table: File/Symbol, Layer Infraction, Impact Level, Inversion Solution)
  • Refactored Port and Adapter Contracts (Interface definition code blocks)
  • Architectural Governance Criteria (4-6 pass/fail gates for CI pipeline reviews)

Self-review

  • Verify every violation maps directly to {{dependency_inversion_rules}}.
  • Ensure domain logic is free from {{source_framework}} runtime bindings.
  • Confirm refactored interfaces isolate the specific issues outlined in {{coupling_concerns}}.
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering10/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency7/10 · Adequate

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-code-review
software-engineering-debugging
architecture
clean-code
code-review