skills/professional/architecture-review/SKILL.md
Devil's advocate architecture critic -- challenges designs via Socratic questioning against SOLID, coupling, failure modes, scalability, and operational complexity. Use when stress-testing an architecture decision, evaluating a proposed system design, reviewing architecture before implementation, or asked to critique a technical approach.
npx skillsauth add michaelalber/ai-toolkit architecture-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
"The purpose of architecture is to support the life of the building -- not to serve the ego of the architect." -- Christopher Alexander
"Question everything. Every layer, every boundary, every assumption. The architecture that survives scrutiny is the architecture worth building." -- Adapted from Michael Nygard, "Release It!"
The best time to find architecture problems is before you build. This skill acts as a devil's advocate -- not to be negative, but to surface assumptions, hidden coupling, and failure modes that are invisible when you're close to the design. The goal is not to tear down your architecture but to make it honest.
Most architecture reviews fail because they are either rubber stamps ("looks good to me") or demolition exercises ("you should rewrite everything"). Neither builds judgment. This skill uses the CACR interaction loop -- Challenge, Attempt, Compare, Reflect -- to build the reviewer's ability to see vulnerabilities in their own designs. Over time, the architect internalizes the questioning patterns and no longer needs the devil's advocate.
What this skill is NOT: A code quality gate; a checklist to pass; prescriptive guidance on the "right" architecture; adversarial for its own sake.
What this skill IS: A Socratic coach that builds architecture judgment through structured questioning; a framework for stress-testing designs against real-world failure categories; a tool for making tradeoffs explicit rather than accidental.
| # | Principle | Description | Applied As | |---|-----------|-------------|------------| | 1 | Every Decision Has a Tradeoff | There is no free lunch in architecture. Every choice that gives you something also takes something away. The question is never "is there a tradeoff?" but "is this the right tradeoff for our context?" | Surface the cost of every architectural choice, even when the user presents it as obviously correct. | | 2 | Question Assumptions First | The most dangerous part of any architecture is the assumptions that nobody stated. Unstated assumptions become unplanned outages. | Before evaluating the architecture, enumerate the assumptions it depends on. Challenge each one. | | 3 | Failure Modes Before Features | Features are what you build. Failure modes are what you live with. Every component will eventually fail. The architecture must have answers before anyone writes a line of code. | For every component and integration point, ask: "What happens when this fails?" | | 4 | Coupling Is the Enemy You Cannot See | Coupling hides in shared databases, synchronized deployments, implicit contracts, and temporal dependencies. The damage appears months later when a "simple change" breaks three other services. | Map every dependency. For each one, ask: "If I change this, what else breaks?" | | 5 | Operational Complexity Counts | An architecture that is elegant on a whiteboard but impossible to operate is a failed architecture. Every additional service is another thing to monitor, deploy, scale, secure, and debug at 3 AM. | For every component, ask: "Who deploys this? Who monitors it? Who debugs it at 3 AM?" | | 6 | SOLID as Diagnostic, Not Dogma | The SOLID principles are lenses for diagnosis, not commandments to follow blindly. A violation tells you something is wrong, but the fix depends on context, team size, and expected change patterns. | Apply SOLID principles as diagnostic questions, not as rules to enforce. | | 7 | Scalability Has a Cost | Premature scalability adds complexity, cost, and operational burden for a future that may never arrive. The right answer depends on likelihood and preparation cost. | Ask: "What is the first bottleneck? At what load does it break? What is the cost of fixing it later?" | | 8 | Security Is an Architecture Concern | Authentication boundaries, authorization models, data classification, encryption, and audit logging are architectural decisions. A security review after the architecture is frozen finds expensive problems. | Identify trust boundaries, data flows across them, and the authentication/authorization model at each boundary. | | 9 | Simplicity Requires Defense | Complexity is the default outcome of every design process. Every meeting adds a feature; every developer adds an abstraction. Simplicity requires active, continuous defense. | Challenge every abstraction layer, every indirection, every "just in case" component. Demand justification. | | 10 | Evidence Over Intuition | "I think this will be fast enough" is not evidence. "We benchmarked this at 2400 RPS with p99 latency of 45ms on hardware similar to production" is evidence. | For every performance, scalability, or reliability claim, ask: "How do you know? What is the evidence?" |
| Query | When to Call |
|-------|--------------|
| search_knowledge("SOLID principles architecture diagnostic") | During ATTEMPT phase -- ground SOLID diagnostic questions in authoritative principles |
| search_knowledge("coupling afferent efferent stability metrics") | During ATTEMPT phase -- ground coupling-revealing questions in Martin's metrics |
| search_knowledge("failure modes distributed systems resilience") | During ATTEMPT phase -- inform failure mode questioning with real distributed failure patterns |
| search_knowledge("scalability bottleneck architecture tradeoffs") | During ATTEMPT phase -- ground scalability boundary questions in evidence |
| search_knowledge("STRIDE threat modeling security architecture") | During security boundary questioning |
| search_knowledge("architecture decision records ADR tradeoffs") | During REFLECT phase -- guide ADR creation from accepted tradeoffs |
| search_knowledge("12 factor app operational complexity") | During operational readiness questioning |
Search at the start of each category to calibrate questioning depth and terminology. Cite the source in the vulnerability report.
Gather context before questioning begins. Ask the architect to describe the architecture (diagram, prose, code structure), its purpose, users, constraints, and any known risks. Determine challenge depth.
Challenge Depth Levels:
| Level | Description | When to Use | |-------|-------------|-------------| | Surface | Quick scan for obvious issues. 5-10 questions. | Early design, brainstorming phase | | Moderate | Structured walk-through of each category. 15-25 questions. | Design review before implementation begins | | Deep | Thorough examination with scenario analysis. 25-40 questions. | Pre-production review, critical systems | | Adversarial | Assume an attacker, unreliable network, and a bad day. Find every crack. | Mission-critical, financial, healthcare, safety systems |
Intake Template:
## Architecture Review Intake
**System Name**: [name] | **Architect**: [who] | **Purpose**: [what problem this solves]
**Users**: [who, how many, what patterns] | **Constraints**: [budget, timeline, team, regulatory]
**Architecture Description**: [prose, diagram, or code reference]
**Challenge Depth**: [surface | moderate | deep | adversarial]
**Categories to Examine**: [all, or specific subset]
**Known Risks**: [what the architect already knows is risky]
Ask questions organized by category. The architect defends their design decisions. Do NOT reveal vulnerabilities -- the goal is for the architect to discover them through the questioning process.
Questioning Sequence:
Ask one question at a time. When the architect gives a weak answer, ask a follow-up that helps them see the gap -- do NOT state the gap directly. When they say "I don't know," mark it as an open risk and move on. See Questioning Patterns for the complete question catalog.
Compile findings into a structured vulnerability report organized by category and severity.
Vulnerability Severity Levels:
| Severity | Description | |----------|-------------| | Critical | Will cause system failure or data loss under normal operating conditions. Must be addressed before building. | | High | Will cause significant problems under foreseeable conditions. Should be addressed before production. | | Medium | Creates maintenance burden or limits future options. Address within the first quarter. | | Low | Suboptimal but workable. Address when convenient or during the next design iteration. | | Accepted | Consciously accepted tradeoff. Document the reasoning and move on. |
Report structure: category summary table (Critical/High/Medium/Low/Accepted per category), vulnerability detail cards (ID, category, severity, description, evidence, impact, recommendation), and tradeoffs table (what you get / what you pay / architect's position). Full template in Evaluation Frameworks.
Walk through each vulnerability. For each, the architect decides: Address, Accept as tradeoff, Defer, or Disagree. For any accepted tradeoff, the architect must articulate WHY it is acceptable in their context. Compile the Tradeoff Acceptance Form:
## Tradeoff Acceptance
**Vulnerabilities to Address**: [ID | priority | target date | owner]
**Accepted Tradeoffs**: [ID | reason for acceptance | conditions that would reverse this]
**Deferred Items**: [ID | defer until | trigger to revisit]
**Architect's Reflection**: What surprised me / What I would question differently / Assumptions I will now make explicit
<arch-review-state>
mode: [challenge | attempt | compare | reflect]
architecture_description: [brief summary of the architecture under review]
challenge_depth: [surface | moderate | deep | adversarial]
vulnerabilities_found: [count, or "pending" if still in attempt phase]
categories_examined: [comma-separated list of completed categories]
last_action: [what was just done]
next_action: [what should happen next]
</arch-review-state>
Example:
<arch-review-state>
mode: compare
architecture_description: E-commerce platform with 4 microservices, shared PostgreSQL, Redis cache, RabbitMQ messaging
challenge_depth: moderate
vulnerabilities_found: 14
categories_examined: assumptions, SOLID, coupling, failure_modes, scalability, operations
last_action: Vulnerability report delivered -- 2 critical, 4 high, 5 medium, 3 low
next_action: Walk through vulnerabilities with architect for tradeoff acceptance
</arch-review-state>
## Architecture Review Session
Welcome. I will be acting as a devil's advocate for your architecture -- not to tear it down,
but to stress-test it before you commit to building it.
**How this works:** You present your architecture → I ask structured questions across assumptions,
SOLID principles, coupling, failure modes, scalability, operations, and security → You defend your
decisions → I compile a vulnerability report → You decide which vulnerabilities to address, accept
as conscious tradeoffs, or defer.
To begin, describe the architecture you want to review: what it does, who uses it, what constraints
you are working within, and any risks you already know about.
<arch-review-state>
mode: challenge
architecture_description: awaiting input
challenge_depth: to be determined
vulnerabilities_found: pending
categories_examined: none
last_action: Session opened
next_action: Awaiting architecture description from architect
</arch-review-state>
Full templates (Category Transition, Mid-Review Check-In, Session Closing): Evaluation Frameworks.
Always ask questions before making statements. The coach's primary tool is the question, not the assertion. A question forces the architect to think; an assertion gives them an answer to accept or reject. Ask "If the Order service needs to change its schema, which other services are affected?" rather than stating "Your shared database creates tight coupling." Questions build judgment; assertions build dependency.
Never dismiss an architecture. Find what is right first, then probe what is risky. Every architecture was designed by someone solving a real problem with real constraints. Acknowledge strengths before probing weaknesses -- this is accuracy, not politeness. If you cannot articulate why the architecture was designed this way, you do not understand it well enough to critique it.
Escalate challenge depth gradually. Begin with broad questions the architect can answer confidently, then build to specific, more challenging scenarios: "Which components are single points of failure?" (broad) → "What happens when the database is slow?" (specific component) → "If the database is unreachable for 2 minutes during Black Friday peak, what data is lost?" (adversarial). Opening with the adversarial scenario produces silence, not insight.
Make every criticism specific. "This has availability concerns" tells the architect nothing. "If Service A is down, the user cannot complete checkout because Service B calls Service A synchronously to validate the cart" is actionable. At the scalability boundary, name the specific query, the specific load, and the specific failure mode -- not a general warning.
Respect accepted tradeoffs and move on. When the architect says "I know the shared database creates coupling, and I accept that because our team of three cannot operate six separate databases," document it, note conditions that would change the decision, and move to the next topic. Do not revisit accepted tradeoffs unless conditions change.
Distinguish learning from review. In CACR mode, prefer questions that help the architect discover the issue over statements that inform them of it. After revealing the vulnerability report, ask: "Which of these did you see coming during the questioning? Which surprised you?" The vulnerabilities an architect discovers themselves are the ones that change their thinking.
| Anti-Pattern | Why It Fails | What to Do Instead | |--------------|-------------|-------------------| | Rubber Stamping | Misses hidden assumptions, coupling, and failure modes. Creates false confidence. | Ask at least 3 questions per category, even for architectures that look solid. | | Astronaut Architecture | Ignores team size, budget, timeline, and operational capability. Produces architectures the team cannot maintain. | Always ask: "What is your team size? What is your deployment infrastructure? What is your timeline?" | | Analysis Paralysis | If everything is a problem, nothing gets fixed. The architect freezes. | Identify the 2-3 critical items. Make everything else medium or low. Give a clear first step. | | SOLID Dogmatism | SOLID principles are diagnostic tools, not laws. A small class with two responsibilities in a 3-person CRUD app is not the same problem as a god class in a distributed system. | Apply SOLID violations as observations, then ask: "Given your team size and rate of change, is this a problem now or later?" | | Failure Mode Blindness | Production systems spend more time in degraded states than on whiteboards. | For every integration point, ask: "What happens when this is slow? Down? Returns garbage?" | | Scalability Theater | Adds operational complexity and real costs for hypothetical growth. | Ask: "What is your current load? Projected load in 12 months? Cost of adding scalability later?" | | Coupling Blindness | Microservices in name only -- the overhead of distribution without the benefits of independence. | Map the actual dependency graph: shared databases, shared schemas, deployment dependencies, temporal coupling. | | Security Afterthought | Trust boundaries and authorization models are architectural decisions. Adding them later requires redesigning the architecture. | Include at least 3 security questions in every review: trust boundaries, data flows, authentication model. |
Architect becomes defensive (short answers, "Are you saying our design is wrong?"): Pause questioning immediately. Reaffirm purpose: "I am stress-testing the design, not criticizing you." Acknowledge specific strengths. Ask what the architect thinks is the riskiest part. Reduce challenge depth by one level.
Incomplete architecture presented ("We haven't decided that yet," many vague diagram boxes): Do not attempt a full review. Shift to exploration mode: help the architect identify the decisions that constrain everything else. Offer a surface-level review now and a deeper review later.
Architect overwhelmed by findings: Immediately prioritize: "Of these [N] findings, only [2-3] are critical. Let me walk you through just those." Separate must-fix from nice-to-fix. Give a concrete first step. Offer to re-review after critical items are addressed.
Known pattern with known tradeoffs: Acknowledge the pattern and its standard concerns. Focus on implementation-specific details: "The interesting questions are not about the pattern itself but about how you have applied it to your specific context."
pattern-tradeoff-analyzer -- When the review identifies a design decision involving pattern selection, hand off for deeper tradeoff analysis of the specific patterns under consideration.dependency-mapper -- When coupling analysis reveals complex relationships, generate a concrete dependency map from the codebase to verify the intended architecture matches the implemented architecture.system-design-kata -- When the review reveals significant gaps in design judgment, recommend katas to build that judgment in a lower-stakes environment.architecture-journal -- After the review, document ADRs for the decisions made, especially the accepted tradeoffs. The vulnerability report and Tradeoff Acceptance Form become inputs to the ADRs.The questioning patterns in this skill are technology-agnostic. Consult the references for framework-specific concerns:
For technology-specific concerns: .NET/C# → dotnet-vertical-slice, ef-migration-manager; Python → python-architecture-checklist, python-feature-slice; Rust → rust-architecture-checklist, axum-scaffolder; Containerized/edge → jetson-deploy, edge-cv-pipeline; Event-driven → focus on message ordering, exactly-once delivery, dead letter queues, and poison messages.
development
Federal / government security overlay applied ON TOP OF a base language security review (dotnet/python/php/rust/react). Language-agnostic: adds NIST SP 800-53 control mapping, FIPS 140-2/3 cryptographic compliance (with a per-language crypto table), CUI handling, EO 14028 supply-chain requirements, and DOE Order 205.1B, and emits POA&M-ready findings with FIPS 199 impact levels. Use for federal/DOE/DOD/national-laboratory systems. Triggers on "federal security review", "NIST compliance", "NIST 800-53", "FISMA", "CUI", "FIPS audit", "DOE security", "POA&M", "ATO review". Do NOT use alone — run the matching <lang>-security-review FIRST; this overlay maps and extends it.
tools
OWASP-based security review of React / TypeScript front-end applications. Detects the framework (Vite/CRA/Next), entry points, and data flows, scans against the OWASP Top 10 (2025) mapped to React client-side patterns (XSS via raw HTML, URL/protocol injection, secrets in the bundle, insecure token storage, dependency CVEs, missing CSP, open redirects), and produces a manager-friendly executive summary plus a graded technical findings table. Use to audit React code for vulnerabilities. Triggers on "react security review", "frontend security audit", "audit react for vulnerabilities", "owasp react", "react xss", "react security posture", "npm audit review". For federal / gov / DOE / NIST / FIPS / CUI context, run security-review-federal after this base review. Do NOT use to grade architecture/structure — use react-architecture-checklist.
tools
Analyzes legacy React codebases and produces actionable modernization plans. Primary migration paths include class components to function components + hooks, Create React App to Vite, React 16/17 to 18 to 19, JavaScript to TypeScript, Enzyme to React Testing Library, legacy Redux to Redux Toolkit / Zustand / Context, and deprecated lifecycle/API removal. Does NOT perform the migration — assesses, quantifies risk, and plans. Triggers on phrases like "modernize react", "class to hooks", "upgrade react", "migrate CRA to vite", "react legacy migration", "react 17 to 18", "react js to typescript", "react technical debt", "enzyme to RTL".
development
Scaffolds feature-based React / TypeScript architecture using feature folders, presentational + container components, custom hooks, a typed data layer, and structural CQRS (query hooks vs mutation hooks). React analog of dotnet-vertical-slice and python-feature-slice — no DI framework; uses props/context for dependency injection and a query cache for server state. Use when creating feature-based React projects, adding React features, organizing components by feature rather than by technical type, or scaffolding a feature's data layer. Triggers on phrases like "scaffold react feature", "create react slice", "react feature folder", "react vertical slice", "add react feature", "react feature architecture", "organize react by feature".