Code review
AuraScore 83/100

Monolith Extraction Refactoring Review Specification

Review extracted modular code to eliminate circular dependencies, architectural coupling, and anti-patterns.

Apply this template when reviewing domain refactors or microservice carve-outs from monolithic codebases. It ensures clean separation of concerns and structural maintainability.

Template

Role: Lead Software Architect specializing in domain-driven design, legacy decoupling, and technical debt reduction.

Context

  • Core monolithic component: {{monolith_component}}
  • Modern target runtime framework: {{target_framework}}
  • Code diff extracted for migration: {{extracted_module_patch}}
  • Maximum allowable cyclomatic complexity: {{cyclomatic_threshold}}
  • Dependency injection container: {{dependency_injection_framework}}
  • Automated test coverage baseline: {{test_coverage_baseline}}

Task

Author an architectural refactoring review specification evaluating module boundaries, interface cohesion, and structural coupling to ensure clean extraction from the legacy codebase.

Method

  1. Map direct import graphs in {{extracted_module_patch}} to identify hidden circular dependencies.
  2. Calculate cyclomatic complexity across new functions against {{cyclomatic_threshold}}.
  3. Inspect inversion-of-control wiring inside {{dependency_injection_framework}} for accidental singleton leaks.
  4. Audit domain boundary encapsulation between {{monolith_component}} and newly formed domain services.
  5. Verify that database transactional boundaries do not span across decoupled package interfaces.
  6. Evaluate automated test suites to ensure compliance with {{test_coverage_baseline}}.
  7. Formulate interface segregation rules to prevent leaking legacy domain entities into {{target_framework}}.

Constraints

  • MUST flag any shared mutable globals lingering from {{monolith_component}}.
  • MUST NOT approve direct database access calls that bypass the extracted repository interfaces.
  • Limit architectural deviation exceptions to a maximum of two documented items.
  • All suggested interface signatures must follow {{target_framework}} idiomatic standards.

Output format

  1. Architectural Decoupling Audit (Table: Interface, Coupling Score, Boundary Violation, Action)
  2. Complexity and Anti-Pattern Diagnostics (Bulleted technical teardown with function references)
  3. Interface Contract Adjustments (Exact method signatures and inversion wiring specs)
  4. Test Coverage Gap Plan (Targeted unit and integration test definitions)

Self-review

  • Checked that zero direct references to legacy internal classes leak into {{target_framework}}?
  • Validated that cyclomatic metrics strictly respect {{cyclomatic_threshold}}?
  • Verified regression risks are covered against {{test_coverage_baseline}}?
AuraScore breakdown
83/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 engineering12/12 · Strong

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
refactoring
architecture
code-review