Architecture Advisor

codewithmukesh/dotnet-claude-kit/skills/architecture-advisor

by codewithmukesh23300897f4d1No license754 starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 2 months ago

Architecture selection advisor for .NET applications. Asks structured questions about domain complexity, team size, system lifetime, compliance, and integration needs, then recommends the best-fit architecture: Vertical Slice, Clean Architecture, DDD + Clean Architecture, or Modular Monolith. Load this skill when the user asks "which architecture", "choose architecture", "set up project", "new project", "architecture decision", "restructure", or "how should I organize". Always load BEFORE any architecture-specific skill.

Instructions only

Architecture Advisor

Core Principles

  1. Ask before recommending — Never prescribe an architecture without understanding the project. Run the questionnaire first to gather context about domain, team, lifetime, and constraints.
  2. Right-size the architecture — The best architecture is the simplest one that handles the project's actual complexity. CRUD apps do not need DDD. Startups do not need Clean Architecture. Match complexity to real requirements, not aspirations.
  3. Architecture is not permanent — Every architecture has an evolution path. Start simple and add structure when complexity demands it. Document the decision so the team knows when to evolve.
  4. Four supported architectures — dotnet-claude-kit provides first-class patterns for Vertical Slice Architecture (VSA), Clean Architecture (CA), DDD + Clean Architecture, and Modular Monolith. Each has specific strengths and trade-offs.

The Architecture Questionnaire

Before recommending an architecture, ask questions across these 6 categories. Not every question applies to every project — skip irrelevant ones.

Category 1: Domain Complexity

#QuestionLow SignalHigh Signal
1How many distinct business entities does the system manage?< 10 entities20+ entities with relationships
2Do business rules involve multiple entities interacting?Rules are per-entity CRUDComplex invariants across entity groups
3Are there business workflows with multiple steps?Simple request → responseSagas, approval chains, state machines
4Do domain experts use specialized vocabulary?Generic terms (create, update)Ubiquitous language (underwrite, adjudicate)

Category 2: Team & Organization

#QuestionLow SignalHigh Signal
5How large is the development team?1-3 developers8+ developers, multiple teams
6Do different teams own different parts of the system?Single team owns everythingTeams aligned to business domains
7What is the team's experience level with .NET?Junior or mixedSenior, experienced with patterns

Category 3: System Lifetime & Scale

#QuestionLow SignalHigh Signal
8Expected system lifetime?< 2 years, MVP/prototype5+ years, long-lived product
9How many concurrent users or requests per second?< 100 RPS1000+ RPS, variable load
10Will the system need to scale independently by feature area?Uniform loadHot spots need independent scaling

Category 4: Regulatory & Compliance

#QuestionLow SignalHigh Signal
11Are there audit trail or compliance requirements?Basic logging sufficientFull audit trail, SOX/HIPAA/PCI
12Do different parts of the system have different security boundaries?Single auth boundaryMulti-tenant, data isolation

Category 5: Existing Codebase

#QuestionLow SignalHigh Signal
13Is this greenfield or brownfield?Greenfield, starting freshBrownfield, migrating from legacy
14Are there existing architectural patterns the team follows?No established patternsStrong conventions in place

Category 6: Integration Complexity

#QuestionLow SignalHigh Signal
15How many external systems does this integrate with?0-2 simple APIs5+ systems with complex contracts
16Are there event-driven or async communication needs?Synchronous request/responseEvent sourcing, pub/sub, eventual consistency

Decision Matrix

Map questionnaire answers to architecture recommendations:

ProfileRecommended ArchitectureWhy
Low domain complexity, small team, short lifetimeVertical Slice ArchitectureMinimal ceremony, fast feature delivery, easy to understand
Low-medium domain complexity, any team size, API-focusedVertical Slice ArchitectureFeature cohesion, one file per operation, natural fit for minimal APIs
Medium domain complexity, medium team, long lifetimeClean ArchitectureEnforced boundaries via project references, testable domain, clear dependency direction
High domain complexity, specialized vocabulary, complex invariantsDDD + Clean ArchitectureAggregates protect invariants, value objects model domain concepts, domain events decouple side effects
Multiple bounded contexts, team-per-domain, independent deployment potentialModular MonolithModule isolation, independent data stores, evolution path to microservices
Brownfield with existing layered architectureClean ArchitectureFamiliar to teams coming from N-tier, preserves layer separation with better dependency direction

When Signals Conflict

If signals point to different architectures:

  1. Default to simpler — When in doubt, start with VSA and evolve
  2. Domain complexity wins — High domain complexity overrides team size and lifetime signals
  3. Team familiarity matters — A team experienced with CA will be more productive with CA than learning VSA, even if VSA is technically simpler
  4. Compliance drives structure — Regulatory requirements often force stricter boundaries (CA or DDD)

Patterns

Vertical Slice Architecture (VSA)

Organize by feature, not by layer. Each operation is a self-contained slice.

src/MyApp.Api/  Features/    Orders/CreateOrder.cs    # Request + Handler + Response + Endpoint    Orders/GetOrder.cs  Common/    Behaviors/ValidationBehavior.cs    Persistence/AppDbContext.cs

Best for: CRUD-heavy apps, APIs, MVPs, small-medium teams, short-medium lifetime. Load skill: vertical-slice

Clean Architecture (CA)

Concentric layers with dependency inversion. Domain at the center, infrastructure at the edge.

src/  MyApp.Domain/              # Entities, interfaces, domain logic  MyApp.Application/         # Use cases, DTOs, validation  MyApp.Infrastructure/      # EF Core, external services  MyApp.Api/                 # Endpoints, middleware

Best for: Medium complexity, long-lived systems, teams familiar with layered patterns. Load skill: clean-architecture

DDD + Clean Architecture

Clean Architecture with tactical DDD patterns: aggregates, value objects, domain events.

src/  MyApp.Domain/              # Aggregates, value objects, domain events, domain services  MyApp.Application/         # Use cases orchestrating aggregates  MyApp.Infrastructure/      # Persistence, external service adapters  MyApp.Api/                 # Thin endpoints

Best for: Complex domains, specialized vocabulary, strict invariants, experienced teams. Load skill: ddd + clean-architecture

Modular Monolith

Independent modules in a single deployable unit, each with its own architecture internally.

src/  MyApp.Host/                # Wires modules together  Modules/    Orders/                  # Own features, own DbContext, own architecture    Catalog/                 # Can use VSA, CA, or DDD internally  MyApp.Shared/              # Integration event contracts only

Best for: Multiple bounded contexts, team-per-domain, future microservices extraction. Load template: modular-monolith

Evolution Paths

Architecture is not a one-time decision. Systems evolve. Here are the common migration paths:

FromToTriggerHow
VSACADomain logic growing beyond handlersExtract Domain + Application layers, keep features as use cases
VSAModular MonolithMultiple bounded contexts emergingGroup features into modules, add module boundaries
CADDD + CAInvariants becoming complex, primitive obsessionIntroduce aggregates, value objects, domain events
MonolithModular MonolithTeams stepping on each other, shared database couplingSplit into modules with own DbContexts and schemas
Modular MonolithMicroservicesIndependent scaling needs, independent deploymentExtract modules into separate deployable services

Anti-patterns

Picking Clean Architecture for a CRUD App

// BAD — 4 projects, 6+ files per feature for simple CRUDsrc/MyApp.Domain/Entities/Product.cssrc/MyApp.Application/Products/CreateProduct/CreateProductCommand.cssrc/MyApp.Application/Products/CreateProduct/CreateProductHandler.cssrc/MyApp.Application/Products/CreateProduct/CreateProductValidator.cssrc/MyApp.Infrastructure/Persistence/ProductRepository.cssrc/MyApp.Api/Endpoints/ProductEndpoints.cs
// GOOD — VSA: 1 file for a simple CRUD featuresrc/MyApp.Api/Features/Products/CreateProduct.cs

DDD Everywhere

// BAD — value objects and aggregates for a settings tablepublic class UserSettings : AggregateRoot  // overkill{    public ThemeName Theme { get; private set; }  // value object for "dark"/"light"?    public void ChangeTheme(ThemeName theme) { /* domain event? really? */ }}
// GOOD — simple entity for simple datapublic class UserSettings{    public Guid UserId { get; init; }    public string Theme { get; set; } = "light";}

Premature Microservices

// BAD — splitting into 5 microservices on day one with 2 developersOrderService (own repo, own DB, own CI/CD)CatalogService (own repo, own DB, own CI/CD)IdentityService (own repo, own DB, own CI/CD)NotificationService (own repo, own DB, own CI/CD)GatewayService (own repo, own CI/CD)
// GOOD — start as a modular monolith, extract when you have evidencesrc/  Modules/Orders/  Modules/Catalog/  Modules/Identity/  Modules/Notifications/

Skipping the Questionnaire

// BAD — "I always use Clean Architecture"User: "Set up a new project for a todo app"Agent: *immediately scaffolds 4-project CA solution*
// GOOD — ask first, then recommendUser: "Set up a new project for a todo app"Agent: "Let me ask a few questions about your project to recommend the best architecture..."Agent: *runs questionnaire, recommends VSA for low-complexity app*

Decision Guide

ScenarioRecommendation
New project, unknown requirementsRun the questionnaire
Simple CRUD API, 1-3 developersVSA
Medium complexity, long-lived, experienced teamClean Architecture
Complex domain, specialized vocabularyDDD + Clean Architecture
Multiple bounded contexts, multiple teamsModular Monolith
Existing N-tier codebase, needs modernizationClean Architecture (familiar migration)
MVP / startup, speed is priorityVSA
Regulatory / compliance-heavyClean Architecture or DDD (enforced boundaries)
Will need independent scaling laterModular Monolith (extraction-ready)

Source and attribution

Source:codewithmukesh/dotnet-claude-kitinskills/architecture-advisorat commit2330089

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal

More from codewithmukesh/dotnet-claude-kit

Wrap Up

codewithmukesh

Captures end-of-session work, pending tasks and learnings into a handoff file, and reloads it at session start.

Productivity & Workflow754updated 2 months ago

Workflow Mastery

codewithmukesh

Claude Code workflow mastery for .NET developers. Covers parallel execution with git worktrees, plan mode strategy, verification loops, auto-formatting hooks, permission setup for dotnet CLI, prompting techniques, subagent patterns, and context discipline — token budget management, MCP-first navigation, lazy loading, and subagent isolation — all adapted for the .NET ecosystem. Load this skill when setting up Claude Code for a .NET project, optimizing workflows, running parallel sessions, when context is running low or sessions feel sluggish, when exploring a large codebase efficiently, or when the user mentions "productivity", "workflow", "parallel", "worktree", "plan mode", "permissions", "hooks", "10x", "setup Claude Code", "speed up development", "context", "tokens", "budget", "running out of context", "too many files", or "large codebase". Inspired by tips from Boris Cherny (creator of Claude Code) and the Anthropic team.

Awaiting classification754updated 2 months ago

Vertical Slice

codewithmukesh

Guides .NET developers in structuring applications with Vertical Slice Architecture, covering feature folders, endpoint grouping and handler patterns.

Software Development754updated 2 months ago

Testing

codewithmukesh

Testing strategy for .NET 10 applications. Covers xUnit v3, WebApplicationFactory for integration tests, Testcontainers for real database testing, Verify for snapshot testing, and the AAA pattern. Load this skill when writing tests, setting up test infrastructure, reviewing test coverage, or when the user mentions "test", "xUnit", "WebApplicationFactory", "Testcontainers", "integration test", "unit test", "bUnit", "snapshot test", "Verify", "test coverage", "AAA pattern", "WireMock", or "FakeTimeProvider".

Awaiting classification754updated 2 months ago

Tdd

codewithmukesh

Guided test-driven development workflow for .NET 10 using xUnit v3, WebApplicationFactory, Testcontainers, and Verify snapshots. Follows the strict red-green-refactor cycle. Use when: "TDD", "test-driven", "let's TDD this", "red green refactor", "write the test first", or when building a feature with clear acceptance criteria.

Awaiting classification754updated 2 months ago

Spec

codewithmukesh

Turns a vague feature idea into an agreed, persisted specification file through structured questioning rounds.

Productivity & Workflow754updated 2 months ago