home / skills / athola / claude-night-market / architecture-review

architecture-review skill

/plugins/pensive/skills/architecture-review

This skill guides architecture assessments and ADR compliance reviews to improve modularity, boundaries, and alignment with design principles across the

npx playbooks add skill athola/claude-night-market --skill architecture-review

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
5.4 KB
---
name: architecture-review
description: 'Use this skill for architecture assessment and compliance. Use when
  reviewing architecture decisions, auditing ADR compliance, analyzing coupling, validating
  design principles. Do not use when selecting architecture paradigms - use archetypes
  skills. DO NOT use when: API surface review - use api-review.'
category: architecture
tags:
- architecture
- design
- adr
- coupling
- patterns
- principles
tools:
- adr-auditor
- coupling-analyzer
- principle-checker
usage_patterns:
- architecture-assessment
- adr-audit
- refactor-review
- design-validation
complexity: advanced
estimated_tokens: 300
progressive_loading: true
dependencies:
- pensive:shared
- imbue:evidence-logging
- imbue:diff-analysis/modules/risk-assessment-framework
modules:
- modules/adr-audit.md
- modules/coupling-analysis.md
- modules/principle-checks.md
---
## Table of Contents

- [Quick Start](#quick-start)
- [When to Use](#when-to-use)
- [Progressive Loading](#progressive-loading)
- [Required TodoWrite Items](#required-todowrite-items)
- [Workflow](#workflow)
- [Step 1: Establish Context (`arch-review:context-established`)](#step-1:-establish-context-(arch-review:context-established))
- [Step 2: ADR Audit (`arch-review:adr-audit`)](#step-2:-adr-audit-(arch-review:adr-audit))
- [Step 3: Interaction Mapping (`arch-review:interaction-mapping`)](#step-3:-interaction-mapping-(arch-review:interaction-mapping))
- [Step 4: Principle Checks (`arch-review:principle-checks`)](#step-4:-principle-checks-(arch-review:principle-checks))
- [Step 5: Risks and Actions (`arch-review:risks-actions`)](#step-5:-risks-and-actions-(arch-review:risks-actions))
- [Testing](#testing)

## Testing

Run `pytest plugins/pensive/tests/skills/test_architecture_review.py` to verify review logic.
- [Architecture Principles Checklist](#architecture-principles-checklist)
- [Coupling](#coupling)
- [Cohesion](#cohesion)
- [Layering](#layering)
- [Evolution](#evolution)


# Architecture Review Workflow

Architecture assessment against ADRs and design principles.

## Quick Start

```bash
/architecture-review
```

## When To Use

- Approving reimplementations.
- Large-scale refactoring reviews.
- System design changes.
- New module/service introduction.
- Dependency restructuring.

## When NOT To Use

- Selecting architecture paradigms - use archetypes
  skills
- API surface review - use api-review
- Selecting architecture paradigms - use archetypes
  skills
- API surface review - use api-review

## Progressive Loading

Load modules based on review scope:

- **`modules/adr-audit.md`** (~400 tokens): ADR verification and documentation.
- **`modules/coupling-analysis.md`** (~450 tokens): Dependency analysis and boundary violations.
- **`modules/principle-checks.md`** (~500 tokens): Code quality, security, and performance.

Load all modules for full reviews. For focused reviews, load only relevant modules.

## Required TodoWrite Items

1. `arch-review:context-established`: Repository, branch, motivation.
2. `arch-review:adr-audit`: ADR verification and new ADR needs.
3. `arch-review:interaction-mapping`: Module coupling analysis.
4. `arch-review:principle-checks`: LoD, security, performance.
5. `arch-review:risks-actions`: Recommendation and follow-ups.

## Workflow

### Step 1: Establish Context (`arch-review:context-established`)

Confirm repository and branch:
```bash
pwd
git status -sb
```

Document:
- Feature/bug/epic motivating review.
- Affected subsystems.
- Architectural intent from README/docs.
- Design trade-off assumptions.

### Step 2: ADR Audit (`arch-review:adr-audit`)

**Load: `modules/adr-audit.md`**

- Locate ADRs in project.
- Verify required sections.
- Check status flow.
- Confirm immutability compliance.
- Flag need for new ADRs.

### Step 3: Interaction Mapping (`arch-review:interaction-mapping`)

**Load: `modules/coupling-analysis.md`**

- Diagram before/after module interactions.
- Verify composition boundaries.
- Check data ownership clarity.
- Validate dependency flow direction.
- Identify coupling violations.

### Step 4: Principle Checks (`arch-review:principle-checks`)

**Load: `modules/principle-checks.md`**

- Law of Demeter.
- Anti-slop patterns.
- Security (input validation, least privilege).
- Performance (N+1 queries, caching).

### Step 5: Risks and Actions (`arch-review:risks-actions`)

Summarize using `imbue:diff-analysis/modules/risk-assessment-framework`:
- Current vs proposed architecture.
- Business impact.
- Technical debt implications.

List follow-ups with owners and dates.

Provide recommendation:
- **Approve**: Architecture sound.
- **Approve with actions**: Minor issues to address.
- **Block**: Fundamental problems requiring redesign.

## Architecture Principles Checklist

### Coupling
- [ ] Dependencies follow defined boundaries.
- [ ] No circular dependencies.
- [ ] Extension points used properly.
- [ ] Abstractions don't leak.

### Cohesion
- [ ] Related functionality grouped.
- [ ] Single responsibility per module.
- [ ] Clear module purposes.

### Layering
- [ ] Layers have clear responsibilities.
- [ ] Dependencies flow downward.
- [ ] No layer bypassing.

### Evolution
- [ ] Changes are reversible.
- [ ] Migration paths are clear.
- [ ] ADRs document decisions.
## Troubleshooting

### Common Issues

**Command not found**
Ensure all dependencies are installed and in PATH

**Permission errors**
Check file permissions and run with appropriate privileges

**Unexpected behavior**
Enable verbose logging with `--verbose` flag

Overview

This skill performs architecture assessment and compliance checks against documented decisions and design principles. It helps auditors and architects validate ADR coverage, analyze coupling and cohesion, and produce actionable risk-and-follow-up recommendations. Use it to formalize reviews for large changes, refactors, or new service introductions.

How this skill works

The skill establishes repository and branch context, locates and audits ADRs, maps module interactions, and runs principle checks like Law of Demeter, layering, and security controls. It progressively loads focused modules (ADR audit, coupling analysis, principle checks) based on review scope and yields a final risks-and-actions summary with an approve/approve-with-actions/block recommendation. Outputs include diagrams, checklist status, and assigned follow-ups.

When to use it

  • Approving large refactors or reimplementations before merge
  • Reviewing system design changes or introducing a new service/module
  • Auditing ADR coverage and documenting missing decisions
  • Analyzing coupling and boundary violations after dependency changes
  • Validating design principles for security, performance, and maintainability

Best practices

  • Start by documenting the motivating feature, affected subsystems, and design intent
  • Load only the modules needed for focused reviews to save time; run full modules for comprehensive audits
  • Treat ADRs as immutable records; flag new ADRs when decisions or trade-offs are missing
  • Map interactions before and after changes to reveal hidden coupling and boundary leaks
  • Produce clear follow-ups with owners, deadlines, and acceptance criteria for approval-with-actions

Example use cases

  • A proposed refactor that splits a monolith into services—verify boundaries, data ownership, and migration path
  • Adding a third-party dependency across core modules—check for circular dependencies and privilege scope
  • Introducing a new API gateway—ensure layering rules and no bypass of business logic
  • Validating an ADR set before a release to ensure decisions and rollbacks are documented
  • Assessing performance risk (N+1 queries, caching gaps) during a schema redesign

FAQ

Can this skill choose the overall architecture pattern for a project?

No. It assesses and audits architecture decisions and compliance. Use an archetypes-focused skill when selecting high-level paradigms.

Should I use this for API surface reviews?

No. API surface reviews are out of scope; use a dedicated api-review skill for API contract and surface checks.