maestro-flow 0.5.37 → 0.5.39

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 (216) hide show
  1. package/.agents/skills/maestro/SKILL.md +11 -5
  2. package/.agents/skills/maestro-ralph/SKILL.md +80 -12
  3. package/.agents/skills/maestro-ralph-execute/SKILL.md +17 -6
  4. package/.agents/skills/manage-drift-realign/SKILL.md +153 -0
  5. package/.agents/skills/odyssey-debug/SKILL.md +90 -269
  6. package/.agents/skills/odyssey-improve/SKILL.md +39 -240
  7. package/.agents/skills/odyssey-planex/SKILL.md +21 -105
  8. package/.agents/skills/odyssey-review-test-fix/SKILL.md +98 -318
  9. package/.agents/skills/odyssey-ui/SKILL.md +82 -265
  10. package/.agy/skills/maestro/SKILL.md +11 -5
  11. package/.agy/skills/maestro-ralph/SKILL.md +80 -12
  12. package/.agy/skills/maestro-ralph-execute/SKILL.md +17 -6
  13. package/.agy/skills/manage-drift-realign/SKILL.md +153 -0
  14. package/.agy/skills/odyssey-debug/SKILL.md +90 -269
  15. package/.agy/skills/odyssey-improve/SKILL.md +39 -240
  16. package/.agy/skills/odyssey-planex/SKILL.md +21 -105
  17. package/.agy/skills/odyssey-review-test-fix/SKILL.md +98 -318
  18. package/.agy/skills/odyssey-ui/SKILL.md +82 -265
  19. package/.claude/commands/maestro-ralph-execute.md +17 -6
  20. package/.claude/commands/maestro-ralph.md +80 -12
  21. package/.claude/commands/maestro.md +11 -5
  22. package/.claude/commands/manage-drift-realign.md +151 -0
  23. package/.claude/commands/odyssey-debug.md +90 -269
  24. package/.claude/commands/odyssey-improve.md +39 -240
  25. package/.claude/commands/odyssey-planex.md +21 -105
  26. package/.claude/commands/odyssey-review-test-fix.md +98 -318
  27. package/.claude/commands/odyssey-ui.md +82 -265
  28. package/.codex/skills/maestro/SKILL.md +16 -8
  29. package/.codex/skills/maestro-ralph/SKILL.md +138 -11
  30. package/.codex/skills/maestro-ralph-execute/SKILL.md +17 -6
  31. package/.codex/skills/manage-drift-realign/SKILL.md +471 -0
  32. package/.codex/skills/odyssey-debug/SKILL.md +167 -338
  33. package/.codex/skills/odyssey-improve/SKILL.md +226 -395
  34. package/.codex/skills/odyssey-planex/SKILL.md +317 -159
  35. package/.codex/skills/odyssey-review-test-fix/SKILL.md +137 -255
  36. package/.codex/skills/odyssey-ui/SKILL.md +197 -338
  37. package/README.md +25 -8
  38. package/README.zh-CN.md +6 -6
  39. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +23 -2
  40. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +242 -26
  41. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  42. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +2 -0
  43. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +92 -29
  44. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  45. package/dashboard/dist-server/src/commands/hooks.d.ts +2 -1
  46. package/dashboard/dist-server/src/commands/hooks.js +16 -9
  47. package/dashboard/dist-server/src/commands/hooks.js.map +1 -1
  48. package/dashboard/dist-server/src/commands/install-backend.d.ts +10 -0
  49. package/dashboard/dist-server/src/commands/install-backend.js +69 -0
  50. package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
  51. package/dashboard/dist-server/src/core/component-defs.d.ts +11 -0
  52. package/dashboard/dist-server/src/core/component-defs.js +34 -2
  53. package/dashboard/dist-server/src/core/component-defs.js.map +1 -1
  54. package/dashboard/dist-server/src/hooks/kg-sync-hook.js +5 -0
  55. package/dashboard/dist-server/src/hooks/kg-sync-hook.js.map +1 -1
  56. package/dashboard/dist-server/src/hooks/session-context.js +276 -3
  57. package/dashboard/dist-server/src/hooks/session-context.js.map +1 -1
  58. package/dashboard/dist-server/src/search/daemon-client.d.ts +8 -3
  59. package/dashboard/dist-server/src/search/daemon-client.js +20 -0
  60. package/dashboard/dist-server/src/search/daemon-client.js.map +1 -1
  61. package/dist/src/cli.js +3 -2
  62. package/dist/src/cli.js.map +1 -1
  63. package/dist/src/commands/domain.d.ts.map +1 -1
  64. package/dist/src/commands/domain.js +12 -3
  65. package/dist/src/commands/domain.js.map +1 -1
  66. package/dist/src/commands/hooks.d.ts +2 -1
  67. package/dist/src/commands/hooks.d.ts.map +1 -1
  68. package/dist/src/commands/hooks.js +16 -9
  69. package/dist/src/commands/hooks.js.map +1 -1
  70. package/dist/src/commands/install-backend.d.ts +10 -0
  71. package/dist/src/commands/install-backend.d.ts.map +1 -1
  72. package/dist/src/commands/install-backend.js +69 -0
  73. package/dist/src/commands/install-backend.js.map +1 -1
  74. package/dist/src/commands/install.js +34 -2
  75. package/dist/src/commands/install.js.map +1 -1
  76. package/dist/src/commands/ralph.d.ts.map +1 -1
  77. package/dist/src/commands/ralph.js +8 -0
  78. package/dist/src/commands/ralph.js.map +1 -1
  79. package/dist/src/commands/search.d.ts.map +1 -1
  80. package/dist/src/commands/search.js +59 -6
  81. package/dist/src/commands/search.js.map +1 -1
  82. package/dist/src/commands/spec.d.ts.map +1 -1
  83. package/dist/src/commands/spec.js +15 -0
  84. package/dist/src/commands/spec.js.map +1 -1
  85. package/dist/src/commands/timeline.d.ts +14 -0
  86. package/dist/src/commands/timeline.d.ts.map +1 -0
  87. package/dist/src/commands/timeline.js +377 -0
  88. package/dist/src/commands/timeline.js.map +1 -0
  89. package/dist/src/core/component-defs.d.ts +11 -0
  90. package/dist/src/core/component-defs.d.ts.map +1 -1
  91. package/dist/src/core/component-defs.js +34 -2
  92. package/dist/src/core/component-defs.js.map +1 -1
  93. package/dist/src/core/install-executor.d.ts.map +1 -1
  94. package/dist/src/core/install-executor.js +11 -1
  95. package/dist/src/core/install-executor.js.map +1 -1
  96. package/dist/src/core/install-profile.d.ts.map +1 -1
  97. package/dist/src/core/install-profile.js +52 -17
  98. package/dist/src/core/install-profile.js.map +1 -1
  99. package/dist/src/hooks/kg-sync-hook.d.ts.map +1 -1
  100. package/dist/src/hooks/kg-sync-hook.js +5 -0
  101. package/dist/src/hooks/kg-sync-hook.js.map +1 -1
  102. package/dist/src/hooks/session-context.d.ts.map +1 -1
  103. package/dist/src/hooks/session-context.js +276 -3
  104. package/dist/src/hooks/session-context.js.map +1 -1
  105. package/dist/src/i18n/locales/en.d.ts.map +1 -1
  106. package/dist/src/i18n/locales/en.js +4 -1
  107. package/dist/src/i18n/locales/en.js.map +1 -1
  108. package/dist/src/i18n/locales/zh.d.ts.map +1 -1
  109. package/dist/src/i18n/locales/zh.js +4 -1
  110. package/dist/src/i18n/locales/zh.js.map +1 -1
  111. package/dist/src/i18n/types.d.ts +3 -0
  112. package/dist/src/i18n/types.d.ts.map +1 -1
  113. package/dist/src/ralph/cmd-complete.d.ts +4 -0
  114. package/dist/src/ralph/cmd-complete.d.ts.map +1 -1
  115. package/dist/src/ralph/cmd-complete.js +8 -0
  116. package/dist/src/ralph/cmd-complete.js.map +1 -1
  117. package/dist/src/ralph/cmd-next.js +58 -8
  118. package/dist/src/ralph/cmd-next.js.map +1 -1
  119. package/dist/src/ralph/status-schema.d.ts +29 -2
  120. package/dist/src/ralph/status-schema.d.ts.map +1 -1
  121. package/dist/src/ralph/status-schema.js +1 -1
  122. package/dist/src/search/daemon-client.d.ts +8 -3
  123. package/dist/src/search/daemon-client.d.ts.map +1 -1
  124. package/dist/src/search/daemon-client.js +20 -0
  125. package/dist/src/search/daemon-client.js.map +1 -1
  126. package/dist/src/search/daemon.d.ts +3 -3
  127. package/dist/src/search/daemon.d.ts.map +1 -1
  128. package/dist/src/search/daemon.js +9 -3
  129. package/dist/src/search/daemon.js.map +1 -1
  130. package/dist/src/tui/install-ui/ComponentGrid.d.ts.map +1 -1
  131. package/dist/src/tui/install-ui/ComponentGrid.js +71 -38
  132. package/dist/src/tui/install-ui/ComponentGrid.js.map +1 -1
  133. package/dist/src/tui/install-ui/ComponentGrid.logic.d.ts +12 -3
  134. package/dist/src/tui/install-ui/ComponentGrid.logic.d.ts.map +1 -1
  135. package/dist/src/tui/install-ui/ComponentGrid.logic.js +21 -4
  136. package/dist/src/tui/install-ui/ComponentGrid.logic.js.map +1 -1
  137. package/dist/src/tui/install-ui/CyberItem.d.ts +3 -1
  138. package/dist/src/tui/install-ui/CyberItem.d.ts.map +1 -1
  139. package/dist/src/tui/install-ui/CyberItem.js +6 -5
  140. package/dist/src/tui/install-ui/CyberItem.js.map +1 -1
  141. package/dist/src/tui/install-ui/GroupedHub.d.ts +9 -0
  142. package/dist/src/tui/install-ui/GroupedHub.d.ts.map +1 -1
  143. package/dist/src/tui/install-ui/GroupedHub.js +54 -47
  144. package/dist/src/tui/install-ui/GroupedHub.js.map +1 -1
  145. package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
  146. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  147. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  148. package/dist/src/tui/install-ui/InstallFlow.js +54 -5
  149. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  150. package/dist/src/tui/install-ui/types.d.ts +1 -0
  151. package/dist/src/tui/install-ui/types.d.ts.map +1 -1
  152. package/dist/src/tui/install-ui/types.js.map +1 -1
  153. package/dist/src/tui/install-ui/useInstallFlowState.d.ts +8 -2
  154. package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -1
  155. package/dist/src/tui/install-ui/useInstallFlowState.js +145 -15
  156. package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -1
  157. package/dist/src/utils/update-notices.js +12 -0
  158. package/dist/src/utils/update-notices.js.map +1 -1
  159. package/package.json +1 -1
  160. package/workflows/agy-instructions.md +127 -88
  161. package/workflows/analyze.md +2 -2
  162. package/workflows/auto-test.md +7 -1
  163. package/workflows/blueprint.md +22 -19
  164. package/workflows/brainstorm.md +11 -3
  165. package/workflows/business-test.md +4 -0
  166. package/workflows/codebase-rebuild.md +8 -1
  167. package/workflows/codebase-refresh.md +7 -1
  168. package/workflows/codex-instructions.md +1 -1
  169. package/workflows/debug.md +5 -2
  170. package/workflows/domain-add.md +6 -0
  171. package/workflows/drift-realign.md +396 -0
  172. package/workflows/execute.md +5 -4
  173. package/workflows/explore-usage.md +2 -2
  174. package/workflows/finish-work.md +6 -6
  175. package/workflows/fork.md +2 -2
  176. package/workflows/grill.md +6 -5
  177. package/workflows/harvest.md +2 -2
  178. package/workflows/impeccable.md +3 -2
  179. package/workflows/init.md +7 -7
  180. package/workflows/integration-test.md +1 -0
  181. package/workflows/issue-gaps-analyze.codex.md +2 -0
  182. package/workflows/issue-gaps-analyze.md +4 -4
  183. package/workflows/issue-plan.md +1 -1
  184. package/workflows/knowhow.md +7 -1
  185. package/workflows/knowledge-audit.md +1 -1
  186. package/workflows/maestro-super.md +2 -2
  187. package/workflows/maestro.md +3 -3
  188. package/workflows/map.md +2 -2
  189. package/workflows/milestone-audit.md +1 -1
  190. package/workflows/milestone-complete.md +1 -1
  191. package/workflows/odyssey-base.md +258 -0
  192. package/workflows/plan.md +7 -6
  193. package/workflows/quick.md +8 -6
  194. package/workflows/ralph-amend-goal.md +177 -0
  195. package/workflows/refactor.md +2 -0
  196. package/workflows/retrospective.md +7 -3
  197. package/workflows/review.md +6 -4
  198. package/workflows/roadmap-common.md +3 -3
  199. package/workflows/roadmap.md +8 -5
  200. package/workflows/spec-generate.md +23 -18
  201. package/workflows/specs-load.md +1 -1
  202. package/workflows/specs-setup.md +2 -0
  203. package/workflows/sync.md +4 -2
  204. package/workflows/test-gen.md +1 -1
  205. package/workflows/test.md +1 -1
  206. package/workflows/ui-codify-extract.md +1 -0
  207. package/workflows/ui-codify-knowhow.md +1 -1
  208. package/workflows/ui-codify-package.md +1 -1
  209. package/workflows/ui-codify.md +9 -7
  210. package/workflows/ui-design.md +9 -7
  211. package/workflows/ui-style.md +6 -4
  212. package/workflows/verify.md +4 -4
  213. package/workflows/wiki-connect.md +2 -0
  214. package/workflows/wiki-digest.md +5 -3
  215. package/workflows/wiki-manage.md +4 -0
  216. package/workflows/maestro.codex.md +0 -365
@@ -110,6 +110,7 @@ If resuming: load understanding.md + evidence.ndjson, spawn continuation agent.
110
110
  ### Step 1.5: Load Project Specs
111
111
 
112
112
  ```
113
+ # MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep
113
114
  specs_content = maestro spec load --category debug
114
115
  → Pass to debug agents as prior knowledge
115
116
  ```
@@ -175,7 +176,7 @@ Create the directory.
175
176
 
176
177
  ---
177
178
 
178
- ### Step 5: Spawn Parallel Debug Agents
179
+ ### Step 5: Spawn Parallel Debug Agents — MANDATORY, NOT SUBSTITUTABLE
179
180
 
180
181
  For each cluster, spawn concurrently (`run_in_background: false`):
181
182
 
@@ -219,7 +220,7 @@ Pass cli_evidence as supplementary_context to debug agent prompts in Step 5/6
219
220
 
220
221
  ---
221
222
 
222
- ### Step 6: Spawn Single Debug Agent (sequential mode)
223
+ ### Step 6: Spawn Single Debug Agent (sequential mode) — MANDATORY, NOT SUBSTITUTABLE
223
224
 
224
225
  Spawn agent (`run_in_background: false`):
225
226
 
@@ -330,6 +331,8 @@ Load prior state (understanding.md + evidence.ndjson) + user checkpoint response
330
331
 
331
332
  ---
332
333
 
334
+ **GATE Step 12→13**: Glob `{$DEBUG_DIR}/understanding.md` AND `{$DEBUG_DIR}/evidence.ndjson` MUST exist before Step 13 report; BLOCKED if missing.
335
+
333
336
  ### Step 13: Report
334
337
 
335
338
  ```
@@ -56,6 +56,7 @@ Auto-derive from the definition and codebase context:
56
56
  Write via `maestro domain add`:
57
57
 
58
58
  ```bash
59
+ # MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep
59
60
  maestro domain add "<canonical>" "<definition>" --tier <tier>
60
61
  ```
61
62
 
@@ -67,11 +68,14 @@ maestro domain update "<canonical>" --aliases "alias1,alias2" --keywords "kw1,kw
67
68
 
68
69
  Records `source.kind = 'manual'`, `source.registered_at = now`.
69
70
 
71
+ **GATE Step 4→5**: REQUIRED term written via `maestro domain add` (exit 0); BLOCKED if write failed or term missing from glossary.
72
+
70
73
  ### Step 5: Verify Injection
71
74
 
72
75
  Confirm the term is injectable by checking:
73
76
 
74
77
  ```bash
78
+ # MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep
75
79
  maestro domain show "<canonical>"
76
80
  ```
77
81
 
@@ -80,6 +84,8 @@ Display: canonical name, definition, aliases, tier, relationships, and verify co
80
84
  maestro domain list
81
85
  ```
82
86
 
87
+ **GATE Step 5→6**: REQUIRED term verified injectable via `maestro domain show`; BLOCKED if not injectable.
88
+
83
89
  ### Step 6: Report
84
90
 
85
91
  ```
@@ -0,0 +1,396 @@
1
+ # Drift Realign Workflow
2
+
3
+ ---
4
+
5
+ ## Prerequisites
6
+
7
+ - `.workflow/` 已初始化(`.workflow/state.json` 存在)
8
+ - Git 仓库可访问(`git log` 可执行)
9
+ - 至少一个 `.workflow/` artifact 存在
10
+ - REQUIRED: wiki indexed via `maestro wiki rebuild` (supports session association)
11
+
12
+
13
+ ---
14
+
15
+ ## Argument Shape
16
+
17
+ ```
18
+ /drift-realign --scope all → 全量扫描所有 scope(交互式)
19
+ /drift-realign --scope spec --since 2026-06-01 → 仅扫 spec 漂移,指定起始时间
20
+ /drift-realign --scope roadmap --depth deep → 深度扫描 roadmap
21
+ /drift-realign --scope all --dry-run → 完整预演,不写盘
22
+ /drift-realign --scope all --report → 仅出报告不动盘
23
+ /drift-realign --scope codebase --auto-archive → 自动归档 codebase 漂移
24
+ /drift-realign --scope all --interactive → 逐条交互决策
25
+ ```
26
+
27
+ | Flag | Effect |
28
+ |------|--------|
29
+ | `--scope <type>` | 目标 scope: roadmap / spec / codebase / state / issue / knowhow / project / all(默认 all) |
30
+ | `--since <date\|commit>` | 起始时间点(日期或 commit hash),覆盖自动推断 |
31
+ | `--depth <level>` | shallow(正则 + 路径校验)/ deep(LLM 语义分析),默认 shallow |
32
+ | `--dry-run` | 全流程预演,展示所有 findings 和建议 action,不写盘 |
33
+ | `--report` | 仅生成报告到 `.workflow/.drift-realign/`,跳过交互和 apply |
34
+ | `--auto-archive` | P1/P2 自动归档,P0 保留人工审查 |
35
+ | `--interactive` | 逐条交互决策(默认开启,除非 `--report` 或 `--auto-archive`)|
36
+
37
+ 互斥规则:`--report` 强制 read-only,覆盖其他 mode;`--auto-archive` 与 `--interactive` 互斥;`--auto-archive` 覆盖 `--interactive`。
38
+
39
+ ---
40
+
41
+ ## Stage 1: parse_input
42
+
43
+ ```
44
+ 验证 .workflow/ 存在(否则 E001)。解析参数:
45
+ scope: roadmap | spec | codebase | state | issue | knowhow | project | all(默认 all,E002 若非法值)
46
+ since: 显式指定 → 使用提供的日期/commit
47
+ state.json.last_drift_realign 存在 → 使用该值
48
+ state.json.last_pruned 存在 → 使用该值
49
+ 兜底 → 90 天前
50
+ depth: shallow(默认)| deep
51
+ mode: interactive(默认)| dry-run | report | auto-archive
52
+
53
+ 互斥校验:
54
+ --report → 强制覆盖 mode 为 read-only
55
+ --auto-archive 覆盖 --interactive(非错误,静默降级); flag session as [LOW CONFIDENCE] (interactive skipped)
56
+
57
+ 检查 git 可用性(E003)。
58
+ 初始化 .workflow/.drift-realign/ 目录。
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Stage 2: reconstruct_timeline
64
+
65
+ ```
66
+ 运行 maestro timeline --since <resolved_date> --json --output .workflow/.drift-realign/timeline-{date}.json
67
+
68
+ timeline 每条 session 事件包含以下字段(已足够 shallow 分析):
69
+ id: session 唯一标识
70
+ title: session 标题
71
+ summary: 用户首条提问摘要(≤200 字符)
72
+ edited_files: 该 session 编辑的文件列表
73
+ code_paths: 该 session 涉及的代码路径
74
+ platform: 平台标识(claude / codex / unknown)
75
+
76
+ 解析输出提取以下结构:
77
+ window: { from, to, total_days }
78
+ git_summary: { commit_count, files_changed, insertions, deletions }
79
+ session_summary: { total, with_edits, last_session_date, by_platform: { claude: N, codex: N, ... } }
80
+ events: 按时间戳排序的 commit + session 事件交织列表
81
+ hot_paths: 变更频率最高的目录列表(包含 git files + session edited_files + code_paths)
82
+ cold_workflow_files: 在窗口内未修改的 .workflow/ 文件列表
83
+ ```
84
+
85
+ ### 2a. 平台问询(交互式)
86
+
87
+ ```
88
+ 检查 session_summary.by_platform 分布。
89
+ 如果存在多个平台且 session 总量 > 20:
90
+ 使用 AskUserQuestion 向用户展示平台分布并询问:
91
+ "检测到多个 session 平台(claude: 80, codex: 40, unknown: 12)。
92
+ 修改主要在哪个平台进行?聚焦特定平台可以缩小分析范围。"
93
+ 选项:
94
+ - 全部平台(不过滤)
95
+ - Claude(仅 Claude Code session)
96
+ - Codex(仅 Codex session)
97
+
98
+ 如果用户选择特定平台:
99
+ 重新运行 maestro timeline --since <date> --platform <选择> --json --output ...
100
+ 后续 scanner agent 仅使用该平台的 session 上下文。
101
+ ```
102
+
103
+ ### 2b. Session 详情按需加载
104
+
105
+ ```
106
+ timeline 事件中的 summary + edited_files + code_paths 足以支撑 shallow 扫描。
107
+ 当 --depth deep 时,scanner agent 可能需要 session 完整内容来判断语义漂移:
108
+
109
+ 对于与 drifted .workflow/ 文件有交集的 session(edited_files 交集检测):
110
+ maestro load --type session --id <session_id> --json
111
+ → 获取 body(详细描述)、related(关联条目)等完整字段
112
+
113
+ 按需加载规则:
114
+ 1. 仅 --depth deep 时触发
115
+ 2. 仅加载 edited_files 与 cold_workflow_files 有交集的 session
116
+ 3. 最多加载 10 个 session(按相关度排序:交集文件数降序)
117
+ 4. 加载结果写入 .workflow/.drift-realign/session-details-{date}.json
118
+ 5. scanner agent 在 deep 模式下同时接收 timeline.json + session-details.json
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Stage 3: compute_drift_score
124
+
125
+ ```
126
+ 公式:drift_score = drift_window_days × sqrt(changed_files_count) × scope_weight
127
+
128
+ changed_files_count 来源:git_summary.files_changed + session 中 edited_files 去重后的独立文件数。
129
+ 合并公式:changed_files_count = |Set(git_files) ∪ Set(session_edited_files)|
130
+
131
+ scope_weight 映射:
132
+ roadmap: 1.5 (结构性,影响所有下游)
133
+ spec: 1.3 (影响编码指导)
134
+ project: 1.4 (基础性)
135
+ state: 1.2 (运行态)
136
+ codebase: 1.0 (文档)
137
+ issue: 0.8 (跟踪)
138
+ knowhow: 0.7 (参考)
139
+
140
+ 阈值判定:
141
+ LOW: score < 30 → 以 --depth shallow 继续
142
+ MODERATE: 30 ≤ score < 100 → 以配置的 depth 继续
143
+ SEVERE: score ≥ 100 → 自动升级为 --depth deep,若 drift_window > 180 天则 emit W002
144
+
145
+ 向用户展示 drift summary。
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Stage 4: parallel_drift_scan
151
+
152
+ **MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: 在单条消息中并行派发 4 个 agent。每个 agent 接收 timeline.json + 相关 scope 文件 + git diff 摘要。**
153
+
154
+ ### 4a. roadmap-scanner
155
+
156
+ | Drift Type | Detection Algorithm | Severity |
157
+ |-----------|-------------------|----------|
158
+ | phantom_phase | roadmap.md 列出的 phase 在代码或 state.json 中无对应 | P0 |
159
+ | stale_progress | Phase Progress 表格百分比与实际 task 完成状态不符 | P1 |
160
+ | milestone_mismatch | state.json milestones 与 roadmap.md milestone 描述不一致 | P0 |
161
+ | outdated_criteria | 成功标准引用了已删除/重命名的 feature | P1 |
162
+ | dependency_ghost | 依赖引用指向已删除/重构的模块 | P1 |
163
+ | timeline_impossible | roadmap 中的日期已过期但 milestone 未标记完成 | P2 |
164
+
165
+ ### 4b. spec-scanner
166
+
167
+ | Drift Type | Detection Algorithm | Severity |
168
+ |-----------|-------------------|----------|
169
+ | convention_violation | Spec 规定 "使用 X 模式" 但 git diff 显示代码使用 Y 模式 | P0 |
170
+ | dead_import_pattern | Spec 引用的 import 风格在 codebase 中已不存在 | P1 |
171
+ | architecture_breach | 新代码结构违反了架构约束 | P0 |
172
+ | stale_dependency | Spec 提及的库版本/API 与 package.json 矛盾 | P1 |
173
+ | naming_drift | Spec 中的命名规范与 hot_paths 实际命名不匹配 | P2 |
174
+ | test_convention_gap | 测试规范 spec vs 实际测试文件模式 | P2 |
175
+
176
+ 检测方法:
177
+ - shallow:grep spec 引用的模式匹配 hot_paths 文件,检查文件是否存在
178
+ - deep:LLM 阅读 spec entry + hot_paths 代码采样,判断对齐度
179
+
180
+ ### 4c. codebase-scanner
181
+
182
+ | Drift Type | Detection Algorithm | Severity |
183
+ |-----------|-------------------|----------|
184
+ | architecture_outdated | architecture.md 描述的结构已被 git diff 改变 | P0 |
185
+ | feature_missing | features.md 未提及近期 commit 中可见的新 feature | P1 |
186
+ | tech_stack_changed | tech-stack.md 列出已移除的依赖或遗漏新增依赖 | P0 |
187
+ | concern_drift | concerns.md 描述的模式已不存在 | P1 |
188
+ | doc_index_stale | doc-index.json 引用的文件在磁盘上不存在 | P0 |
189
+
190
+ 检测方法:
191
+ - shallow:交叉校验 doc-index.json 路径与文件系统,检查文件 mtime
192
+ - deep:LLM 阅读每个 codebase 文档 + 采样近期代码,判断准确性
193
+
194
+ ### 4d. artifact-scanner
195
+
196
+ | Drift Type | Detection Algorithm | Severity |
197
+ |-----------|-------------------|----------|
198
+ | issue_code_ref_dead | issues.jsonl 的 related_files 指向已移动/删除的路径 | P1 |
199
+ | issue_stale_open | Open issue 的 fix_direction 引用了已重构的代码 | P1 |
200
+ | knowhow_code_ref_dead | Knowhow entry 引用的代码路径已不存在 | P1 |
201
+ | orphan_session | active/ 中的 session 在 state.json 中无对应 artifact | P2 |
202
+ | project_tech_drift | project.md Tech Stack 部分 vs 实际 package.json/code | P0 |
203
+ | project_req_drift | project.md Requirements 部分 vs 已实现的 feature | P1 |
204
+ | accumulated_stale | state.json accumulated_context.key_decisions 引用已重构区域 | P1 |
205
+ | deferred_resolved | state.json deferred items 实际已被 git 历史证明已实现 | P2 |
206
+
207
+ 每个 agent 返回:
208
+ ```
209
+ DriftFinding {
210
+ id: "DFT-{8hex}",
211
+ scope: "roadmap" | "spec" | "codebase" | "state" | "issue" | "knowhow" | "project",
212
+ severity: "P0" | "P1" | "P2",
213
+ target: { file: string, section?: string },
214
+ drift_type: string,
215
+ evidence: { code_reality: string, doc_claim: string, git_ref?: string },
216
+ suggested_action: "keep" | "update" | "archive" | "rebuild",
217
+ update_hint?: string
218
+ }
219
+ ```
220
+
221
+ ---
222
+
223
+ ## Stage 5: synthesize_findings
224
+
225
+ ```
226
+ 合并所有 agent 结果为统一 DriftFinding[]。
227
+
228
+ 去重:若多个 agent 标记同一 file+section,保留最高 severity。
229
+ 排序:P0 优先,然后 P1,然后 P2。
230
+ 按 --scope 过滤(若非 "all")。
231
+ 按 scope 和 severity 统计计数。
232
+
233
+ Conflict-marker 集成:
234
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: 运行 maestro spec conflict list → 已标记的冲突条目
235
+ 对于已有 conflict-marker 的 spec 条目,若 drift scanner 也检测到同一文件:
236
+ 合并为同一 finding(提升 severity 到 P0,来源标注 "drift + conflict-marker")
237
+ 对于 drift scanner 发现但无 conflict-marker 的条目:保持 scanner 原始 severity
238
+ ```
239
+
240
+ ---
241
+
242
+ ## Stage 6: interactive_triage
243
+
244
+ ```
245
+ 若 --report → 跳至 Stage 9。
246
+ 若 --auto-archive → 自动应用每个 finding 的 suggested_action(P1/P2 直接执行,P0 保留人工审查)。
247
+ 若 --dry-run → 展示所有 findings 及建议 action,跳过 Stage 7-8。
248
+
249
+ 否则,逐条交互:
250
+ ```
251
+
252
+ ```
253
+ [!] Drift Detected (P0 - architecture_outdated)
254
+ Scope: codebase
255
+ Target: .workflow/codebase/architecture.md §Module Boundaries
256
+ Evidence: Code added new src/payments/ module not described in architecture.md
257
+ Git Ref: commit abc123 (2026-06-10)
258
+ Hint: Add Payments module section describing src/payments/ structure
259
+ Suggestion: [u]pdate
260
+
261
+ Action? [k]eep / [u]pdate / [a]rchive / [r]ebuild / [s]kip / [q]uit
262
+ > _
263
+ ```
264
+
265
+ | Action | 行为 |
266
+ |--------|------|
267
+ | `keep` | 确认无漂移或可接受,标记为已审查(记录到 drift-log.jsonl action=keep)|
268
+ | `update` | 在目标文件顶部注入 TODO 标记:`<!-- DRIFT-TODO: {update_hint} (DFT-{id}, {date}) -->` |
269
+ | `archive` | 移动到 .trash/(先备份)|
270
+ | `rebuild` | 标记为自动重建目标(codebase scope 触发 `/quality-sync --full`)|
271
+ | `skip` | 跳过本条不做决策(记录到 drift-log.jsonl action=skipped,下次 re-run 会重新出现)|
272
+
273
+ ---
274
+
275
+ ## Stage 7: backup
276
+
277
+ ```
278
+ mkdir .workflow/.trash/drift-realign-{ISO_timestamp}/
279
+ for each actionable finding:
280
+ cp target.file → .trash/{timestamp}/{relative_path}
281
+ 也备份 state.json → .trash/{timestamp}/state.json.bak
282
+ 若任一备份失败 → E005,禁止 Stage 8
283
+ ```
284
+
285
+ ---
286
+
287
+ ## Stage 8: apply_actions
288
+
289
+ | Action | 实施 |
290
+ |--------|------|
291
+ | `keep` | 写 drift-log.jsonl 一条 action=keep 记录 |
292
+ | `skip` | 写 drift-log.jsonl 一条 action=skipped 记录(不标记 reviewed,下次 re-run 重现)|
293
+ | `update` | 在目标文件头部插入 TODO 注释块:`<!-- DRIFT-TODO: {update_hint} (DFT-{id}, {date}) -->` |
294
+ | `archive` | 移动文件到 `.trash/{timestamp}/` + 更新 state.json 引用 |
295
+ | `rebuild` | 收集 rebuild 目标;全部其他 action 完成后:通过 `Skill()` 自动调用 `/quality-sync --full` |
296
+
297
+ rebuild 后处理:
298
+ - 若 W001 或重大结构变更 → MUST run `/manage-codebase-rebuild`
299
+
300
+ Conflict-marker 清除:
301
+ - 对于 update/archive 的 spec 目标文件,若存在 conflict-marker:
302
+ maestro spec conflict clear <file> <line>
303
+ (与 knowledge-audit 的 deprecate/delete 清除行为对称)
304
+
305
+ 更新 state.json:设置 `last_drift_realign = now`(ISO-8601)
306
+
307
+ state.json 原子写:备份 → 写新版本 → re-read 验证。
308
+
309
+ ---
310
+
311
+ ## Stage 9: report
312
+
313
+ 写 `.workflow/.drift-realign/drift-report-{date}.md`:
314
+
315
+ ```markdown
316
+ # Drift Realign Report — {date}
317
+
318
+ ## Timeline Window
319
+ - From: {from} → To: {to} ({days} days)
320
+ - Git: {commits} commits, {files_changed} files changed
321
+ - Sessions: {total} total, {with_edits} with edits
322
+ - Drift Score: {score} ({LOW|MODERATE|SEVERE})
323
+
324
+ ## Scan Summary
325
+ - Total findings: {N} ({P0} P0 / {P1} P1 / {P2} P2)
326
+ - By scope: roadmap {N} / spec {N} / codebase {N} / state {N} / issue {N} / knowhow {N} / project {N}
327
+
328
+ ## Actions Applied
329
+ | # | Scope | Drift Type | Target | Action | Status |
330
+ |---|-------|-----------|--------|--------|--------|
331
+ | 1 | codebase | architecture_outdated | architecture.md §Module Boundaries | update | OK |
332
+ | 2 | spec | convention_violation | coding-conventions.md §Import Rules | archive | OK |
333
+
334
+ ## Kept (no drift or user chose keep)
335
+ | Finding | Reason |
336
+ |---------|--------|
337
+ | DFT-abc12345 | User chose keep — marked as reviewed |
338
+
339
+ ## Auto-Rebuilt
340
+ - /quality-sync --full triggered: {yes/no}
341
+ - /manage-codebase-rebuild suggested: {yes/no}
342
+
343
+ ## Backup
344
+ - Location: .workflow/.trash/drift-realign-{timestamp}/
345
+ ```
346
+
347
+ 同时追加结构化条目到 `.workflow/.drift-realign/drift-log.jsonl`(每行一条 JSON):
348
+
349
+ ```json
350
+ {
351
+ "realign_id": "DFT-RUN-{timestamp}",
352
+ "finding_id": "DFT-{8hex}",
353
+ "scope": "codebase",
354
+ "drift_type": "architecture_outdated",
355
+ "severity": "P0",
356
+ "target": { "file": ".workflow/codebase/architecture.md", "section": "Module Boundaries" },
357
+ "action": "update",
358
+ "applied_at": "2026-06-24T15:30:00.000Z",
359
+ "backup_path": ".workflow/.trash/drift-realign-20260624T153000/"
360
+ }
361
+ ```
362
+
363
+ 显示摘要并引导后续步骤:
364
+
365
+ ```
366
+ === DRIFT REALIGN COMPLETE ===
367
+ Scope: all
368
+
369
+ Findings: 18 total (4 P0 / 9 P1 / 5 P2)
370
+ Updated: 6 (TODO markers injected)
371
+ Archived: 3 (moved to .trash/)
372
+ Rebuilt: 2 (via /quality-sync --full)
373
+ Kept: 7 (marked as reviewed)
374
+
375
+ Report: .workflow/.drift-realign/drift-report-2026-06-24.md
376
+ Backup: .workflow/.trash/drift-realign-20260624T153000/
377
+
378
+ Next:
379
+ → 处理 TODO 标记: grep -r "DRIFT-TODO" .workflow/
380
+ → 内部矛盾审查: /manage-knowledge-audit --scope all
381
+ → 全量 codebase 重建: /manage-codebase-rebuild
382
+ → 周期巡检 (REQUIRED at milestone end): run --scope all --report
383
+ ```
384
+
385
+ ---
386
+
387
+ ### Safety invariants
388
+
389
+ 1. **Code-as-Truth** — 代码永远是对的;当代码和文档不一致时,是文档漂移了
390
+ 2. **Backup before mutate** — Stage 7 必须成功才能执行 Stage 8;state.json 原子写(备份 → 写新 → re-read 校验)
391
+ 3. **No auto-delete** — drift-realign 绝不物理删除文件;archive 仅移动到 `.trash/`
392
+ 4. **Rebuild is scoped** — 自动重建仅对 codebase scope 触发,绝不对 spec/roadmap 触发
393
+ 5. **Idempotent** — 相同输入产生相同 findings(git 状态 + 文件状态确定性)
394
+ 6. **Graceful degradation** — wiki/session 不可用时(W001),以 git-only timeline 继续; flag timeline as [LOW CONFIDENCE] (wiki/session unavailable)
395
+ 7. **Preserve user work** — TODO 标记是注释,绝不覆盖文件内容
396
+ 8. **State.json atomic** — 所有 state.json 变更遵循 备份 → 写新 → 验证 模式
@@ -193,6 +193,7 @@ Build execution_queue from plan.json.waves, including only waves with pending (n
193
193
  ## E1.5: Load Project Specs
194
194
 
195
195
  ```
196
+ # MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep
196
197
  specs_content = maestro spec load --category coding
197
198
  ```
198
199
 
@@ -316,7 +317,7 @@ Each task = one independent dispatch (never merge tasks into one delegate prompt
316
317
  ```
317
318
  Max 3 auto-fix attempts per task:
318
319
  Agent path: handled internally by workflow-executor agent
319
- CLI path: 1) --resume ${fixedId} → 2) simplified prompt → 3) fallback to agent
320
+ CLI path: 1) --resume ${fixedId} → 2) simplified prompt → 3) fallback to agent; flag task as [LOW CONFIDENCE] (agent fallback used)
320
321
 
321
322
  If all 3 fail: mark "blocked" with checkpoint in .task/${task_id}.json.meta.checkpoint
322
323
  { attempt: 3, last_error, partial_files, executor, delegate_id: fixedId }
@@ -528,7 +529,7 @@ If config.json.codebase.auto_sync_after_execute == true:
528
529
  3. Update affected entries
529
530
  4. Refresh tech-registry and feature-maps as needed
530
531
  Else:
531
- Log "Auto-sync disabled. Run /workflow:sync manually if needed."
532
+ Log "Auto-sync disabled. MUST run /workflow:sync manually."
532
533
  ```
533
534
 
534
535
  ---
@@ -608,8 +609,8 @@ Mark artifact.harvested = true; write state.json (atomic)
608
609
  | Plan directory not found | Abort: "Plan dir not found." |
609
610
  | Task file missing | Skip task, log error, continue wave |
610
611
  | Agent spawn fails | Retry once, then mark task as "blocked" |
611
- | Delegate fails | Resume with `--resume ${fixedId}`, then fallback to agent |
612
- | Git commit fails | Log warning, continue (task still marked completed) |
612
+ | Delegate fails | Resume with `--resume ${fixedId}`, then fallback to agent; flag task as [LOW CONFIDENCE] (fallback agent) |
613
+ | Git commit fails | Log W0xx, mark task [LOW CONFIDENCE] (commit failed); do NOT mark fully completed until commit succeeds |
613
614
  | All tasks in wave blocked | Stop execution, report blocked wave |
614
615
 
615
616
  ---
@@ -67,7 +67,7 @@ Endpoint B: [job4] → [job5] (serial)
67
67
  ↑ parallel ↑
68
68
  ```
69
69
 
70
- Raise per-endpoint parallelism with `--ep-concurrency 2` when the API allows it.
70
+ Raise per-endpoint parallelism with `--ep-concurrency 2` when the API rate limit permits (verify via test request).
71
71
 
72
72
  ## Multi-Prompt Input
73
73
 
@@ -126,7 +126,7 @@ Multi-prompt — **background**:
126
126
  Bash({ command: "maestro explore \"p1\" \"p2\" --json", run_in_background: true })
127
127
  ```
128
128
 
129
- Single quick lookup — foreground is fine:
129
+ Single quick lookup — run in foreground:
130
130
 
131
131
  ```
132
132
  Bash({ command: "maestro explore \"Where is X defined?\"" })
@@ -8,7 +8,7 @@ Caller passes: `SESSION_DIR`, `SESSION_TYPE` (grill | brainstorm | analyze | blu
8
8
 
9
9
  ### 1. Detect outputs
10
10
 
11
- Scan `SESSION_DIR` for any of these files (any absent skip silently):
11
+ Scan `SESSION_DIR` for any of these files; if absent: log W0xx "<file> missing" and continue; flag harvest as [LOW CONFIDENCE] (partial fragments):
12
12
 
13
13
  | File | Source | Used for |
14
14
  |------|--------|----------|
@@ -46,7 +46,7 @@ Iterate detected files; build a `fragments[]` array. Each fragment: `{ kind, cat
46
46
 
47
47
  **Keyword extraction**: take 3-5 lowercased domain terms (filter stop words, take frequency-ranked nouns/identifiers from content).
48
48
 
49
- **Deduplication**: hash `(kind, content[:100])` — skip if any existing spec/knowhow entry has matching hash (check via `maestro spec list --json` + `maestro knowhow list --json`).
49
+ **Deduplication**: hash `(kind, content[:100])` — skip if any existing spec/knowhow entry has matching hash (MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: check via `maestro spec list --json` + `maestro knowhow list --json`).
50
50
 
51
51
  ### 3. Route fragments
52
52
 
@@ -58,10 +58,10 @@ Apply? (auto | spec-only | knowhow-only | skip)
58
58
 
59
59
  Then for each fragment in approved buckets:
60
60
 
61
- - **spec**: `maestro spec add <category> "<title>" "<content>" --keywords {csv} --description "<one-line summary>" --source finish-work` (capture returned id into `extracted_spec_ids[]`)
62
- - **knowhow**: `maestro knowhow add --type {DCS|RCP|REF|KNW} --title "{title}" --body "{content}" --keywords {csv}` (capture id into `extracted_knowhow_ids[]`)
61
+ - **spec**: MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: `maestro spec add <category> "<title>" "<content>" --keywords {csv} --description "<one-line summary>" --source finish-work` (capture returned id into `extracted_spec_ids[]`)
62
+ - **knowhow**: MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: `maestro knowhow add --type {DCS|RCP|REF|KNW} --title "{title}" --body "{content}" --keywords {csv}` (capture id into `extracted_knowhow_ids[]`)
63
63
  - Below confidence threshold: increment `skipped_count`, do nothing
64
- - CLI failure: log W002, continue with remaining fragments
64
+ - CLI failure: log W002, continue with remaining fragments; flag harvest as [LOW CONFIDENCE] (CLI failure)
65
65
 
66
66
  ### 3.5 Domain Term Extraction (interactive, conditional)
67
67
 
@@ -79,7 +79,7 @@ Process:
79
79
  2. 过滤已注册的 `glossary.yaml` terms
80
80
  3. 0 个新候选 → 跳过(静默)
81
81
  4. ≥ 1 个新候选 → 交互确认(domain 注册始终需要用户确认,`-y` 对 domain 无效)
82
- 5. 确认的术语写入 `glossary.yaml` via `maestro domain add`
82
+ 5. MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: 确认的术语写入 `glossary.yaml` via `maestro domain add`
83
83
  6. 记录到 `archive.json` 的 `extraction.domain_ids[]`
84
84
 
85
85
  Skip conditions:
package/workflows/fork.md CHANGED
@@ -42,7 +42,7 @@ milestoneSlug = kebab-case of milestoneName, max 40 chars.
42
42
 
43
43
  ## Step 4: Sync Mode (--sync)
44
44
 
45
- If `syncMode` is true, this is a sync operation on an existing worktree, not a fork.
45
+ If `syncMode` is true, treat as sync operation on existing worktree, not a fork.
46
46
 
47
47
  ```
48
48
  IF syncMode:
@@ -154,7 +154,7 @@ Display:
154
154
  Or delegate (automated):
155
155
  maestro delegate "run full lifecycle for milestone" --cd {wtPath} --mode write
156
156
 
157
- Sync worktree with main (if needed later):
157
+ Sync worktree with main (REQUIRED before merge):
158
158
  /maestro-fork -m {milestoneNum} --sync
159
159
 
160
160
  When all phases in milestone complete:
@@ -82,8 +82,8 @@ output_dir = .workflow/scratch/{YYYYMMDD}-grill-{slug}/
82
82
  1. Read .workflow/project.md (if exists) → tech_stack, validated_requirements, active_requirements
83
83
  2. Read .workflow/state.json (if exists) → accumulated_context, artifacts[]
84
84
  3. Read .workflow/roadmap.md (if exists) → phase structure
85
- 4. specs_content = maestro spec load --category arch
86
- 5. wiki_hits = maestro wiki search "{topic keywords}"
85
+ 4. specs_content = maestro spec load --category arch # MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep
86
+ 5. wiki_hits = maestro wiki search "{topic keywords}" # MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep
87
87
  ```
88
88
 
89
89
  ### 2.2: Load Upstream Material
@@ -97,7 +97,7 @@ Store as `upstream_material` (in-memory).
97
97
 
98
98
  ### 2.3: Codebase Scan
99
99
 
100
- Spawn `Agent(subagent_type: Explore)` to map the codebase surface relevant to the topic:
100
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: spawn `Agent(subagent_type: Explore)` to map the codebase surface relevant to the topic:
101
101
 
102
102
  ```
103
103
  Agent(
@@ -116,7 +116,7 @@ Agent(
116
116
  )
117
117
  ```
118
118
 
119
- Store as `codebase_context`. W001 on failure: continue without code grounding.
119
+ Store as `codebase_context`. W001 on failure: continue without code grounding; flag grill output as [LOW CONFIDENCE] (no code grounding).
120
120
 
121
121
  ### 2.4: Initialize Report
122
122
 
@@ -191,7 +191,7 @@ AskUserQuestion({
191
191
  })
192
192
  ```
193
193
 
194
- **Auto mode (`-y`)**: Use CLI exploration to resolve — prefer existing code naming unless semantically wrong.
194
+ **Auto mode (`-y`)**: Use CLI exploration to resolve — prefer existing code naming; override only when name is semantically incorrect (verify via symbol lookup).
195
195
 
196
196
  ### 3.4: Write Terminology File
197
197
 
@@ -302,6 +302,7 @@ AskUserQuestion({
302
302
 
303
303
  **Auto mode**: Instead of asking the user, use code exploration to answer:
304
304
  ```
305
+ # MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep
305
306
  maestro delegate "PURPOSE: Answer '{question}' for the proposal '{topic}'
306
307
  TASK: Search codebase for evidence | Analyze existing patterns | Determine most likely answer
307
308
  MODE: analysis
@@ -217,11 +217,11 @@ Fragments extracted: 8 (filtered from 12 by confidence ≥ 0.5)
217
217
 
218
218
  ### 6a. Wiki routing
219
219
 
220
- `maestro wiki create --type <wiki_type> --slug harvest-<source_type>-<short_id>`. Fallback: write `.workflow/harvest/wiki-pending-{id}.md`.
220
+ `maestro wiki create --type <wiki_type> --slug harvest-<source_type>-<short_id>`. Fallback: write `.workflow/harvest/wiki-pending-{id}.md`; flag wiki entry as [LOW CONFIDENCE] (pending offline).
221
221
 
222
222
  ### 6b. Spec routing
223
223
 
224
- `Skill({ skill: "spec-add", args: "<spec_type> <content>" })`. Mapping: pattern→pattern, decision→decision, bug→bug, knowhow→rule.
224
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: `Skill({ skill: "spec-add", args: "<spec_type> <content>" })`. Mapping: pattern→pattern, decision→decision, bug→bug, knowhow→rule.
225
225
 
226
226
  ### 6c. Issue routing
227
227
 
@@ -70,7 +70,7 @@ Keep concise: 5-15 bullet points maximum. Capture decisions, not process.
70
70
 
71
71
  ### For DCS- (decision), TIP- (tip), REF- (reference)
72
72
 
73
- Use `store_knowhow` MCP tool:
73
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: use `store_knowhow` MCP tool:
74
74
 
75
75
  ```json
76
76
  {
@@ -146,6 +146,7 @@ Create both:
146
146
  For decision and asset entries, create a spec reference for discoverability:
147
147
 
148
148
  ```bash
149
+ # MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep
149
150
  maestro spec add ui "<title>" "<one-line summary>" \
150
151
  --keywords impeccable,<command>,<domain keywords> \
151
152
  --ref "knowhow/<filename>"
@@ -164,4 +165,4 @@ Output one-line harvest summary:
164
165
  查看: maestro wiki load <id>
165
166
  ```
166
167
 
167
- If harvest fails, emit W001 and continue (command execution already succeeded).
168
+ If harvest fails, emit W001 and continue (command execution already succeeded); flag harvest as [LOW CONFIDENCE] (harvest failed).