refactor(agent-collaboration-kit): split stable core from project overrides

- Reorganize flat files into core/ templates/ examples/ scripts/ with VERSION
- Deduplicate: single-source state machine, three-round policy, acceptance signals
- Abstract orchestration in closed-loop.md with manual mode; move Orca commands to orca-adapter.md
- Add tasks.schema.json + validate_tasks.py (jsonschema or builtin rules, no hard deps)
- Add filled examples, concurrency write rule, kitVersion tracking; unify to Chinese

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-06 10:01:09 +08:00
parent 58de2650c2
commit d7a74578dc
18 changed files with 1177 additions and 806 deletions
@@ -0,0 +1,106 @@
# 派发 Prompt 模板(稳定核心)
用于 Coordinator 给 Developer Worker 派发任务。复制时替换尖括号占位符。这些模板与编排工具无关:Orca 模式用 `orca-adapter.md` 的命令投递,手动模式直接把文本发给 Developer。
---
## 1. 初始派发模板
```text
你现在接到一个受监督的协作任务。请在 <dev_worktree> 开发工作树内完成。
任务:
- 修复 <task_id>: <task_title>
请先读取:
- AGENTS.md
- tasks.yaml
- <relevant_spec_or_test_doc>
当前失败证据:
<copy latest Product/Test evidence>
验收标准(可观测信号,见 optimization-method.md §1):
1. <expected behavior 1>
2. <expected behavior 2>
3. <expected behavior 3>
约束:
- 只修改 Developer 可写路径(见 AGENTS.md 权限表)。
- 不要修改 Product/Test 负责的规格和集成测试文件,除非任务明确要求。
- 不要写 tasks.yaml,不要标记 verified。
- 不要提交或推送,除非用户明确要求。
- 最小 diff,避免无关重构。
完成前必须运行:
- <test command 1>
- <test command 2>
完成后回报一次 worker_done(格式见 §4)。如果阻塞,请发送 escalation 或 ask。
```
---
## 2. 复测失败再派发模板
```text
第 <n> 轮复测未通过,请继续修 <task_id>。
上一轮开发声称:
<worker_done summary>
Product/Test 独立复测结果:
- 运行命令:<commands>
- 失败页面/API<page or endpoint>
- 仍缺失:<missing expected checks>
- 实际观察:<actual evidence>
关键提示:
- 不要只满足静态文案,必须满足交互后的真实状态。
- 如果后端/API 正常而 UI 不更新,请优先排查事件链、状态重置、异步请求、构建产物和服务 worktree。
- 修复后请自己用浏览器或脚本复现 Product/Test 的完整步骤。
验收不变:
<copy acceptance criteria>
完成后回报 worker_donesubject 使用:"<task_id> fix ready round <n>"
```
---
## 3. Developer Worker worker_done 回报格式(通用)
无论 Orca 还是手动,回报都应包含以下字段:
```text
subject: <task_id> fix ready round <n>
filesModified: [<file_a>, <file_b>]
verification:
- <command_a>: passed
- <command_b>: passed
reproduce: 我如何复现验收路径 <steps>
risk: <remaining risk or none>
```
Orca 模式下用 `orca-adapter.md` §「Developer 回报 worker_done」的命令发送同样的字段。
---
## 4. Coordinator 最终报告模板
```text
本轮闭环完成。
已验证:
- <task_id>: <what passed>
遗留:
- <task_id>: 三轮仍未通过,已记录为 leftover。最后失败证据:<evidence>
验证命令:
- <command>: passed
工作树状态:
- <repo_path>: <git status summary>
- <dev_worktree>: <git status summary>
```