一键创建 3-agent 全栈开发团队:main(项目经理) + my_dev(全栈开发) + my_test(测试)。
openclaw.json 并创建 agent 配置和 workspace 文件~/.openclaw/ 目录用户说以下任意关键词时触发:
从 openclaw.json 读取当前默认模型:
openclaw config get agents.defaults.model
记录 primary 和 fallbacks 作为后续步骤的默认值。
向用户展示当前默认模型,询问是否需要指定专用模型:
当前默认模型:{读取到的primary模型}
是否为开发团队指定专用模型?
1. 使用默认模型(推荐) — 三个agent共用当前默认模型
2. 指定专用模型 — 需要提供provider名称、Base URL、API Key、模型ID
如果用户选择1(默认):直接跳到 Step 3。
如果用户选择2(指定):询问:
请提供模型配置:
Provider名称(如 custom-openai): ___
Base URL: ___
API Key: ___
模型ID(如 gpt-4o): ___
如果用户只有一个模型,dev 和 test 共用同一个。
展示配置摘要,用户确认后立即执行:
📋 开发团队配置摘要:
团队架构(固定):
main(项目经理)→ 路由 + 状态流转
my_dev(全栈开发)→ 代码开发 + 单元测试
my_test(测试)→ 部署验证 + 接口测试
默认技术栈(固定):
前端:Vue 3 + TypeScript + Vite + Pinia + Element Plus
后端:Spring Boot 3 + Java 17 + MyBatis-Plus
AI:LangChain4j (Java)
模型配置:
主模型:{primary模型}
备用模型:{fallback模型 或 同主模型}
确认后开始配置...(输入 确认 继续)
用户确认后,执行以下操作:
openclaw agents add my_dev
openclaw agents add my_test
通过 openclaw config patch 写入以下配置(只写增量,不覆盖现有配置):
{
"agents": {
"defaults": {
"subagents": {
"maxSpawnDepth": 2,
"maxConcurrent": 5,
"maxChildrenPerAgent": 5
}
}
},
"tools": {
"agentToAgent": {
"enabled": true,
"allow": ["main", "my_dev", "my_test"]
}
}
}
my_dev workspace(~/.openclaw/workspace_dev/):
SOUL.md — 人格定义AGENTS.md — 行为规范TOOLS.md — 环境和工具配置IDENTITY.md — 身份标识my_test workspace(~/.openclaw/workspace_test/):
SOUL.md — 人格定义AGENTS.md — 行为规范TOOLS.md — 环境和工具配置IDENTITY.md — 身份标识模板文件位置:references/ 目录下
在 openclaw.json 中更新 main agent 的 subagents.allowAgents,加入 my_dev 和 my_test。
openclaw config validate
✅ 开发团队配置完成!
创建的 Agent:
- main(项目经理)— {主模型}
- my_dev(全栈开发)— {主模型}
- my_test(测试)— {备用模型}
开发流水线:
需求 → main分解 → my_dev开发 → my_test测试 → 交付
↑ │
└── 不通过:返工 ────┘
默认技术栈:
前端:Vue 3 + TS + Vite + Pinia + Element Plus
后端:Spring Boot 3 + Java 17 + MyBatis-Plus
使用方式:
直接告诉 main 你的开发需求,它会自动调度 my_dev 和 my_test。
⚠️ 请执行 openclaw gateway restart 使配置生效。
如果用户说"修改开发团队配置"或"更新dev-team":
默认技术栈(大模型应用全栈开发):
可选技术栈:
| 选择 | 前端描述 | 后端描述 |
|---|---|---|
| ------ | ---------- | ---------- |
| Vue3+TS(默认) | Vue 3 + TypeScript + Vite + Pinia + Element Plus | Spring Boot 3 + Java 17 + MyBatis-Plus |
| React+TS | React 18 + TypeScript + Vite + Ant Design | Spring Boot 3 + Java 17 + MyBatis-Plus |
| Express | - | Express.js + TypeScript + Prisma |
| Gin | - | Gin (Go) + GORM |
reports/{任务ID}-dev.md:
task_id: T-001
status: success | failed
file_location: "开发文件路径"
summary: "一句话摘要,不超过30字"
fail_reason: "失败原因(选填)"
fuction: "已经开发过的功能列表(供my_test进行测试)"
reports/{任务ID}-test.md:
task_id: T-001
recommendation: complete | retry
result: pass | fail
summary: "一句话总结测试结果,不超过30字"
fail_reason: "失败原因(result=fail 时必填)"
tests_run: 5
tests_passed: 4
tested_features:
- "功能A:通过"
- "功能B:失败 - 接口返回500"
recommendation 字段recommendation: complete → 完成recommendation: retry → 返工(上限 3 次)npm run dev -- --close共 6 个版本