# 六个 Agent 角色 > _Shell-stripped: preserves full prompt content for Agent system templates_ > 系统由六个无状态 Agent 组成。每个 Agent 都符合「文档输入 → 思考 → 文档输出」的纯函数式约定。Agent 之间不直接通信,仅通过 DocStore / UnitRegistry 握手。 ## 职责矩阵 | Agent | 所属 Loop | 触发条件 | 主要产物 | 专属页 | | --- | --- | --- | --- | --- | | **PM** | L3 | 人类新需求 | `prd.html` (rev+1) | [→ 详情](agents-pm.html) | | **Architect** | L3 + L2 | PRD 改变 / L2 失败 | `sdd.html` + `units.json` | [→ 详情](agents-architect.html) | | **Coder** | L1 | Unit 进 coding 态 | `units/{id}/code/` + `contract.json` | [→ 详情](agents-coder.html) | | **Tester** | L1 | Coder 提交后 | `tests/` + `runs/result.json` | [→ 详情](agents-tester.html) | | **Integrator** | L2 | L2 闸门打开 | `integration/runs/{id}/result.json` | [→ 详情](agents-integrator.html) | | **BugTriager** | L2 | Integrator 失败 | `triage.json` | [→ 详情](agents-triager.html) | ## 调用拓扑(谁调用谁) 白色箭头是**直接调用**,虚线箭头是**通过文档触发**。LoopController 是唯一编排者,所有 Agent 之间永远不直接调用。 > _实线 = 直接 callAgent · 虚线 = 通过文档系统握手_ ## Agent 元数据模板 所有六个 Agent 都在 `system/agents/_registry.json` 注册。模板结构对齐 LemonBoss 现有 `{id, name, type, ...}` 约定,新增 `devloop` 字段标识它属于本系统。 ``` { "id": "devloop-coder", "name": "Coder Agent", "type": "executor", "devloop": { "loop": "L1", "role": "code", "upstream": ["architect"], "downstream": ["tester"] }, "cli": { "model": "claude-sonnet-4-6", "toolPolicy": ["Read", "Edit", "Write", "Bash"], "systemPromptFile": "system/agents/devloop-coder/prompt.md" }, "sandbox": { "cwd": "data/companies/{cid}/projects/{pid}/units/{unitId}/", "writeAllowList": ["code/**", "contract.json", "coder.log"] } } ``` ## 模型分级 不同 Agent 对模型能力的需求差异很大。默认配置如下,可在每个项目的 `project.json` 覆盖。 | Agent | 默认模型 | 原因 | | --- | --- | --- | | PM | Sonnet 4.6 | 对话场景多,Opus 不划算 | | Architect | **Opus 4.7** | 需要架构判断 + 契约设计 | | Coder | Sonnet 4.6 | 代码生成主力,性价比最高 | | Tester | Sonnet 4.6 | 跑命令 Haiku 够用,但写好的 negative case 需要中等推理;Tester 调用次数有限,Sonnet 性价比可接受 | | Integrator | Sonnet 4.6 | 需要读多个 Unit 代码 + 跑命令 | | BugTriager | **Opus 4.7** | 归因质量直接决定 L2 收敛性 |