maestro-flow 0.5.33 → 0.5.35

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 (238) hide show
  1. package/.agents/agents/role-design-author.md +5 -3
  2. package/.agents/agents/workflow-collab-planner.md +1 -0
  3. package/.agents/agents/workflow-planner.md +2 -0
  4. package/.agents/skills/maestro/SKILL.md +8 -1
  5. package/.agents/skills/maestro-help/SKILL.md +39 -10
  6. package/.agents/skills/maestro-help/index/catalog.json +117 -53
  7. package/.agents/skills/maestro-help/phases/01-parse-intent.md +9 -6
  8. package/.agents/skills/maestro-help/phases/02-search-present.md +55 -15
  9. package/.agents/skills/maestro-help/phases/03-workflow-guide.md +35 -2
  10. package/.agents/skills/maestro-plan/SKILL.md +3 -1
  11. package/.agents/skills/maestro-ralph/SKILL.md +55 -19
  12. package/.agents/skills/maestro-ralph-execute/SKILL.md +52 -10
  13. package/.agents/skills/manage-harvest/SKILL.md +3 -0
  14. package/.agents/skills/manage-knowledge-audit/SKILL.md +29 -0
  15. package/.agents/skills/odyssey-debug/SKILL.md +7 -1
  16. package/.agents/skills/odyssey-improve/SKILL.md +7 -1
  17. package/.agents/skills/odyssey-planex/SKILL.md +11 -1
  18. package/.agents/skills/odyssey-review-test-fix/SKILL.md +7 -1
  19. package/.agents/skills/odyssey-ui/SKILL.md +7 -1
  20. package/.agents/skills/quality-review/SKILL.md +3 -0
  21. package/.agents/skills/quality-test/SKILL.md +27 -1
  22. package/.agy/agents/role-design-author.md +5 -3
  23. package/.agy/agents/workflow-collab-planner.md +1 -0
  24. package/.agy/agents/workflow-planner.md +2 -0
  25. package/.agy/skills/maestro/SKILL.md +8 -1
  26. package/.agy/skills/maestro-help/SKILL.md +39 -10
  27. package/.agy/skills/maestro-help/index/catalog.json +117 -53
  28. package/.agy/skills/maestro-help/phases/01-parse-intent.md +9 -6
  29. package/.agy/skills/maestro-help/phases/02-search-present.md +55 -15
  30. package/.agy/skills/maestro-help/phases/03-workflow-guide.md +35 -2
  31. package/.agy/skills/maestro-plan/SKILL.md +3 -1
  32. package/.agy/skills/maestro-ralph/SKILL.md +55 -19
  33. package/.agy/skills/maestro-ralph-execute/SKILL.md +52 -10
  34. package/.agy/skills/manage-harvest/SKILL.md +3 -0
  35. package/.agy/skills/manage-knowledge-audit/SKILL.md +29 -0
  36. package/.agy/skills/odyssey-debug/SKILL.md +7 -1
  37. package/.agy/skills/odyssey-improve/SKILL.md +7 -1
  38. package/.agy/skills/odyssey-planex/SKILL.md +11 -1
  39. package/.agy/skills/odyssey-review-test-fix/SKILL.md +7 -1
  40. package/.agy/skills/odyssey-ui/SKILL.md +7 -1
  41. package/.agy/skills/quality-review/SKILL.md +3 -0
  42. package/.agy/skills/quality-test/SKILL.md +27 -1
  43. package/.claude/agents/role-design-author.md +5 -3
  44. package/.claude/agents/workflow-collab-planner.md +1 -0
  45. package/.claude/agents/workflow-planner.md +2 -0
  46. package/.claude/commands/maestro-plan.md +3 -1
  47. package/.claude/commands/maestro-ralph-execute.md +52 -10
  48. package/.claude/commands/maestro-ralph.md +55 -19
  49. package/.claude/commands/maestro.md +8 -1
  50. package/.claude/commands/manage-harvest.md +3 -0
  51. package/.claude/commands/manage-knowledge-audit.md +29 -0
  52. package/.claude/commands/odyssey-debug.md +7 -1
  53. package/.claude/commands/odyssey-improve.md +7 -1
  54. package/.claude/commands/odyssey-planex.md +11 -1
  55. package/.claude/commands/odyssey-review-test-fix.md +7 -1
  56. package/.claude/commands/odyssey-ui.md +7 -1
  57. package/.claude/commands/quality-review.md +3 -0
  58. package/.claude/commands/quality-test.md +27 -1
  59. package/.claude/skills/maestro-help/SKILL.md +39 -10
  60. package/.claude/skills/maestro-help/index/catalog.json +117 -53
  61. package/.claude/skills/maestro-help/phases/01-parse-intent.md +9 -6
  62. package/.claude/skills/maestro-help/phases/02-search-present.md +55 -15
  63. package/.claude/skills/maestro-help/phases/03-workflow-guide.md +35 -2
  64. package/.codex/skills/maestro/SKILL.md +17 -2
  65. package/.codex/skills/maestro-analyze/SKILL.md +20 -3
  66. package/.codex/skills/maestro-brainstorm/SKILL.md +30 -4
  67. package/.codex/skills/maestro-execute/SKILL.md +25 -3
  68. package/.codex/skills/maestro-grill/SKILL.md +9 -0
  69. package/.codex/skills/maestro-plan/SKILL.md +26 -3
  70. package/.codex/skills/maestro-ralph/SKILL.md +6 -0
  71. package/.codex/skills/maestro-ralph-execute/SKILL.md +51 -10
  72. package/.codex/skills/maestro-roadmap/SKILL.md +30 -1
  73. package/.codex/skills/manage-harvest/SKILL.md +2 -1
  74. package/.codex/skills/quality-review/SKILL.md +13 -2
  75. package/README.md +219 -87
  76. package/README.zh-CN.md +221 -79
  77. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +82 -0
  78. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +444 -0
  79. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -0
  80. package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.js +9 -4
  81. package/dashboard/dist-server/dashboard/src/server/wiki/graph-analysis.js.map +1 -1
  82. package/dashboard/dist-server/dashboard/src/server/wiki/search.d.ts +54 -5
  83. package/dashboard/dist-server/dashboard/src/server/wiki/search.js +420 -46
  84. package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
  85. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js +16 -0
  86. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js.map +1 -1
  87. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +14 -4
  88. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +130 -49
  89. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  90. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.test.js +64 -22
  91. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.test.js.map +1 -1
  92. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js +12 -12
  93. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js.map +1 -1
  94. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js +10 -3
  95. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js.map +1 -1
  96. package/dashboard/dist-server/src/commands/hooks.d.ts +3 -0
  97. package/dashboard/dist-server/src/commands/hooks.js +11 -8
  98. package/dashboard/dist-server/src/commands/hooks.js.map +1 -1
  99. package/dashboard/dist-server/src/graph/kg/db/types.d.ts +2 -1
  100. package/dashboard/dist-server/src/graph/kg/db/types.js.map +1 -1
  101. package/dashboard/dist-server/src/graph/kg/extraction/code/code-extractor.js +1 -1
  102. package/dashboard/dist-server/src/graph/kg/extraction/code/code-extractor.js.map +1 -1
  103. package/dashboard/dist-server/src/graph/kg/extraction/knowledge-extractor-registry.d.ts +22 -0
  104. package/dashboard/dist-server/src/graph/kg/extraction/knowledge-extractor-registry.js +64 -0
  105. package/dashboard/dist-server/src/graph/kg/extraction/knowledge-extractor-registry.js.map +1 -0
  106. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +14 -104
  107. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
  108. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js +5 -2
  109. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js.map +1 -1
  110. package/dashboard/dist-server/src/hooks/wiki-role-loader.js +2 -1
  111. package/dashboard/dist-server/src/hooks/wiki-role-loader.js.map +1 -1
  112. package/dashboard/dist-server/src/tools/domain-loader.js +22 -16
  113. package/dashboard/dist-server/src/tools/domain-loader.js.map +1 -1
  114. package/dashboard/dist-server/src/tools/spec-entry-parser.d.ts +6 -1
  115. package/dashboard/dist-server/src/tools/spec-entry-parser.js +44 -13
  116. package/dashboard/dist-server/src/tools/spec-entry-parser.js.map +1 -1
  117. package/dashboard/dist-server/src/tools/spec-keyword-index.d.ts +2 -0
  118. package/dashboard/dist-server/src/tools/spec-keyword-index.js +4 -9
  119. package/dashboard/dist-server/src/tools/spec-keyword-index.js.map +1 -1
  120. package/dashboard/dist-server/src/tools/spec-loader.js +3 -11
  121. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  122. package/dashboard/dist-server/src/types/index.d.ts +14 -0
  123. package/dashboard/dist-server/src/utils/frontmatter.d.ts +15 -0
  124. package/dashboard/dist-server/src/utils/frontmatter.js +76 -0
  125. package/dashboard/dist-server/src/utils/frontmatter.js.map +1 -0
  126. package/dist/src/cli.js +1 -0
  127. package/dist/src/cli.js.map +1 -1
  128. package/dist/src/commands/domain.d.ts.map +1 -1
  129. package/dist/src/commands/domain.js +8 -2
  130. package/dist/src/commands/domain.js.map +1 -1
  131. package/dist/src/commands/hooks.d.ts +3 -0
  132. package/dist/src/commands/hooks.d.ts.map +1 -1
  133. package/dist/src/commands/hooks.js +11 -8
  134. package/dist/src/commands/hooks.js.map +1 -1
  135. package/dist/src/commands/install.d.ts.map +1 -1
  136. package/dist/src/commands/install.js +48 -11
  137. package/dist/src/commands/install.js.map +1 -1
  138. package/dist/src/commands/knowhow.d.ts.map +1 -1
  139. package/dist/src/commands/knowhow.js +3 -26
  140. package/dist/src/commands/knowhow.js.map +1 -1
  141. package/dist/src/commands/search.d.ts +6 -1
  142. package/dist/src/commands/search.d.ts.map +1 -1
  143. package/dist/src/commands/search.js +124 -52
  144. package/dist/src/commands/search.js.map +1 -1
  145. package/dist/src/commands/spec.d.ts.map +1 -1
  146. package/dist/src/commands/spec.js +106 -6
  147. package/dist/src/commands/spec.js.map +1 -1
  148. package/dist/src/commands/uninstall.d.ts.map +1 -1
  149. package/dist/src/commands/uninstall.js +12 -3
  150. package/dist/src/commands/uninstall.js.map +1 -1
  151. package/dist/src/commands/update.d.ts.map +1 -1
  152. package/dist/src/commands/update.js +37 -21
  153. package/dist/src/commands/update.js.map +1 -1
  154. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  155. package/dist/src/config/cli-tools-config.js +2 -0
  156. package/dist/src/config/cli-tools-config.js.map +1 -1
  157. package/dist/src/core/extension-loader.d.ts.map +1 -1
  158. package/dist/src/core/extension-loader.js +4 -0
  159. package/dist/src/core/extension-loader.js.map +1 -1
  160. package/dist/src/core/install-executor.d.ts.map +1 -1
  161. package/dist/src/core/install-executor.js +8 -3
  162. package/dist/src/core/install-executor.js.map +1 -1
  163. package/dist/src/graph/analyzers/fs-analyzer.js +2 -2
  164. package/dist/src/graph/analyzers/fs-analyzer.js.map +1 -1
  165. package/dist/src/graph/kg/db/node-kind-registry.d.ts +18 -0
  166. package/dist/src/graph/kg/db/node-kind-registry.d.ts.map +1 -0
  167. package/dist/src/graph/kg/db/node-kind-registry.js +42 -0
  168. package/dist/src/graph/kg/db/node-kind-registry.js.map +1 -0
  169. package/dist/src/graph/kg/db/types.d.ts +2 -1
  170. package/dist/src/graph/kg/db/types.d.ts.map +1 -1
  171. package/dist/src/graph/kg/db/types.js.map +1 -1
  172. package/dist/src/graph/kg/extraction/code/code-extractor.js +1 -1
  173. package/dist/src/graph/kg/extraction/code/code-extractor.js.map +1 -1
  174. package/dist/src/graph/kg/extraction/knowledge-extractor-registry.d.ts +23 -0
  175. package/dist/src/graph/kg/extraction/knowledge-extractor-registry.d.ts.map +1 -0
  176. package/dist/src/graph/kg/extraction/knowledge-extractor-registry.js +64 -0
  177. package/dist/src/graph/kg/extraction/knowledge-extractor-registry.js.map +1 -0
  178. package/dist/src/graph/kg/extraction/orchestrator.d.ts.map +1 -1
  179. package/dist/src/graph/kg/extraction/orchestrator.js +14 -104
  180. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  181. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
  182. package/dist/src/hooks/keyword-spec-injector.js +5 -2
  183. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  184. package/dist/src/hooks/wiki-role-loader.d.ts.map +1 -1
  185. package/dist/src/hooks/wiki-role-loader.js +2 -1
  186. package/dist/src/hooks/wiki-role-loader.js.map +1 -1
  187. package/dist/src/index.d.ts +6 -0
  188. package/dist/src/index.d.ts.map +1 -1
  189. package/dist/src/index.js +4 -0
  190. package/dist/src/index.js.map +1 -1
  191. package/dist/src/ralph/cmd-next.d.ts.map +1 -1
  192. package/dist/src/ralph/cmd-next.js +2 -3
  193. package/dist/src/ralph/cmd-next.js.map +1 -1
  194. package/dist/src/tools/domain-loader.d.ts.map +1 -1
  195. package/dist/src/tools/domain-loader.js +22 -16
  196. package/dist/src/tools/domain-loader.js.map +1 -1
  197. package/dist/src/tools/spec-conflict-marker.d.ts +55 -0
  198. package/dist/src/tools/spec-conflict-marker.d.ts.map +1 -0
  199. package/dist/src/tools/spec-conflict-marker.js +228 -0
  200. package/dist/src/tools/spec-conflict-marker.js.map +1 -0
  201. package/dist/src/tools/spec-entry-parser.d.ts +6 -1
  202. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
  203. package/dist/src/tools/spec-entry-parser.js +44 -13
  204. package/dist/src/tools/spec-entry-parser.js.map +1 -1
  205. package/dist/src/tools/spec-keyword-index.d.ts +2 -0
  206. package/dist/src/tools/spec-keyword-index.d.ts.map +1 -1
  207. package/dist/src/tools/spec-keyword-index.js +4 -9
  208. package/dist/src/tools/spec-keyword-index.js.map +1 -1
  209. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  210. package/dist/src/tools/spec-loader.js +3 -11
  211. package/dist/src/tools/spec-loader.js.map +1 -1
  212. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  213. package/dist/src/tools/spec-writer.js +2 -6
  214. package/dist/src/tools/spec-writer.js.map +1 -1
  215. package/dist/src/tools/store-knowhow.d.ts.map +1 -1
  216. package/dist/src/tools/store-knowhow.js +6 -52
  217. package/dist/src/tools/store-knowhow.js.map +1 -1
  218. package/dist/src/tui/uninstall-ui/UninstallFlow.d.ts.map +1 -1
  219. package/dist/src/tui/uninstall-ui/UninstallFlow.js +3 -1
  220. package/dist/src/tui/uninstall-ui/UninstallFlow.js.map +1 -1
  221. package/dist/src/types/index.d.ts +14 -0
  222. package/dist/src/types/index.d.ts.map +1 -1
  223. package/dist/src/utils/frontmatter.d.ts +16 -0
  224. package/dist/src/utils/frontmatter.d.ts.map +1 -0
  225. package/dist/src/utils/frontmatter.js +76 -0
  226. package/dist/src/utils/frontmatter.js.map +1 -0
  227. package/dist/src/utils/migration-registry.d.ts.map +1 -1
  228. package/dist/src/utils/migration-registry.js +14 -1
  229. package/dist/src/utils/migration-registry.js.map +1 -1
  230. package/package.json +5 -3
  231. package/workflows/claude-instructions.md +63 -45
  232. package/workflows/codex-instructions.md +105 -28
  233. package/workflows/command-authoring.md +1 -1
  234. package/workflows/plan.md +2 -1
  235. package/.agents/skills/maestro-ralph-beta/SKILL.md +0 -877
  236. package/.agy/skills/maestro-ralph-beta/SKILL.md +0 -873
  237. package/.claude/commands/maestro-ralph-beta.md +0 -875
  238. package/.codex/skills/maestro-ralph-beta/SKILL.md +0 -883
package/README.zh-CN.md CHANGED
@@ -2,22 +2,58 @@
2
2
 
3
3
  # Maestro-Flow
4
4
 
5
- ### 多智能体时代的编排层
5
+ ### 多智能体时代的意图驱动工作流编排
6
6
 
7
- **不仅是执行,更是编排。**
7
+ **描述你想要什么,Maestro 负责搞定。**
8
8
 
9
+ <br/>
10
+
11
+ [![npm version](https://img.shields.io/npm/v/maestro-flow?color=cb3837&logo=npm&logoColor=white)](https://www.npmjs.com/package/maestro-flow)
9
12
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
10
13
  [![Node.js](https://img.shields.io/badge/Node.js-≥18-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
11
14
  [![MCP](https://img.shields.io/badge/MCP-Protocol-8B5CF6)](https://modelcontextprotocol.io/)
12
15
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
13
16
 
14
- [English](README.md) | [简体中文](README.zh-CN.md)
17
+ [English](README.md)&nbsp;&nbsp;|&nbsp;&nbsp;[简体中文](README.zh-CN.md)
15
18
 
16
19
  </div>
17
20
 
18
- ---
21
+ <br/>
22
+
23
+ > 大多数 AI 编程工具只能让一个 agent 做一件事。
24
+ > Maestro-Flow 编排**多个 agent 横跨整个开发生命周期** — 从头脑风暴到部署上线 — 通过自适应决策引擎、自增强知识图谱和实时可视化仪表盘。
25
+
26
+ <br/>
27
+
28
+ ## 两大支柱
29
+
30
+ Maestro-Flow 建立在两个相互增强的系统之上:
31
+
32
+ ```
33
+ ┌─────────────────────────────────────┐
34
+ │ Maestro-Flow │
35
+ │ │
36
+ ┌──────────────┴──────────────┐ ┌──────────────────┴───────────────┐
37
+ │ 工作流编排 │ │ 知识系统 │
38
+ │ │ │ │
39
+ │ 意图路由 │ │ MaestroGraph (SQLite) │
40
+ │ └─ 40+ 链类型 │ │ └─ 代码 + 知识统一存储 │
41
+ │ Ralph 决策引擎 │ │ Spec 注入 (Hooks) │
42
+ │ └─ 11 状态 FSM │ │ └─ 自动注入 agent 提示词 │
43
+ │ 质量管线 │ │ Wiki + BM25 搜索 │
44
+ │ └─ verify → review → test│ │ └─ 反向链接 + 健康评分 │
45
+ │ 多智能体调度 │ │ 学习循环 │
46
+ │ └─ Claude, Gemini, Codex │ │ └─ 复盘 → 持久化 → 注入 │
47
+ │ │ │ │
48
+ └─────────────┬───────────────┘ └──────────────────┬───────────────┘
49
+ │ ▲ │ ▲
50
+ │ │ 知识注入 │ │
51
+ │ └──────────────┘ │
52
+ │ 执行结果 │
53
+ └──────────────────────────────────────┘
54
+ ```
19
55
 
20
- Maestro-Flow 是一个面向 Claude Code、Codex、Gemini 等多智能体的工作流编排框架。你只需描述意图,Maestro-Flow 自动路由到最优命令链,驱动多个 AI 智能体并行执行,通过自适应决策节点、实时仪表盘和知识图谱形成完整的项目交付闭环。
56
+ **工作流产生知识,知识改善未来的工作流。** Agent 从每次会话中学习,将发现持久化为 spec knowhow,未来的 agent 通过 hook 注入自动获取这些上下文 — 形成自增强循环。
21
57
 
22
58
  ---
23
59
 
@@ -28,19 +64,23 @@ npm install -g maestro-flow
28
64
  maestro install
29
65
  ```
30
66
 
31
- **前置条件**:Node.js >= 18,Claude Code CLI。可选:Codex CLI、Gemini CLI 用于多智能体工作流。
67
+ **前置条件**:Node.js 18,Claude Code CLI。可选:Codex CLI、Gemini CLI 用于多智能体工作流。
68
+
69
+ `maestro install` 提供交互式组件选择器 — 可选择安装哪些资产(命令、Hook、MCP、Agent)。使用 `maestro workspace link` 跨多个项目共享知识(spec、knowhow、domain)。
32
70
 
33
71
  ---
34
72
 
35
73
  ## 快速开始
36
74
 
37
- **`/maestro-ralph`** 是主推入口 — 闭环生命周期引擎,自动读取项目状态、推断当前位置、构建自适应命令链并驱动执行:
75
+ ### Ralph 引擎
76
+
77
+ **`/maestro-ralph`** 是主推入口 — 闭环生命周期引擎,自动读取项目状态,推断你在开发生命周期中的位置,构建自适应命令链:
38
78
 
39
79
  ```bash
40
80
  /maestro-ralph "实现基于 OAuth2 的用户认证,带 refresh token"
41
81
  ```
42
82
 
43
- Ralph 自动判断你在生命周期中的位置(brainstorm → blueprint → analyze → roadmap → plan → execute → verify → review → test → milestone-complete)并构建相应命令链。上游起源命令(brainstorm、blueprint)和 roadmap 均为可选 — Ralph 根据项目状态和范围自动跳过。关键检查点的 decision 节点根据实际执行结果,动态插入 debug → fix → retry 循环。
83
+ Ralph 自动判断你在哪个阶段(brainstorm → plan → execute → verify → review → test → milestone),构建相应命令链。关键检查点的 decision 节点根据实际结果,动态插入 debug → fix → retry 循环。
44
84
 
45
85
  ```bash
46
86
  /maestro-ralph status # 查看会话进度
@@ -54,92 +94,185 @@ Ralph 自动判断你在生命周期中的位置(brainstorm → blueprint →
54
94
  |------|---------|
55
95
  | `/maestro "..."` | 描述意图,AI 自动路由最优命令链 |
56
96
  | `/maestro-quick` | 快速修复、小功能(analyze → plan → execute) |
57
- | `/maestro-*` | 逐步执行:init、brainstorm、blueprint、analyze、roadmap、plan、execute、verify |
97
+ | `/maestro-*` | 逐步执行:brainstorm、blueprint、analyze、plan、execute、verify |
98
+
99
+ ### Odyssey — 长周期迭代循环
100
+
101
+ Odyssey 命令运行扩展的自校正循环,组合考古式分析、诊断、修复、验证和知识持久化,直到满足验收标准:
102
+
103
+ | 命令 | 聚焦场景 |
104
+ |------|---------|
105
+ | `odyssey-debug` | 调试循环 — 考古分析、诊断、修复、确认、泛化 |
106
+ | `odyssey-planex` | 需求驱动循环 — 计划、执行、严格验证、修复迭代 |
107
+ | `odyssey-improve` | 代码库改进 — 多维审计、定向修复、验证 |
108
+ | `odyssey-review-test-fix` | 深度审查 + 修复 — 多维审查、定向修复、泛化 |
109
+ | `odyssey-ui` | UI 优化 — 视觉巡检、审计、发散探索、修复 |
58
110
 
59
111
  ---
60
112
 
61
- ## 核心特性
113
+ ## 工作流编排
62
114
 
63
- ### 1. 自适应生命周期引擎(`maestro-ralph`)
115
+ ### 自适应生命周期引擎
64
116
 
65
- 读取项目状态 推断生命周期位置 构建含 decision 节点的命令链。每个检查点读取实际执行结果,决定继续还是插入 debug → fix → retry 循环。链在运行中动态增长/收缩。
117
+ Ralph 是一个 11 状态有限状态机,**只做决策,不做执行**。它读取项目状态,推断生命周期位置,构建带质量门的命令链,将执行交给 `maestro-ralph-execute`。在每个 decision 节点(`◆`),Ralph 评估实际结果并决定:继续前进,还是插入 debug → fix → retry 循环。
66
118
 
67
119
  ```
68
120
  brainstorm → blueprint(可选) → init → analyze(宏观) → roadmap(可选) → analyze(微观) → plan → execute → verify
69
- post-verify
70
- business-test
71
- post-business-test
72
- review
73
- ◆ post-review
74
- test
75
- ◆ post-test
76
- milestone-audit milestone-complete
77
- ◆ post-milestone → 下一里程碑
121
+ decision
122
+ review ─── ◆ ─── test ─── ◆ ─── milestone-audit → milestone-complete
123
+ → 下一里程碑
124
+ ```
125
+
126
+ **三种质量模式**控制质量深度:
127
+
128
+ | 模式 | 管线 | 适用场景 |
129
+ |------|------|---------|
130
+ | `full` | verify → business-test → review → test-gen → test | 生产环境、安全关键代码 |
131
+ | `standard` | verify → review → test | 默认,平衡质量 |
132
+ | `quick` | verify → CLI-review | 原型开发、快速修复 |
133
+
134
+ ### 意图驱动路由
135
+
136
+ 你不需要编写 pipeline YAML。用自然语言描述意图,Maestro 将其分类到 **40+ 链类型**中,每种都是预组合的命令序列。同一意图在不同项目状态下产生不同的链:
137
+
138
+ ```bash
139
+ /maestro "添加用户个人资料页"
140
+ # → 新项目: brainstorm → blueprint → analyze → plan → execute → verify
141
+ # → 已有项目: analyze → plan → execute → verify
142
+ # → 快速修复: plan → execute → verify
78
143
  ```
79
144
 
80
- 三种质量模式:`full`(verify + business-test + review + test)、`standard`(verify + review + test)、`quick`(verify + CLI-review)。
145
+ ### 分层命令拓扑
81
146
 
82
- ### 2. 完整质量管线
147
+ 命令按四层组织:
83
148
 
84
- 每个 `◆` decision 节点是一个质量门禁,根据实际结果动态调整链路:
149
+ | 层级 | 用途 | 命令 |
150
+ |------|------|------|
151
+ | **起源层** | 发散创意,收敛方向 | brainstorm、blueprint |
152
+ | **理解层** | 探索范围(宏观)+ 深入研究(微观) | analyze(双模式) |
153
+ | **编排层** | 组织为里程碑和阶段 | roadmap |
154
+ | **执行层** | 计划、实现、验证 | plan、execute、verify、review、test |
85
155
 
86
- 1. **verify** — 目标回溯验证:检查所有 plan 需求是否实现、架构约束校验、反模式扫描、Nyquist 测试覆盖率
87
- 2. **business-test** — PRD 前向业务测试:需求追溯、fixture 生成、验收标准多层执行
88
- 3. **review** — 多维度代码审查:正确性、可读性、性能、安全、测试、架构
89
- 4. **test-gen** — 覆盖率缺口分析 + 自动测试生成(TDD/E2E 分类,L0-L3 渐进层)
90
- 5. **test** — 交互式 UAT:探索性测试,会话持久化,缺口闭环
156
+ 6 条规范路径(A–F)覆盖从全新项目到单行修复的所有场景。
91
157
 
92
- ### 3. 分层命令拓扑
158
+ ### 多智能体调度
93
159
 
94
- 命令按四层组织:**上游起源层**(brainstorm 发散、blueprint 收敛)、**理解层**(analyze 双层模式:宏观探索影响面 + 微观 Phase 级深入)、**编排层**(roadmap — 可选,纯 Milestone > Phase 分解)、**执行层**(plan → execute → verify)。6 条规范路径(Path A–F)覆盖从全新项目到小修复的所有场景。50 个斜杠命令覆盖 7 大类别,所有产物存放于 `.workflow/scratch/`,由 `state.json` 追踪。
160
+ Maestro 通过四种可组合的编排模式协调 **Claude Code、Codex、Gemini、Qwen、OpenCode**:
95
161
 
96
- ### 4. Issue 闭环
162
+ | 模式 | 工作方式 |
163
+ |------|---------|
164
+ | **Delegate** | 通过 `maestro delegate` 派发到任意 CLI 工具,SQLite 任务中介管理异步执行,支持消息注入和链式调用 |
165
+ | **Team** | 协调器-工人架构 — 协调器生成角色规格,并行派生 `team-worker` agent,由常驻质量观察者监督 |
166
+ | **Wave** | 任务拓扑排序为依赖波次,波次内独立任务并行执行 |
167
+ | **Swarm** | ACO 蚁群驱动的多智能体探索,信息素引导收敛 |
168
+
169
+ 这些模式可以**组合**:团队协调器可将子任务委托给不同的 LLM 后端,波次执行并行化独立工作,仪表盘提供实时监控 — 所有模式共享中介和消息总线作为协调原语。
170
+
171
+ ---
97
172
 
98
- Issue 是自修复管线:discover → analyze → plan → execute → close。质量命令自动为发现的问题创建 Issue,修复代码回流到阶段管线。
173
+ ## 知识系统
99
174
 
100
- ### 5. 可视化仪表盘
175
+ ### 知识图谱(MaestroGraph)
101
176
 
102
- 实时看板 `http://127.0.0.1:3001`,React 19 + Tailwind CSS 4 + WebSocket 实时更新。Kanban 看板、甘特时间线、可排序表格、指挥中心。在 Issue 卡片上选择智能体,一键派发。
177
+ **MaestroGraph** 是统一的代码索引引擎,替代了原有的 CodeGraph 外部依赖。基于 `web-tree-sitter` 实现 AST 级提取,将**代码结构**(函数、类、调用链)和**项目知识**(spec、knowhow、领域术语、issue)存储在同一个 SQLite 图数据库中,配备双 FTS5 索引。
103
178
 
104
179
  ```bash
105
- maestro serve # → http://127.0.0.1:3001
106
- maestro view # 终端 TUI 替代方案
107
- maestro command-help # 在浏览器中打开交互式命令参考(别名: ch)
180
+ maestro kg search <symbol> # 查找节点
181
+ maestro kg context <node> # 获取上下文
182
+ maestro kg callers <function> # 追溯调用链
183
+ maestro kg callees <function> # 追溯依赖
184
+ ```
185
+
186
+ ### Spec 注入
187
+
188
+ 项目规则(编码规范、架构约束、质量标准)以带关键词标签的 `<spec-entry>` 格式存储。**Hook 自动将相关 spec 注入每个 agent 的提示词** — agent 无需手动加载即可获得项目专属规则。
189
+
190
+ ### 自增强学习循环
191
+
108
192
  ```
193
+ Agent 执行任务
194
+ → 发现模式/陷阱/决策
195
+ → 持久化为 spec 条目或 knowhow 文档
196
+ → Hook 系统索引新知识
197
+ → 未来 agent 通过提示词注入自动获取
198
+ → 更好的执行 → 更多发现 → ...
199
+ ```
200
+
201
+ 四个学习工具驱动这个循环:`learn-retro`(复盘)、`learn-follow`(模式学习)、`learn-decompose`(架构拆解)、`learn-investigate`(深度探究)。
109
202
 
110
- ### 6. 多智能体引擎
203
+ ### 领域知识
111
204
 
112
- 并行协调 Claude Code、Codex、Gemini、Qwen、OpenCode。波次执行独立任务并行,依赖任务等待前置完成。
205
+ 语义词汇表层,定义项目中**事物的含义**。Domain 术语(`maestro domain`)标准化命名、映射概念关系,并作为 MaestroGraph 的知识源之一 桥接代码级符号与业务级概念。
113
206
 
114
- ### 7. 智能知识库
207
+ ### Wiki 与搜索
115
208
 
116
- Wiki 知识图谱支持 BM25 搜索、反向链接遍历、健康评分。学习工具箱(retrofollowdecompose、investigate、second-opinion)汇入统一的 `lessons.jsonl` 知识库。
209
+ WikiIndexer 遍历 `.workflow/` 目录,解析 frontmatter,构建反向链接图,并创建 **BM25 倒排索引**用于全文搜索 — 覆盖所有项目知识:specknowhowissue 以及 KG 节点的虚拟条目。
117
210
 
118
211
  ---
119
212
 
120
- ## 命令与 Agent
213
+ ## Issue 闭环
121
214
 
122
- | 类别 | 数量 | 前缀 | 用途 |
123
- |------|------|------|------|
124
- | **核心工作流** | 19 | `maestro-*` | 全生命周期 — ralph、init、brainstorm、blueprint、analyze、roadmap、plan、execute、verify、milestones、overlays |
125
- | **管理** | 12 | `manage-*` | Issue 生命周期、代码库文档、知识捕获、记忆管理、状态 |
126
- | **质量** | 9 | `quality-*` | review、test、debug、test-gen、integration-test、business-test、refactor、sync |
127
- | **学习** | 5 | `learn-*` | 复盘、跟读、模式拆解、探究、多视角 |
128
- | **规范** | 3 | `spec-*` | setup、add、load |
129
- | **知识图谱** | 2 | `wiki-*` | 连接发现、知识摘要 |
215
+ Issue 不仅是工单,更是自修复管线:
130
216
 
131
- `.claude/agents/` 下 21 个专业化 Agent 定义,Claude Code 按需加载。
217
+ ```
218
+ discover → analyze → plan → execute → close
219
+ ▲ │
220
+ └────── 质量命令自动创建 ──────────────┘
221
+ ```
222
+
223
+ 质量命令(review、test、verify)自动为发现的问题创建 Issue,修复代码回流到阶段管线。
132
224
 
133
225
  ---
134
226
 
135
- ## 架构
227
+ ## 可视化仪表盘
228
+
229
+ 实时仪表盘 `http://127.0.0.1:3001` — Kanban 看板、甘特时间线、可排序表格、指挥中心。在 Issue 卡片上选择智能体,一键派发。
230
+
231
+ ```bash
232
+ maestro serve # 启动 Web 仪表盘
233
+ maestro view # 终端 TUI 替代方案
234
+ maestro command-help # 交互式命令参考(别名: ch)
235
+ ```
236
+
237
+ 基于 React 19、Zustand、Tailwind CSS 4、Framer Motion、Hono、WebSocket 构建。
238
+
239
+ ---
240
+
241
+ ## 项目概览
242
+
243
+ | 指标 | 数量 |
244
+ |------|------|
245
+ | 源文件 (TypeScript) | 454 |
246
+ | 代码行数 | ~111,000 |
247
+ | 斜杠命令 | 64 |
248
+ | 工作流定义 | 115 |
249
+ | 技能包 | 45 |
250
+ | Agent 定义 | 23 |
251
+ | CLI 命令 | 32 |
252
+ | 模板 | 92 |
253
+ | 指南(双语) | 67 |
254
+
255
+ ### 技术栈
256
+
257
+ | 层级 | 技术 |
258
+ |------|------|
259
+ | CLI | Commander.js, TypeScript, ESM |
260
+ | MCP | @modelcontextprotocol/sdk (stdio) |
261
+ | 知识图谱 | better-sqlite3, Drizzle ORM, web-tree-sitter |
262
+ | 前端 | React 19, Zustand, Tailwind CSS 4, Framer Motion, Radix UI |
263
+ | 后端 | Hono, WebSocket, SSE |
264
+ | 智能体 | Claude Agent SDK, Codex CLI, Gemini CLI, OpenCode |
265
+ | 构建 | Vite 6, TypeScript 5.7, Vitest |
266
+
267
+ ### 架构
136
268
 
137
269
  ```
138
270
  maestro/
139
271
  ├── bin/ # CLI 入口
140
272
  ├── src/ # 核心 CLI (Commander.js + MCP SDK)
141
- │ ├── commands/ # 11 个 CLI 命令 (serve, run, cli, ext, tool, ...)
273
+ │ ├── commands/ # 32 个 CLI 命令
142
274
  │ ├── mcp/ # MCP 服务器 (stdio 传输)
275
+ │ ├── graph/ # 知识图谱 (SQLite + tree-sitter)
143
276
  │ └── core/ # 工具注册、扩展加载器
144
277
  ├── dashboard/ # 实时 Web 仪表盘
145
278
  │ └── src/
@@ -147,38 +280,46 @@ maestro/
147
280
  │ ├── server/ # Hono API + WebSocket + SSE
148
281
  │ └── shared/ # 共享类型
149
282
  ├── .claude/
150
- │ ├── commands/ # 50 个斜杠命令 (.md)
151
- └── agents/ # 21 个 Agent 定义 (.md)
152
- ├── workflows/ # 45 个工作流实现 (.md)
153
- ├── templates/ # JSON 模板 (task, plan, issue, ...)
283
+ │ ├── commands/ # 64 个斜杠命令 (.md)
284
+ ├── agents/ # 23 个 Agent 定义 (.md)
285
+ │ └── skills/ # 45 个技能包
286
+ ├── workflows/ # 115 个工作流定义 (.md)
287
+ ├── templates/ # 92 个 JSON 模板
154
288
  └── extensions/ # 插件系统
155
289
  ```
156
290
 
157
- | 层级 | 技术 |
158
- |------|------|
159
- | CLI | Commander.js, TypeScript, ESM |
160
- | MCP | @modelcontextprotocol/sdk (stdio) |
161
- | 前端 | React 19, Zustand, Tailwind CSS 4, Framer Motion, Radix UI |
162
- | 后端 | Hono, WebSocket, SSE |
163
- | 智能体 | Claude Agent SDK, Codex CLI, Gemini CLI, OpenCode |
164
- | 构建 | Vite 6, TypeScript 5.7, Vitest |
165
-
166
291
  ---
167
292
 
168
293
  ## 文档
169
294
 
170
- - **[Maestro Ralph 指南](guide/maestro-ralph-guide.md)** — 自适应生命周期引擎:位置推断、decision 节点、质量模式、重试升级
171
- - **[命令使用指南](guide/command-usage-guide.md)** — 全部 53 个命令,含工作流图表、管线衔接、Issue 闭环
172
- - **[命令参考 (HTML)](guide/command-usage-guide.html)** — 交互式 HTML 版本,支持搜索、卡片网格、工作流示例(`maestro command-help` 打开)
173
- - **[CLI 命令参考](guide/cli-commands-guide.en.md)** — 全部 21 个终端命令:install、delegate、coordinate、wiki、hooks、overlay、collab
174
- - **[Spec 系统指南](guide/spec-system-guide.md)** — `<spec-entry>` 格式、keyword 加载、验证 Hook、session dedup 注入
175
- - **[Delegate 异步执行指南](guide/delegate-async-guide.md)** — 异步任务委派:CLI & MCP 用法、消息注入、链式调用
176
- - **[Overlay 系统指南](guide/overlay-guide.md)** — 非侵入式命令扩展:格式、section 注入、bundle 打包/导入
177
- - **[Hook 系统指南](guide/hooks-guide.md)** — Hook 系统架构、11 个 Hook、Spec 注入、上下文预算
178
- - **[Worktree 并行开发指南](guide/worktree-guide.md)** — 里程碑级 worktree 并行:fork、sync、merge、dashboard 集成
179
- - **[Collab 协作 — 使用指南](guide/team-lite-guide.md)** — 2-8 人小团队协作
180
- - **[Collab 协作 — 设计文档](guide/team-lite-design.md)** — 架构、数据模型、命名空间边界
181
- - **[MCP 工具参考](guide/mcp-tools-guide.en.md)** — 全部 9 个 MCP 端点工具
295
+ **快速入门**
296
+ - **[快速开始指南](guide/quick-start-guide.md)** — 安装、第一个工作流、核心概念
297
+ - **[安装指南](guide/install-guide.md)** — 分步安装、组件选择、工作空间配置
298
+ - **[Maestro Ralph 指南](guide/maestro-ralph-guide.md)** — 自适应生命周期引擎、decision 节点、质量模式
299
+
300
+ **工作流**
301
+ - **[命令使用指南](guide/command-usage-guide.md)** — 全部 64 个命令,含工作流图表和管线衔接
302
+ - **[CLI 命令参考](guide/cli-commands-guide.md)** — 全部 32 个终端命令
303
+ - **[工作流结构指南](guide/workflow-structure-guide.md)** — 命令拓扑、链组合
304
+ - **[质量管线指南](guide/quality-pipeline-guide.md)** — verify、review、test 管线
305
+ - **[Maestro 协调器指南](guide/maestro-coordinator-guide.md)** — 多智能体协调模式
306
+
307
+ **知识系统**
308
+ - **[知识管理指南](guide/knowledge-management-guide.md)** — KG、spec、knowhow、wiki
309
+ - **[搜索系统指南](guide/search-system-guide.md)** — 统一 BM25F 搜索、MaestroGraph 集成、类型过滤
310
+ - **[MaestroGraph 设计文档](guide/plan-maestrograph.md)** — 统一 KG 引擎设计、CodeGraph 替代、tree-sitter 集成
311
+ - **[领域知识设计文档](guide/plan-domain-knowledge.md)** — 语义词汇表、术语关系、概念层
312
+ - **[Spec 系统指南](guide/spec-system-guide.md)** — spec 条目、关键词加载、验证 Hook
313
+ - **[Hook 系统指南](guide/hooks-guide.md)** — 17 个 Hook、Spec 注入、上下文预算
314
+ - **[学习工具指南](guide/learn-tools-guide.md)** — 复盘、跟读、拆解、探究
315
+
316
+ **进阶**
317
+ - **[Delegate 异步执行指南](guide/delegate-async-guide.md)** — 多 CLI 委派、消息注入、链式调用
318
+ - **[Overlay 系统指南](guide/overlay-guide.md)** — 非侵入式命令扩展
319
+ - **[Worktree 并行开发指南](guide/worktree-guide.md)** — 里程碑级并行开发
320
+ - **[跨工作空间指南](guide/workspace-guide.md)** — 跨项目知识共享、link/unlink
321
+ - **[MCP 工具参考](guide/mcp-tools-guide.md)** — 全部 9 个 MCP 端点工具
322
+ - **[Collab 协作指南](guide/team-lite-guide.md)** — 2-8 人团队协作
182
323
 
183
324
  ---
184
325
 
@@ -186,6 +327,7 @@ maestro/
186
327
 
187
328
  - **[GET SHIT DONE](https://github.com/gsd-build/get-shit-done)** by TACHES — 规格驱动开发模型和上下文工程理念。
188
329
  - **[Claude-Code-Workflow](https://github.com/catlog22/Claude-Code-Workflow)** — 前身项目,开创了多 CLI 编排和 skill 路由工作流。
330
+ - **[Impeccable](https://github.com/pbakaus/impeccable)** by [@pbakaus](https://github.com/pbakaus) — UI 设计技能,集成为 `maestro-impeccable`。基于 [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) 许可。
189
331
 
190
332
  ## 贡献者
191
333
 
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Embedding-based semantic search using @huggingface/transformers (ONNX backend).
3
+ *
4
+ * Features:
5
+ * - Smart device detection: auto-benchmarks CPU vs GPU (DirectML), picks fastest
6
+ * - Batch inference: processes documents in configurable batch sizes (4-5x faster)
7
+ * - Incremental indexing: only re-embeds new or changed documents
8
+ * - Graceful degradation: falls back to pure BM25 when transformers is unavailable
9
+ */
10
+ export interface EmbeddingIndex {
11
+ modelId: string;
12
+ dimension: number;
13
+ docIds: string[];
14
+ vectors: Float32Array[];
15
+ contentHashes?: string[];
16
+ builtAt: number;
17
+ deviceUsed?: string;
18
+ buildTimeMs?: number;
19
+ }
20
+ export interface VectorSearchResult {
21
+ docId: string;
22
+ score: number;
23
+ }
24
+ export type DeviceType = 'cpu' | 'gpu';
25
+ export type DtypeType = 'fp32' | 'fp16' | 'q8' | 'q4';
26
+ export interface DeviceConfig {
27
+ device: DeviceType;
28
+ dtype: DtypeType;
29
+ batchSize: number;
30
+ }
31
+ export interface RankedResult {
32
+ docId: string;
33
+ score: number;
34
+ }
35
+ export interface RRFSignal {
36
+ name: string;
37
+ weight: number;
38
+ results: RankedResult[];
39
+ }
40
+ export declare function mergeRRFSignals(signals: RRFSignal[], limit: number, k?: number): RankedResult[];
41
+ export declare function mergeRRF(bm25Results: RankedResult[], vectorResults: RankedResult[], limit: number, k?: number, bm25Weight?: number, vectorWeight?: number): RankedResult[];
42
+ /**
43
+ * Hybrid fusion: RRF for ordering stability + BM25 magnitude for score discrimination.
44
+ * finalScore = alpha * rrfNorm + (1-alpha) * bm25Norm
45
+ */
46
+ export declare function mergeHybrid(bm25Results: RankedResult[], vectorResults: RankedResult[], limit: number, options?: {
47
+ k?: number;
48
+ alpha?: number;
49
+ bm25Weight?: number;
50
+ vectorWeight?: number;
51
+ }): RankedResult[];
52
+ interface BackendInfo {
53
+ name: string;
54
+ bundled: boolean;
55
+ }
56
+ export declare function detectDevice(): Promise<DeviceConfig>;
57
+ export declare function getDeviceSummary(): string;
58
+ export interface HardwareInfo {
59
+ backends: BackendInfo[];
60
+ gpuAvailable: boolean;
61
+ selectedDevice: DeviceConfig;
62
+ reason: string;
63
+ }
64
+ export declare function getHardwareInfo(): Promise<HardwareInfo>;
65
+ export declare const DEFAULT_MODEL_ID = "Xenova/multilingual-e5-small";
66
+ export declare function isAvailable(): Promise<boolean>;
67
+ export declare function getUnavailableReason(): string | null;
68
+ export declare function embedTexts(texts: string[]): Promise<Float32Array[]>;
69
+ export declare function embedQuery(query: string): Promise<Float32Array>;
70
+ export declare function vectorSearch(queryVector: Float32Array, index: EmbeddingIndex, limit: number): VectorSearchResult[];
71
+ export declare function saveEmbeddingIndex(index: EmbeddingIndex, dir: string): void;
72
+ export declare function loadEmbeddingIndex(dir: string): EmbeddingIndex | null;
73
+ export interface DocForEmbedding {
74
+ id: string;
75
+ title: string;
76
+ summary: string;
77
+ tags: string[];
78
+ body?: string;
79
+ }
80
+ export declare function hashDocContent(d: DocForEmbedding): string;
81
+ export declare function buildEmbeddingIndex(docs: DocForEmbedding[], existingIndex?: EmbeddingIndex | null): Promise<EmbeddingIndex>;
82
+ export {};