-
Notifications
You must be signed in to change notification settings - Fork 1
AgentRoles
AI Software Factory edited this page Aug 21, 2026
·
1 revision
角色 Agent = continuable 子代理(持久会话、动态创建、可复用/可打断)。
| 角色 | 触发时机 | 主要产出 |
|---|---|---|
| PM | 需求批准后 | product-spec.md |
| Architect | 需求稳定后 | architecture.md / api-spec.yaml / database-schema.sql |
| Backend | 实现阶段 | workspace/backend/**(FastAPI) |
| Frontend | 实现阶段 | workspace/frontend/**(React) |
| QA | 后端就绪后 | tests/**(pytest) |
| Review | 实现+测试后 | reports/review-report.md(verdict) |
| Security | 发布阶段 | artifacts/security-report.md |
| DevOps | 发布阶段 | Dockerfile / compose / build-report |
- 动态创建:按需 spawn,纯 Web 项目不建 Mobile、纯 CRUD 不建 AI Engineer
- 并行:backend ∥ frontend、qa ∥ review(同轮并发)
-
复用:同角色连续任务
send_message复用同一会话(保留角色记忆) - 换人:失败阶梯的 Switch Agent 步骤(全新 spawn)
-
契约注入:每次委派包含 role/mission/input/output/constraints/qualityCriteria/failurePolicy(见
contracts/<role>.yaml)
role: backend
mission: 按 api-spec.yaml 实现 FastAPI 后端
input: [artifacts/api-spec.yaml, artifacts/database-schema.sql]
output: [workspace/backend/**]
constraints:
- 不修改 spec 类产物
- 不在子代理内请求沙箱升级(approval = never)
qualityCriteria: ["pytest 全绿", "无硬编码 secret"]
failurePolicy: 报告失败原因 + 已完成部分- 8 个角色全部实跑;角色注册表见
projects/p-001/reports/agents.md - 复用实证:backend 子代理 3 轮任务(实现→修复→FR-6)均复用同一会话
- 换人实证:Phase 4 注入回归后启动全新 fix-engineer 修复