Skip to content
architecture-assessment logo

Architecture Assessment

architecture-assessment

Evaluates codebase architecture for patterns, anti-patterns, coupling, cohesion, scalability, and technical debt. Use when assessing system design, reviewing architecture decisions, identifying improvement areas, or preparing for major refactoring.

SKILL.md

Full skill instructions

Architecture Assessment

Systematic evaluation of codebase architecture including pattern recognition, anti-pattern detection, coupling/​cohesion analysis, scalability review, and technical debt identification.

Quick Start

Full architecture assessment:

Perform a comprehensive architecture assessment of this codebase, identifying patterns, anti-patterns, and improvement opportunities.

Pattern identification:

Identify the architectural patterns used in this project and evaluate how well they're implemented.

Technical debt analysis:

Analyze this codebase for technical debt and prioritize items for remediation.

Capabilities

1. Architecture Evaluation

Assess overall codebase architecture through structured analysis.

Evaluation Framework
1. STRUCTURE ANALYSIS
   - Directory organization
   - Module boundaries
   - Dependency flow
   - Layer separation

2. DESIGN PRINCIPLES
   - SOLID adherence
   - DRY compliance
   - Separation of concerns
   - Single responsibility

3. QUALITY ATTRIBUTES
   - Maintainability
   - Testability
   - Extensibility
   - Reliability

4. RISK ASSESSMENT
   - Complexity hotspots
   - Coupling issues
   - Change propagation
   - Failure domains
Architecture Health Score
DimensionWeightIndicators
Modularity25%Clear boundaries, low coupling, high cohesion
Maintainability25%Complexity metrics, documentation, test coverage
Scalability20%Statelessness, horizontal scaling potential
Testability15%Dependency injection, isolation, mock-ability
Security15%Input validation, auth boundaries, data protection

Scoring rubric:

  • 90-100: Excellent - Minor improvements only
  • 70-89: Good - Some areas need attention
  • 50-69: Fair - Significant improvements needed
  • Below 50: Poor - Major refactoring required

2. Pattern Recognition

Identify and evaluate architectural patterns in the codebase.

Pattern Detection Matrix
PatternDirectory IndicatorsCode Indicators
MVCmodels/, views/, controllers/Route handlers, template rendering
MVVMviewmodels/, views/Two-way binding, observable state
Clean Architecturedomain/, application/, infrastructure/Dependency inversion, use cases
Hexagonalports/, adapters/Interface-based boundaries
MicroservicesMultiple package.json, DockerfilesService-to-service communication
Event-Drivenevents/, handlers/, subscribers/Event bus, message queues
CQRScommands/, queries/Separate read/​write models
Repositoryrepositories/Data access abstraction
Pattern Evaluation Criteria

For each identified pattern, assess:

## Pattern: {Name}

### Implementation Quality
- [ ] Pattern applied consistently across codebase
- [ ] Clear boundaries between pattern components
- [ ] Dependencies flow in correct direction
- [ ] Abstractions used appropriately

### Deviations
- List specific violations or inconsistencies
- Note areas where pattern is partially implemented
- Identify technical debt from pattern drift

### Recommendations
- Specific actions to improve implementation
- Priority (High/​Medium/​Low)
- Estimated effort

See references/​architecture-patterns.md for detailed pattern analysis.


3. Anti-Pattern Detection

Identify architectural anti-patterns that harm maintainability and scalability.

Critical Anti-Patterns
Anti-PatternSymptomsImpactFix
God Class1000+ lines, 20+ methods, knows everythingUntestable, change-resistantExtract classes by responsibility
Spaghetti CodeNo clear structure, tangled dependenciesImpossible to maintainIntroduce layers, extract modules
Big Ball of MudNo architecture, everything coupledTechnical bankruptcyIncremental strangler pattern
Distributed MonolithMicroservices with shared DB, sync callsWorst of both worldsTrue service boundaries
Anemic DomainDTOs with no behavior, logic in servicesFragile, scattered logicRich domain models
Circular DependenciesA depends on B, B depends on ACannot evolve independentlyDependency inversion
Detection Commands
# Circular dependency detection
npx madge --circular src/
pydeps --show-cycles src/

# God class detection (files > 500 lines)
find src -name "*.ts" -exec wc -l {} \; | awk '$1 > 500'

# Coupling analysis
npx dependency-cruiser --output-type dot src | dot -T svg > deps.svg

See references/​anti-patterns.md for comprehensive anti-pattern catalog.


4. Coupling Analysis

Measure and evaluate coupling between modules.

Coupling Types (Worst to Best)
  1. Content Coupling - Module modifies internal data of another
  2. Common Coupling - Shared global state
  3. Control Coupling - One module controls flow of another via flags
  4. Stamp Coupling - Shared data structures with unused fields
  5. Data Coupling - Only necessary data passed (ideal)
  6. Message Coupling - Loosest, communication via messages only
Coupling Metrics
## Module Coupling Report

### Afferent Coupling (Ca) - Who depends on me?
| Module | Dependents | Risk Level |
|--------|------------|------------|
| core/​utils | 45 | HIGH - Changes break many |
| auth/​jwt | 12 | MEDIUM |
| ui/​Button | 8 | LOW |

### Efferent Coupling (Ce) - Who do I depend on?
| Module | Dependencies | Risk Level |
|--------|--------------|------------|
| pages/​Dashboard | 23 | HIGH - Fragile |
| services/​order | 8 | MEDIUM |
| utils/​format | 2 | LOW |

### Instability Index
I = Ce / (Ca + Ce)
- 0.0 = Maximally stable (many dependents, few dependencies)
- 1.0 = Maximally unstable (few dependents, many dependencies)
Coupling Reduction Strategies
StrategyWhen to UseExample
Dependency InjectionControl couplingPass dependencies via constructor
Interface SegregationStamp couplingCreate specific interfaces
Event BusControl couplingDecouple via events
FacadeMultiple dependenciesSingle entry point

See references/​metrics.md for coupling metric calculations.


5. Cohesion Assessment

Evaluate how well modules focus on single responsibilities.

Cohesion Types (Best to Worst)
  1. Functional - All elements contribute to single task (ideal)
  2. Sequential - Output of one element is input to next
  3. Communicational - Elements operate on same data
  4. Procedural - Elements related by execution order
  5. Temporal - Elements execute at same time
  6. Logical - Elements related by category, not function
  7. Coincidental - No meaningful relationship (worst)
LCOM4 Metric

Lack of Cohesion of Methods:

  • LCOM = 0: Perfect cohesion
  • LCOM = 1: Acceptable
  • LCOM > 1: Low cohesion, consider splitting

Calculation:

LCOM4 = Number of connected components in method-field graph
- Each method is a node
- Edge exists if two methods share a field
- LCOM4 = number of disconnected subgraphs
Cohesion Assessment Template
## Cohesion Analysis: {ModuleName}

### Responsibility Inventory
1. {Responsibility 1}
2. {Responsibility 2}
...

### Cohesion Evaluation
- **Type**: {Functional|Sequential|etc.}
- **LCOM Score**: {0-N}
- **Field Usage Matrix**: Show which methods use which fields

### Recommendations
- [ ] Extract {Responsibility X} to new module
- [ ] Merge related methods
- [ ] Remove unrelated functionality

6. Scalability Review

Assess architecture for horizontal and vertical scaling capability.

Scalability Dimensions
DimensionAssessment Questions
StatelessnessCan instances be added/​removed freely? Is session state externalized?
Data PartitioningCan data be sharded? Are there partition-limiting queries?
Async ProcessingAre long-running tasks queued? Can work be distributed?
Caching StrategyWhat's cached? Cache invalidation approach?
Database AccessConnection pooling? Read replicas? Query optimization?
Service DependenciesCircuit breakers? Timeouts? Graceful degradation?
Scalability Anti-Patterns
Anti-PatternImpactDetectionFix
Sticky SessionsCan't scale horizontallySession affinity configExternalize sessions (Redis)
Unbounded QueriesMemory exhaustionSELECT * without LIMITPagination, streaming
Sync Blocking CallsThroughput bottleneckLong-running HTTP callsAsync, message queues
Single Write MasterWrite bottleneckAll writes to one DBSharding, CQRS
Memory-Bound CachingNode memory limitsIn-process cacheDistributed cache
Scalability Checklist

See checklists/​scalability-checklist.md for detailed assessment.


7. Technical Debt Identification

Find, categorize, and prioritize technical debt.

Debt Categories
CategoryExamplesDetection
Architecture DebtMonolith needing split, wrong patternArchitecture review
Code DebtComplex functions, duplicates, dead codeStatic analysis
Dependency DebtOutdated packages, security vulnsnpm audit, pip-audit
Test DebtLow coverage, missing testsCoverage reports
Documentation DebtOutdated docs, missing API docsDoc freshness check
Infrastructure DebtManual deployments, no IaCInfrastructure review
Debt Prioritization Matrix
              Impact
         Low    |    High
        +-------+--------+
High    | PLAN  | DO NOW |
Effort  +-------+--------+
Low     | DEFER | DO SOON|
        +-------+--------+
Debt Inventory Template
## Technical Debt Inventory

### Critical (Fix within 2 weeks)
| ID | Description | Category | Impact | Effort | Owner |
|----|-------------|----------|--------|--------|-------|
| TD-001 | Security vulnerabilities in auth | Security | Critical | 2d | @dev |

### High (Fix within quarter)
| ID | Description | Category | Impact | Effort | Owner |
|----|-------------|----------|--------|--------|-------|
| TD-002 | Circular dependency in core | Architecture | High | 1w | @team |

### Medium (Track and address opportunistically)
...

### Low (Accept or defer)
...

See checklists/​debt-assessment-checklist.md for systematic debt discovery.


Assessment Workflows

Full Architecture Assessment

1. DISCOVERY (1-2 hours)
   [ ] Clone/​access repository
   [ ] Review documentation (README, ADRs, wiki)
   [ ] Interview stakeholders on pain points
   [ ] Identify key business domains

2. STATIC ANALYSIS (2-4 hours)
   [ ] Run complexity analysis (lizard, escomplex)
   [ ] Run dependency analysis (madge, pydeps)
   [ ] Check test coverage
   [ ] Audit dependencies

3. PATTERN ANALYSIS (1-2 hours)
   [ ] Identify primary architecture pattern
   [ ] Evaluate pattern adherence
   [ ] Document deviations

4. COUPLING/​COHESION (1-2 hours)
   [ ] Map module dependencies
   [ ] Calculate coupling metrics
   [ ] Assess module cohesion

5. ANTI-PATTERN SCAN (1-2 hours)
   [ ] Check for god classes
   [ ] Find circular dependencies
   [ ] Identify distributed monolith signs

6. SCALABILITY REVIEW (1-2 hours)
   [ ] Assess statelessness
   [ ] Review data access patterns
   [ ] Check async processing

7. DEBT INVENTORY (2-4 hours)
   [ ] Catalog all debt
   [ ] Prioritize by impact/​effort
   [ ] Estimate remediation costs

8. REPORT & RECOMMENDATIONS (2-4 hours)
   [ ] Compile findings
   [ ] Prioritize recommendations
   [ ] Create roadmap

Quick Health Check (30 min)

1. Structure scan - directory layout, layers
2. Complexity hotspots - top 5 complex files
3. Dependency health - vulnerabilities, outdated
4. Test coverage - overall percentage
5. Quick recommendations - top 3 issues

Output Templates

Architecture Assessment Report

# Architecture Assessment: {Project Name}

## Executive Summary
- **Overall Health Score**: {X}/​100
- **Primary Pattern**: {Pattern Name}
- **Critical Issues**: {Count}
- **Recommended Actions**: {Top 3}

## Assessment Details

### 1. Architecture Overview
- Pattern: {Identified pattern}
- Layers: {Layer breakdown}
- Key Components: {List}

### 2. Strengths
- {Strength 1}
- {Strength 2}

### 3. Concerns
| Priority | Issue | Impact | Recommendation |
|----------|-------|--------|----------------|
| Critical | ... | ... | ... |
| High | ... | ... | ... |

### 4. Metrics Summary
| Metric | Current | Target | Status |
|--------|---------|--------|--------|
| Avg Cyclomatic Complexity | 12 | <10 | WARN |
| Test Coverage | 65% | >80% | WARN |
| Dependency Health | 3 vulns | 0 | FAIL |

### 5. Recommendations Roadmap
#### Immediate (0-2 weeks)
1. ...

#### Short-term (1-3 months)
1. ...

#### Long-term (3-12 months)
1. ...

### 6. Technical Debt Summary
- Total Items: {count}
- Estimated Remediation: {time}
- Priority Distribution: {Critical: X, High: Y, Medium: Z}

Tool Integration

Static Analysis Commands

# JavaScript/​TypeScript
npx escomplex src/ --format json > complexity.json
npx madge --circular --extensions ts src/
npx dependency-cruiser --output-type json src/ > deps.json

# Python
radon cc src/ -a -j > complexity.json
radon mi src/ -j > maintainability.json
pydeps src/ --cluster --max-bacon 2

# Go
gocyclo -over 10 ./​...
gocognit -over 15 ./​...

# Multi-language
lizard src/ -l python -l javascript --CCN 15

# Dependency health
npm audit --json
pip-audit --format=json

Visualization

# Dependency graphs
npx madge --image deps.png src/
npx dependency-cruiser --output-type dot src | dot -T svg > deps.svg

# Architecture diagrams
npx arkit -o architecture.svg

Reference Files

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View