maestro-flow 0.5.44 → 0.5.46

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 (126) hide show
  1. package/.agents/agents/ralph-executor.md +93 -0
  2. package/.agents/skills/maestro-ralph-cli/SKILL.md +21 -16
  3. package/.agents/skills/maestro-ralph-v2/SKILL.md +923 -0
  4. package/.agents/skills/odyssey-debug/SKILL.md +338 -253
  5. package/.agents/skills/odyssey-improve/SKILL.md +367 -281
  6. package/.agents/skills/odyssey-planex/SKILL.md +490 -420
  7. package/.agents/skills/odyssey-review-test-fix/SKILL.md +336 -251
  8. package/.agents/skills/odyssey-ui/SKILL.md +332 -247
  9. package/.agy/agents/ralph-executor.md +91 -0
  10. package/.agy/skills/maestro-ralph-cli/SKILL.md +21 -16
  11. package/.agy/skills/maestro-ralph-v2/SKILL.md +935 -0
  12. package/.agy/skills/odyssey-debug/SKILL.md +338 -253
  13. package/.agy/skills/odyssey-improve/SKILL.md +367 -281
  14. package/.agy/skills/odyssey-planex/SKILL.md +490 -420
  15. package/.agy/skills/odyssey-review-test-fix/SKILL.md +336 -251
  16. package/.agy/skills/odyssey-ui/SKILL.md +332 -247
  17. package/.claude/agents/ralph-executor.md +91 -0
  18. package/.claude/commands/maestro-ralph-cli.md +21 -16
  19. package/.claude/commands/maestro-ralph-v2.md +921 -0
  20. package/.claude/commands/odyssey-debug.md +352 -267
  21. package/.claude/commands/odyssey-improve.md +381 -295
  22. package/.claude/commands/odyssey-planex.md +504 -434
  23. package/.claude/commands/odyssey-review-test-fix.md +350 -265
  24. package/.claude/commands/odyssey-ui.md +346 -261
  25. package/.codex/skills/maestro-next/SKILL.md +1 -1
  26. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +3 -3
  27. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  28. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +4 -4
  29. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  30. package/dashboard/dist-server/src/graph/kg/db/queries.d.ts +6 -0
  31. package/dashboard/dist-server/src/graph/kg/db/queries.js +141 -19
  32. package/dashboard/dist-server/src/graph/kg/db/queries.js.map +1 -1
  33. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  34. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  35. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  36. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  37. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  38. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  39. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  40. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  41. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +2 -2
  42. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
  43. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js +1 -1
  44. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js.map +1 -1
  45. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js +35 -0
  46. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js.map +1 -1
  47. package/dashboard/dist-server/src/hooks/spec-analytics.d.ts +1 -0
  48. package/dashboard/dist-server/src/hooks/spec-analytics.js.map +1 -1
  49. package/dashboard/dist-server/src/hooks/wiki-search-bridge.d.ts +32 -0
  50. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js +71 -0
  51. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js.map +1 -0
  52. package/dist/src/agents/api-explore/agent-loop.d.ts +15 -2
  53. package/dist/src/agents/api-explore/agent-loop.d.ts.map +1 -1
  54. package/dist/src/agents/api-explore/agent-loop.js +6 -5
  55. package/dist/src/agents/api-explore/agent-loop.js.map +1 -1
  56. package/dist/src/agents/api-explore/config.d.ts +56 -0
  57. package/dist/src/agents/api-explore/config.d.ts.map +1 -1
  58. package/dist/src/agents/api-explore/config.js +34 -0
  59. package/dist/src/agents/api-explore/config.js.map +1 -1
  60. package/dist/src/agents/api-explore/llm.d.ts +5 -1
  61. package/dist/src/agents/api-explore/llm.d.ts.map +1 -1
  62. package/dist/src/agents/api-explore/llm.js +10 -8
  63. package/dist/src/agents/api-explore/llm.js.map +1 -1
  64. package/dist/src/agents/api-explore/moa-cache.d.ts +12 -0
  65. package/dist/src/agents/api-explore/moa-cache.d.ts.map +1 -0
  66. package/dist/src/agents/api-explore/moa-cache.js +50 -0
  67. package/dist/src/agents/api-explore/moa-cache.js.map +1 -0
  68. package/dist/src/agents/api-explore/moa-loop.d.ts +49 -0
  69. package/dist/src/agents/api-explore/moa-loop.d.ts.map +1 -0
  70. package/dist/src/agents/api-explore/moa-loop.js +43 -0
  71. package/dist/src/agents/api-explore/moa-loop.js.map +1 -0
  72. package/dist/src/agents/api-explore/moa-pipeline.d.ts +43 -0
  73. package/dist/src/agents/api-explore/moa-pipeline.d.ts.map +1 -0
  74. package/dist/src/agents/api-explore/moa-pipeline.js +276 -0
  75. package/dist/src/agents/api-explore/moa-pipeline.js.map +1 -0
  76. package/dist/src/agents/api-explore/runner.d.ts +3 -0
  77. package/dist/src/agents/api-explore/runner.d.ts.map +1 -1
  78. package/dist/src/agents/api-explore/runner.js +24 -7
  79. package/dist/src/agents/api-explore/runner.js.map +1 -1
  80. package/dist/src/agents/api-explore/session.d.ts +15 -0
  81. package/dist/src/agents/api-explore/session.d.ts.map +1 -1
  82. package/dist/src/agents/api-explore/session.js.map +1 -1
  83. package/dist/src/cli.js +1 -0
  84. package/dist/src/cli.js.map +1 -1
  85. package/dist/src/commands/explore.d.ts.map +1 -1
  86. package/dist/src/commands/explore.js +16 -1
  87. package/dist/src/commands/explore.js.map +1 -1
  88. package/dist/src/commands/moa.d.ts +3 -0
  89. package/dist/src/commands/moa.d.ts.map +1 -0
  90. package/dist/src/commands/moa.js +202 -0
  91. package/dist/src/commands/moa.js.map +1 -0
  92. package/dist/src/graph/kg/db/queries.d.ts +6 -0
  93. package/dist/src/graph/kg/db/queries.d.ts.map +1 -1
  94. package/dist/src/graph/kg/db/queries.js +141 -19
  95. package/dist/src/graph/kg/db/queries.js.map +1 -1
  96. package/dist/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  97. package/dist/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  98. package/dist/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  99. package/dist/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  100. package/dist/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  101. package/dist/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  102. package/dist/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  103. package/dist/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  104. package/dist/src/graph/kg/extraction/orchestrator.js +2 -2
  105. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  106. package/dist/src/graph/kg/surface/hook-injector.js +1 -1
  107. package/dist/src/graph/kg/surface/hook-injector.js.map +1 -1
  108. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
  109. package/dist/src/hooks/keyword-spec-injector.js +35 -0
  110. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  111. package/dist/src/hooks/spec-analytics.d.ts +1 -0
  112. package/dist/src/hooks/spec-analytics.d.ts.map +1 -1
  113. package/dist/src/hooks/spec-analytics.js.map +1 -1
  114. package/dist/src/hooks/wiki-search-bridge.d.ts +33 -0
  115. package/dist/src/hooks/wiki-search-bridge.d.ts.map +1 -0
  116. package/dist/src/hooks/wiki-search-bridge.js +71 -0
  117. package/dist/src/hooks/wiki-search-bridge.js.map +1 -0
  118. package/dist/src/utils/update-notices.js +12 -0
  119. package/dist/src/utils/update-notices.js.map +1 -1
  120. package/package.json +1 -1
  121. package/.agents/skills/maestro-ralph-agent/SKILL.md +0 -697
  122. package/.agents/skills/maestro-ralph-agent-execute/SKILL.md +0 -461
  123. package/.agy/skills/maestro-ralph-agent/SKILL.md +0 -696
  124. package/.agy/skills/maestro-ralph-agent-execute/SKILL.md +0 -457
  125. package/.claude/commands/maestro-ralph-agent-execute.md +0 -459
  126. package/.claude/commands/maestro-ralph-agent.md +0 -695
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: ralph-executor
3
+ description: Single-step executor — ralph next + inline skill execution, multi-agent orchestration via SendMessage
4
+ allowed-tools:
5
+ - read_file
6
+ - write_file
7
+ - edit_file
8
+ - shell
9
+ - find_files
10
+ - search
11
+ - invoke_skill
12
+ - delegate_subagent
13
+ - send_message
14
+ ---
15
+ <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
16
+
17
+
18
+ # Ralph Executor
19
+
20
+ ## Role
21
+
22
+ Single-step skill executor with multi-agent orchestration capability. Call `maestro ralph next` to load the skill prompt, execute it inline, return execution output via send_message. You are a sandboxed executor — arg resolution, context assembly, signal extraction, drift analysis, and session management are handled by the orchestrator.
23
+
24
+ ## Process
25
+
26
+ **立即自启动**:你是 named mailbox teammate。收到含 `session_id` 和 `agent_name` 的 dispatch prompt 后,MUST 立即从 step 1 开始执行——禁止等待 mailbox 后续指令,禁止发送 idle notification。
27
+
28
+ 1. Call `shell("maestro ralph next --session {session_id}")` — **全量捕获 stdout,严禁截断管道**
29
+ - Exit 0 → skill_prompt = stdout,继续执行
30
+ - Exit 1 → send_message 错误信息给 main,结束
31
+ - Exit 2 → send_message "所有 step 已完成" 给 main,结束
32
+ - Exit 3 → send_message "并发冲突" 给 main,结束
33
+ 2. Execute the skill prompt inline — follow all instructions faithfully
34
+ 3. Handle `<deferred_reading>` paths: Read files on demand during execution, do not batch-load upfront
35
+ 4. send_message({to: "main"}) 返回执行产物路径 + 摘要
36
+
37
+ ## Multi-Agent Orchestration
38
+
39
+ 当 skill prompt 需要多 agent 编排时(如 `maestro-execute` 的 wave 并行派发):
40
+
41
+ 1. **派发 named worker**:调用 `delegate_subagent({name})` 派发 worker 为 named teammate,确保长时间任务存活:
42
+ ```
43
+ worker name 格式: {agent_name}-w{index}(如 exe-v2-001-w1, exe-v2-001-w2)
44
+ ```
45
+ > **必须传 name**:匿名 agent 执行完当前任务会 came to rest(死亡),后台任务完成通知无法唤醒。Named teammate 只会 idle,可被后台任务通知或 send_message 唤醒。
46
+ 2. **等待结果**:worker 通过 send_message 回传结果到 executor 的 mailbox
47
+ 3. **收集汇总**:接收所有 worker 的 send_message,汇总执行结果
48
+ 4. **回报主流程**:通过 `send_message({to: "main"})` 返回最终执行输出
49
+
50
+ ### Worker Dispatch Template
51
+
52
+ ```
53
+ delegate_subagent({
54
+ name: "{agent_name}-w{index}",
55
+ description: "执行子任务: {task_description}",
56
+ prompt: "你是 worker agent。执行以下任务:\n{task_content}\n\n完成后必须调用 send_message({to: \"{agent_name}\", summary: \"worker完成\", message: \"WORKER_RESULT: [执行结果摘要 + 产物路径]\"})。"
57
+ })
58
+ ```
59
+
60
+ ## Input
61
+
62
+ 从 dispatch prompt 中提取:
63
+
64
+ | Field | Required | Description |
65
+ |-------|----------|-------------|
66
+ | `session_id` | Yes | ralph session ID |
67
+ | `agent_name` | Yes | 本 agent 的 name,用于 sub-agent send_message 回传 |
68
+ | execution context | No | 编排器注入的上下文(intent、boundary、goals、prior steps 等) |
69
+
70
+ ## Output
71
+
72
+ 通过 `send_message({to: "main"})` 返回,格式:
73
+
74
+ ```
75
+ EXECUTOR_OUTPUT:
76
+ - status: DONE|DONE_WITH_CONCERNS|ERROR
77
+ - summary: <执行摘要>
78
+ - artifacts: <产物路径列表>
79
+ - concerns: <关注点,仅 DONE_WITH_CONCERNS 时>
80
+ - error: <错误信息,仅 ERROR 时>
81
+ ```
82
+
83
+ 失败时也必须 send_message,禁止静默崩溃。
84
+
85
+ ## Constraints
86
+
87
+ - 禁止无故空转——收到 session_id 即开始执行,不等待编排器的后续 mailbox 指令。等待 worker send_message 回传期间的 idle 是正常行为(平台自动触发 idle_notification,不可抑制)
88
+ - Execute exactly one step per invocation
89
+ - Do not call `maestro ralph complete` — completion is handled by the orchestrator
90
+ - Do not read or modify `status.json` — session management is the orchestrator's responsibility
91
+ - Do not skip execution steps or short-circuit — execute the full skill content
92
+ - Do not insert/delete/reorder steps or evaluate decision nodes
93
+ - 所有执行结果必须通过 send_message({to: "main"}) 回报,直接文本输出主流程看不到
@@ -15,11 +15,9 @@ allowed-tools:
15
15
  <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
16
16
 
17
17
  <purpose>
18
- CLI-delegated variant of maestro-ralph. Same chain-building logic — but this command owns the full orchestration loop: compose prompt → delegate to CLI (via ralph-cli-execute wrapper) → STOP → callback → analyze structured result → mark complete → decide next → loop.
18
+ CLI-delegated lifecycle orchestrator: compose prompt → delegate to CLI (via ralph-cli-execute wrapper) → STOP → callback → analyze structured result → mark complete → decide next → loop.
19
19
 
20
20
  Session: `.workflow/.maestro/ralph-cli-{YYYYMMDD-HHmmss}/status.json`
21
-
22
- Chain building(A_RESOLVE_PHASE → A_INFER_POSITION → A_BUILD_STEPS)、session schema、decomposition(A_DECOMPOSE_TASKS)与 ralph 共用。
23
21
  </purpose>
24
22
 
25
23
  <context>
@@ -48,17 +46,26 @@ Remaining → intent (amend_mode 时为 change_request)
48
46
  </context>
49
47
 
50
48
  <invariants>
51
- All ralph invariants (1-16) apply, with the following overrides:
52
- - **Invariant 1 CLI 语义**: ralph-cli 不直接调用 `invoke_skill()` 执行 step 内容;执行由 delegate cli-execute 完成
53
- - **Invariant 2 覆盖**: ralph-cli 不调用 `invoke_skill("maestro-ralph-execute")`;invariant 17-21 替代 handoff 机制,ralph-cli 持有完整循环
54
-
55
- Additionally:
56
-
57
- 17. **ralph-cli owns the loop** — compose delegate → analyze → decide 全部在本命令内完成;ralph-cli-execute 只是被委托端的执行包装器
58
- 18. **Delegate via cli-execute** delegate prompt 首行为 cli-execute 调用,格式由目标工具决定(见 Invocation Notation)
59
- 19. **Parse ---RESULT--- block** delegate 返回后从输出中解析结构化结果块
60
- 20. **Decision evaluation inline** decision 节点不 handoff,直接在本循环内评估(仍用 `maestro delegate --to {session.cli_tool} --mode analysis` 做只读分析)
61
- 21. **No inline skill execution**本命令不执行 skill 逻辑;执行由委托端 cli-execute 完成
49
+ 1. **Ralph-cli never executes steps** — only creates sessions, composes delegation prompts, and evaluates decisions;执行由 delegate 端 cli-execute 完成
50
+ 2. **ralph-cli owns the loop** compose delegate analyze → decide 全部在本命令内完成;ralph-cli-execute 只是被委托端的执行包装器
51
+ 3. **Delegate via cli-execute** delegate prompt 首行为 cli-execute 调用,格式由目标工具决定(见 Invocation Notation)
52
+ 4. **Parse ---RESULT--- block** — delegate 返回后从输出中解析结构化结果块
53
+ 5. **Decision evaluation inline** — decision 节点不 handoff,直接在本循环内评估(用 `maestro delegate --to {session.cli_tool} --mode analysis` 做只读分析)
54
+ 6. **Decision delegates read-only** — `maestro delegate --to <tool> --mode analysis`
55
+ 7. **No inline skill execution** — 本命令不执行 skill 逻辑;执行由委托端 cli-execute 完成
56
+ 8. **执行 step 通过 `maestro ralph next` CLI 加载并内联执行**(由 cli-execute 端完成)
57
+ 9. **status.json 是唯一真源**不生成 markdown 清单或侧文件
58
+ 10. **每个 step 必须 `completion_confirmed: true`** `maestro ralph complete N --status DONE`(或 DONE_WITH_CONCERNS)写入;CLI 是唯一合法写入路径
59
+ 11. **command_path A_BUILD_STEPS 解析**通过 `maestro ralph skills --platform agent --json --quiet` 预校验
60
+ 12. **执行 step 加载契约** — 由 `maestro ralph next` CLI 在执行期完成
61
+ 13. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻
62
+ 14. **planning_mode governs arg granularity** — `unified` → skill args 无 `{phase}`;`independent` → 含 `{phase}`
63
+ 15. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop
64
+ 16. **Invariant violation = BLOCK** — 违反上述任一 invariant 即阻断当前操作
65
+ 17. **Delegate fallback 必须标记** — A_DELEGATE_EVALUATE 解析 verdict 失败时 fallback 为 "fix",MUST 在 decisions.ndjson 记录 `"parse_failed": true, "confidence_score": 0`
66
+ 18. **auto_confirm 单一来源** — `auto_confirm` 仅由用户 `-y` 标志设定
67
+ 19. **分解契约单一所有者** — `boundary_contract` / `task_decomposition` 由 session 创建者拥有
68
+ 20. **控制权优先级(范式治理)** — FSM 独占 session 生命周期 + step 排序 + retry/fix/escalate + cross-step decision 节点
62
69
  </invariants>
63
70
 
64
71
  <state_machine>
@@ -623,8 +630,6 @@ E001–E006, W001–W004 适用。CLI 新增:
623
630
 
624
631
  ### Success Criteria
625
632
 
626
- Ralph success criteria 适用。CLI 新增:
627
-
628
633
  - [ ] ralph-cli owns full loop: compose → delegate → STOP → callback → parse → complete → next
629
634
  - [ ] Delegation prompt 首行为 cli-execute 调用(`--session {session_id}`,格式由 cli_tool 决定),后接 `<execution_context>`
630
635
  - [ ] A_PARSE_RESULT extracts STATUS/SUMMARY/ARTIFACTS/DECISIONS/CAVEATS/DEFERRED/SIGNALS from ---RESULT--- block