Skip to content
architecture-design-critique logo

Architecture Design Critique

architecture-design-critique

Perform a codebase-wide architectural review through a Ports & Adapters (hexagonal architecture) lens. Assess boundary violations, coupling issues, and dependency direction. Produces a prioritized improvement roadmap. Use when reviewing architecture for testability/portability, assessing technica...

NeverSight/skills_feed0installs215stars

SKILL.md

Full skill instructions

Architecture Design Critique

Assess how well a codebase separates core domain logic from infrastructure concerns. Three phases with distinct mindsets to prevent jumping to recommendations without understanding what exists.

Key questions answered: Can you swap your database without rewriting business logic? Can you test domain rules without spinning up external services? Will the architecture support 10x growth?

Ports & Adapters in 30 Seconds

The core idea: your domain logic (business rules, core algorithms) should never directly depend on infrastructure (databases, HTTP, file systems, external APIs). Instead:

  • Ports: Interfaces that define what the domain needs (e.g., UserRepository, PaymentGateway)
  • Adapters: Implementations that connect ports to real infrastructure (e.g., PostgresUserRepository, StripePaymentGateway)

Dependencies point inward: adapters depend on ports, never the reverse. This makes the core testable, portable, and resistant to infrastructure churn.

Output Structure

Before starting, ask the user for an output directory (e.g., ./​docs/​architecture/ or ./​reviews/).

Create a subfolder with a meaningful name based on the project or focus area:

{output-directory}/
└── {project-name}-architecture-review/
    ├── 01-inventory.md      # Phase 1: Architectural Inventory
    ├── 02-assessment.md     # Phase 2: Architectural Assessment
    └── 03-roadmap.md        # Phase 3: Improvement Roadmap

Naming the subfolder: Use the project name or a descriptive label, e.g.:

  • acme-api-architecture-review/
  • payments-service-review/
  • monolith-decomposition-analysis/

Write each document as you complete its phase. This creates a persistent record the team can reference, share, and update over time.


Phase 1: Research

Use the /​codebase-librarian skill to create a comprehensive inventory of the codebase.

The librarian skill will systematically catalog:

  • Project foundation (language, tooling, dependencies)
  • Entry points (HTTP, CLI, workers, consumers)
  • Services and module boundaries
  • Infrastructure (databases, caches, queues, external APIs)
  • Domain model (entities, relationships)
  • Data flows (end-to-end request traces)
  • Existing patterns and conventions

Output: Save the inventory to 01-inventory.md in the review folder.

The goal is to know exactly what exists before any critique begins. No opinions—just facts.


Phase 2: Critique

Persona: Senior Platform Engineer with Strong Design Taste

Mindset: Big-picture thinker who cares deeply about sustainable architecture. You've seen codebases thrive and rot. You focus on structural integrity, not cosmetic issues. Style guide violations and naming conventions are beneath your concern—you're looking at whether this architecture will support the next 5 years of growth.

Focus Areas

AreaWhat to Look For
Boundary violationsDomain logic importing infrastructure (e.g., Order.save() calling SQL directly)
CouplingCan components be tested/​replaced independently?
Dependency directionDo dependencies point inward toward the domain, or outward toward infrastructure?
Infrastructure portabilityCould you swap databases/​frameworks without touching core logic?
Pattern coherenceIs the architecture consistent, or a patchwork of different approaches?
Scaling bottlenecksWhat breaks when load, team size, or feature count grows?

What to Ignore

Don't waste time on:

  • Code style and formatting
  • Naming conventions
  • Minor duplication
  • Individual function implementations
  • Test coverage numbers

These matter, but they're not architectural. Stay at the structural level.

Critique Process

1. For each domain concept, check: does it know about its persistence mechanism?
2. For each external dependency, check: is it accessed through an abstraction?
3. Trace a feature addition: how many layers need to change?
4. Imagine swapping the database: what files would you touch?
5. Check test files: can domain logic be tested without mocking infrastructure?

Output Format

Write findings to 02-assessment.md using this structure:

# Architectural Assessment: [Project Name]

## Executive Summary
[2-3 paragraph narrative covering:]
- Overall health assessment (strong / mixed / needs attention)
- Key strengths worth preserving
- Primary concerns and their business/​technical impact
- Thesis statement: "This codebase does X well, but struggles with Y"

## What's Working Well
[Brief bullets highlighting solid patterns and boundaries]

## Detailed Findings

### Finding 1: [Descriptive Title]

**Category**: Boundary Violation | Coupling | Dependency Direction | Scaling Risk

**The Problem**
[2-3 sentences: what's happening, where it occurs, surrounding context]

**Why It Matters**
[Consequences: testability, maintainability, team velocity, scaling implications]

**Evidence**
- `file.py:123` - [code reference with explanation]
- `other_file.py:45` - [additional evidence]

**Suggested Direction**
[High-level fix approach—detailed implementation goes in roadmap]

---

[Repeat for each significant finding]

Reference specific files and line numbers. Be direct about problems—sugarcoating doesn't help. The executive summary should give readers the big picture before they dive into specifics.


Phase 3: Priority Ranking

Persona: Seasoned Engineering Manager (Technical Leader)

Mindset: You're a hands-on technical leader who never lost touch with the code. You balance three forces: delivering product value, enabling team effectiveness, and maintaining engineering excellence. You know that perfect architecture means nothing if you can't ship, but you also know technical debt compounds mercilessly.

Evaluation Criteria

For each issue identified in Phase 2, assess:

CriterionQuestions to Ask
ImpactHow much does this hurt day-to-day development?
EffortHow much work to fix? Days, weeks, or months?
RiskWhat could go wrong? What's the blast radius if it fails?
DependenciesDoes this block other improvements?
Business alignmentDoes fixing this enable upcoming product needs?

Priority Tiers

Quick Wins (days, not weeks)

  • High impact, low risk
  • Can be done opportunistically alongside feature work
  • Examples: extract interface, move misplaced file, add missing abstraction boundary

Medium-term (weeks)

  • Meaningful effort but clear path forward
  • Requires dedicated time but pays dividends
  • Examples: introduce repository pattern, consolidate duplicate infrastructure, establish module boundaries

Long-term Projects (quarters)

  • Architectural changes requiring sustained investment
  • Must be balanced against feature delivery
  • Examples: decompose monolith, introduce domain events, migrate data layer

Output Format

Write findings to 03-roadmap.md using this structure:

# Improvement Roadmap: [Project Name]

## Executive Summary
[1-2 paragraphs covering:]
- Item count: X quick wins, Y medium-term, Z long-term
- Recommended starting point and rationale
- Key dependencies between items
- Expected outcomes if roadmap is followed

## Quick Wins

### 1. [Descriptive Title]

**Problem**: [One sentence summary]
**Impact**: [What improves—testability, maintainability, etc.]

**Implementation Approach**

Step-by-step guidance with code examples:

1. Create the port interface:
   ```python
   class CachePort(Protocol):
       def get(self, key: str) -> Optional[str]: ...
       def set(self, key: str, value: str, ttl: int) -> None: ...
  1. Implement the adapter:

    class RedisCacheAdapter(CachePort):
        def __init__(self, client: Redis):
            self._client = client
        # ... implementation
    
  2. Wire it up:

    • Modify constructor to accept port
    • Update composition root / dependency injection

Files to Modify

  • domain/​ports/​cache.py (new)
  • infrastructure/​redis_cache.py (new)
  • services/​planner.py:117-121 (inject dependency)

Verification

  • Existing tests should pass unchanged
  • Add unit test with mock cache implementation

Medium-term

2. [Title]

[Same structure as above with appropriate depth]


Long-term

3. [Title]

[Same structure—can be higher-level for larger efforts]


Provide concrete code examples showing the "before implied, after explicit" pattern. Developers should be able to follow the roadmap without extensive further research.

---

## Architectural Red Flags

Quick reference for common violations to look for:

### Boundary Violations
- Domain entities with `save()`, `load()`, or `delete()` methods that call infrastructure
- Business logic inside HTTP handlers or database repositories
- Domain models importing ORM decorators or framework code
- Validation rules living in controllers instead of domain

### Coupling Smells
- Everything imports a "god" utility module
- Circular dependencies between packages
- Feature A directly instantiates Feature B's internal classes
- Configuration scattered across multiple layers

### Dependency Direction Issues
- Core domain package imports from infrastructure package
- Business rules reference specific database types (e.g., `postgres.Connection`)
- Domain entities have JSON/​XML serialization annotations

### Missing Abstractions
- Direct `fetch()` or HTTP client calls in business logic
- Raw SQL queries in service classes
- File system operations mixed with domain calculations

---

**Example output**: See [references/​example-output.md](references/example-output.md) for a complete e-commerce codebase critique example.

More skills from NeverSight

devops-deployer logo
NeverSight/skills_feed

devops-deployer

Comprehensive DevOps and deployment workflow that orchestrates infrastructure automation, CI/CD pipelines, container orchestration, and cloud deployment. Handles everything from infrastructure as code and pipeline setup to monitoring, scaling, and disaster recovery.

215 1
View
avnu logo
NeverSight/skills_feed

avnu

Integrate avnu SDK for Starknet DeFi: token swaps with best-price routing, DCA recurring buys, native staking, gasless transactions via paymaster, and market data. Use when building Starknet trading, DEX aggregation, or DeFi automation features.

215 0
View
post-to-x logo
NeverSight/skills_feed

post-to-x

发布内容和文章到 X (Twitter)。支持带图片的普通推文和 X Articles(长文)。使用真实的 Chrome 和 CDP 来绕过自动化检测。

215 0
View
ralph-prompt-builder logo
NeverSight/skills_feed

ralph-prompt-builder

Master orchestrator for generating Ralph Wiggum-compatible prompts. Analyzes task requirements and routes to appropriate generator (single-task, multi-task, project, or research). Use when you need to create any Ralph loop prompt and want automatic selection of the right generator.

215 0
View
branch-comparison logo
NeverSight/skills_feed

branch-comparison

Use when the user asks to compare branches, analyze git diffs, review changes between branches, update specifications based on code changes, or analyze what changed. Triggers on keywords like "compare branches", "git diff", "what changed", "branch comparison", "code changes", "spec update".

215 0
View
fastapi-development logo
NeverSight/skills_feed

fastapi-development

Build high-performance FastAPI applications with async routes, validation, dependency injection, security, and automatic API documentation. Use when developing modern Python APIs with async support, automatic OpenAPI documentation, and high performance requirements.

215 0
View
zendesk-chat logo
NeverSight/skills_feed

zendesk-chat

Enables Claude to manage Zendesk Chat conversations, support tickets, and customer service operations

215 0
View
forge logo
NeverSight/skills_feed

forge

Mine transcripts for knowledge - decisions, learnings, failures, patterns. Triggers: "forge insights", "mine transcripts", "extract knowledge".

215 0
View
mixpanel logo
NeverSight/skills_feed

mixpanel

Track product analytics and user behavior with Mixpanel's event-based platform.

215 0
View
ocpp logo
NeverSight/skills_feed

ocpp

OCPP protocol reference for EV charging infrastructure development. Covers OCPP 2.0.1 and OCPP 1.6J. Use when working with OCPP messages, charging station code, CSMS/Central System backends, smart charging, transaction handling, or EV charging protocols. Activates on keywords: OCPP, charging stat...

215 0
View
bee-collect logo
NeverSight/skills_feed

bee-collect

Gather scattered ideas into organized GitHub issues. The bee collects pollen from every flower, checks if the hive already has it, and carefully deposits new work in the comb for later. Never edits code—only organizes the work ahead. Use when creating issues from TODOs or planning work.

215 0
View
vercel-react-native-skills logo
NeverSight/skills_feed

vercel-react-native-skills

Comprehensive best practices for React Native and Expo applications. Contains rules across multiple categories covering performance, animations, UI patterns, and platform-specific optimizations.

215 0
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