brand
context
industry
strategy
AaaS
Skip to main content
Academy/Action Pack
🎯 Action PackintermediateFree

Architecture Review Agent

The Architecture Review Agent analyzes codebase architecture, identifies anti-patterns and technical debt, and suggests refactoring opportunities with prioritized ADRs and C4 model diagrams.

codingarchitecturereviewdesign-patternstechnical-debtcode-analysisrefactoringc4-model

6 Steps

  1. 1

    Set up the Environment: Install necessary Python libraries for static analysis, dependency graph generation, and C4 model diagram creation. This example uses `pyan3` for dependency analysis, `radon` for code metrics, and `plantuml` for diagram generation. Adjust based on your specific needs and language.

  2. 2

    Analyze Dependencies: Use `pyan3` to generate a dependency graph of your codebase. This will help identify circular dependencies and high-coupling areas.

  3. 3

    Assess Code Metrics: Employ `radon` to calculate code metrics like Cyclomatic Complexity and Maintainability Index. High complexity and low maintainability often indicate areas needing refactoring.

  4. 4

    Identify Anti-Patterns: Manually review the dependency graph and code metrics output. Look for:

  5. 5

    Generate C4 Model Diagrams: Create C4 model diagrams (Context, Container, Component, Code) to visualize the architecture. Use PlantUML or similar tools to generate diagrams from text descriptions. This step requires manual creation of the PlantUML files based on your architecture.

  6. 6

    Prioritize Refactoring: Prioritize refactoring opportunities based on technical debt cost (effort to fix) and business risk (impact of the issue). Create Architectural Decision Records (ADRs) for each prioritized item.

Ready to run this action pack?

Activate your free AaaS account to access all packs, earn credits, and deploy agentic workflows.

Get Started Free →