@zmice/zc 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +430 -420
  2. package/dist/cli/__tests__/platform.test.js +158 -89
  3. package/dist/cli/__tests__/platform.test.js.map +1 -1
  4. package/dist/cli/__tests__/surface.test.js +1 -1
  5. package/dist/cli/__tests__/surface.test.js.map +1 -1
  6. package/dist/cli/platform.d.ts.map +1 -1
  7. package/dist/cli/platform.js +92 -10
  8. package/dist/cli/platform.js.map +1 -1
  9. package/dist/cli/setup.d.ts +3 -0
  10. package/dist/cli/setup.d.ts.map +1 -0
  11. package/dist/cli/setup.js +41 -0
  12. package/dist/cli/setup.js.map +1 -0
  13. package/dist/node_modules/@zmice/platform-core/dist/index.test.js +5 -3
  14. package/dist/node_modules/@zmice/platform-core/dist/index.test.js.map +1 -1
  15. package/dist/runtime/worktree-manager.js +2 -2
  16. package/dist/runtime/worktree-manager.js.map +1 -1
  17. package/dist/utils/codex-config-merge.d.ts +3 -0
  18. package/dist/utils/codex-config-merge.d.ts.map +1 -0
  19. package/dist/utils/codex-config-merge.js +43 -0
  20. package/dist/utils/codex-config-merge.js.map +1 -0
  21. package/dist/utils/codex-config-merge.test.d.ts +2 -0
  22. package/dist/utils/codex-config-merge.test.d.ts.map +1 -0
  23. package/dist/utils/codex-config-merge.test.js +64 -0
  24. package/dist/utils/codex-config-merge.test.js.map +1 -0
  25. package/dist/utils/install-target.test.js +3 -2
  26. package/dist/utils/install-target.test.js.map +1 -1
  27. package/dist/utils/qwen-extension-cli.d.ts.map +1 -1
  28. package/dist/utils/qwen-extension-cli.js +4 -4
  29. package/dist/utils/qwen-extension-cli.js.map +1 -1
  30. package/dist/utils/qwen-extension-cli.test.js +9 -6
  31. package/dist/utils/qwen-extension-cli.test.js.map +1 -1
  32. package/dist/utils/workspace.js +1 -1
  33. package/dist/utils/workspace.js.map +1 -1
  34. package/dist/utils/workspace.test.js +14 -0
  35. package/dist/utils/workspace.test.js.map +1 -1
  36. package/package.json +3 -3
  37. package/vendor/node_modules/@zmice/platform-core/dist/index.test.js +5 -3
  38. package/vendor/node_modules/@zmice/platform-core/dist/index.test.js.map +1 -1
  39. package/vendor/packages/platform-claude/dist/index.js +75 -75
  40. package/vendor/packages/platform-claude/dist/index.test.js +11 -8
  41. package/vendor/packages/platform-claude/dist/index.test.js.map +1 -1
  42. package/vendor/packages/platform-codex/dist/index.d.ts.map +1 -1
  43. package/vendor/packages/platform-codex/dist/index.js +262 -165
  44. package/vendor/packages/platform-codex/dist/index.js.map +1 -1
  45. package/vendor/packages/platform-codex/dist/index.test.js +42 -20
  46. package/vendor/packages/platform-codex/dist/index.test.js.map +1 -1
  47. package/vendor/packages/platform-opencode/dist/index.js +75 -75
  48. package/vendor/packages/platform-opencode/dist/index.test.js +19 -15
  49. package/vendor/packages/platform-opencode/dist/index.test.js.map +1 -1
  50. package/vendor/packages/platform-qwen/dist/index.js +75 -75
  51. package/vendor/packages/platform-qwen/dist/index.test.js +9 -7
  52. package/vendor/packages/platform-qwen/dist/index.test.js.map +1 -1
  53. package/vendor/packages/toolkit/src/content/agents/architect/body.md +42 -42
  54. package/vendor/packages/toolkit/src/content/agents/code-reviewer/body.md +41 -41
  55. package/vendor/packages/toolkit/src/content/agents/product-owner/body.md +40 -40
  56. package/vendor/packages/toolkit/src/content/commands/plan-review/body.md +31 -31
  57. package/vendor/packages/toolkit/src/content/commands/start/body.md +197 -197
  58. package/vendor/packages/toolkit/src/content/commands/start/meta.yaml +55 -55
  59. package/vendor/packages/toolkit/src/content/skills/branch-finish-and-cleanup/body.md +172 -172
  60. package/vendor/packages/toolkit/src/content/skills/browser-qa-testing/body.md +111 -111
  61. package/vendor/packages/toolkit/src/content/skills/ci-cd-and-automation/body.md +86 -86
  62. package/vendor/packages/toolkit/src/content/skills/code-review-and-quality/body.md +140 -140
  63. package/vendor/packages/toolkit/src/content/skills/code-simplification/body.md +80 -80
  64. package/vendor/packages/toolkit/src/content/skills/context-engineering/body.md +67 -67
  65. package/vendor/packages/toolkit/src/content/skills/continuous-learning/body.md +102 -102
  66. package/vendor/packages/toolkit/src/content/skills/multi-perspective-review/body.md +81 -81
  67. package/vendor/packages/toolkit/src/content/skills/parallel-agent-dispatch/body.md +113 -113
  68. package/vendor/packages/toolkit/src/content/skills/performance-optimization/body.md +75 -75
  69. package/vendor/packages/toolkit/src/content/skills/planning-and-task-breakdown/body.md +83 -83
  70. package/vendor/packages/toolkit/src/content/skills/sdd-tdd-workflow/body.md +95 -95
  71. package/vendor/packages/toolkit/src/content/skills/sprint-retrospective/body.md +99 -99
  72. package/vendor/packages/toolkit/src/content/skills/team-orchestration/body.md +126 -126
  73. package/vendor/packages/toolkit/src/content/skills/test-driven-development/body.md +78 -78
  74. package/vendor/packages/toolkit/src/content/skills/using-agent-skills/body.md +193 -193
  75. package/vendor/references/upstreams.yaml +94 -94
@@ -1,95 +1,95 @@
1
- # SDD + TDD 开发工作流
2
-
3
- ## 角色定位
4
-
5
- 这是完整交付的编排 skill,不是每个阶段的详细教程。它负责把需求按阶段推进,并在进入具体阶段时再读取对应专项 skill。
6
-
7
- 渐进式披露规则:
8
-
9
- - 当前只需要路由和门控时,只读取本文。
10
- - 进入某个阶段时,再加载该阶段 skill。
11
- - 不把所有阶段规则同时塞进上下文。
12
- - 发现任务变成 bug、文档、发布或上下文问题时,切换到对应入口,不继续硬走完整流程。
13
-
14
- ## 快速路径
15
-
16
- 1. 判断任务是否需要完整交付;简单修复、文档或调查任务不要套完整流程。
17
- 2. 若需求模糊,先进入 `brainstorming-and-design` 或 `spec-driven-development`。
18
- 3. 若规格清楚,进入 `planning-and-task-breakdown`。
19
- 4. 计划确认后,进入 `incremental-implementation` + `test-driven-development`。
20
- 5. 实现完成后,进入 `code-review-and-quality`。
21
- 6. 准备声明完成前,进入 `verification-before-completion`。
22
- 7. 需要提交时,进入 `git-workflow-and-versioning`,并等待用户确认。
23
- 8. 周期结束或需要沉淀经验时,进入 `sprint-retrospective`。
24
-
25
- ## 阶段门控
26
-
27
- | 阶段 | 默认入口 | 通过条件 |
28
- |---|---|---|
29
- | Brainstorm(可选) | `brainstorming-and-design` | 目标、约束、方案方向已收敛 |
30
- | Specify | `spec-driven-development` | 规格可测试,假设已显式列出 |
31
- | Plan | `planning-and-task-breakdown` | 任务有依赖、文件边界和验证方式 |
32
- | Plan Review(可选) | `multi-perspective-review` | `GO / REVISE / NO-GO` 结论明确 |
33
- | Build | `incremental-implementation` + `test-driven-development` | 每个切片实现、测试、回归通过 |
34
- | Review | `code-review-and-quality` | Critical/Important 已处理或有明确延后理由 |
35
- | Verify | `verification-before-completion` | 新鲜验证命令通过,输出已读 |
36
- | Commit(可选) | `git-workflow-and-versioning` | 用户确认提交范围和消息 |
37
- | Retro(可选) | `sprint-retrospective` | 偏差、复盘和行动项已记录 |
38
-
39
- ## 构建模式选择
40
-
41
- - **Manual(默认)**:你自己按任务串行实现。适合大多数改动。
42
- - **Subagent-Driven**:任务彼此独立,但用户没有要求并行时,可作为串行委派建议。
43
- - **Parallel**:用户明确要求多 agent / 并行 / team 模式,且任务有清晰文件所有权时,使用 `parallel-agent-dispatch`。
44
- - **Team Orchestration**:需要 tmux + git worktree 文件系统隔离或多 CLI worker 时,使用 `team-orchestration`。
45
-
46
- 除非用户已经明确要求并行,否则只给并行建议,不直接启动子代理或 `zc team`。
47
-
48
- 推荐提示格式:
49
-
50
- ```text
51
- Recommendation: 按 Manual / Parallel / Team 模式推进 because <证据与 trade-off>。
52
- - 并行收益:
53
- - 并行代价:
54
- - 文件所有权:
55
- - fan-in 验证:
56
- ```
57
-
58
- ## 阶段切换纪律
59
-
60
- - 进入新阶段前,说明当前阶段已满足的证据。
61
- - 阶段中发现前提失真时,回退到上游阶段,不继续堆实现。
62
- - 长会话变慢或内容开始混乱时,切到 `context-budget-audit` / `context-engineering`。
63
- - 变更涉及浏览器体验时,在单元/API 测试之外补 `browser-qa-testing`。
64
- - 涉及高风险命令、生产数据或敏感文件时,先切到 `safety-guardrails`。
65
-
66
- ## 停线条件
67
-
68
- 立即停止当前阶段并重新定位:
69
-
70
- - 测试、构建或 lint 失败但原因未读清。
71
- - 用户纠正了需求、范围或安全边界。
72
- - 计划要求修改的文件和实际代码结构明显不一致。
73
- - 出现破坏性操作、凭据、生产数据或不可逆迁移风险。
74
- - 需要并行但没有文件所有权、隔离策略和 fan-in 验证。
75
-
76
- ## 输出契约
77
-
78
- 完整交付过程中的关键结论都要使用可审查的推荐格式:
79
-
80
- ```text
81
- Recommendation: <下一步动作> because <具体证据、取舍和被放弃的替代方案>。
82
- ```
83
-
84
- 不要只说“更稳”“更好”“建议继续”。必须说明为什么这个动作优于至少一个替代方案,以及如何验证它成立。
85
-
86
- ## 验证
87
-
88
- 声明完成前至少给出:
89
-
90
- - 实际运行的验证命令
91
- - 退出结果
92
- - 与本次任务相关的关键输出
93
- - 未运行的验证及原因
94
-
95
- 不能用历史结果、主观判断或“应该没问题”替代验证证据。
1
+ # SDD + TDD 开发工作流
2
+
3
+ ## 角色定位
4
+
5
+ 这是完整交付的编排 skill,不是每个阶段的详细教程。它负责把需求按阶段推进,并在进入具体阶段时再读取对应专项 skill。
6
+
7
+ 渐进式披露规则:
8
+
9
+ - 当前只需要路由和门控时,只读取本文。
10
+ - 进入某个阶段时,再加载该阶段 skill。
11
+ - 不把所有阶段规则同时塞进上下文。
12
+ - 发现任务变成 bug、文档、发布或上下文问题时,切换到对应入口,不继续硬走完整流程。
13
+
14
+ ## 快速路径
15
+
16
+ 1. 判断任务是否需要完整交付;简单修复、文档或调查任务不要套完整流程。
17
+ 2. 若需求模糊,先进入 `brainstorming-and-design` 或 `spec-driven-development`。
18
+ 3. 若规格清楚,进入 `planning-and-task-breakdown`。
19
+ 4. 计划确认后,进入 `incremental-implementation` + `test-driven-development`。
20
+ 5. 实现完成后,进入 `code-review-and-quality`。
21
+ 6. 准备声明完成前,进入 `verification-before-completion`。
22
+ 7. 需要提交时,进入 `git-workflow-and-versioning`,并等待用户确认。
23
+ 8. 周期结束或需要沉淀经验时,进入 `sprint-retrospective`。
24
+
25
+ ## 阶段门控
26
+
27
+ | 阶段 | 默认入口 | 通过条件 |
28
+ |---|---|---|
29
+ | Brainstorm(可选) | `brainstorming-and-design` | 目标、约束、方案方向已收敛 |
30
+ | Specify | `spec-driven-development` | 规格可测试,假设已显式列出 |
31
+ | Plan | `planning-and-task-breakdown` | 任务有依赖、文件边界和验证方式 |
32
+ | Plan Review(可选) | `multi-perspective-review` | `GO / REVISE / NO-GO` 结论明确 |
33
+ | Build | `incremental-implementation` + `test-driven-development` | 每个切片实现、测试、回归通过 |
34
+ | Review | `code-review-and-quality` | Critical/Important 已处理或有明确延后理由 |
35
+ | Verify | `verification-before-completion` | 新鲜验证命令通过,输出已读 |
36
+ | Commit(可选) | `git-workflow-and-versioning` | 用户确认提交范围和消息 |
37
+ | Retro(可选) | `sprint-retrospective` | 偏差、复盘和行动项已记录 |
38
+
39
+ ## 构建模式选择
40
+
41
+ - **Manual(默认)**:你自己按任务串行实现。适合大多数改动。
42
+ - **Subagent-Driven**:任务彼此独立,但用户没有要求并行时,可作为串行委派建议。
43
+ - **Parallel**:用户明确要求多 agent / 并行 / team 模式,且任务有清晰文件所有权时,使用 `parallel-agent-dispatch`。
44
+ - **Team Orchestration**:需要 tmux + git worktree 文件系统隔离或多 CLI worker 时,使用 `team-orchestration`。
45
+
46
+ 除非用户已经明确要求并行,否则只给并行建议,不直接启动子代理或 `zc team`。
47
+
48
+ 推荐提示格式:
49
+
50
+ ```text
51
+ Recommendation: 按 Manual / Parallel / Team 模式推进 because <证据与 trade-off>。
52
+ - 并行收益:
53
+ - 并行代价:
54
+ - 文件所有权:
55
+ - fan-in 验证:
56
+ ```
57
+
58
+ ## 阶段切换纪律
59
+
60
+ - 进入新阶段前,说明当前阶段已满足的证据。
61
+ - 阶段中发现前提失真时,回退到上游阶段,不继续堆实现。
62
+ - 长会话变慢或内容开始混乱时,切到 `context-budget-audit` / `context-engineering`。
63
+ - 变更涉及浏览器体验时,在单元/API 测试之外补 `browser-qa-testing`。
64
+ - 涉及高风险命令、生产数据或敏感文件时,先切到 `safety-guardrails`。
65
+
66
+ ## 停线条件
67
+
68
+ 立即停止当前阶段并重新定位:
69
+
70
+ - 测试、构建或 lint 失败但原因未读清。
71
+ - 用户纠正了需求、范围或安全边界。
72
+ - 计划要求修改的文件和实际代码结构明显不一致。
73
+ - 出现破坏性操作、凭据、生产数据或不可逆迁移风险。
74
+ - 需要并行但没有文件所有权、隔离策略和 fan-in 验证。
75
+
76
+ ## 输出契约
77
+
78
+ 完整交付过程中的关键结论都要使用可审查的推荐格式:
79
+
80
+ ```text
81
+ Recommendation: <下一步动作> because <具体证据、取舍和被放弃的替代方案>。
82
+ ```
83
+
84
+ 不要只说“更稳”“更好”“建议继续”。必须说明为什么这个动作优于至少一个替代方案,以及如何验证它成立。
85
+
86
+ ## 验证
87
+
88
+ 声明完成前至少给出:
89
+
90
+ - 实际运行的验证命令
91
+ - 退出结果
92
+ - 与本次任务相关的关键输出
93
+ - 未运行的验证及原因
94
+
95
+ 不能用历史结果、主观判断或“应该没问题”替代验证证据。
@@ -1,99 +1,99 @@
1
- # Sprint Retrospective
2
-
3
- ## 角色定位
4
-
5
- 在一个交付周期结束后,用证据复盘计划、实现、审查和验证的质量,并把下一轮要改变的行为写成少量可执行行动项。
6
-
7
- Retro 不是情绪总结,也不是长篇过程记录。没有行动项的 retro 通常只是仪式。
8
-
9
- ## 何时使用
10
-
11
- - 完成一次 SDD+TDD 周期后。
12
- - 一周或一个里程碑结束后。
13
- - 生产事故、重大返工或计划偏差后。
14
- - 发现重复摩擦,但还没有明确改进项时。
15
- - 开始新大任务前,需要先复盘上一轮。
16
-
17
- ## 快速路径
18
-
19
- 1. 收集事实:提交、diff、测试、验证、PR/issue、事故记录。
20
- 2. 对照原始 spec / plan,检查 scope drift。
21
- 3. 识别有效做法、失败模式和根因。
22
- 4. 评估流程健康:TDD、review、verify、build、handoff。
23
- 5. 选出最多 3-5 个行动项。
24
- 6. 给每个行动项写 owner、deadline、success metric。
25
- 7. 判断哪些经验应该进入 ADR、docs、skill、memory 或保持为聊天结论。
26
-
27
- ## 推荐数据
28
-
29
- 按当前任务范围收集即可,不要为了复盘跑无关统计:
30
-
31
- - commit count / changed files / insertions / deletions
32
- - tests added or changed
33
- - verification commands and failures
34
- - review findings and resolution time
35
- - spec items delivered / modified / deferred / dropped
36
- - CI/build stability
37
-
38
- monorepo 中必须限定路径范围,避免 unrelated diff 污染结论。
39
-
40
- ## Drift 判断
41
-
42
- ```text
43
- Spec drift:
44
- - Delivered as planned:
45
- - Modified:
46
- - Deferred:
47
- - Added:
48
- - Dropped:
49
- - Reason:
50
- ```
51
-
52
- drift 不一定是坏事。没有记录的 drift 才危险,因为下一轮会基于错误文档继续推进。
53
-
54
- ## 行动项格式
55
-
56
- ```text
57
- Action item:
58
- - What:
59
- - Why:
60
- - Owner:
61
- - Deadline:
62
- - Success metric:
63
- - Verification:
64
- ```
65
-
66
- 行动项最多 3-5 个。超过这个数量,优先级通常还没有收敛。
67
-
68
- ## 知识沉淀边界
69
-
70
- - 架构或公共接口决策:进入 ADR / docs。
71
- - 项目长期约定:进入项目文档或入口规则。
72
- - 用户偏好或跨会话经验:只有明确授权后才进入 memory。
73
- - 一次性上下文和临时事故细节:只保留在本次记录中。
74
-
75
- ## 输出契约
76
-
77
- ```markdown
78
- # Retrospective: <period / milestone>
79
-
80
- ## Evidence
81
- - ...
82
-
83
- ## What Worked
84
- - ...
85
-
86
- ## What Failed
87
- - ...
88
-
89
- ## Drift
90
- - ...
91
-
92
- ## Action Items
93
- - ...
94
-
95
- ## Recommendation
96
- Recommendation: <keep / change / document / escalate> because <evidence, trade-off, and rejected alternative>.
97
- ```
98
-
99
- 推荐必须说明下一轮具体改变什么,而不是只说“继续保持”。
1
+ # Sprint Retrospective
2
+
3
+ ## 角色定位
4
+
5
+ 在一个交付周期结束后,用证据复盘计划、实现、审查和验证的质量,并把下一轮要改变的行为写成少量可执行行动项。
6
+
7
+ Retro 不是情绪总结,也不是长篇过程记录。没有行动项的 retro 通常只是仪式。
8
+
9
+ ## 何时使用
10
+
11
+ - 完成一次 SDD+TDD 周期后。
12
+ - 一周或一个里程碑结束后。
13
+ - 生产事故、重大返工或计划偏差后。
14
+ - 发现重复摩擦,但还没有明确改进项时。
15
+ - 开始新大任务前,需要先复盘上一轮。
16
+
17
+ ## 快速路径
18
+
19
+ 1. 收集事实:提交、diff、测试、验证、PR/issue、事故记录。
20
+ 2. 对照原始 spec / plan,检查 scope drift。
21
+ 3. 识别有效做法、失败模式和根因。
22
+ 4. 评估流程健康:TDD、review、verify、build、handoff。
23
+ 5. 选出最多 3-5 个行动项。
24
+ 6. 给每个行动项写 owner、deadline、success metric。
25
+ 7. 判断哪些经验应该进入 ADR、docs、skill、memory 或保持为聊天结论。
26
+
27
+ ## 推荐数据
28
+
29
+ 按当前任务范围收集即可,不要为了复盘跑无关统计:
30
+
31
+ - commit count / changed files / insertions / deletions
32
+ - tests added or changed
33
+ - verification commands and failures
34
+ - review findings and resolution time
35
+ - spec items delivered / modified / deferred / dropped
36
+ - CI/build stability
37
+
38
+ monorepo 中必须限定路径范围,避免 unrelated diff 污染结论。
39
+
40
+ ## Drift 判断
41
+
42
+ ```text
43
+ Spec drift:
44
+ - Delivered as planned:
45
+ - Modified:
46
+ - Deferred:
47
+ - Added:
48
+ - Dropped:
49
+ - Reason:
50
+ ```
51
+
52
+ drift 不一定是坏事。没有记录的 drift 才危险,因为下一轮会基于错误文档继续推进。
53
+
54
+ ## 行动项格式
55
+
56
+ ```text
57
+ Action item:
58
+ - What:
59
+ - Why:
60
+ - Owner:
61
+ - Deadline:
62
+ - Success metric:
63
+ - Verification:
64
+ ```
65
+
66
+ 行动项最多 3-5 个。超过这个数量,优先级通常还没有收敛。
67
+
68
+ ## 知识沉淀边界
69
+
70
+ - 架构或公共接口决策:进入 ADR / docs。
71
+ - 项目长期约定:进入项目文档或入口规则。
72
+ - 用户偏好或跨会话经验:只有明确授权后才进入 memory。
73
+ - 一次性上下文和临时事故细节:只保留在本次记录中。
74
+
75
+ ## 输出契约
76
+
77
+ ```markdown
78
+ # Retrospective: <period / milestone>
79
+
80
+ ## Evidence
81
+ - ...
82
+
83
+ ## What Worked
84
+ - ...
85
+
86
+ ## What Failed
87
+ - ...
88
+
89
+ ## Drift
90
+ - ...
91
+
92
+ ## Action Items
93
+ - ...
94
+
95
+ ## Recommendation
96
+ Recommendation: <keep / change / document / escalate> because <evidence, trade-off, and rejected alternative>.
97
+ ```
98
+
99
+ 推荐必须说明下一轮具体改变什么,而不是只说“继续保持”。
@@ -1,126 +1,126 @@
1
- # Team Orchestration
2
-
3
- ## 角色定位
4
-
5
- 使用 `zc team` 把多个 AI CLI worker 运行在 tmux pane 和 git worktree 中,适合需要文件系统级隔离、长时间并行或多 CLI 协作的任务。
6
-
7
- 这是重型能力。默认先考虑串行执行或 `parallel-agent-dispatch`;只有用户明确要求多 worker / team 模式,且文件边界清楚时才启动。
8
-
9
- ## 何时使用
10
-
11
- 使用:
12
-
13
- - 多个任务可以分配给不同 worker。
14
- - 需要独立 worktree 避免写入冲突。
15
- - 需要不同 CLI 处理不同类型任务。
16
- - 任务较长,值得承担 fan-in 和清理成本。
17
-
18
- 不使用:
19
-
20
- - 单个简单任务。
21
- - 任务高度耦合、共享大量上下文。
22
- - 没有测试或集成验证方式。
23
- - 只是想“快一点”,但文件所有权不清。
24
-
25
- ## 快速路径
26
-
27
- 1. 先用 `zc doctor` 检查环境。
28
- 2. 用 `zc team plan` 做 dry-run,任务必须带 `files=` 边界。
29
- 3. 只有 `canStart=true` 且用户确认后,才运行 `zc team start`。
30
- 4. 用 `zc team status` 和 `zc team log` 监控 worker。
31
- 5. fan-in 前运行 `zc team shutdown <team> --plan` 查看 clean/dirty/ahead/merged 状态。
32
- 6. 明确每个分支去向后再 `zc team shutdown`。
33
-
34
- ```bash
35
- zc doctor
36
-
37
- zc team plan \
38
- -w 2 \
39
- -t "API | files=src/api.ts,src/api.test.ts" \
40
- -t "UI | files=src/ui.ts,src/ui.test.ts"
41
-
42
- zc team start \
43
- -w "w1:codex,w2:qwen-code" \
44
- -t "API | files=src/api.ts,src/api.test.ts" \
45
- -t "UI | files=src/ui.ts,src/ui.test.ts"
46
-
47
- zc team status <team-name>
48
- zc team log <team-name>
49
- zc team shutdown <team-name> --plan
50
- zc team shutdown <team-name>
51
- ```
52
-
53
- ## 任务描述规则
54
-
55
- 每个 `-t` 至少包含:
56
-
57
- - 任务名
58
- - `files=` 文件或目录所有权
59
- - 验收标准
60
- - 验证命令
61
-
62
- 示例:
63
-
64
- ```text
65
- 实现用户认证 API | files=src/auth.ts,src/auth.test.ts | verify=pnpm test auth
66
- ```
67
-
68
- 没有 `files=` 时,默认不能证明任务可安全并行。
69
-
70
- ## 启动前推荐格式
71
-
72
- ```text
73
- Recommendation: 使用 zc team because <文件系统隔离收益> outweighs <tmux/worktree/fan-in 成本>。
74
- - worker:
75
- - worktree 边界:
76
- - 不使用 team 的替代方案:
77
- - fan-in 验证:
78
- - 清理策略:
79
-
80
- 确认后我再启动;不确认则按串行或 Context Fan-Out 推进。
81
- ```
82
-
83
- ## Worker 协作纪律
84
-
85
- - 每个 worker 只修改自己的 `files=` 范围。
86
- - 共享接口变更必须通过 mailbox 或主线程广播。
87
- - worker 完成时报告修改文件、验证结果和待集成事项。
88
- - 主线程负责最终集成,不把 fan-in 交给任意单个 worker 自行处理。
89
-
90
- ## Fan-In 与收尾
91
-
92
- 结束前必须记录:
93
-
94
- ```text
95
- Team acceptance transcript:
96
- - Team:
97
- - Workers:
98
- - Task ownership:
99
- - Branch/worktree status:
100
- - Worker results:
101
- - Integrated diff:
102
- - Verification:
103
- - Cleanup:
104
- ```
105
-
106
- 收尾判断:
107
-
108
- - clean 且已合入:可删除 worktree/branch。
109
- - dirty:先读 diff,决定合入、保留或放弃。
110
- - ahead 但未合入:明确是否提交、PR 或丢弃。
111
- - unknown:不要直接删除,先人工确认状态。
112
-
113
- ## 边界与安全
114
-
115
- - 不把 `zc team` 当成默认实现方式。
116
- - 不为了形式统一创建多个 worker。
117
- - 不在未验证 `canStart=true` 时启动。
118
- - 不直接清理 dirty worktree。
119
- - 不混入破坏性 git 操作;需要删除或重置时必须先确认。
120
-
121
- ## 相关技能
122
-
123
- - `parallel-agent-dispatch`:上下文级并行,成本更低。
124
- - `subagent-driven-development`:串行子代理委派。
125
- - `branch-finish-and-cleanup`:分支和 worktree 收尾。
126
- - `verification-before-completion`:声明完成前的最终证据门禁。
1
+ # Team Orchestration
2
+
3
+ ## 角色定位
4
+
5
+ 使用 `zc team` 把多个 AI CLI worker 运行在 tmux pane 和 git worktree 中,适合需要文件系统级隔离、长时间并行或多 CLI 协作的任务。
6
+
7
+ 这是重型能力。默认先考虑串行执行或 `parallel-agent-dispatch`;只有用户明确要求多 worker / team 模式,且文件边界清楚时才启动。
8
+
9
+ ## 何时使用
10
+
11
+ 使用:
12
+
13
+ - 多个任务可以分配给不同 worker。
14
+ - 需要独立 worktree 避免写入冲突。
15
+ - 需要不同 CLI 处理不同类型任务。
16
+ - 任务较长,值得承担 fan-in 和清理成本。
17
+
18
+ 不使用:
19
+
20
+ - 单个简单任务。
21
+ - 任务高度耦合、共享大量上下文。
22
+ - 没有测试或集成验证方式。
23
+ - 只是想“快一点”,但文件所有权不清。
24
+
25
+ ## 快速路径
26
+
27
+ 1. 先用 `zc doctor` 检查环境。
28
+ 2. 用 `zc team plan` 做 dry-run,任务必须带 `files=` 边界。
29
+ 3. 只有 `canStart=true` 且用户确认后,才运行 `zc team start`。
30
+ 4. 用 `zc team status` 和 `zc team log` 监控 worker。
31
+ 5. fan-in 前运行 `zc team shutdown <team> --plan` 查看 clean/dirty/ahead/merged 状态。
32
+ 6. 明确每个分支去向后再 `zc team shutdown`。
33
+
34
+ ```bash
35
+ zc doctor
36
+
37
+ zc team plan \
38
+ -w 2 \
39
+ -t "API | files=src/api.ts,src/api.test.ts" \
40
+ -t "UI | files=src/ui.ts,src/ui.test.ts"
41
+
42
+ zc team start \
43
+ -w "w1:codex,w2:qwen-code" \
44
+ -t "API | files=src/api.ts,src/api.test.ts" \
45
+ -t "UI | files=src/ui.ts,src/ui.test.ts"
46
+
47
+ zc team status <team-name>
48
+ zc team log <team-name>
49
+ zc team shutdown <team-name> --plan
50
+ zc team shutdown <team-name>
51
+ ```
52
+
53
+ ## 任务描述规则
54
+
55
+ 每个 `-t` 至少包含:
56
+
57
+ - 任务名
58
+ - `files=` 文件或目录所有权
59
+ - 验收标准
60
+ - 验证命令
61
+
62
+ 示例:
63
+
64
+ ```text
65
+ 实现用户认证 API | files=src/auth.ts,src/auth.test.ts | verify=pnpm test auth
66
+ ```
67
+
68
+ 没有 `files=` 时,默认不能证明任务可安全并行。
69
+
70
+ ## 启动前推荐格式
71
+
72
+ ```text
73
+ Recommendation: 使用 zc team because <文件系统隔离收益> outweighs <tmux/worktree/fan-in 成本>。
74
+ - worker:
75
+ - worktree 边界:
76
+ - 不使用 team 的替代方案:
77
+ - fan-in 验证:
78
+ - 清理策略:
79
+
80
+ 确认后我再启动;不确认则按串行或 Context Fan-Out 推进。
81
+ ```
82
+
83
+ ## Worker 协作纪律
84
+
85
+ - 每个 worker 只修改自己的 `files=` 范围。
86
+ - 共享接口变更必须通过 mailbox 或主线程广播。
87
+ - worker 完成时报告修改文件、验证结果和待集成事项。
88
+ - 主线程负责最终集成,不把 fan-in 交给任意单个 worker 自行处理。
89
+
90
+ ## Fan-In 与收尾
91
+
92
+ 结束前必须记录:
93
+
94
+ ```text
95
+ Team acceptance transcript:
96
+ - Team:
97
+ - Workers:
98
+ - Task ownership:
99
+ - Branch/worktree status:
100
+ - Worker results:
101
+ - Integrated diff:
102
+ - Verification:
103
+ - Cleanup:
104
+ ```
105
+
106
+ 收尾判断:
107
+
108
+ - clean 且已合入:可删除 worktree/branch。
109
+ - dirty:先读 diff,决定合入、保留或放弃。
110
+ - ahead 但未合入:明确是否提交、PR 或丢弃。
111
+ - unknown:不要直接删除,先人工确认状态。
112
+
113
+ ## 边界与安全
114
+
115
+ - 不把 `zc team` 当成默认实现方式。
116
+ - 不为了形式统一创建多个 worker。
117
+ - 不在未验证 `canStart=true` 时启动。
118
+ - 不直接清理 dirty worktree。
119
+ - 不混入破坏性 git 操作;需要删除或重置时必须先确认。
120
+
121
+ ## 相关技能
122
+
123
+ - `parallel-agent-dispatch`:上下文级并行,成本更低。
124
+ - `subagent-driven-development`:串行子代理委派。
125
+ - `branch-finish-and-cleanup`:分支和 worktree 收尾。
126
+ - `verification-before-completion`:声明完成前的最终证据门禁。