@modus-ai/modus 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.
package/package.json
CHANGED
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
--help 显示完整帮助(中文)
|
|
13
13
|
--project <name> 指定项目(多项目 workspace 使用)
|
|
14
14
|
--story <tapd-url> 与直接传 URL 等价(alias)
|
|
15
|
+
--domain <names> 预设业务域(逗号分隔),跳过域确认交互
|
|
16
|
+
--from-plan <name> 从已批准的 plan.md 接力,跳过 SA01(需求分析)和 SA02(设计方案),
|
|
17
|
+
直接从 SA03 代码开发开始(★ 新增,配合 /modus:plan --continue 使用)
|
|
15
18
|
--skip <agents> 跳过指定 SubAgent(逗号分隔,如 "04-perf,05-security")
|
|
16
19
|
--loop1-only 仅执行 Loop 1,不触发 Loop 2 自动修复
|
|
17
20
|
--resume 从最后完成的 SubAgent 断点继续
|
|
@@ -20,6 +23,9 @@
|
|
|
20
23
|
--no-deploy 跳过 07-deploy SubAgent(仅交付到 pre 环境)
|
|
21
24
|
--max-loop2 <n> Loop 2 最大重入次数(默认 3,填 0 禁用 Loop 2)
|
|
22
25
|
--notify <channel> 完成后通知渠道(wework|dingtalk|slack)
|
|
26
|
+
--show-progress 实时输出结构化进度事件到 modus/sessions/events.jsonl(★ 新增)
|
|
27
|
+
--force 跳过所有人工确认节点(Codex 平台自动开启)
|
|
28
|
+
--verbose 输出 SubAgent 详细执行日志
|
|
23
29
|
```
|
|
24
30
|
|
|
25
31
|
## 使用示例
|
|
@@ -31,6 +37,9 @@
|
|
|
31
37
|
/modus:harness https://tapd.cn/.../1234 --loop1-only
|
|
32
38
|
/modus:harness https://tapd.cn/.../1234 --resume
|
|
33
39
|
/modus:harness https://tapd.cn/.../1234 --max-loop2 0 --no-deploy
|
|
40
|
+
/modus:harness --from-plan my-feature # 从技术评审接力(★ 新增)
|
|
41
|
+
/modus:harness https://tapd.cn/.../1234 --show-progress # 实时进度事件(★ 新增)
|
|
42
|
+
/modus:harness https://tapd.cn/.../1234 --force # Codex 无人值守模式
|
|
34
43
|
```
|
|
35
44
|
|
|
36
45
|
**Step Final:** SubAgent 00 (Mode D) — ARCHIVE knowledge extraction
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
--help 显示完整帮助(中文)
|
|
13
13
|
--story <tapd-url> 关联 TAPD Story(自动填写背景,写入 HANDOFF story_id)
|
|
14
14
|
--project <name> 指定项目(多项目 workspace 使用)
|
|
15
|
-
--design
|
|
15
|
+
--design 设计评审模式:只生成技术评审文档(plan.md),status=pending_review,
|
|
16
|
+
不触发代码生成(★ 适合复杂需求在开发前做技术评审)
|
|
17
|
+
--continue <name> 接力模式:读取已批准的 plan.md,自动触发
|
|
18
|
+
/modus:harness --from-plan <name>(跳过 SA01+SA02)(★ 新增)
|
|
16
19
|
--quick 跳过澄清 3 问,直接生成 plan(适合简单任务)
|
|
17
20
|
--enhance 生成 plan 前强制刷新相关 Skill(hash 检查)
|
|
18
21
|
--no-build 归档模式:生成 plan.md 但不触发 Build 确认循环
|
|
@@ -27,11 +30,27 @@
|
|
|
27
30
|
/modus:plan 需要支持歌曲批量导出为 Excel
|
|
28
31
|
/modus:plan --story https://tapd.cn/.../stories/view/123 新增艺人等级评定功能
|
|
29
32
|
/modus:plan --design 评估版权对账系统的重构方案
|
|
33
|
+
/modus:plan --design --story https://tapd.cn/.../123456 # 设计评审模式(★ 新增)
|
|
34
|
+
/modus:plan --continue my-feature # 评审通过,接力 harness 开发(★ 新增)
|
|
30
35
|
/modus:plan --quick 修复版权审核列表分页 bug
|
|
31
36
|
/modus:plan --read-only 分析中央曲库同步的架构方案
|
|
32
37
|
/modus:plan --resume batch-export 继续上次中断的规划
|
|
33
38
|
```
|
|
34
39
|
|
|
40
|
+
## 设计评审 → 代码开发 完整链路
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
/modus:plan --design [story-url]
|
|
44
|
+
↓
|
|
45
|
+
生成 plan.md(status: pending_review,不触发代码生成)
|
|
46
|
+
↓ 人工评审通过后
|
|
47
|
+
/modus:plan --continue {name}
|
|
48
|
+
↓ 自动调用
|
|
49
|
+
/modus:harness --from-plan {name}(跳过 SA01 需求分析 + SA02 设计方案)
|
|
50
|
+
↓
|
|
51
|
+
直接从 SA03 代码开发开始
|
|
52
|
+
```
|
|
53
|
+
|
|
35
54
|
## 执行流程概览
|
|
36
55
|
|
|
37
56
|
```
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
| 版本 | 主要变更 |
|
|
35
35
|
|------|---------|
|
|
36
|
+
| v4.0.0 | plan --design 设计评审节点;plan --continue + harness --from-plan 接力机制;HANDOFF protocol schema v1.3(plan 专用字段);Progress Event Protocol(events.jsonl);AGENTS.md 自动生成(modus update 驱动,不再手动维护) |
|
|
36
37
|
| v3.2.0 | 跨 Skill 路径全面统一到 `modus/knowledge/biz-*/`;步骤编号规范化(禁止小数步骤);modus-analyst 产出路径更正到 `modus/stories/{id}/harness/`;modus-plan 双路径产出规则(Story 模式 vs 独立模式) |
|
|
37
38
|
| v3.1.0 | 知识库路径迁移:`.codebuddy/skills/modus-biz-*` → `modus/knowledge/biz-*`;新增工作区顶层路由 `modus/workspace-catalog.md`;HANDOFF 协议升级到 schema v1.1 |
|
|
38
39
|
| v3.0.0 | 多项目工作区支持(modus-workspace.yaml);引用式适配(不复制知识) |
|
|
@@ -49,6 +50,65 @@
|
|
|
49
50
|
⑥ 输出迁移完成报告
|
|
50
51
|
```
|
|
51
52
|
|
|
53
|
+
## v3.x → v4.0 迁移详细步骤
|
|
54
|
+
|
|
55
|
+
运行 `/modus:upgrade --target 4.0.0` 时自动执行以下步骤:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
Step 1: 备份
|
|
59
|
+
创建 modus/backup/{YYYYMMDD}-v3.x/ 目录
|
|
60
|
+
复制所有现有 Skill 文件和 config.yaml 到备份目录
|
|
61
|
+
|
|
62
|
+
Step 2: HANDOFF 格式兼容检查
|
|
63
|
+
扫描 modus/stories/*/harness/*.md 中的旧版 HTML 注释块(<!--HANDOFF...-->)
|
|
64
|
+
自动转换为 YAML frontmatter 格式(schema v1.1 → v1.2/v1.3)
|
|
65
|
+
输出:「已迁移 N 个产物文件到 YAML frontmatter 格式」
|
|
66
|
+
|
|
67
|
+
Step 3: plan 产物字段补全
|
|
68
|
+
扫描 modus/plans/*/plan.md
|
|
69
|
+
在 HANDOFF frontmatter 中补充新字段(design_mode/status/continue_token/risk_level/estimated_effort)
|
|
70
|
+
默认值:design_mode=false, status=complete, continue_token=""
|
|
71
|
+
|
|
72
|
+
Step 4: harness 命令 Skill 更新
|
|
73
|
+
更新 modus-harness Skill:添加 --from-plan 处理逻辑
|
|
74
|
+
更新 modus-plan Skill:添加 --design 分支 + --continue 接力逻辑
|
|
75
|
+
输出:「已更新 modus-harness / modus-plan Skill 模板」
|
|
76
|
+
|
|
77
|
+
Step 5: 初始化进度事件目录
|
|
78
|
+
创建 modus/sessions/ 目录(若不存在)
|
|
79
|
+
创建 modus/sessions/events.jsonl(若不存在,初始化为空文件)
|
|
80
|
+
输出:「已初始化 Progress Event 日志:modus/sessions/events.jsonl」
|
|
81
|
+
|
|
82
|
+
Step 6: AGENTS.md 自动生成(Codex 平台)
|
|
83
|
+
若 config.yaml platforms 含 codex,重新生成 AGENTS.md:
|
|
84
|
+
融合:workspace-catalog + constitution.hard_rules + 最新命令参数集
|
|
85
|
+
输出:「AGENTS.md 已重新生成(Codex 平台适配)」
|
|
86
|
+
|
|
87
|
+
Step 7: 更新 modus/config.yaml
|
|
88
|
+
将 modus_version 更新为 "4.0.0"
|
|
89
|
+
输出迁移完成报告
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**迁移完成报告示例:**
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
✅ Modus v4.0.0 升级完成
|
|
96
|
+
|
|
97
|
+
迁移内容:
|
|
98
|
+
✓ HANDOFF 格式:N 个产物文件已转换为 YAML frontmatter
|
|
99
|
+
✓ plan 产物:M 个 plan.md 已补充 v4.0 专用字段
|
|
100
|
+
✓ Skill 更新:modus-harness / modus-plan 已更新
|
|
101
|
+
✓ 进度事件:modus/sessions/events.jsonl 已初始化
|
|
102
|
+
✓ AGENTS.md:已重新生成(若 codex 已启用)
|
|
103
|
+
|
|
104
|
+
备份位置:modus/backup/{YYYYMMDD}-v3.x/
|
|
105
|
+
|
|
106
|
+
新功能使用方式:
|
|
107
|
+
设计评审模式:/modus:plan --design [story-url]
|
|
108
|
+
接力开发: /modus:plan --continue {name}
|
|
109
|
+
进度监控: /modus:harness ... --show-progress
|
|
110
|
+
```
|
|
111
|
+
|
|
52
112
|
## 执行此命令
|
|
53
113
|
|
|
54
114
|
读取并执行 `.codebuddy/skills/modus-upgrade/SKILL.md` 中的完整流程。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: modus-harness
|
|
3
|
-
description: Use this skill when executing /modus:harness command to run the full dual-loop multi-agent Harness from requirements analysis to deployment. Acts as the orchestrator coordinating SubAgents 00-07. Trigger on /modus:harness command or when user provides a TAPD Story URL and wants automated end-to-end delivery.
|
|
3
|
+
description: Use this skill when executing /modus:harness command to run the full dual-loop multi-agent Harness from requirements analysis to deployment. Acts as the orchestrator coordinating SubAgents 00-07. Trigger on /modus:harness command or when user provides a TAPD Story URL and wants automated end-to-end delivery. Also handles --from-plan relay (skip SA01+SA02, read plan.md as dev input) and --show-progress (write events.jsonl).
|
|
4
4
|
allowed-tools: Read, Write, Glob, Bash, Task
|
|
5
5
|
disable: false
|
|
6
6
|
---
|
|
@@ -61,6 +61,67 @@ Orchestrator 每步只需读 HANDOFF 块(≤ 20 行),而非整份 MD 文
|
|
|
61
61
|
|
|
62
62
|
---
|
|
63
63
|
|
|
64
|
+
## 参数解析(优先执行,Step 1 之前)
|
|
65
|
+
|
|
66
|
+
**首先**检测用户输入中的参数标志,设置后续行为开关:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
--help → 输出帮助文档,结束执行
|
|
70
|
+
--from-plan X → FROM_PLAN_MODE=true,PLAN_NAME=X(进入 from-plan 接力路径,见下方)
|
|
71
|
+
--show-progress → SHOW_PROGRESS=true(每个关键节点写入 events.jsonl)
|
|
72
|
+
--domain X → FORCED_DOMAINS=X(逗号分隔,跳过域确认交互)
|
|
73
|
+
--skip X → SKIP_AGENTS=X(逗号分隔的 SubAgent ID)
|
|
74
|
+
--loop1-only → LOOP1_ONLY=true
|
|
75
|
+
--resume → RESUME=true
|
|
76
|
+
--dry-run → DRY_RUN=true
|
|
77
|
+
--force → FORCE=true(跳过人工确认,Codex 平台自动开启)
|
|
78
|
+
--no-deploy → NO_DEPLOY=true
|
|
79
|
+
--max-loop2 N → MAX_LOOP2=N(默认 3)
|
|
80
|
+
--verbose → VERBOSE=true
|
|
81
|
+
--project X → PROJECT=X
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**FROM_PLAN 接力路径(--from-plan 时,替代 Step 2 的标准澄清流程):**
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
Step P1:读取 plan.md
|
|
88
|
+
路径:modus/plans/{PLAN_NAME}/plan.md
|
|
89
|
+
读取 HANDOFF frontmatter 验证:
|
|
90
|
+
→ design_mode = true 且 status ∈ {approved, continued}
|
|
91
|
+
→ 若 status = pending_review:
|
|
92
|
+
提示「plan 尚未批准(status=pending_review),请先完成技术评审后再 --continue」
|
|
93
|
+
输出「如需强制继续,运行:/modus:harness --from-plan {name} --force」
|
|
94
|
+
若 FORCE=false:结束执行
|
|
95
|
+
提取关键内容:
|
|
96
|
+
→ domains:传给知识注入(SA00)
|
|
97
|
+
→ story_id:用于工作目录路径(若 plan.md 有 story_id)
|
|
98
|
+
→ 「实现 Todos」章节 → 作为 SA03 的代码开发计划(替代 01-analysis + 02-design Sprint 拆分)
|
|
99
|
+
→ 「技术方案评审 → 推荐方案」→ 作为 SA03 的架构决策参考
|
|
100
|
+
→ 「已知风险」→ 传递给 SA07 代码评审作为审查重点
|
|
101
|
+
→ continue_token:记录到工作目录 .harness-state.yaml
|
|
102
|
+
|
|
103
|
+
Step P2:初始化工作目录
|
|
104
|
+
若 plan.md 含 story_id:工作目录 = modus/stories/{story_id}/harness/
|
|
105
|
+
若无 story_id:工作目录 = modus/plans/{PLAN_NAME}/harness/
|
|
106
|
+
|
|
107
|
+
Step P3:输出接力摘要
|
|
108
|
+
🚀 从 plan --from-plan 接力启动
|
|
109
|
+
plan:modus/plans/{PLAN_NAME}/plan.md
|
|
110
|
+
continue_token:{token}
|
|
111
|
+
跳过:SA01(需求分析)+ SA02(设计方案)
|
|
112
|
+
直接执行:SA00(知识注入)→ SA03(代码开发)→ SA04/05/06(并行审计)→ SA07(评审)→ SA08(部署)
|
|
113
|
+
|
|
114
|
+
Step P4:设置 SKIP_AGENTS = ["01", "02"](强制跳过 SA01 + SA02)
|
|
115
|
+
并将 plan.md 的「实现 Todos」封装为 FROM_PLAN_CONTEXT,注入 SA03 执行时的任务描述
|
|
116
|
+
|
|
117
|
+
写入进度事件(若 SHOW_PROGRESS=true):
|
|
118
|
+
{"ts":"...","type":"plan_relay","plan_name":"{PLAN_NAME}","continue_token":"{token}","skipped_stages":["01-analysis","02-design"]}
|
|
119
|
+
|
|
120
|
+
完成后进入标准 Step 1(项目宪法 + 前置检查),跳过 Step 2(澄清意图)。
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
64
125
|
## 执行流程
|
|
65
126
|
|
|
66
127
|
### Step 1:项目宪法 + 前置检查
|
|
@@ -158,11 +219,20 @@ last_updated: "{ISO 8601 时间戳}"
|
|
|
158
219
|
|
|
159
220
|
将 Skill 内容(已加载的完整 SKILL.md)和 constitution.hard_rules 一起传递给 SubAgent 01 作为背景知识。
|
|
160
221
|
|
|
222
|
+
**FROM_PLAN_MODE 特殊处理:**
|
|
223
|
+
|
|
224
|
+
若 FROM_PLAN_MODE=true,在输出启动摘要时补充 plan 上下文说明:
|
|
225
|
+
|
|
161
226
|
```
|
|
162
|
-
[Harness Orchestrator 启动]
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
227
|
+
[Harness Orchestrator 启动 — plan 接力模式]
|
|
228
|
+
plan:modus/plans/{PLAN_NAME}/plan.md(continue_token: {token})
|
|
229
|
+
工作目录: {工作目录}
|
|
230
|
+
跳过: SA01(需求分析)→ SA02(设计方案)
|
|
231
|
+
知识注入: {domains}[...] | Constitution: {N} 条硬性规则已加载
|
|
232
|
+
|
|
233
|
+
📋 SA03 将读取 plan.md 中的「实现 Todos」作为代码开发输入:
|
|
234
|
+
{plan.md 中 Todos 章节前 3 条预览}
|
|
235
|
+
...(共 N 条 Todo)
|
|
166
236
|
```
|
|
167
237
|
|
|
168
238
|
---
|
|
@@ -313,17 +383,27 @@ feat: {业务摘要}
|
|
|
313
383
|
|
|
314
384
|
## 调度 CoT(每次行动前循环执行)
|
|
315
385
|
|
|
316
|
-
1.
|
|
386
|
+
1. 扫描工作目录,列出已有 HANDOFF frontmatter
|
|
317
387
|
2. 只需读各文件的 HANDOFF frontmatter(≤ 20 行),对照串行顺序确定当前阶段
|
|
318
388
|
3. 检查当前阶段的 Gate 条件是否满足(优先读 HANDOFF,必要时读全文)。**每个 Gate 仅在对应 SubAgent 完成后单独执行,互相独立,不同时触发**:
|
|
319
|
-
- Gate A0:**当 SubAgent 01 写入 `01-analysis.md` 后**,检查该文件 HANDOFF 块的 `gate_status` 字段,确保 = "passed"(需求分析质量门,独立于 Gate A0.5
|
|
320
|
-
- Gate A0.5:**当 SubAgent 02 写入 `02-design-brief.md` 后**,检查 `gate_status ∈ {passed, warning}`;`failed` 时重入 SubAgent 02,最多 2
|
|
389
|
+
- Gate A0:**当 SubAgent 01 写入 `01-analysis.md` 后**,检查该文件 HANDOFF 块的 `gate_status` 字段,确保 = "passed"(需求分析质量门,独立于 Gate A0.5)。**FROM_PLAN_MODE 时跳过此 Gate**(SA01 已跳过)
|
|
390
|
+
- Gate A0.5:**当 SubAgent 02 写入 `02-design-brief.md` 后**,检查 `gate_status ∈ {passed, warning}`;`failed` 时重入 SubAgent 02,最多 2 次。**FROM_PLAN_MODE 时跳过此 Gate**(SA02 已跳过)
|
|
321
391
|
- Gate A:执行 `constitution.build_command`(如 `mvn clean compile -q -DskipTests`),检查 exit code = 0;失败时重入 SubAgent 03,最多 3 次
|
|
322
392
|
- Gate B:扫描 harness/ 目录,检查 `04-test-report.md`、`05-perf-report.md`、`06-security-report.md` 的 HANDOFF `artifact_status` 均为 `complete`;各报告 `gate_status ≠ "failed"`;06(安全审计)有严重/高危则强制拦截;超时(30 分钟)上报用户
|
|
323
393
|
- Gate C:读 `cr-report.md` HANDOFF,检查 `issues` 数组为空或全为 P3;有 P1/P2 时从 `issues[].affected_sprint` 定位受影响 Sprint,触发 Loop 2 精准重入 SubAgent 03
|
|
324
394
|
4. Gate 通过 → 调用下一个 SubAgent 的 Skill(传递 constitution + 相关 Skill 内容)
|
|
325
|
-
- 调用 SubAgent 03
|
|
395
|
+
- 调用 SubAgent 03 时:
|
|
396
|
+
- **标准模式**:必须同时传入 `02-design-brief.md` 内容
|
|
397
|
+
- **FROM_PLAN_MODE**:传入 plan.md 的「实现 Todos」+ 「推荐方案」作为等价输入,代替 02-design-brief.md
|
|
326
398
|
5. Gate 失败 → 按规则处理(重入/上报)
|
|
327
399
|
6. 输出本轮进度卡片
|
|
328
400
|
7. 若 SubAgent 08 完成且 `08-deploy-status.md` HANDOFF `artifact_status = complete` → 触发 ARCHIVE 知识提取(SubAgent 00 模式 D),进入 Step 4
|
|
329
|
-
8.
|
|
401
|
+
8. **进度事件写入(SHOW_PROGRESS=true 时,在步骤 4/5/7 后各执行一次):**
|
|
402
|
+
向 `modus/sessions/events.jsonl` 追加事件(JSON Lines 格式,见 `modus/docs/protocol.md §七`):
|
|
403
|
+
- SubAgent 开始执行前:写入 `stage_start` 事件
|
|
404
|
+
- SubAgent 完成后:写入 `stage_done` 事件
|
|
405
|
+
- Gate 检查完成后:写入 `gate` 事件
|
|
406
|
+
- Gate A 编译检查后:写入 `compile` 事件
|
|
407
|
+
- Loop 2 触发时:写入 `loop2_start` 事件
|
|
408
|
+
- 全流程完成时:写入 `harness_done` 事件
|
|
409
|
+
9. 等待 SubAgent 写入产出物,重复步骤 1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: modus-plan
|
|
3
|
-
description: Use this skill when executing /modus:plan command to generate a single structured plan.md backed by up-to-date business Skills. Trigger on /modus:plan command or when user wants to plan a feature with full business context. Loads Skill domains first, falls back to platform rules + source scan, then asks 0-3 targeted questions (no padding — only ask when truly needed) before generating the plan. Ends with a Build confirmation loop where user can iterate on plan.md before executing code generation.
|
|
3
|
+
description: Use this skill when executing /modus:plan command to generate a single structured plan.md backed by up-to-date business Skills. Trigger on /modus:plan command or when user wants to plan a feature with full business context. Loads Skill domains first, falls back to platform rules + source scan, then asks 0-3 targeted questions (no padding — only ask when truly needed) before generating the plan. Ends with a Build confirmation loop where user can iterate on plan.md before executing code generation. Also handles --design mode (design-review-only, no code gen) and --continue mode (relay plan.md to harness).
|
|
4
4
|
allowed-tools: Read, Write, Glob, Bash
|
|
5
5
|
disable: false
|
|
6
6
|
---
|
|
@@ -13,6 +13,41 @@ disable: false
|
|
|
13
13
|
|
|
14
14
|
功能规划入口。通过**两层知识检索**获取业务上下文,先评估需求复杂度自动分级(simple/medium/complex),再基于加载的知识向用户提出 0–3 个精准澄清问题(按需提问,禁止凑数),最终生成单一 `plan.md` 规划文档。文档生成后进入 Build 确认循环,用户可反复修改直至满意后触发代码执行,并将本次规划中的新知识回写到 Skill(后置更新)。
|
|
15
15
|
|
|
16
|
+
支持两种特殊模式(v4.0 新增):
|
|
17
|
+
- **`--design` 设计评审模式**:仅生成技术评审文档,`status: pending_review`,不触发代码生成
|
|
18
|
+
- **`--continue <name>` 接力模式**:读取已批准的 plan.md,直接接力触发 `harness --from-plan`
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 参数解析(优先执行,Step 0 之前)
|
|
23
|
+
|
|
24
|
+
**首先**检测用户输入中的参数标志,决定执行路径:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
--help → 输出帮助文档,结束执行
|
|
28
|
+
--design → DESIGN_MODE=true(进入设计评审分支,见「Design Mode 流程」)
|
|
29
|
+
--continue X → CONTINUE_MODE=true,PLAN_NAME=X(进入接力分支,见「Continue 流程」)
|
|
30
|
+
--quick → QUICK_MODE=true(跳过域确认和澄清问题)
|
|
31
|
+
--story X → STORY_ID=X(关联 TAPD Story)
|
|
32
|
+
--project X → PROJECT=X(多项目指定)
|
|
33
|
+
--enhance X → ENHANCE_DOMAIN=X(前置强制刷新指定域 Skill)
|
|
34
|
+
--no-build → NO_BUILD=true(生成 plan.md 后跳过 Build 循环)
|
|
35
|
+
--read-only → READ_ONLY=true(同 NO_BUILD,永远不触发代码生成)
|
|
36
|
+
--resume X → RESUME_NAME=X(断点续跑)
|
|
37
|
+
--complexity X → FORCED_COMPLEXITY=X
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**路由决策树:**
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
检测到 --continue X?
|
|
44
|
+
是 → 跳转到「Continue 流程」(完整独立流程,不执行 Step 0-9)
|
|
45
|
+
|
|
46
|
+
检测到 --design?
|
|
47
|
+
是 → 执行 Step 0→Step 1→Step 2→Step 3→Step 4→Step 5→Step 6→Design Mode Step 7(生成 plan.md 后暂停)
|
|
48
|
+
否 → 执行标准流程(Step 0 → Step 9)
|
|
49
|
+
```
|
|
50
|
+
|
|
16
51
|
---
|
|
17
52
|
|
|
18
53
|
## 执行流程
|
|
@@ -348,6 +383,89 @@ created: {ISO8601时间戳}
|
|
|
348
383
|
|
|
349
384
|
---
|
|
350
385
|
|
|
386
|
+
### Step 7(Design Mode 分支):设计评审模式产出 ⏸️ 【人工审批节点】
|
|
387
|
+
|
|
388
|
+
> **仅在 DESIGN_MODE=true 时执行此分支,替代标准 Step 8(Build 循环)。**
|
|
389
|
+
|
|
390
|
+
**生成额外的技术评审内容:**
|
|
391
|
+
|
|
392
|
+
在标准 plan.md 基础上,追加以下章节(design mode 专属):
|
|
393
|
+
|
|
394
|
+
```markdown
|
|
395
|
+
## 技术方案评审
|
|
396
|
+
|
|
397
|
+
### 需求解读(5W1H)
|
|
398
|
+
| 维度 | 内容 |
|
|
399
|
+
|------|------|
|
|
400
|
+
| Who | {谁发起/谁受益} |
|
|
401
|
+
| What | {要做什么} |
|
|
402
|
+
| Why | {业务价值/驱动因素} |
|
|
403
|
+
| When | {预期上线时间/Sprint} |
|
|
404
|
+
| Where | {涉及系统/服务范围} |
|
|
405
|
+
| How | {核心实现思路} |
|
|
406
|
+
|
|
407
|
+
### 技术方案对比(3 个候选方案)
|
|
408
|
+
|
|
409
|
+
| | 方案 A(推荐) | 方案 B | 方案 C |
|
|
410
|
+
|---|---|---|---|
|
|
411
|
+
| 实现思路 | ... | ... | ... |
|
|
412
|
+
| 优点 | ... | ... | ... |
|
|
413
|
+
| 缺点/风险 | ... | ... | ... |
|
|
414
|
+
| 实现成本 | ... | ... | ... |
|
|
415
|
+
|
|
416
|
+
**推荐方案:方案 A**
|
|
417
|
+
理由:{1-2 句话}
|
|
418
|
+
|
|
419
|
+
### 影响范围(方法级)
|
|
420
|
+
| 文件 | 类/方法 | 变更类型 | 影响说明 |
|
|
421
|
+
|------|--------|---------|---------|
|
|
422
|
+
| {路径} | {类名.方法名} | 新增/修改/删除 | {说明} |
|
|
423
|
+
|
|
424
|
+
### API 契约草稿
|
|
425
|
+
{若有接口新增/修改,列出方法签名}
|
|
426
|
+
|
|
427
|
+
### 技术风险点
|
|
428
|
+
| 风险 | 等级 | 应对方案 |
|
|
429
|
+
|------|------|---------|
|
|
430
|
+
| {风险描述} | P1/P2 | {方案} |
|
|
431
|
+
|
|
432
|
+
### 估时
|
|
433
|
+
- 预估工作量:{XS/S/M/L/XL}({N 个工作日})
|
|
434
|
+
- 主要耗时点:{1-2 句话}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
**写入 HANDOFF frontmatter(design mode 专用字段):**
|
|
438
|
+
|
|
439
|
+
```yaml
|
|
440
|
+
---
|
|
441
|
+
schema_version: "1.2"
|
|
442
|
+
agent: "plan"
|
|
443
|
+
design_mode: true
|
|
444
|
+
status: "pending_review"
|
|
445
|
+
risk_level: "{low|medium|high}"
|
|
446
|
+
estimated_effort: "{XS|S|M|L|XL}"
|
|
447
|
+
continue_token: ""
|
|
448
|
+
---
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
**输出并暂停:**
|
|
452
|
+
|
|
453
|
+
```
|
|
454
|
+
✅ 技术评审文档已生成:modus/plans/{name}/plan.md
|
|
455
|
+
设计模式:ON | 状态:pending_review | 风险:{level} | 估时:{effort}
|
|
456
|
+
|
|
457
|
+
──────────────────────────────────────────
|
|
458
|
+
📋 评审文档包含:需求解读 / 3 个候选方案 / 影响范围 / API 草稿 / 风险点 / 估时
|
|
459
|
+
|
|
460
|
+
⏸️ 等待人工技术评审。评审通过后运行:
|
|
461
|
+
/modus:plan --continue {name}
|
|
462
|
+
──────────────────────────────────────────
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
⏸️ **等待人工确认** — 此时**不触发任何代码生成**,整个 Design Mode 流程到此结束。
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
351
469
|
### Step 8:Build 确认循环 ⏸️ 【人工审批节点】
|
|
352
470
|
|
|
353
471
|
plan.md 生成后,展示结果并进入确认循环:
|
|
@@ -474,3 +592,92 @@ modus/
|
|
|
474
592
|
│ ├── .modus-state.yaml ← status: archived
|
|
475
593
|
│ └── plan.md
|
|
476
594
|
```
|
|
595
|
+
|
|
596
|
+
---
|
|
597
|
+
|
|
598
|
+
## Continue 流程(--continue 模式,独立完整流程)
|
|
599
|
+
|
|
600
|
+
> **触发条件:** 用户运行 `/modus:plan --continue <name>` 时进入此流程。
|
|
601
|
+
|
|
602
|
+
### Continue Step 1:读取 plan.md 并验证状态
|
|
603
|
+
|
|
604
|
+
```
|
|
605
|
+
读取 modus/plans/{name}/plan.md 的 HANDOFF frontmatter:
|
|
606
|
+
→ 检查 design_mode = true(不是 design 模式的 plan 不能用 --continue)
|
|
607
|
+
→ 检查 status ∈ {pending_review, approved}(已完成或已 continued 的不重复触发)
|
|
608
|
+
→ 若 status = continued:提示「此 plan 已接力,是否重新触发?[y/N]」
|
|
609
|
+
|
|
610
|
+
若 plan.md 不存在 → 报错:
|
|
611
|
+
❌ 未找到 plan:modus/plans/{name}/plan.md
|
|
612
|
+
请先运行 /modus:plan --design 生成技术评审文档
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
### Continue Step 2:展示接力确认
|
|
616
|
+
|
|
617
|
+
```
|
|
618
|
+
准备接力 harness:
|
|
619
|
+
|
|
620
|
+
📋 plan:{name}
|
|
621
|
+
状态:{pending_review → 即将变更为 approved}
|
|
622
|
+
业务域:{domains}
|
|
623
|
+
风险等级:{risk_level}
|
|
624
|
+
估时:{estimated_effort}
|
|
625
|
+
|
|
626
|
+
⚡ 接力后将跳过:SA01(需求分析)+ SA02(设计方案)
|
|
627
|
+
直接从:SA03 代码开发 开始
|
|
628
|
+
|
|
629
|
+
SA03 将读取 plan.md 中的「实现 Todos」作为代码开发计划。
|
|
630
|
+
是否确认接力?[Y/n](--force 时自动确认)
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
### Continue Step 3:生成 continue_token 并更新状态
|
|
634
|
+
|
|
635
|
+
```
|
|
636
|
+
生成 continue_token:{name}:{YYYYMMDD}
|
|
637
|
+
更新 plan.md frontmatter:
|
|
638
|
+
status: "approved" → 写入后立即变更为 "continued"
|
|
639
|
+
continue_token: "{name}:{YYYYMMDD}"
|
|
640
|
+
|
|
641
|
+
写入 .modus-state.yaml:
|
|
642
|
+
status: continued
|
|
643
|
+
continued_at: {ISO8601 时间戳}
|
|
644
|
+
harness_triggered: true
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
### Continue Step 4:接力触发 harness
|
|
648
|
+
|
|
649
|
+
输出启动提示:
|
|
650
|
+
|
|
651
|
+
```
|
|
652
|
+
🚀 plan --continue 接力启动
|
|
653
|
+
规划文件:modus/plans/{name}/plan.md
|
|
654
|
+
传递标记:[FROM_PLAN: {name} | token: {continue_token}]
|
|
655
|
+
跳过阶段:SA01(需求分析)+ SA02(设计方案)
|
|
656
|
+
直接启动:SA03 代码开发
|
|
657
|
+
|
|
658
|
+
启动 /modus:harness --from-plan {name}...
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
以如下格式构造 harness 的入参(在**当前上下文中**直接继续执行 modus-harness Skill):
|
|
662
|
+
|
|
663
|
+
```
|
|
664
|
+
/modus:harness --from-plan {name}
|
|
665
|
+
|
|
666
|
+
传递上下文:
|
|
667
|
+
plan_file: modus/plans/{name}/plan.md
|
|
668
|
+
continue_token: {token}
|
|
669
|
+
domains: {plan.md 中的 domains}
|
|
670
|
+
constitution: {当前 config.yaml constitution}
|
|
671
|
+
skip_agents: ["01", "02"]
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
`modus-harness` Skill 检测到 `--from-plan` 时,读取 plan.md 中的以下内容作为 SA03 的输入:
|
|
675
|
+
- 「实现 Todos」→ 作为代码开发计划(替代 01-analysis.md + 02-design-brief.md 中的 Sprint 拆分)
|
|
676
|
+
- 「技术方案评审 → 推荐方案」→ 作为架构决策(替代 SA02 的设计方案)
|
|
677
|
+
- 「已知风险」→ 传递给 SA07(代码评审)作为审查重点
|
|
678
|
+
|
|
679
|
+
### Continue Step 5:写入进度事件(若 events.jsonl 存在)
|
|
680
|
+
|
|
681
|
+
```json
|
|
682
|
+
{"ts":"{ISO8601}","type":"plan_relay","plan_name":"{name}","continue_token":"{token}","skipped_stages":["01-analysis","02-design"]}
|
|
683
|
+
```
|