Software Architecture Design
Description
Provide system architecture design proposals, technology stack recommendations, and architecture tradeoff analysis to ensure solutions meet business requirements and non-functional requirements.
When to Use
- User requests "design architecture for XX system" or "help me choose tech stack"
- User asks about system scalability, high availability, or performance optimization strategies
- User needs microservices decomposition, module partitioning, or service boundary design
- User requests architecture review or refactoring proposal
- User asks how to apply architectural theories (CAP theorem, consistency models, distributed transactions) to specific scenarios
- User compares different architecture patterns or technology stacks
When NOT to Use
- User only needs specific code implementation or programming tips without architectural decisions
- User's problem is a pure algorithm or data structure implementation
- User needs UI/UX design rather than system architecture
- User only asks how to use a framework or library without system-level design
- User's project is extremely small (e.g., personal script, single-file tool) and doesn't require architecture
Input
{
requirements: {
businessScenario: string // Business scenario description
userScale?: string // User scale (e.g., "1M DAU")
qps?: string // Query/Request volume (e.g., "1000 QPS peak")
dataVolume?: string // Data volume (e.g., "10TB historical data")
latencyRequirement?: string // Latency requirement (e.g., "p99 < 100ms")
readWriteRatio?: string // Read/Write ratio (e.g., "read:write = 9:1")
consistencyRequirement?: string // Consistency (strong/eventual/causal)
}
constraints: {
budget?: string // Budget constraints
teamSize?: string // Team size and skill set
timeline?: string // Delivery timeline
existingTechStack?: string[] // Existing technology stack
complianceRequirements?: string // Compliance (e.g., GDPR, SOC2)
}
goals: {
priority: string // Core objective (performance/cost/time-to-market)
tradeoffs?: string // Known tradeoff preferences
}
existingArchitecture?: string // Existing architecture (for review/refactoring)
}
Output
{
architectureProposal: {
style: string // Architecture style (monolithic/layered/microservices/event-driven/CQRS/serverless)
topology: string // Topology description (components, data flow, call relationships)
diagram?: string // Mermaid diagram or C4 model description
componentBreakdown: {
name: string
responsibility: string
technology: string
}[]
}
techStackRecommendation: {
category: string // Category (database/cache/message queue/load balancer, etc.)
options: {
name: string
pros: string[]
cons: string[]
justification: string // Selection rationale
}[]
recommendation: string // Recommended solution
risks: string[] // Potential risks
mitigationPlan: string // Risk mitigation measures
}[]
tradeoffAnalysis: {
dimension: string // Tradeoff dimension (performance vs cost/consistency vs availability, etc.)
options: {
choice: string
pros: string[]
cons: string[]
applicableScenarios: string[]
}[]
recommendation: string
}[]
nonFunctionalRequirements: {
highAvailability?: string // HA solution (failover/degradation/circuit breaking/rate limiting)
scalability?: string // Scalability solution (stateless design/sharding/caching)
observability?: string // Observability (logging/monitoring/tracing/alerting)
security?: string // Security (authentication/authorization/encryption/audit)
}
evolutionPath?: string // Architecture evolution path (e.g., monolith to microservices migration)
}
Execution Workflow
Copy the following checklist before starting, and explicitly mark status after completing each step.
Step 1: Requirement Clarification and Constraint Identification
- Confirm business scenario and core use cases
- Quantify key metrics (user scale, QPS, latency, data volume)
- Identify read/write patterns and consistency requirements
- Clarify resource constraints (budget, team, timeline, existing tech stack)
- Determine priority objectives (performance/cost/time-to-market)
Feedback Loop: If critical constraint information is missing (e.g., QPS or data volume), MUST ask user to provide details. Avoid designing based on assumptions.
Step 2: Architecture Style Selection
- List candidate architecture styles (monolithic/layered/microservices/event-driven/CQRS/serverless)
- Compare applicability of each style in current scenario
- Explain recommended approach and rationale
Feedback Loop: If business scenario allows multiple reasonable architectures, provide 2-3 options for user to weigh, rather than a single answer.
Step 3: Component Design and Technology Selection
- Define core system components and their responsibility boundaries
- Describe data flow and call relationships between components
- For each technology category (database/cache/message queue, etc.), provide candidate comparisons
- Explain recommended tech stack and selection rationale (performance/maturity/ecosystem/team familiarity)
Feedback Loop: If recommended tech stack conflicts with existing stack, MUST explain migration cost and evolution path, or provide compatible alternatives.
Step 4: Tradeoff Analysis
- Identify key tradeoff dimensions (performance vs cost, consistency vs availability, complexity vs flexibility)
- Provide pros/cons analysis for different choices in each dimension
- Give recommended decision based on business objectives
Example Tradeoff Dimensions:
- Performance vs Cost: Vertical scaling vs Horizontal scaling
- Consistency vs Availability: CAP theorem application (CP vs AP)
- Complexity vs Flexibility: Monolith vs Microservices
- Real-time vs Resource consumption: Push vs Pull model
Step 5: Non-Functional Requirements Design
- High Availability: Failover, service degradation, circuit breaking, rate limiting
- Scalability: Stateless design, sharding strategy, caching layers
- Observability: Log aggregation, metrics monitoring, distributed tracing, alerting rules
- Security: Authentication/authorization, data encryption, audit logs
Feedback Loop: If user hasn't clarified non-functional requirement priorities, provide default reasonable solutions and mark optional enhancements.
Step 6: Risk Identification and Mitigation
- List potential risks of architecture proposal (technical, operational, cost risks)
- Provide mitigation measures for each risk
- Explain architecture evolution path (e.g., monolith to microservices migration strategy)
Feedback Loop: If solution has significant unmitigable risks, MUST explicitly inform user rather than hide or downplay.
Failure Handling
Unclear Requirements
- Symptom: User only provides vague description (e.g., "design a high-concurrency system")
- Action: Return requirement clarification checklist, ask user to provide key constraints (user scale, QPS, latency, data volume)
Conflicting Constraints
- Symptom: User demands extremely high performance with extremely low budget
- Action: Clearly point out constraint conflicts, provide multiple solutions with cost/performance tradeoffs, let user decide
Tech Stack Limitations
- Symptom: User requires using unsuitable tech stack (e.g., relational database for time-series data)
- Action: Explain tech stack limitations, provide alternatives or compromises (e.g., TimescaleDB)
Architecture Review Failure
- Symptom: Existing architecture has serious design flaws
- Action: Clearly point out issues, impact scope, and severity. Provide incremental refactoring path rather than complete rewrite.
See Also
deep-learning-expert — when the system centers on model training or serving.
llm-testing-expert — quality and safety infrastructure for LLM-powered systems.
github-master — turning the design into CI/CD, branching, and release workflows.
1---2name: software-architect3description: Use this skill when user needs system architecture design, technology stack selection, or architecture review. Trigger keywords: system design, architecture proposal, tech stack, microservices, distributed systems, high availability, scalability, CAP theorem, architecture tradeoffs, refactoring plan. Applicable to high-level design decisions, not specific code implementation.4---56# Software Architecture Design78## Description9Provide system architecture design proposals, technology stack recommendations, and architecture tradeoff analysis to ensure solutions meet business requirements and non-functional requirements.1011## When to Use12- User requests "design architecture for XX system" or "help me choose tech stack"13- User asks about system scalability, high availability, or performance optimization strategies14- User needs microservices decomposition, module partitioning, or service boundary design15- User requests architecture review or refactoring proposal16- User asks how to apply architectural theories (CAP theorem, consistency models, distributed transactions) to specific scenarios17- User compares different architecture patterns or technology stacks1819## When NOT to Use20- User only needs specific code implementation or programming tips without architectural decisions21- User's problem is a pure algorithm or data structure implementation22- User needs UI/UX design rather than system architecture23- User only asks how to use a framework or library without system-level design24- User's project is extremely small (e.g., personal script, single-file tool) and doesn't require architecture2526## Input27```typescript28{29 requirements: {30 businessScenario: string // Business scenario description31 userScale?: string // User scale (e.g., "1M DAU")32 qps?: string // Query/Request volume (e.g., "1000 QPS peak")33 dataVolume?: string // Data volume (e.g., "10TB historical data")34 latencyRequirement?: string // Latency requirement (e.g., "p99 < 100ms")35 readWriteRatio?: string // Read/Write ratio (e.g., "read:write = 9:1")36 consistencyRequirement?: string // Consistency (strong/eventual/causal)37 }38 constraints: {39 budget?: string // Budget constraints40 teamSize?: string // Team size and skill set41 timeline?: string // Delivery timeline42 existingTechStack?: string[] // Existing technology stack43 complianceRequirements?: string // Compliance (e.g., GDPR, SOC2)44 }45 goals: {46 priority: string // Core objective (performance/cost/time-to-market)47 tradeoffs?: string // Known tradeoff preferences48 }49 existingArchitecture?: string // Existing architecture (for review/refactoring)50}51```5253## Output54```typescript55{56 architectureProposal: {57 style: string // Architecture style (monolithic/layered/microservices/event-driven/CQRS/serverless)58 topology: string // Topology description (components, data flow, call relationships)59 diagram?: string // Mermaid diagram or C4 model description60 componentBreakdown: {61 name: string62 responsibility: string63 technology: string64 }[]65 }66 techStackRecommendation: {67 category: string // Category (database/cache/message queue/load balancer, etc.)68 options: {69 name: string70 pros: string[]71 cons: string[]72 justification: string // Selection rationale73 }[]74 recommendation: string // Recommended solution75 risks: string[] // Potential risks76 mitigationPlan: string // Risk mitigation measures77 }[]78 tradeoffAnalysis: {79 dimension: string // Tradeoff dimension (performance vs cost/consistency vs availability, etc.)80 options: {81 choice: string82 pros: string[]83 cons: string[]84 applicableScenarios: string[]85 }[]86 recommendation: string87 }[]88 nonFunctionalRequirements: {89 highAvailability?: string // HA solution (failover/degradation/circuit breaking/rate limiting)90 scalability?: string // Scalability solution (stateless design/sharding/caching)91 observability?: string // Observability (logging/monitoring/tracing/alerting)92 security?: string // Security (authentication/authorization/encryption/audit)93 }94 evolutionPath?: string // Architecture evolution path (e.g., monolith to microservices migration)95}96```9798## Execution Workflow99100Copy the following checklist before starting, and explicitly mark status after completing each step.101102### Step 1: Requirement Clarification and Constraint Identification103- Confirm business scenario and core use cases104- Quantify key metrics (user scale, QPS, latency, data volume)105- Identify read/write patterns and consistency requirements106- Clarify resource constraints (budget, team, timeline, existing tech stack)107- Determine priority objectives (performance/cost/time-to-market)108109**Feedback Loop**: If critical constraint information is missing (e.g., QPS or data volume), MUST ask user to provide details. Avoid designing based on assumptions.110111### Step 2: Architecture Style Selection112- List candidate architecture styles (monolithic/layered/microservices/event-driven/CQRS/serverless)113- Compare applicability of each style in current scenario114- Explain recommended approach and rationale115116**Feedback Loop**: If business scenario allows multiple reasonable architectures, provide 2-3 options for user to weigh, rather than a single answer.117118### Step 3: Component Design and Technology Selection119- Define core system components and their responsibility boundaries120- Describe data flow and call relationships between components121- For each technology category (database/cache/message queue, etc.), provide candidate comparisons122- Explain recommended tech stack and selection rationale (performance/maturity/ecosystem/team familiarity)123124**Feedback Loop**: If recommended tech stack conflicts with existing stack, MUST explain migration cost and evolution path, or provide compatible alternatives.125126### Step 4: Tradeoff Analysis127- Identify key tradeoff dimensions (performance vs cost, consistency vs availability, complexity vs flexibility)128- Provide pros/cons analysis for different choices in each dimension129- Give recommended decision based on business objectives130131**Example Tradeoff Dimensions**:132- Performance vs Cost: Vertical scaling vs Horizontal scaling133- Consistency vs Availability: CAP theorem application (CP vs AP)134- Complexity vs Flexibility: Monolith vs Microservices135- Real-time vs Resource consumption: Push vs Pull model136137### Step 5: Non-Functional Requirements Design138- High Availability: Failover, service degradation, circuit breaking, rate limiting139- Scalability: Stateless design, sharding strategy, caching layers140- Observability: Log aggregation, metrics monitoring, distributed tracing, alerting rules141- Security: Authentication/authorization, data encryption, audit logs142143**Feedback Loop**: If user hasn't clarified non-functional requirement priorities, provide default reasonable solutions and mark optional enhancements.144145### Step 6: Risk Identification and Mitigation146- List potential risks of architecture proposal (technical, operational, cost risks)147- Provide mitigation measures for each risk148- Explain architecture evolution path (e.g., monolith to microservices migration strategy)149150**Feedback Loop**: If solution has significant unmitigable risks, MUST explicitly inform user rather than hide or downplay.151152## Failure Handling153154### Unclear Requirements155- **Symptom**: User only provides vague description (e.g., "design a high-concurrency system")156- **Action**: Return requirement clarification checklist, ask user to provide key constraints (user scale, QPS, latency, data volume)157158### Conflicting Constraints159- **Symptom**: User demands extremely high performance with extremely low budget160- **Action**: Clearly point out constraint conflicts, provide multiple solutions with cost/performance tradeoffs, let user decide161162### Tech Stack Limitations163- **Symptom**: User requires using unsuitable tech stack (e.g., relational database for time-series data)164- **Action**: Explain tech stack limitations, provide alternatives or compromises (e.g., TimescaleDB)165166### Architecture Review Failure167- **Symptom**: Existing architecture has serious design flaws168- **Action**: Clearly point out issues, impact scope, and severity. Provide incremental refactoring path rather than complete rewrite.169170## See Also171- `deep-learning-expert` — when the system centers on model training or serving.172- `llm-testing-expert` — quality and safety infrastructure for LLM-powered systems.173- `github-master` — turning the design into CI/CD, branching, and release workflows.