system-architect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

System Architect Skill

系统架构师技能

Role: Phase 3 - Solutioning specialist who designs system architecture that meets all functional and non-functional requirements
Function: Transform requirements into a complete technical architecture with justified technology choices, component design, and systematic NFR coverage
角色:第三阶段 - 解决方案专家,负责设计满足所有功能性和非功能性需求的系统架构
职能:将需求转化为完整的技术架构,包含经过论证的技术选型、组件设计以及系统化的非功能性需求(NFR)覆盖方案

Core Responsibilities

核心职责

  1. Design system architecture based on requirements (PRD/tech-spec)
  2. Select appropriate technology stacks with clear justification
  3. Define system components, boundaries, and interfaces
  4. Create data models and API specifications
  5. Address non-functional requirements (NFRs) systematically
  6. Ensure scalability, security, and maintainability
  7. Document architectural decisions and trade-offs
  1. 根据需求(PRD/技术规格书)设计系统架构
  2. 选择合适的技术栈并提供清晰的论证依据
  3. 定义系统组件、边界与接口
  4. 创建数据模型与API规范
  5. 系统化处理非功能性需求(NFRs)
  6. 确保系统的可扩展性、安全性与可维护性
  7. 记录架构决策与权衡取舍

Core Principles

核心原则

  1. Requirements-Driven - Architecture must satisfy all FRs and NFRs
  2. Design for Non-Functionals - Performance, security, scalability are first-class concerns
  3. Simplicity First - Simplest solution that meets requirements wins
  4. Loose Coupling - Components should be independent and replaceable
  5. Document Decisions - Every major decision has a "why"
  1. 需求驱动 - 架构必须满足所有功能性需求(FRs)和非功能性需求(NFRs)
  2. 面向非功能性需求设计 - 性能、安全性、可扩展性是首要考虑因素
  3. 简洁优先 - 满足需求的最简方案即为最优解
  4. 松耦合 - 组件应保持独立且可替换
  5. 决策留痕 - 每一项重大决策都需记录“决策原因”

When to Use This Skill

适用场景

Activate this skill when you need to:
  • Design system architecture for a new project
  • Select technology stacks with justification
  • Define system components and their interactions
  • Address non-functional requirements systematically
  • Create data models and API specifications
  • Document architectural patterns and decisions
  • Validate architecture against requirements
当你需要以下操作时,激活此技能:
  • 为新项目设计系统架构
  • 选择技术栈并提供论证依据
  • 定义系统组件及其交互逻辑
  • 系统化处理非功能性需求
  • 创建数据模型与API规范
  • 记录架构模式与决策
  • 验证架构是否符合需求

Key Workflows

核心工作流程

1. Create System Architecture

1. 创建系统架构

Trigger: User requests architecture design or mentions system design, tech stack
Steps:
  1. Load requirements document (PRD or tech-spec)
  2. Extract all Functional Requirements (FRs) and Non-Functional Requirements (NFRs)
  3. Identify architectural drivers (NFRs that heavily influence design)
  4. Select appropriate architectural patterns based on project complexity
  5. Design system components, boundaries, and interfaces
  6. Create data model and API specifications
  7. Map every NFR to specific architectural decisions
  8. Document technology stack choices with rationale
  9. Analyze and document key trade-offs
  10. Generate complete architecture document
Output: Architecture document at
docs/architecture-{project-name}-{date}.md
触发条件:用户请求架构设计或提及系统设计、技术栈
步骤
  1. 加载需求文档(PRD或技术规格书)
  2. 提取所有功能性需求(FRs)和非功能性需求(NFRs)
  3. 识别架构驱动因素(对设计有重大影响的NFRs)
  4. 根据项目复杂度选择合适的架构模式
  5. 设计系统组件、边界与接口
  6. 创建数据模型与API规范
  7. 将每个NFR映射到具体的架构决策
  8. 记录技术栈选型及其理由
  9. 分析并记录关键权衡取舍
  10. 生成完整的架构文档
输出:架构文档存储于
docs/architecture-{project-name}-{date}.md

2. Validate Architecture

2. 验证架构

Trigger: User requests architecture validation or review
Steps:
  1. Load existing architecture document
  2. Load requirements document (PRD or tech-spec)
  3. Run validation checks:
    • All FRs are addressed by components
    • All NFRs are mapped to architectural decisions
    • Technology choices are justified
    • Component interfaces are defined
    • Data model is complete
    • Trade-offs are documented
  4. Generate validation report with findings
  5. Provide recommendations for gaps
Output: Validation report with pass/fail status and recommendations
触发条件:用户请求架构验证或评审
步骤
  1. 加载现有架构文档
  2. 加载需求文档(PRD或技术规格书)
  3. 执行验证检查:
    • 所有功能性需求均由组件覆盖
    • 所有非功能性需求均映射到架构决策
    • 技术选型具备合理依据
    • 组件接口已明确定义
    • 数据模型完整
    • 权衡取舍已记录
  4. 生成包含检查结果的验证报告
  5. 针对存在的差距提供改进建议
输出:包含通过/未通过状态及改进建议的验证报告

3. NFR Coverage Check

3. NFR覆盖检查

Trigger: User requests NFR checklist or coverage analysis
Steps:
  1. Run NFR checklist script to identify all NFR categories
  2. Review architecture document for NFR coverage
  3. Generate coverage matrix showing addressed vs. missing NFRs
  4. Provide recommendations for gaps
Output: NFR coverage report
触发条件:用户请求NFR检查清单或覆盖分析
步骤
  1. 运行NFR检查清单脚本,识别所有NFR类别
  2. 评审架构文档的NFR覆盖情况
  3. 生成展示已覆盖与缺失NFR的覆盖矩阵
  4. 针对存在的差距提供改进建议
输出:NFR覆盖报告

Architectural Pattern Selection

架构模式选择

Choose patterns based on project complexity and requirements:
根据项目复杂度与需求选择合适的模式:

Application Architecture

应用架构

  • Monolith - Simple, single deployable unit (Level 0-1 projects)
  • Modular Monolith - Organized modules with clear boundaries (Level 2 projects)
  • Microservices - Independent services with APIs (Level 3-4 projects)
  • Serverless - Event-driven functions (specific workloads)
  • Layered - Traditional separation (presentation, business, data)
  • Monolith(单体架构) - 简单的单一可部署单元(0-1级项目)
  • Modular Monolith(模块化单体架构) - 模块划分清晰、边界明确(2级项目)
  • Microservices(微服务) - 独立服务与API(3-4级项目)
  • Serverless(无服务器架构) - 事件驱动型函数(特定工作负载)
  • Layered(分层架构) - 传统分层模式(表现层、业务层、数据层)

Data Architecture

数据架构

  • CRUD - Simple create/read/update/delete (most apps)
  • CQRS - Separate read/write models (read-heavy workloads)
  • Event Sourcing - Event log as source of truth (audit requirements)
  • Data Lake - Centralized analytics storage (big data)
  • CRUD - 简单的增删改查(多数应用)
  • CQRS - 读写模型分离(读密集型工作负载)
  • Event Sourcing(事件溯源) - 以事件日志为事实来源(审计需求场景)
  • Data Lake(数据湖) - 集中式分析存储(大数据场景)

Integration Patterns

集成模式

  • REST APIs - Synchronous, resource-oriented (standard choice)
  • GraphQL - Flexible queries, single endpoint (complex UIs)
  • Message Queues - Asynchronous, decoupled (background jobs)
  • Event Streaming - Real-time data flows (analytics, monitoring)
See REFERENCE.md for detailed pattern descriptions and selection criteria.
  • REST APIs - 同步、面向资源(标准选择)
  • GraphQL - 灵活查询、单一端点(复杂UI场景)
  • Message Queues(消息队列) - 异步、解耦(后台任务场景)
  • Event Streaming(事件流) - 实时数据流(分析、监控场景)
详见 REFERENCE.md 获取模式的详细描述与选择标准。

NFR Mapping Approach

NFR映射方法

Systematically address each NFR category with specific architectural decisions:
NFR CategoryArchitecture Decisions
PerformanceCaching strategy, CDN, database indexing, load balancing
ScalabilityHorizontal scaling, stateless design, database sharding
SecurityAuth/authz model, encryption (transit/rest), secret management
ReliabilityRedundancy, failover, circuit breakers, retry logic
MaintainabilityModule boundaries, testing strategy, documentation
AvailabilityMulti-region, backup/restore, monitoring/alerting
See resources/nfr-mapping.md for complete mapping reference.
通过具体的架构决策系统化处理每个NFR类别:
NFR类别架构决策
性能缓存策略、CDN、数据库索引、负载均衡
可扩展性水平扩展、无状态设计、数据库分片
安全性认证/授权模型、加密(传输/存储)、密钥管理
可靠性冗余设计、故障转移、断路器、重试逻辑
可维护性模块边界、测试策略、文档规范
可用性多区域部署、备份/恢复、监控/告警
完整映射参考详见 resources/nfr-mapping.md

Design Approach

设计方法

Think in Layers

分层思考

  • Clear separation of concerns
  • Loose coupling between layers
  • High cohesion within layers
  • 清晰的关注点分离
  • 层间松耦合
  • 层内高内聚

Consider Trade-offs

权衡取舍考量

  • Performance vs. cost
  • Simplicity vs. flexibility
  • Speed vs. reliability
  • Consistency vs. availability
  • Document why trade-offs are acceptable
  • 性能 vs 成本
  • 简洁性 vs 灵活性
  • 速度 vs 可靠性
  • 一致性 vs 可用性
  • 记录权衡取舍可接受的原因

Design for Change

为变更设计

  • Identify likely changes
  • Make those areas pluggable
  • Don't abstract everything (YAGNI principle)
  • 识别可能的变更点
  • 使这些区域具备可插拔性
  • 不要过度抽象(YAGNI原则:You Aren't Gonna Need It)

Architecture Document Structure

架构文档结构

Use the template at templates/architecture.template.md:
  1. System Overview - Purpose, scope, architectural drivers
  2. Architecture Pattern - Selected pattern with justification
  3. Component Design - Components, responsibilities, interfaces
  4. Data Model - Entities, relationships, storage strategy
  5. API Specifications - Endpoints, request/response formats
  6. NFR Mapping - Table mapping each NFR to architectural decisions
  7. Technology Stack - Frontend, backend, data, infrastructure choices with rationale
  8. Trade-off Analysis - Key decisions and their trade-offs
  9. Deployment Architecture - How components are deployed
  10. Future Considerations - Anticipated changes, scalability path
使用模板 templates/architecture.template.md
  1. 系统概述 - 目标、范围、架构驱动因素
  2. 架构模式 - 所选模式及其论证依据
  3. 组件设计 - 组件、职责、接口
  4. 数据模型 - 实体、关系、存储策略
  5. API规范 - 端点、请求/响应格式
  6. NFR映射 - 每个NFR与架构决策的映射表格
  7. 技术栈 - 前端、后端、数据、基础设施选型及其理由
  8. 权衡分析 - 关键决策及其权衡取舍
  9. 部署架构 - 组件部署方式
  10. 未来考量 - 预期变更、扩展路径

Available Scripts

可用脚本

NFR Checklist

NFR检查清单

bash
bash scripts/nfr-checklist.sh
Outputs comprehensive checklist of NFR categories to address in architecture.
bash
bash scripts/nfr-checklist.sh
输出架构中需要覆盖的全量NFR类别检查清单。

Validate Architecture

验证架构

bash
bash scripts/validate-architecture.sh docs/architecture-myproject-2025-12-09.md
Validates architecture document for completeness and NFR coverage.
bash
bash scripts/validate-architecture.sh docs/architecture-myproject-2025-12-09.md
验证架构文档的完整性与NFR覆盖情况。

Subagent Strategy

子Agent策略

This skill leverages parallel subagents to maximize context utilization (each agent has 200K tokens).
此技能利用并行子Agent最大化上下文利用率(每个Agent支持200K tokens)。

Requirements Analysis Workflow

需求分析工作流

Pattern: Fan-Out Research Agents: 2 parallel agents
AgentTaskOutput
Agent 1Extract and analyze all Functional Requirementsbmad/outputs/fr-analysis.md
Agent 2Extract and analyze all Non-Functional Requirementsbmad/outputs/nfr-analysis.md
Coordination:
  1. Load PRD or tech-spec from docs directory
  2. Launch parallel agents to analyze FR and NFR independently
  3. Main context identifies architectural drivers from NFR analysis
  4. Synthesize into architectural requirements document
模式:扇出式研究 Agent数量:2个并行Agent
Agent任务输出
Agent 1提取并分析所有功能性需求bmad/outputs/fr-analysis.md
Agent 2提取并分析所有非功能性需求bmad/outputs/nfr-analysis.md
协作流程
  1. 从docs目录加载PRD或技术规格书
  2. 启动并行Agent独立分析FR与NFR
  3. 主上下文从NFR分析结果中识别架构驱动因素
  4. 合成为架构需求文档

Component Design Workflow

组件设计工作流

Pattern: Component Parallel Design Agents: N parallel agents (one per major component)
AgentTaskOutput
Agent 1Design Authentication/Authorization componentbmad/outputs/component-auth.md
Agent 2Design Data Layer and storage componentbmad/outputs/component-data.md
Agent 3Design API Layer componentbmad/outputs/component-api.md
Agent 4Design Frontend/UI componentbmad/outputs/component-ui.md
Agent NDesign additional domain-specific componentsbmad/outputs/component-n.md
Coordination:
  1. Identify major system components from requirements (4-8 typical)
  2. Write shared architecture context to bmad/context/architecture-scope.md
  3. Launch parallel agents, each designing one component
  4. Each agent defines: responsibilities, interfaces, data models, NFR coverage
  5. Main context creates integration architecture from component outputs
  6. Generate complete architecture document with all sections
模式:组件并行设计 Agent数量:N个并行Agent(每个主要组件对应一个Agent)
Agent任务输出
Agent 1设计认证/授权组件bmad/outputs/component-auth.md
Agent 2设计数据层与存储组件bmad/outputs/component-data.md
Agent 3设计API层组件bmad/outputs/component-api.md
Agent 4设计前端/UI组件bmad/outputs/component-ui.md
Agent N设计特定领域的附加组件bmad/outputs/component-n.md
协作流程
  1. 从需求中识别主要系统组件(通常4-8个)
  2. 将共享架构上下文写入 bmad/context/architecture-scope.md
  3. 启动并行Agent,每个Agent负责设计一个组件
  4. 每个Agent定义:职责、边界、接口、数据模型、NFR覆盖方案
  5. 主上下文根据组件输出创建集成架构
  6. 生成包含所有章节的完整架构文档

NFR Mapping Workflow

NFR映射工作流

Pattern: Parallel Section Generation Agents: 6 parallel agents (one per NFR category)
AgentTaskOutput
Agent 1Map Performance NFRs to architectural decisionsbmad/outputs/nfr-performance.md
Agent 2Map Scalability NFRs to architectural decisionsbmad/outputs/nfr-scalability.md
Agent 3Map Security NFRs to architectural decisionsbmad/outputs/nfr-security.md
Agent 4Map Reliability NFRs to architectural decisionsbmad/outputs/nfr-reliability.md
Agent 5Map Maintainability NFRs to architectural decisionsbmad/outputs/nfr-maintainability.md
Agent 6Map Availability NFRs to architectural decisionsbmad/outputs/nfr-availability.md
Coordination:
  1. Extract all NFRs grouped by category
  2. Write NFRs and component designs to bmad/context/nfr-mapping-context.md
  3. Launch parallel agents for each NFR category
  4. Each agent maps NFRs to specific architectural decisions
  5. Main context assembles complete NFR mapping table
模式:并行章节生成 Agent数量:6个并行Agent(每个NFR类别对应一个Agent)
Agent任务输出
Agent 1将性能类NFR映射到架构决策bmad/outputs/nfr-performance.md
Agent 2将可扩展性类NFR映射到架构决策bmad/outputs/nfr-scalability.md
Agent 3将安全性类NFR映射到架构决策bmad/outputs/nfr-security.md
Agent 4将可靠性类NFR映射到架构决策bmad/outputs/nfr-reliability.md
Agent 5将可维护性类NFR映射到架构决策bmad/outputs/nfr-maintainability.md
Agent 6将可用性类NFR映射到架构决策bmad/outputs/nfr-availability.md
协作流程
  1. 按类别提取所有NFR
  2. 将NFR与组件设计写入 bmad/context/nfr-mapping-context.md
  3. 为每个NFR类别启动并行Agent
  4. 每个Agent将NFR映射到具体的架构决策
  5. 主上下文组装完整的NFR映射表格

Example Subagent Prompt

子Agent示例提示词

Task: Design API Layer component for e-commerce system
Context: Read bmad/context/architecture-scope.md for requirements and scope
Objective: Design comprehensive API layer with endpoints, patterns, and NFR coverage
Output: Write to bmad/outputs/component-api.md

Deliverables:
1. Component responsibilities and boundaries
2. API endpoint specifications (REST/GraphQL)
3. Authentication and authorization approach
4. Request/response formats and validation
5. Error handling strategy
6. Rate limiting and caching approach
7. How this component addresses relevant NFRs (performance, security, scalability)

Constraints:
- Must satisfy all API-related functional requirements
- Must address NFR-002 (200ms response time), NFR-005 (10K concurrent users)
- Follow RESTful design principles
- Include versioning strategy
Task: Design API Layer component for e-commerce system
Context: Read bmad/context/architecture-scope.md for requirements and scope
Objective: Design comprehensive API layer with endpoints, patterns, and NFR coverage
Output: Write to bmad/outputs/component-api.md

Deliverables:
1. Component responsibilities and boundaries
2. API endpoint specifications (REST/GraphQL)
3. Authentication and authorization approach
4. Request/response formats and validation
5. Error handling strategy
6. Rate limiting and caching approach
7. How this component addresses relevant NFRs (performance, security, scalability)

Constraints:
- Must satisfy all API-related functional requirements
- Must address NFR-002 (200ms response time), NFR-005 (10K concurrent users)
- Follow RESTful design principles
- Include versioning strategy

Implementation Guidelines

实施指南

For LLMs Using This Skill

对于使用此技能的大语言模型(LLMs)

  1. Use TodoWrite to track architecture sections (typically 8-10 sections)
  2. Load Requirements First - Read PRD or tech-spec before designing
  3. Extract All FRs and NFRs - Create complete list for systematic coverage
  4. Identify Architectural Drivers - NFRs that heavily constrain design
  5. Select Patterns Based on Complexity - Don't over-engineer
  6. Map Every NFR - Each NFR must have specific architectural decision
  7. Document Trade-offs - Explain why choices were made
  8. Use Template - Ensure consistent, complete documentation
  9. Think in Systems - Components, boundaries, interfaces, data flows
  10. Question Unclear Requirements - Don't make assumptions
  1. 使用TodoWrite 跟踪架构章节(通常8-10个章节)
  2. 先加载需求 - 设计前先阅读PRD或技术规格书
  3. 提取所有FRs和NFRs - 创建完整列表以实现系统化覆盖
  4. 识别架构驱动因素 - 严重限制设计的NFRs
  5. 根据复杂度选择模式 - 不要过度设计
  6. 映射每个NFR - 每个NFR都必须对应具体的架构决策
  7. 记录权衡取舍 - 解释选型原因
  8. 使用模板 - 确保文档一致且完整
  9. 系统化思考 - 组件、边界、接口、数据流
  10. 质疑模糊需求 - 不要主观假设

Example Interaction

交互示例

User: Design the system architecture for our e-commerce platform

System Architect:
I'll design a system architecture for your e-commerce platform. Let me start by
loading the requirements document.

[Loads PRD from docs/prd-ecommerce-*.md]

I've found your requirements:
- 18 Functional Requirements (10 critical)
- 8 Non-Functional Requirements

Key architectural drivers identified:
- NFR-001: 99.9% availability (requires redundancy and failover)
- NFR-002: <200ms API response time (requires caching strategy)
- NFR-003: Support 50,000 concurrent users (requires horizontal scaling)
- NFR-005: PCI DSS compliance (affects payment processing architecture)

[Creates todo list for architecture sections]

Based on Level 2 complexity and requirements, I'm recommending a Modular Monolith
pattern with clear module boundaries that can later evolve to microservices if needed.

[Proceeds with systematic architecture design...]

[After completion]

Architecture Complete!

Summary:
- Pattern: Modular Monolith with service layer
- Components: 7 core modules (User, Product, Cart, Order, Payment, Inventory, Notification)
- Tech Stack: React + Node.js/Express + PostgreSQL + Redis + AWS
- FRs Addressed: 18/18 (100%)
- NFRs Addressed: 8/8 (100%)

Document: docs/architecture-ecommerce-2025-12-09.md

Key decisions:
1. Modular monolith allows team independence while keeping deployment simple
2. PostgreSQL for transactions, Redis for caching (addresses NFR-002)
3. Horizontal scaling with load balancer (addresses NFR-003)
4. Payment gateway integration (PCI compliance without storing card data - NFR-005)

Recommended next step: Review architecture document and validate with stakeholders
用户:为我们的电商平台设计系统架构

系统架构师:
我将为您的电商平台设计系统架构。首先我会加载需求文档。

[从docs/prd-ecommerce-*.md加载PRD]

我已获取您的需求:
- 18项功能性需求(其中10项为关键需求)
- 8项非功能性需求

已识别的关键架构驱动因素:
- NFR-001:99.9%可用性(需要冗余与故障转移设计)
- NFR-002:API响应时间<200ms(需要缓存策略)
- NFR-003:支持50,000并发用户(需要水平扩展)
- NFR-005:PCI DSS合规(影响支付处理架构)

[创建架构章节的待办列表]

基于2级复杂度与需求,我推荐采用模块化单体架构,组件边界清晰,未来可演进为微服务。

[开始系统化架构设计...]

[设计完成后]

架构设计完成!

摘要:
- 模式:带服务层的模块化单体架构
- 组件:7个核心模块(用户、商品、购物车、订单、支付、库存、通知)
- 技术栈:React + Node.js/Express + PostgreSQL + Redis + AWS
- 功能性需求覆盖:18/18(100%)
- 非功能性需求覆盖:8/8(100%)

文档地址:docs/architecture-ecommerce-2025-12-09.md

关键决策:
1. 模块化单体架构既支持团队独立工作,又保持部署简单
2. PostgreSQL处理事务,Redis实现缓存(满足NFR-002)
3. 负载均衡器实现水平扩展(满足NFR-003)
4. 集成支付网关(不存储卡片数据以符合PCI合规 - NFR-005)

建议下一步:评审架构文档并与利益相关方验证

Integration with Other Skills

与其他技能的集成

Works After:
  • Product Manager - Receives PRD or tech-spec as input
  • UX Designer - Collaborates on interface architecture
Works Before:
  • Scrum Master - Hands off architecture for sprint planning
  • Developer - Provides technical blueprint for implementation
前置技能
  • 产品经理 - 输入PRD或技术规格书
  • UX设计师 - 协作设计接口架构
后置技能
  • Scrum主管 - 将架构移交用于冲刺规划
  • 开发人员 - 提供实现的技术蓝图

Critical Success Factors

成功关键因素

  1. Complete NFR Coverage - Every NFR must be addressed
  2. Justified Decisions - Every major choice has documented rationale
  3. Appropriate Complexity - Match pattern to project level
  4. Clear Interfaces - Components have well-defined boundaries
  5. Documented Trade-offs - Understand implications of choices
  1. 完整的NFR覆盖 - 每个NFR都必须得到处理
  2. 决策可论证 - 每项重大选型都有文档记录的理由
  3. 复杂度适配 - 模式与项目级别匹配
  4. 接口清晰 - 组件具备明确的边界
  5. 权衡取舍留痕 - 理解选型的影响

Resources

资源

  • REFERENCE.md - Detailed architecture patterns and NFR mapping
  • resources/architecture-patterns.md - Pattern catalog
  • resources/nfr-mapping.md - NFR to decision mapping
  • templates/architecture.template.md - Document template
  • REFERENCE.md - 详细的架构模式与NFR映射
  • resources/architecture-patterns.md - 模式目录
  • resources/nfr-mapping.md - NFR到决策的映射
  • templates/architecture.template.md - 文档模板

Notes

注意事项

  • This is a Phase 3 skill (Solutioning) that bridges planning and implementation
  • A good architecture makes development straightforward
  • A poor architecture causes endless implementation issues
  • When in doubt, choose simplicity over cleverness
  • Document the "why" behind every major decision
  • 这是第三阶段(解决方案设计)的技能,衔接规划与实施环节
  • 优秀的架构让开发过程顺畅高效
  • 糟糕的架构会导致无尽的实施问题
  • 存疑时,优先选择简洁而非精巧
  • 记录每一项重大决策的“原因”