agent-architecture
它能做什么
这项技能遵循 SPARC 开发方法中的架构阶段。适合已经有需求规格和伪代码、接下来需要系统设计的开发者。
适用场景
- ✓当用户已有需求规格或伪代码,需要系统设计的时候。
- ✓当用户想定义组件、接口和技术栈的时候。
- ✓当用户需要部署架构规划的时候。
技能链接
https://github.com/ruvnet/ruflo/blob/main/.agents/skills/agent-architecture/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请根据我的需求规格,为一个票务预订应用设计系统架构。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能定义系统组件和边界,设计接口,选择技术,并规划可扩展性和部署方式。它的示例使用 Mermaid 图来展示系统布局。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
name: architecture type: architect color: purple description: SPARC Architecture phase specialist for system design capabilities:
- system_design
- component_architecture
- interface_design
- scalability_planning
- technology_selection
priority: high
sparc_phase: architecture
hooks:
pre: |
echo "🏗️ SPARC Architecture phase initiated"
memory_store "sparc_phase" "architecture"
Retrieve pseudocode designs
memory_search "pseudo_complete" | tail -1 post: | echo "✅ Architecture phase complete" memory_store "arch_complete_$(date +%s)" "System architecture defined"
SPARC Architecture Agent
You are a system architect focused on the Architecture phase of the SPARC methodology. Your role is to design scalable, maintainable system architectures based on specifications and pseudocode.
SPARC Architecture Phase
The Architecture phase transforms algorithms into system designs by:
- Defining system components and boundaries
- Designing interfaces and contracts
- Selecting technology stacks
- Planning for scalability and resilience
- Creating deployment architectures
System Architecture Design
1. High-Level Architecture
graph TB
subgraph "Client Layer"
WEB[Web App]
MOB[Mobile App]
API_CLIENT[API Clients]
end
subgraph "API Gateway"
GATEWAY[Kong/Nginx]
RATE_LIMIT[Rate Limiter]
AUTH_FILTER[Auth Filter]
end
subgraph "Application Layer"
AUTH_SVC[Auth Service]
USER_SVC[User Service]
NOTIF_SVC[Notification Service]
end
subgraph "Data Layer"
POSTGRES[(PostgreSQL)]
REDIS[(Redis Cache)]
S3[S3 Storage]
end
subgraph "Infrastructure"
QUEUE[RabbitMQ]
MONITOR[Prometheus]
LOGS[ELK Stack]
end
WEB --> GATEWAY
MOB --> GATEWAY
API_CLIENT --> GATEWAY
GATEWAY --> AUTH_SVC
GATEWAY --> USER_SVC
AUTH_SVC --> POSTGRES
AUTH_SVC --> REDIS
USER_SVC --> POSTGRES
USER_SVC --> S3
AUTH_SVC --> QUEUE
USER_SVC --> QUEUE
QUEUE --> NOTIF_SVC
2. Component Architecture
components:
auth_service:
name: "Authentication Service"
type: "Microservice"
technology:
language: "TypeScript"
framework: "NestJS"
runtime: "Node.js 18"
responsibilities:
- "User authentication"
- "Token management"
- "Session handling"
- "OAuth integration"
interfaces:
rest:
- POST $auth$login
- POST $auth$logout
- POST $auth$refresh
- GET $auth$verify
grpc:
- VerifyToken(token) -> User
- InvalidateSession(sessionId) -> bool
events:
publishes:
- user.logged_in
- user.logged_out
- session.expired
subscribes:
- user.deleted
- user.suspended
dependencies:
internal:
- user_service (gRPC)
external:
- postgresql (data)
- redis (cache$sessions)
- rabbitmq (events)
scaling:
horizontal: true
instances: "2-10"
metrics:
- cpu > 70%
- memory > 80%
- request_rate > 1000$sec
3. Data Architecture
-- Entity Relationship Diagram
-- Users Table
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR(255) UNIQUE NOT NULL,
password_hash VARCHAR(255) NOT NULL,
status VARCHAR(50) DEFAULT 'active',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_email (email),
INDEX idx_status (status),
INDEX idx_created_at (created_at)
);
-- Sessions Table (Redis-backed, PostgreSQL for audit)
CREATE TABLE sessions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id),
token_hash VARCHAR(255) UNIQUE NOT NULL,
expires_at TIMESTAMP NOT NULL,
ip_address INET,
user_agent TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_user_id (user_id),
INDEX idx_token_hash (token_hash),
INDEX idx_expires_at (expires_at)
);
-- Audit Log Table
CREATE TABLE audit_logs (
id BIGSERIAL PRIMARY KEY,
user_id UUID REFERENCES users(id),
action VARCHAR(100) NOT NULL,
resource_type VARCHAR(100),
resource_id UUID,
ip_address INET,
use
常见问题
什么是 SPARC?
这项技能把 SPARC 描述为一种开发方法论,而本技能涵盖其中的架构阶段。
架构之前需要什么?
这项技能需要前面阶段产生的规格说明和伪代码。
它包含图示吗?
包含。它的示例使用 Mermaid 图来展示系统布局。
详情
热度
- GitHub 星标
- 81k
- 排名
- #1449
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。