Agent Skills
› serithemage/serverless-openclaw
› architecture
architecture
GitHub提供Serverless OpenClaw架构参考,涵盖网络设计、CDK堆栈结构、DynamoDB数据模型及API协议。支持Agent运行时路由配置与Lambda数据流说明,辅助开发者理解系统分层与成本优化原则。
Trigger Scenarios
查询系统架构设计
了解CDK堆栈结构
查看Serverless组件交互流程
Install
npx skills add serithemage/serverless-openclaw --skill architecture -g -y
SKILL.md
Frontmatter
{
"name": "architecture",
"description": "References Serverless OpenClaw architecture. Covers network design, CDK stack structure, DynamoDB data model, API protocols, and container design.",
"allowed-tools": "Read, Glob, Grep"
}
Architecture Reference
Design Documents
- architecture.md — VPC/network, security groups, CDK stacks, DynamoDB schema, API protocols, security model
- implementation-plan.md — Detailed design based on MoltWorker reference
- cold-start-optimization.md — Cold start optimization (Phase 1 complete, Phase 2 in progress)
Core Architecture Principles
- Cost minimization: No NAT Gateway, no ALB, no Interface Endpoints
- Serverless-first: Lambda (events), Fargate Spot (long-running), DynamoDB (PAY_PER_REQUEST)
- Single responsibility: 7 separate Lambdas, 9 separate CDK stacks
- Layer separation: API Gateway → Lambda → Bridge → OpenClaw Gateway
- Protocol translation: Lambda(HTTP) ↔ Bridge ↔ OpenClaw Gateway(JSON-RPC 2.0 WebSocket)
AGENT_RUNTIME Feature Flag
Controls which agent backend handles requests:
| Value | Behavior |
|---|---|
fargate |
Route all agent requests to Fargate container (Phase 1 mode) |
lambda |
Route all agent requests to Lambda agent (Phase 2 mode) |
both |
Smart routing via classifyRoute(): reuse running Fargate, honor /heavy//fargate hints, default to Lambda, fallback to Fargate on Lambda failure |
See architecture.md §12 for full Lambda architecture details and smart routing rules.
Lambda Data Flow (Phase 2)
Client → API Gateway (WS/REST) → Gateway Lambda → Lambda Agent Function
→ runEmbeddedPiAgent()
→ OpenClaw in-process
CDK Stacks (9 total)
SecretsStack + NetworkStack → StorageStack → {AuthStack, ComputeStack} → ApiStack → WebStack + MonitoringStack + LambdaAgentStack
Version History
- 504300d Current 2026-07-25 09:02


