pi-maestro-flow 0.2.0 → 0.3.0

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 (235) hide show
  1. package/README.md +44 -72
  2. package/agents/cross-role-reviewer.md +1 -1
  3. package/agents/impeccable-agent.md +1 -1
  4. package/agents/ralph-executor.md +1 -1
  5. package/agents/team-worker.md +1 -1
  6. package/agents/workflow-analyzer.md +1 -1
  7. package/agents/workflow-codebase-mapper.md +1 -1
  8. package/agents/workflow-collab-planner.md +1 -1
  9. package/agents/workflow-debugger.md +1 -1
  10. package/agents/workflow-executor.md +1 -1
  11. package/agents/workflow-integration-checker.md +1 -1
  12. package/agents/workflow-nyquist-auditor.md +1 -1
  13. package/agents/workflow-phase-researcher.md +1 -1
  14. package/agents/workflow-planner.md +1 -1
  15. package/agents/workflow-project-researcher.md +1 -1
  16. package/agents/workflow-reviewer.md +1 -1
  17. package/agents/workflow-verifier.md +1 -1
  18. package/package.json +13 -4
  19. package/skills/codify-to-knowhow/SKILL.md +1 -1
  20. package/skills/delegation-check/SKILL.md +1 -1
  21. package/skills/domain-add/SKILL.md +5 -7
  22. package/skills/insight-challenge/SKILL.md +1 -1
  23. package/skills/learn-decompose/SKILL.md +4 -4
  24. package/skills/learn-follow/SKILL.md +5 -5
  25. package/skills/learn-investigate/SKILL.md +5 -5
  26. package/skills/learn-second-opinion/SKILL.md +5 -5
  27. package/skills/maestro/SKILL.md +9 -10
  28. package/skills/maestro-amend/SKILL.md +3 -3
  29. package/skills/maestro-analyze/SKILL.md +10 -13
  30. package/skills/maestro-blueprint/SKILL.md +8 -11
  31. package/skills/maestro-brainstorm/SKILL.md +11 -14
  32. package/skills/maestro-collab/SKILL.md +4 -4
  33. package/skills/maestro-companion/SKILL.md +3 -3
  34. package/skills/maestro-composer/SKILL.md +11 -12
  35. package/skills/maestro-execute/SKILL.md +9 -12
  36. package/skills/maestro-fork/SKILL.md +8 -11
  37. package/skills/maestro-grill/SKILL.md +13 -16
  38. package/skills/maestro-guard/SKILL.md +5 -5
  39. package/skills/maestro-help/SKILL.md +3 -3
  40. package/skills/maestro-impeccable/SKILL.md +7 -7
  41. package/skills/maestro-init/SKILL.md +9 -12
  42. package/skills/maestro-merge/SKILL.md +6 -8
  43. package/skills/maestro-milestone-audit/SKILL.md +3 -5
  44. package/skills/maestro-milestone-complete/SKILL.md +9 -12
  45. package/skills/maestro-milestone-release/SKILL.md +9 -11
  46. package/skills/maestro-next/SKILL.md +5 -5
  47. package/skills/maestro-overlay/SKILL.md +16 -16
  48. package/skills/maestro-plan/SKILL.md +9 -12
  49. package/skills/maestro-player/SKILL.md +5 -5
  50. package/skills/maestro-quick/SKILL.md +5 -7
  51. package/skills/maestro-ralph/SKILL.md +16 -17
  52. package/skills/maestro-ralph-cli/SKILL.md +6 -6
  53. package/skills/maestro-ralph-cli-execute/SKILL.md +2 -2
  54. package/skills/maestro-ralph-execute/SKILL.md +4 -4
  55. package/skills/maestro-ralph-v2/SKILL.md +18 -19
  56. package/skills/maestro-roadmap/SKILL.md +8 -9
  57. package/skills/maestro-swarm-workflow/SKILL.md +9 -9
  58. package/skills/maestro-tools-execute/SKILL.md +5 -7
  59. package/skills/maestro-tools-register/SKILL.md +7 -9
  60. package/skills/maestro-ui-codify/SKILL.md +9 -10
  61. package/skills/maestro-universal-workflow/SKILL.md +15 -15
  62. package/skills/maestro-update/SKILL.md +10 -10
  63. package/skills/manage-codebase-rebuild/SKILL.md +4 -6
  64. package/skills/manage-drift-realign/SKILL.md +8 -11
  65. package/skills/manage-harvest/SKILL.md +6 -9
  66. package/skills/manage-issue/SKILL.md +5 -8
  67. package/skills/manage-issue-discover/SKILL.md +8 -11
  68. package/skills/manage-kg-extractors/SKILL.md +3 -3
  69. package/skills/manage-knowhow/SKILL.md +3 -5
  70. package/skills/manage-knowhow-capture/SKILL.md +4 -6
  71. package/skills/manage-knowledge-audit/SKILL.md +6 -9
  72. package/skills/manage-status/SKILL.md +3 -5
  73. package/skills/manage-wiki/SKILL.md +5 -7
  74. package/skills/odyssey-debug/SKILL.md +13 -13
  75. package/skills/odyssey-improve/SKILL.md +15 -15
  76. package/skills/odyssey-planex/SKILL.md +16 -16
  77. package/skills/odyssey-review-test-fix/SKILL.md +11 -11
  78. package/skills/odyssey-ui/SKILL.md +10 -10
  79. package/skills/prompt-generator/SKILL.md +5 -5
  80. package/skills/quality-auto-test/SKILL.md +3 -5
  81. package/skills/quality-debug/SKILL.md +3 -5
  82. package/skills/quality-refactor/SKILL.md +3 -5
  83. package/skills/quality-retrospective/SKILL.md +10 -13
  84. package/skills/quality-review/SKILL.md +5 -8
  85. package/skills/quality-sync/SKILL.md +3 -5
  86. package/skills/quality-test/SKILL.md +4 -6
  87. package/skills/scholar-anti-ai-writing/SKILL.md +1 -1
  88. package/skills/scholar-citation-verify/SKILL.md +1 -1
  89. package/skills/scholar-experiment/SKILL.md +2 -2
  90. package/skills/scholar-ideation/SKILL.md +7 -7
  91. package/skills/scholar-latex-organizer/SKILL.md +1 -1
  92. package/skills/scholar-publish/SKILL.md +3 -3
  93. package/skills/scholar-rebuttal-pro/SKILL.md +3 -3
  94. package/skills/scholar-review/SKILL.md +1 -1
  95. package/skills/scholar-writing/SKILL.md +1 -1
  96. package/skills/security-audit/SKILL.md +2 -4
  97. package/skills/skill-generator/SKILL.md +3 -3
  98. package/skills/skill-iter-tune/SKILL.md +3 -3
  99. package/skills/skill-simplify/SKILL.md +1 -1
  100. package/skills/skill-tuning/SKILL.md +1 -1
  101. package/skills/spec-add/SKILL.md +5 -7
  102. package/skills/spec-load/SKILL.md +3 -5
  103. package/skills/spec-remove/SKILL.md +4 -6
  104. package/skills/spec-setup/SKILL.md +6 -8
  105. package/skills/team-adversarial-swarm/SKILL.md +5 -5
  106. package/skills/team-arch-opt/SKILL.md +2 -2
  107. package/skills/team-brainstorm/SKILL.md +3 -3
  108. package/skills/team-coordinate/SKILL.md +4 -4
  109. package/skills/team-designer/SKILL.md +1 -1
  110. package/skills/team-executor/SKILL.md +3 -3
  111. package/skills/team-frontend/SKILL.md +2 -2
  112. package/skills/team-frontend-debug/SKILL.md +3 -3
  113. package/skills/team-interactive-craft/SKILL.md +2 -2
  114. package/skills/team-issue/SKILL.md +3 -3
  115. package/skills/team-lifecycle-v4/SKILL.md +4 -4
  116. package/skills/team-motion-design/SKILL.md +2 -2
  117. package/skills/team-perf-opt/SKILL.md +3 -3
  118. package/skills/team-planex/SKILL.md +2 -2
  119. package/skills/team-quality-assurance/SKILL.md +3 -3
  120. package/skills/team-review/SKILL.md +3 -3
  121. package/skills/team-roadmap-dev/SKILL.md +3 -3
  122. package/skills/team-swarm/SKILL.md +4 -4
  123. package/skills/team-tech-debt/SKILL.md +2 -2
  124. package/skills/team-testing/SKILL.md +3 -3
  125. package/skills/team-ui-polish/SKILL.md +2 -2
  126. package/skills/team-uidesign/SKILL.md +2 -2
  127. package/skills/team-ultra-analyze/SKILL.md +4 -4
  128. package/skills/team-ux-improve/SKILL.md +3 -3
  129. package/skills/team-visual-a11y/SKILL.md +2 -2
  130. package/skills/workflow-skill-designer/SKILL.md +8 -8
  131. package/templates/business-test-report.json +68 -0
  132. package/templates/config.json +48 -0
  133. package/templates/context.md +16 -0
  134. package/templates/doc-index.json +11 -0
  135. package/templates/index.json +68 -0
  136. package/templates/issue.json +36 -0
  137. package/templates/plan.json +38 -0
  138. package/templates/project.md +60 -0
  139. package/templates/reflection-log.md +20 -0
  140. package/templates/roadmap.md +45 -0
  141. package/templates/scratch-index.json +19 -0
  142. package/templates/search-tool.json +1 -0
  143. package/templates/search-tools.md +47 -0
  144. package/templates/state.json +18 -0
  145. package/templates/task-summary.md +21 -0
  146. package/templates/task.json +89 -0
  147. package/templates/terminology-template.json +22 -0
  148. package/templates/uat.md +21 -0
  149. package/templates/validation.json +31 -0
  150. package/templates/verification.json +37 -0
  151. package/templates/workflow.md +14 -0
  152. package/templates/worktree-scope.json +9 -0
  153. package/templates/worktrees.json +26 -0
  154. package/workflows/agy-instructions.md +156 -0
  155. package/workflows/analyze.md +768 -0
  156. package/workflows/auto-test.md +705 -0
  157. package/workflows/blueprint.md +406 -0
  158. package/workflows/boundary-grill.md +50 -0
  159. package/workflows/brainstorm.md +508 -0
  160. package/workflows/business-test.md +574 -0
  161. package/workflows/chinese-response.md +25 -0
  162. package/workflows/claude-instructions.md +167 -0
  163. package/workflows/codebase-rebuild.md +267 -0
  164. package/workflows/codebase-refresh.md +168 -0
  165. package/workflows/codex-instructions.md +156 -0
  166. package/workflows/coding-philosophy.md +70 -0
  167. package/workflows/command-authoring.md +823 -0
  168. package/workflows/debug.md +409 -0
  169. package/workflows/delegate-usage.md +99 -0
  170. package/workflows/domain-add.md +121 -0
  171. package/workflows/drift-realign.md +396 -0
  172. package/workflows/execute.md +631 -0
  173. package/workflows/explore-usage.md +93 -0
  174. package/workflows/finish-work.md +124 -0
  175. package/workflows/fork.md +162 -0
  176. package/workflows/grill.md +494 -0
  177. package/workflows/harvest.md +478 -0
  178. package/workflows/impeccable.md +168 -0
  179. package/workflows/init.md +157 -0
  180. package/workflows/instruction-authoring-guide.md +97 -0
  181. package/workflows/integration-test.md +186 -0
  182. package/workflows/interview-mechanics.md +8 -0
  183. package/workflows/issue-analyze.md +20 -0
  184. package/workflows/issue-discover.md +238 -0
  185. package/workflows/issue-execute.md +110 -0
  186. package/workflows/issue-gaps-analyze.codex.md +256 -0
  187. package/workflows/issue-gaps-analyze.md +215 -0
  188. package/workflows/issue-plan.md +110 -0
  189. package/workflows/issue.md +338 -0
  190. package/workflows/knowhow.md +429 -0
  191. package/workflows/knowledge-audit.md +355 -0
  192. package/workflows/learn.md +271 -0
  193. package/workflows/maestro-chain-execute.md +20 -0
  194. package/workflows/maestro-link-coordinate.md +114 -0
  195. package/workflows/maestro-super.md +120 -0
  196. package/workflows/maestro.md +501 -0
  197. package/workflows/map.md +74 -0
  198. package/workflows/merge.md +122 -0
  199. package/workflows/milestone-audit.md +155 -0
  200. package/workflows/milestone-complete.md +167 -0
  201. package/workflows/milestone-release.md +82 -0
  202. package/workflows/odyssey-base-codex.md +305 -0
  203. package/workflows/odyssey-base.md +256 -0
  204. package/workflows/overlays.md +109 -0
  205. package/workflows/plan.md +520 -0
  206. package/workflows/quick.md +350 -0
  207. package/workflows/ralph-amend-goal.md +177 -0
  208. package/workflows/refactor.md +87 -0
  209. package/workflows/retrospective.md +471 -0
  210. package/workflows/review.md +448 -0
  211. package/workflows/roadmap-common.md +193 -0
  212. package/workflows/roadmap.md +106 -0
  213. package/workflows/shell-exec-protocol.md +30 -0
  214. package/workflows/skill-authoring.md +265 -0
  215. package/workflows/spec-generate.md +475 -0
  216. package/workflows/specs-add.md +123 -0
  217. package/workflows/specs-load.md +76 -0
  218. package/workflows/specs-remove.md +104 -0
  219. package/workflows/specs-setup.md +316 -0
  220. package/workflows/status.md +149 -0
  221. package/workflows/sync.md +116 -0
  222. package/workflows/tdd.md +255 -0
  223. package/workflows/test-gen.md +226 -0
  224. package/workflows/test.md +385 -0
  225. package/workflows/tools-spec.md +70 -0
  226. package/workflows/ui-codify-extract.md +372 -0
  227. package/workflows/ui-codify-knowhow.md +258 -0
  228. package/workflows/ui-codify-package.md +159 -0
  229. package/workflows/ui-codify.md +227 -0
  230. package/workflows/ui-design.md +393 -0
  231. package/workflows/ui-style.md +201 -0
  232. package/workflows/verify.md +557 -0
  233. package/workflows/wiki-connect.md +153 -0
  234. package/workflows/wiki-digest.md +180 -0
  235. package/workflows/wiki-manage.md +113 -0
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-quick
3
3
  description: "Quick task execution, skip optional agents Arguments: [description] [--full] [--discuss] [-y]"
4
- allowed-tools: Read Write Edit Bash Glob Grep Agent AskUserQuestion
4
+ allowed-tools: Read Write Edit Bash Glob Grep teammate maestro
5
5
  ---
6
6
 
7
7
  <purpose>
@@ -10,9 +10,7 @@ Flags --discuss and --full enable additional pipeline stages.
10
10
  **Implicit write**: state.json scratch task entry is written automatically as part of workflow tracking (no confirmation gate).
11
11
  </purpose>
12
12
 
13
- <required_reading>
14
- @~/.maestro/workflows/quick.md
15
- </required_reading>
13
+ > **Required**: Read `~/.pi/agent/packages/pi-maestro-flow/workflows/quick.md` before proceeding.
16
14
 
17
15
  <context>
18
16
  $ARGUMENTS
@@ -40,7 +38,7 @@ Parse for:
40
38
  2. **Evidence-based summaries** — task summaries MUST include concrete evidence (files changed, tests run, commands executed); NEVER accept "task completed successfully" as a summary
41
39
  3. **Plan before execute** — plan.json MUST be written before any task execution begins; NEVER skip planning even for single-task workflows
42
40
  4. **Scratch isolation** — all workflow artifacts MUST live under `.workflow/scratch/{task-dir}/`; NEVER write workflow metadata outside this directory
43
- 5. **Commit confirmation** — staged files and commit message MUST be shown via AskUserQuestion before committing (unless `-y`); NEVER auto-commit without user awareness
41
+ 5. **Commit confirmation** — staged files and commit message MUST be shown via user prompt before committing (unless `-y`); NEVER auto-commit without user awareness
44
42
  </invariants>
45
43
 
46
44
  <execution>
@@ -63,7 +61,7 @@ Parse for:
63
61
  - REQUIRED: --full verification passed (if flag set).
64
62
  - BLOCKED if: any task summary missing or lacking evidence.
65
63
 
66
- Follow '~/.maestro/workflows/quick.md' completely.
64
+ Follow '~/.pi/agent/packages/pi-maestro-flow/workflows/quick.md' completely.
67
65
 
68
66
  ### Artifact Verification (before completion)
69
67
 
@@ -113,5 +111,5 @@ maestro ralph complete <idx> --status {DONE|DONE_WITH_CONCERNS|NEEDS_RETRY|BLOCK
113
111
  - [ ] plan.json written with task definitions
114
112
  - [ ] All tasks executed with summaries written
115
113
  - [ ] state.json updated with scratch task entry (implicit — part of workflow tracking, no confirmation needed)
116
- - [ ] Commit created with task changes: stage ONLY files modified by the task (from `.summaries/TASK-*-summary.md` "Files modified" list); confirm with `AskUserQuestion` showing staged files and proposed commit message — unless `-y` is active, in which case auto-commit
114
+ - [ ] Commit created with task changes: stage ONLY files modified by the task (from `.summaries/TASK-*-summary.md` "Files modified" list); confirm with `user prompt` showing staged files and proposed commit message — unless `-y` is active, in which case auto-commit
117
115
  </success_criteria>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-ralph
3
3
  description: "[LEGACY — prefer maestro-ralph-v2] Inline lifecycle orchestrator — state-based determination with main-session execution Arguments: <intent> [-y] | status | continue | --amend [change]"
4
- allowed-tools: Read Write Edit Bash Glob Grep Skill AskUserQuestion
4
+ allowed-tools: Read Write Edit Bash Glob Grep maestro
5
5
  ---
6
6
 
7
7
  <purpose>
@@ -9,9 +9,8 @@ Closed-loop decision engine: read project state → infer position → build ada
9
9
  Ralph builds/evaluates; ralph-execute runs steps. Session: `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`.
10
10
  </purpose>
11
11
 
12
- <deferred_reading>
13
- - [ralph-amend-goal.md](~/.maestro/workflows/ralph-amend-goal.md) — read when `--amend` flag active for goal amendment flow
14
- </deferred_reading>
12
+ > **Reference files** (read when needed):
13
+ > - [ralph-amend-goal.md](~/.pi/agent/packages/pi-maestro-flow/workflows/ralph-amend-goal.md) — read when `--amend` flag active for goal amendment flow
15
14
 
16
15
  <context>
17
16
  $ARGUMENTS — intent text, flags, or keywords.
@@ -46,7 +45,7 @@ Remaining → intent (amend_mode 时为 change_request)
46
45
  12. **Invariant violation = BLOCK** — 违反上述任一 invariant 即阻断当前操作。不得以 "效率" 或 "意图明确" 为由绕过。特别是 invariant 1(ralph 不执行 step)和 invariant 6(completion_confirmed 由 CLI 写入)不可隐性违反。
47
46
  13. **Delegate fallback 必须标记** — A_DELEGATE_EVALUATE 解析 verdict 失败时 fallback 为 "fix",但 MUST 在 decisions.ndjson 记录 `"parse_failed": true, "confidence_score": 0`,后续 step 继承 LOW CONFIDENCE 标记。
48
47
  14. **auto_confirm 单一来源** — `auto_confirm` 仅由用户 `-y` 标志设定;ralph 不得内部推断。`session.auto_mode` 仅反映用户输入。
49
- 15. **分解契约单一所有者** — `boundary_contract` / `task_decomposition` 由 session 创建者拥有(`source=="ralph"` → `decomposition_owner="ralph"`;`source=="maestro"` → `"maestro"`)。contract 已存在时,后续 S_DECOMPOSE MUST 跳过 AskUserQuestion,仅做 shape 校验 + 缺省补齐;goal-audit 只更新 `task_decomposition[*].status/completion_confirmed/completed_at`,禁止改 `goal/done_when/boundary`。
48
+ 15. **分解契约单一所有者** — `boundary_contract` / `task_decomposition` 由 session 创建者拥有(`source=="ralph"` → `decomposition_owner="ralph"`;`source=="maestro"` → `"maestro"`)。contract 已存在时,后续 S_DECOMPOSE MUST 跳过 user prompt,仅做 shape 校验 + 缺省补齐;goal-audit 只更新 `task_decomposition[*].status/completion_confirmed/completed_at`,禁止改 `goal/done_when/boundary`。
50
49
  16. **控制权优先级(范式治理)** — FSM 独占 session 生命周期 + step 排序 + retry/fix/escalate + cross-step decision 节点;Pipeline 命令只拥有自身 artifact GATE(GATE 失败 → `maestro ralph complete <idx> --status BLOCKED|NEEDS_RETRY`,自身 GATE 全过 → DONE);Router 命令不得出现在 FSM step 内。
51
50
  </invariants>
52
51
 
@@ -129,7 +128,7 @@ S_CONFIRM:
129
128
  → END WHEN: user selects "Cancel"
130
129
 
131
130
  S_DISPATCH:
132
- → END DO: Skill({ skill: "maestro-ralph-execute" })
131
+ → END DO: invoke /skill: "maestro-ralph-execute" })
133
132
 
134
133
  S_DECISION_EVAL: (decision 节点 == `step.decision` 非空,下述 gate 名取自该字段)
135
134
  → S_APPLY_VERDICT WHEN: quality-gate (post-execute, post-business-test, post-review, post-test, post-frontend-verify)
@@ -162,16 +161,16 @@ S_APPLY_VERDICT:
162
161
  GUARD: confidence_score < 60 AND proceed → override to fix
163
162
  GUARD: confidence_score > 95 AND fix AND retry > 0 → suggest proceed
164
163
  GUARD: auto_confirm → skip user prompt, apply adjusted verdict
165
- GUARD: not auto_confirm → AskUserQuestion with override options
164
+ GUARD: not auto_confirm → user prompt with override options
166
165
  GUARD: post-reground + drifted + confidence_score >= 60 → A_REGROUND_HALT(漂移熔断为安全门,auto_confirm 不跳过)
167
166
 
168
167
  S_AMEND_GOAL:
169
168
  → S_DISPATCH WHEN: change applied + user confirmed DO: A_AMEND_GOAL
170
169
  → END WHEN: user cancels
171
- GUARD: RISK_LEVEL=high → auto_confirm 无效,必须 AskUserQuestion
170
+ GUARD: RISK_LEVEL=high → auto_confirm 无效,必须 user prompt
172
171
 
173
172
  S_FALLBACK:
174
- → S_PARSE_ROUTE WHEN: user provides input DO: AskUserQuestion
173
+ → S_PARSE_ROUTE WHEN: user provides input DO: user prompt
175
174
  → END WHEN: user cancels
176
175
 
177
176
  </transitions>
@@ -203,7 +202,7 @@ S_FALLBACK:
203
202
  | 3 | 未派生 → 取最新 in-progress artifact 的 phase | false |
204
203
  | 4 | 仍无 → state.json 首个 incomplete phase | false |
205
204
  | 5 | position 将是 brainstorm/blueprint/init/roadmap/analyze-macro → phase = null | n/a |
206
- | 6 | 仍模糊 → `AskUserQuestion` | 由用户回答确定 |
205
+ | 6 | 仍模糊 → `user prompt` | 由用户回答确定 |
207
206
 
208
207
  **D-007 Phase→Milestone 反查**(数字 phase 已解析时):
209
208
  ```
@@ -317,9 +316,9 @@ wants_roadmap = (--roadmap flag)
317
316
  | intent 显式指定 phase 编号(如 "phase 2"、"P3") | `independent` | 用户明确针对单个 phase |
318
317
  | milestone 仅含 1 个 phase(读 state.json) | `independent` | 统一无意义 |
319
318
  | milestone 含多个 phase + `auto_confirm` | `unified` | 自动模式倾向高效 |
320
- | milestone 含多个 phase + 非 `auto_confirm` | → AskUserQuestion | 征询用户选择 |
319
+ | milestone 含多个 phase + 非 `auto_confirm` | → user prompt | 征询用户选择 |
321
320
 
322
- **AskUserQuestion** (仅当 milestone 含 ≥2 phase 且非 auto_confirm):
321
+ **user prompt** (仅当 milestone 含 ≥2 phase 且非 auto_confirm):
323
322
 
324
323
  ```
325
324
  question: "当前里程碑含 {N} 个 phase,选择规划模式?"
@@ -346,7 +345,7 @@ Runs once before chain build; additive to status.json. 设 `session.decompositio
346
345
  | named single file/function/bug, "fix X", "add Y to Z" | narrow | skip — auto-derive |
347
346
  | otherwise | medium | clarify unless auto_confirm |
348
347
 
349
- **2. Clarify boundary** (broad/medium) — `AskUserQuestion`, ≤3 rounds, options pre-filled from intent + a quick Glob/Grep scan of the target module:
348
+ **2. Clarify boundary** (broad/medium) — `user prompt`, ≤3 rounds, options pre-filled from intent + a quick Glob/Grep scan of the target module:
350
349
 
351
350
  | Round | Question | Drives |
352
351
  |-------|----------|--------|
@@ -632,7 +631,7 @@ GUARD: `task_decomposition` 存在(周期触发,见 build rule 5.5)
632
631
  - 把下一个未完成的 `plan` step 改为 `maestro-plan --from analyze:{analyze_macro_id}`,去掉 `{phase}`,`source_artifact_ref = analyze:{analyze_macro_id}`
633
632
  - 后续 `execute` 等沿用同一 standalone scope(不带 `{phase}`,由 plan 写出的 task 列表驱动)
634
633
  4. 路径 C(`unknown`):
635
- - 非 auto_confirm → AskUserQuestion 二选一(roadmap 多发布 / 单一计划);auto_confirm → 默认路径 B(单一计划,不引入 roadmap)
634
+ - 非 auto_confirm → user prompt 二选一(roadmap 多发布 / 单一计划);auto_confirm → 默认路径 B(单一计划,不引入 roadmap)
636
635
  5. Reindex steps,标 decision completed,write status.json
637
636
  6. Display: ◆ Scope verdict: {verdict} → {kept|collapsed to standalone via analyze:{ANL_ID}}
638
637
 
@@ -668,12 +667,12 @@ GUARD: `task_decomposition` 存在(周期触发,见 build rule 5.5)
668
667
  | Phase | 行为 | 产出 |
669
668
  |-------|------|------|
670
669
  | 1. 快照 | 读 `task_decomposition` + `boundary_contract` + 已完成 steps 的 `completion_summary` | Display: 目标列表 + 进度 |
671
- | 2. 解析 | `change_request` 非空 → 直接用;为空 → AskUserQuestion(修改/新增/移除/调整边界) | `change_type` + `change_request` |
670
+ | 2. 解析 | `change_request` 非空 → 直接用;为空 → user prompt(修改/新增/移除/调整边界) | `change_type` + `change_request` |
672
671
  | 3. Mini Grill | `maestro delegate --to {session.cli_tool} --mode analysis`:评估影响 | RISK_LEVEL + AFFECTED_GOALS + INVALIDATED_STEPS + NEW_GAPS |
673
- | 4. 确认 | AskUserQuestion:应用并继续 / 仅改目标 / 取消 | 用户选择 |
672
+ | 4. 确认 | user prompt:应用并继续 / 仅改目标 / 取消 | 用户选择 |
674
673
  | 5. 应用 | 归档旧目标(`superseded`)→ 写入新目标(`origin: CHG-xxx`)→ 重建链路 → write status.json | handoff ralph-execute |
675
674
 
676
- GUARD: `RISK_LEVEL == high` → AskUserQuestion 不跳过(auto_confirm 无效)
675
+ GUARD: `RISK_LEVEL == high` → user prompt 不跳过(auto_confirm 无效)
677
676
  GUARD: 已完成(`status: "done"`)的目标不可 supersede(skip + warn)
678
677
 
679
678
  </actions>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-ralph-cli
3
3
  description: "[LEGACY — prefer maestro-ralph-v2] CLI-delegated lifecycle orchestrator — compose, delegate, analyze, decide in one loop Arguments: <intent> [-y] [--to <tool>] [--amend [change]] [--roadmap] | status | continue"
4
- allowed-tools: Read Write Edit Bash Glob Grep Skill AskUserQuestion
4
+ allowed-tools: Read Write Edit Bash Glob Grep maestro
5
5
  ---
6
6
 
7
7
  <purpose>
@@ -191,7 +191,7 @@ S_APPLY_VERDICT:
191
191
  GUARD: confidence_score < 60 AND proceed → override to fix
192
192
  GUARD: confidence_score > 95 AND fix AND retry > 0 → suggest proceed
193
193
  GUARD: auto_confirm → skip user prompt, apply adjusted verdict
194
- GUARD: not auto_confirm → AskUserQuestion with override options
194
+ GUARD: not auto_confirm → user prompt with override options
195
195
  GUARD: post-reground + drifted + confidence >= 60 → A_REGROUND_HALT(auto_confirm 不跳过)
196
196
 
197
197
  S_HANDLE_FAIL:
@@ -221,7 +221,7 @@ S_SESSION_DONE:
221
221
  | 3 | 未派生 → 取最新 in-progress artifact 的 phase | false |
222
222
  | 4 | 仍无 → state.json 首个 incomplete phase | false |
223
223
  | 5 | position 将是 brainstorm/blueprint/init/roadmap/analyze-macro → phase = null | n/a |
224
- | 6 | 仍模糊 → `AskUserQuestion` | 由用户回答确定 |
224
+ | 6 | 仍模糊 → `user prompt` | 由用户回答确定 |
225
225
 
226
226
  **D-007 Phase→Milestone 反查**(数字 phase 已解析时):
227
227
  ```
@@ -335,9 +335,9 @@ wants_roadmap = (--roadmap flag)
335
335
  | intent 显式指定 phase 编号(如 "phase 2"、"P3") | `independent` | 用户明确针对单个 phase |
336
336
  | milestone 仅含 1 个 phase(读 state.json) | `independent` | 统一无意义 |
337
337
  | milestone 含多个 phase + `auto_confirm` | `unified` | 自动模式倾向高效 |
338
- | milestone 含多个 phase + 非 `auto_confirm` | → AskUserQuestion | 征询用户选择 |
338
+ | milestone 含多个 phase + 非 `auto_confirm` | → user prompt | 征询用户选择 |
339
339
 
340
- **AskUserQuestion** (仅当 milestone 含 ≥2 phase 且非 auto_confirm):
340
+ **user prompt** (仅当 milestone 含 ≥2 phase 且非 auto_confirm):
341
341
 
342
342
  ```
343
343
  question: "当前里程碑含 {N} 个 phase,选择规划模式?"
@@ -364,7 +364,7 @@ Runs once before chain build; additive to status.json. 设 `session.decompositio
364
364
  | named single file/function/bug, "fix X", "add Y to Z" | narrow | skip — auto-derive |
365
365
  | otherwise | medium | clarify unless auto_confirm |
366
366
 
367
- **2. Clarify boundary** (broad/medium) — `AskUserQuestion`, ≤3 rounds, options pre-filled from intent + a quick Glob/Grep scan of the target module:
367
+ **2. Clarify boundary** (broad/medium) — `user prompt`, ≤3 rounds, options pre-filled from intent + a quick Glob/Grep scan of the target module:
368
368
 
369
369
  | Round | Question | Drives |
370
370
  |-------|----------|--------|
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-ralph-cli-execute
3
3
  description: "Skill execution wrapper for delegate — execute skill, return structured result Arguments: --session <id> | <skill-name> [args...]"
4
- allowed-tools: Read Write Edit Bash Glob Grep Skill AskUserQuestion
4
+ allowed-tools: Read Write Edit Bash Glob Grep maestro
5
5
  ---
6
6
 
7
7
  <purpose>
@@ -73,7 +73,7 @@ S_OUTPUT → END DO: A_OUTPUT_RESULT
73
73
  - Exit 1 → required_reading 缺失或 schema 错误 → set `status = "BLOCKED"`, skip to S_OUTPUT, SUMMARY 引用 CLI stderr
74
74
  - Exit 2 → 无 pending step(已全部完成)→ set `status = "DONE"`, SUMMARY = "所有 step 已完成", skip to S_OUTPUT
75
75
  - Exit 3 → active_step_index 冲突(另一进程占用)→ set `status = "BLOCKED"`, SUMMARY = "并发冲突", skip to S_OUTPUT
76
- 2. If no session → `Skill({ skill: skill_name, args: skill_args })` — direct skill call
76
+ 2. If no session → `invoke /skill: skill_name, args: skill_args })` — direct skill call
77
77
  3. **Goal context**: `ralph next` CLI 输出的 session_anchor 已含 goal context(`ralph_protocol_version >= "2"`),无需额外注入
78
78
  4. **Deferred reading**: `ralph next` 将 `<deferred_reading>` 路径记录到 `step.load.deferred_files`,执行阶段按需 Read
79
79
  5. **Inline execution** — 按 stdout 内容执行 skill 逻辑;执行完成后进入 S_SCAN
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-ralph-execute
3
3
  description: "Execute next pending step in ralph session Arguments: [-y] [session-id]"
4
- allowed-tools: Read Write Edit Bash Glob Grep Skill
4
+ allowed-tools: Read Write Edit Bash Glob Grep maestro
5
5
  ---
6
6
 
7
7
  <purpose>
@@ -31,7 +31,7 @@ Also read `session.auto_mode` from status.json — if true, treat as `-y`.
31
31
 
32
32
  HARD RULES:
33
33
  - 执行 step:**统一通过 `maestro ralph next` CLI 加载**。CLI 负责读 command_path、解析 `<required_reading>` + `<deferred_reading>`、拼接 prompt、写 `step.load.*` + `active_step_index` + `step.status="running"`。不要再在会话里手动 Read + 解析 required_reading
34
- - decision step:A_EXEC_DECISION 通过 `Skill({ skill: "maestro-ralph" })` handoff 给 ralph 评估(不走 CLI)
34
+ - decision step:A_EXEC_DECISION 通过 `invoke /skill: "maestro-ralph" })` handoff 给 ralph 评估(不走 CLI)
35
35
  - `command_path` 由 ralph 在 A_BUILD_STEPS 写入 status.json(缺失 → ralph next 返回 E006/E007 并拒绝执行)
36
36
  - 每个 step 结束必须调用 `maestro ralph complete N --status <S>` 或 `maestro ralph retry N`。STATUS 仅 4 个合法值:`DONE | DONE_WITH_CONCERNS | NEEDS_RETRY | BLOCKED`(**`NEEDS_CONTEXT` 已废除**,context 容量由 harness 自动压缩处理)
37
37
  </context>
@@ -203,7 +203,7 @@ Write enriched args + source_artifact_ref back to status.json.
203
203
 
204
204
  1. Mark step running, write status.json
205
205
  2. Display: `[{index}/{total}] ◆ {step.decision} Retry: {retry}/{max}`
206
- 3. `Skill({ skill: "maestro-ralph" })` — ralph 评估 + handoff
206
+ 3. `invoke /skill: "maestro-ralph" })` — ralph 评估 + handoff
207
207
  4. 执行在此结束
208
208
 
209
209
  ### A_EXEC_STEP
@@ -271,7 +271,7 @@ Write enriched args + source_artifact_ref back to status.json.
271
271
 
272
272
  6. **Propagate context signals** — 按 4c checklist 将关键信号写入 `status.json.context`
273
273
 
274
- 完成后 S_LOCATE 触发 `Skill({ skill: "maestro-ralph-execute" })` 自调用。
274
+ 完成后 S_LOCATE 触发 `invoke /skill: "maestro-ralph-execute" })` 自调用。
275
275
 
276
276
  ### A_POST_ANALYZE_DRIFT
277
277
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-ralph-v2
3
3
  description: "[RECOMMENDED] Adaptive lifecycle orchestrator — compose, dispatch ralph-executor agent, evaluate decision, loop Arguments: <intent> [-y] [--amend [change]] [--roadmap] | status | continue"
4
- allowed-tools: Read Write Edit Bash Glob Grep Skill AskUserQuestion Agent SendMessage
4
+ allowed-tools: Read Write Edit Bash Glob Grep teammate maestro
5
5
  ---
6
6
 
7
7
  <purpose>
@@ -10,9 +10,8 @@ Adaptive lifecycle orchestrator: locate step → resolve args → load context
10
10
  Session: `.workflow/.maestro/ralph-v2-{YYYYMMDD-HHmmss}/status.json`
11
11
  </purpose>
12
12
 
13
- <deferred_reading>
14
- - [ralph-amend-goal.md](~/.maestro/workflows/ralph-amend-goal.md) — read when `--amend` flag active for goal amendment flow
15
- </deferred_reading>
13
+ > **Reference files** (read when needed):
14
+ > - [ralph-amend-goal.md](~/.pi/agent/packages/pi-maestro-flow/workflows/ralph-amend-goal.md) — read when `--amend` flag active for goal amendment flow
16
15
 
17
16
  <context>
18
17
  $ARGUMENTS — intent text, flags, or keywords.
@@ -180,7 +179,7 @@ S_APPLY_VERDICT:
180
179
  GUARD: confidence_score < 60 AND proceed → override to fix
181
180
  GUARD: confidence_score > 95 AND fix AND retry > 0 → suggest proceed
182
181
  GUARD: auto_confirm → skip user prompt, apply adjusted verdict
183
- GUARD: not auto_confirm → AskUserQuestion with override options
182
+ GUARD: not auto_confirm → user prompt with override options
184
183
  GUARD: post-reground + drifted + confidence >= 60 → A_REGROUND_HALT(auto_confirm 不跳过)
185
184
 
186
185
  S_HANDLE_FAIL:
@@ -210,7 +209,7 @@ S_SESSION_DONE:
210
209
  | 3 | 未派生 → 取最新 in-progress artifact 的 phase | false |
211
210
  | 4 | 仍无 → state.json 首个 incomplete phase | false |
212
211
  | 5 | position 将是 brainstorm/blueprint/init/roadmap/analyze-macro → phase = null | n/a |
213
- | 6 | 仍模糊 → `AskUserQuestion` | 由用户回答确定 |
212
+ | 6 | 仍模糊 → `user prompt` | 由用户回答确定 |
214
213
 
215
214
  **D-007 Phase→Milestone 反查**(数字 phase 已解析时):
216
215
  ```
@@ -324,9 +323,9 @@ wants_roadmap = (--roadmap flag)
324
323
  | intent 显式指定 phase 编号(如 "phase 2"、"P3") | `independent` | 用户明确针对单个 phase |
325
324
  | milestone 仅含 1 个 phase(读 state.json) | `independent` | 统一无意义 |
326
325
  | milestone 含多个 phase + `auto_confirm` | `unified` | 自动模式倾向高效 |
327
- | milestone 含多个 phase + 非 `auto_confirm` | → AskUserQuestion | 征询用户选择 |
326
+ | milestone 含多个 phase + 非 `auto_confirm` | → user prompt | 征询用户选择 |
328
327
 
329
- **AskUserQuestion** (仅当 milestone 含 ≥2 phase 且非 auto_confirm):
328
+ **user prompt** (仅当 milestone 含 ≥2 phase 且非 auto_confirm):
330
329
 
331
330
  ```
332
331
  question: "当前里程碑含 {N} 个 phase,选择规划模式?"
@@ -353,7 +352,7 @@ Runs once before chain build; additive to status.json. 设 `session.decompositio
353
352
  | named single file/function/bug, "fix X", "add Y to Z" | narrow | skip — auto-derive |
354
353
  | otherwise | medium | clarify unless auto_confirm |
355
354
 
356
- **2. Clarify boundary** (broad/medium) — `AskUserQuestion`, ≤3 rounds, options pre-filled from intent + a quick Glob/Grep scan of the target module:
355
+ **2. Clarify boundary** (broad/medium) — `user prompt`, ≤3 rounds, options pre-filled from intent + a quick Glob/Grep scan of the target module:
357
356
 
358
357
  | Round | Question | Drives |
359
358
  |-------|----------|--------|
@@ -571,7 +570,7 @@ Execution criteria: {session.execution_criteria joined by '; '}
571
570
  > 执行 Agent 不传 name,结果通过 task-notification `<result>` 自动回传主流程。executor 内部编排也用 unnamed Agent(子结果自动回流 executor,嵌套套娃模型)。
572
571
 
573
572
  ```
574
- Agent({
573
+ teammate({
575
574
  subagent_type: "ralph-executor",
576
575
  description: "执行 step {index}: {step.skill} [{resolved_agent_name}]",
577
576
  prompt: `Session: {session_id}
@@ -739,7 +738,7 @@ Agent({
739
738
  **Mode: `agent`(默认)** — 同步 Agent 评估:
740
739
 
741
740
  ```
742
- Agent({
741
+ teammate({
743
742
  description: "评估 {decision} 质量门(同步评估 Agent,不传 name)",
744
743
  prompt: "PURPOSE: 评估 {decision} 质量门结果
745
744
  TASK: 读取以下结果文件 | 分析状态 | 评估严重性 | 给出建议
@@ -803,7 +802,7 @@ Bash({
803
802
  1. Read `session.task_decomposition` from status.json
804
803
  2. Dispatch audit(按 `evaluate_via` 模式,默认 `agent`):
805
804
  ```
806
- Agent({
805
+ teammate({
807
806
  description: "审计子目标完成情况(同步评估 Agent,不传 name)",
808
807
  prompt: "PURPOSE: 审计未完成子目标,判定 met / unmet
809
808
  TASK:
@@ -839,7 +838,7 @@ Bash({
839
838
  1. Read status.json:intent, boundary_contract, completed steps, done goals
840
839
  2. Dispatch reground(按 `evaluate_via` 模式,默认 `agent`):
841
840
  ```
842
- Agent({
841
+ teammate({
843
842
  description: "意图保真检查(同步评估 Agent,不传 name)",
844
843
  prompt: "PURPOSE: 意图保真检查 — 对照 intent 验证累积执行是否漂移
845
844
  TASK:
@@ -905,7 +904,7 @@ Bash({
905
904
 
906
905
  1. 路径 A(`large` 且 `wants_roadmap`):保持 roadmap+analyze,`plan` 选 phase 列
907
906
  2. 路径 B(`medium`/`small`,或 `large` 非 `wants_roadmap`):删除未完成的 `roadmap` + `analyze` step,`plan` 改为 `--from analyze:{ANL_ID}`
908
- 3. 路径 C(`unknown`):非 auto_confirm → AskUserQuestion;auto_confirm → 默认路径 B
907
+ 3. 路径 C(`unknown`):非 auto_confirm → user prompt;auto_confirm → 默认路径 B
909
908
  4. Reindex steps,标 decision completed
910
909
 
911
910
  ### A_APPLY_GOAL_FIX / A_APPLY_GOAL_DONE
@@ -931,14 +930,14 @@ Bash({
931
930
  | Phase | 行为 | 产出 |
932
931
  |-------|------|------|
933
932
  | 1. 快照 | 读 `task_decomposition` + `boundary_contract` + 已完成 steps 的 `completion_summary` | Display: 目标列表 + 进度 |
934
- | 2. 解析 | `change_request` 非空 → 直接用;为空 → AskUserQuestion(修改/新增/移除/调整边界) | `change_type` + `change_request` |
933
+ | 2. 解析 | `change_request` 非空 → 直接用;为空 → user prompt(修改/新增/移除/调整边界) | `change_type` + `change_request` |
935
934
  | 3. Mini Grill | Agent 评估影响 | RISK_LEVEL + AFFECTED_GOALS + INVALIDATED_STEPS + NEW_GAPS |
936
- | 4. 确认 | AskUserQuestion:应用并继续 / 仅改目标 / 取消 | 用户选择 |
935
+ | 4. 确认 | user prompt:应用并继续 / 仅改目标 / 取消 | 用户选择 |
937
936
  | 5. 应用 | 归档旧目标(`superseded`)→ 写入新目标(`origin: CHG-xxx`)→ 重建链路 → write status.json | re-dispatch |
938
937
 
939
938
  **Phase 3 Agent prompt:**
940
939
  ```
941
- Agent({
940
+ teammate({
942
941
  description: "Amend impact analysis(同步评估 Agent,不传 name)",
943
942
  prompt: "PURPOSE: 评估目标修改对 running session 的影响
944
943
  TASK:
@@ -962,7 +961,7 @@ CONSTRAINTS: 只评估不修改文件"
962
961
  })
963
962
  ```
964
963
 
965
- GUARD: `RISK_LEVEL == high` → AskUserQuestion 不跳过(auto_confirm 无效)
964
+ GUARD: `RISK_LEVEL == high` → user prompt 不跳过(auto_confirm 无效)
966
965
  GUARD: 已完成(`status: "done"`)的目标不可 supersede(skip + warn)
967
966
  旧目标标 `superseded`(`superseded_by` + `superseded_at`),新目标标 `origin: "CHG-xxx"`。`goal_changelog` 含完整 `before/after` + `impact_assessment`。
968
967
 
@@ -1163,7 +1162,7 @@ E001–E006, W001–W004 适用。Agent 新增:
1163
1162
  ### Success Criteria
1164
1163
 
1165
1164
  - [ ] ralph-v2 owns full step loop: locate → resolve → dispatch → wait task-notification → extract → drift → complete → next
1166
- - [ ] One agent per step — `Agent({ subagent_type: "ralph-executor" })` 每步派发一个 unnamed executor
1165
+ - [ ] One agent per step — `teammate({ subagent_type: "ralph-executor" })` 每步派发一个 unnamed executor
1167
1166
  - [ ] Executor 内调 `maestro ralph next` 获取 skill prompt 并执行,内部编排用 unnamed Agent(子结果回流 executor)
1168
1167
  - [ ] Executor 结果通过 task-notification `<result>` 自动回传主流程
1169
1168
  - [ ] 主流程调 `maestro ralph complete` 上报(非 agent 上报)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-roadmap
3
3
  description: "Generate roadmap with milestone/phase structure from requirements or upstream context Arguments: <requirement> [-y] [-c] [-m progressive|direct|auto] [--from <source>] [--from-brainstorm SESSION-ID] [--revise [instructions]] [--review]"
4
- allowed-tools: Read Write Edit Bash Glob Grep Agent AskUserQuestion
4
+ allowed-tools: Read Write Edit Bash Glob Grep teammate maestro
5
5
  ---
6
6
 
7
7
  <purpose>
@@ -11,13 +11,12 @@ Pipeline: brainstorm/blueprint/analyze → **roadmap** → analyze {milestone}
11
11
  </purpose>
12
12
 
13
13
  <required_reading>
14
- @~/.maestro/workflows/roadmap-common.md
15
- @~/.maestro/templates/roadmap.md
14
+ Read and follow `~/.pi/agent/packages/pi-maestro-flow/workflows/roadmap-common.md`.
15
+ @~/.pi/agent/packages/pi-maestro-flow/templates/roadmap.md
16
16
  </required_reading>
17
17
 
18
- <deferred_reading>
19
- - [roadmap.md](~/.maestro/workflows/roadmap.md) — read for roadmap generation workflow
20
- </deferred_reading>
18
+ > **Reference files** (read when needed):
19
+ > - [roadmap.md](~/.pi/agent/packages/pi-maestro-flow/workflows/roadmap.md) — read for roadmap generation workflow
21
20
 
22
21
  <context>
23
22
  $ARGUMENTS -- requirement text, @file reference, or upstream context source.
@@ -48,7 +47,7 @@ $ARGUMENTS -- requirement text, @file reference, or upstream context source.
48
47
  </context>
49
48
 
50
49
  <interview_protocol>
51
- Follows @~/.maestro/workflows/interview-mechanics.md standard.
50
+ Follows `~/.pi/agent/packages/pi-maestro-flow/workflows/interview-mechanics.md` standard.
52
51
 
53
52
  **Interaction mode**: convergent menu-driven
54
53
  **Decision tree** (strict order): mode (create / revise / review) → requirement scope (MVP / complete / phased) → decomposition strategy (progressive / direct / auto) → milestone boundaries → phase dependencies and order
@@ -60,8 +59,8 @@ Follows @~/.maestro/workflows/interview-mechanics.md standard.
60
59
 
61
60
  <execution>
62
61
 
63
- 1. Read `@~/.maestro/workflows/roadmap-common.md` (always — shared logic)
64
- 2. Read `@~/.maestro/workflows/roadmap.md`, follow its process
62
+ 1. Read `@~/.pi/agent/packages/pi-maestro-flow/workflows/roadmap-common.md` (always — shared logic)
63
+ 2. Read `@~/.pi/agent/packages/pi-maestro-flow/workflows/roadmap.md`, follow its process
65
64
 
66
65
  Sub-modes:
67
66
  - **Create** (default): Build roadmap from requirements or upstream context
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-swarm-workflow
3
3
  description: "Parallel workflow accelerator — route intent to fixed Workflow scripts for multi-agent concurrent execution Arguments: <intent> [--script <name>] [--dims <d1,d2>] [--roles <r1,r2>] [--count N] [--tier quick|standard] [--resume <runId>]"
4
- allowed-tools: Read Write Edit Bash Glob Grep Workflow AskUserQuestion
4
+ allowed-tools: Read Write Edit Bash Glob Grep Workflow maestro
5
5
  ---
6
6
 
7
7
  <purpose>
@@ -23,7 +23,7 @@ $ARGUMENTS — intent text with optional flags.
23
23
  Remaining → intent
24
24
  ```
25
25
 
26
- **Script inventory** (`~/.maestro/workflows/swarm/`):
26
+ **Script inventory** (`~/.pi/agent/packages/pi-maestro-flow/workflows/swarm/`):
27
27
 
28
28
  | Script | args 接口 |
29
29
  |--------|-----------|
@@ -36,7 +36,7 @@ Remaining → intent
36
36
  | `wf-execute` | `{ plan_dir, specs?, codebase_context?, wiki_context?, auto_commit? }` |
37
37
  | `wf-milestone-audit` | `{ milestone?, is_adhoc? }` |
38
38
 
39
- **Output boundary**: ALL file writes MUST target `.workflow/scratch/{YYYYMMDD}-swarm-{script}-{slug}/` (results, ralph-compatible artifacts). When inside a ralph session, writes target the corresponding step's scratch directory. NEVER modify source code, workflow scripts (`~/.maestro/workflows/swarm/`), or `.claude/commands/` files.
39
+ **Output boundary**: ALL file writes MUST target `.workflow/scratch/{YYYYMMDD}-swarm-{script}-{slug}/` (results, ralph-compatible artifacts). When inside a ralph session, writes target the corresponding step's scratch directory. NEVER modify source code, workflow scripts (`~/.pi/agent/packages/pi-maestro-flow/workflows/swarm/`), or `.claude/commands/` files.
40
40
  </context>
41
41
 
42
42
  <state_machine>
@@ -58,7 +58,7 @@ S_PARSE:
58
58
 
59
59
  S_ROUTE:
60
60
  → S_CONTEXT WHEN: script resolved DO: A_ROUTE_SCRIPT
61
- → S_FALLBACK WHEN: ambiguous intent DO: AskUserQuestion
61
+ → S_FALLBACK WHEN: ambiguous intent DO: user prompt
62
62
 
63
63
  S_CONTEXT:
64
64
  → S_DISPATCH DO: A_ASSEMBLE_CONTEXT
@@ -101,7 +101,7 @@ Intent-to-script routing(按关键词匹配,--script 优先级最高)。
101
101
  | 7 | 头脑风暴 / brainstorm / 方案 / 评估 / evaluate / 多角度 | `wf-brainstorm` |
102
102
  | 8 | 分析 / analyze / 探索 / explore / 架构 / architecture / 复杂度 / 风险 | `wf-analyze` |
103
103
 
104
- **Disambiguation**: 多命中(同一优先级内多个关键词匹配不同脚本)→ AskUserQuestion 让用户选择。跨优先级命中取高优先级。
104
+ **Disambiguation**: 多命中(同一优先级内多个关键词匹配不同脚本)→ user prompt 让用户选择。跨优先级命中取高优先级。
105
105
 
106
106
  ### A_ASSEMBLE_CONTEXT
107
107
 
@@ -134,7 +134,7 @@ Intent-to-script routing(按关键词匹配,--script 优先级最高)。
134
134
 
135
135
  ### A_DISPATCH_WORKFLOW
136
136
 
137
- 1. 确定 scriptPath = `~/.maestro/workflows/swarm/{script}.js`(展开为绝对路径)
137
+ 1. 确定 scriptPath = `~/.pi/agent/packages/pi-maestro-flow/workflows/swarm/{script}.js`(展开为绝对路径)
138
138
  2. 构建 Workflow 调用:
139
139
  ```
140
140
  Workflow({
@@ -186,7 +186,7 @@ Workflow 返回 JSON 后:
186
186
  2. **args 预编译** — 所有 FS 读取在 A_ASSEMBLE_CONTEXT 完成,脚本内 agent 通过工具自行读取补充
187
187
  3. **产出格式兼容** — 写入的 artifact 格式必须与对应命令(analyze/brainstorm/review/verify)的产出一致
188
188
  4. **resume 透传** — resumeFromRunId 直接透传给 Workflow 工具,利用内置缓存机制
189
- 5. **脚本只读** — 路由命令不修改 `~/.maestro/workflows/swarm/wf-*.js` 脚本文件
189
+ 5. **脚本只读** — 路由命令不修改 `~/.pi/agent/packages/pi-maestro-flow/workflows/swarm/wf-*.js` 脚本文件
190
190
  6. **结果必须展示** — Workflow 返回后必须向用户展示格式化摘要,不得静默完成
191
191
  </invariants>
192
192
 
@@ -204,7 +204,7 @@ Workflow 返回 JSON 后:
204
204
 
205
205
  **GATE 3: Context → Dispatch**
206
206
  - REQUIRED: Args payload assembled with all required fields for target script.
207
- - REQUIRED: Script file exists at `~/.maestro/workflows/swarm/{script}.js`.
207
+ - REQUIRED: Script file exists at `~/.pi/agent/packages/pi-maestro-flow/workflows/swarm/{script}.js`.
208
208
  - BLOCKED if: script file not found (E003) or required args missing.
209
209
 
210
210
  **GATE 4: Dispatch → Ingest**
@@ -264,7 +264,7 @@ ralph-execute 正常通过 `maestro ralph next` 加载并执行,swarm-workflow
264
264
  | Code | Description | Recovery |
265
265
  |------|-------------|----------|
266
266
  | E001 | No intent and no --script | Prompt for intent |
267
- | E002 | Ambiguous routing | AskUserQuestion |
267
+ | E002 | Ambiguous routing | user prompt |
268
268
  | E003 | Script file not found | Check .claude/workflows/ |
269
269
  | E004 | Workflow execution failed | Show error, suggest --resume |
270
270
  | E005 | Result ingestion failed | Write raw JSON to scratch |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-tools-execute
3
3
  description: "Load and execute tool specs by category or name Arguments: [<tool-name> | --category <category>] [--list]"
4
- allowed-tools: Read Write Edit Bash Glob Grep AskUserQuestion Agent
4
+ allowed-tools: Read Write Edit Bash Glob Grep teammate maestro
5
5
  ---
6
6
 
7
7
  <purpose>
@@ -9,9 +9,7 @@ Load registered tool documents and execute them step-by-step.
9
9
  Direct (by name) or category-based (list + select) invocation.
10
10
  </purpose>
11
11
 
12
- <required_reading>
13
- @~/.maestro/workflows/tools-spec.md
14
- </required_reading>
12
+ > **Required**: Read `~/.pi/agent/packages/pi-maestro-flow/workflows/tools-spec.md` before proceeding.
15
13
 
16
14
  <context>
17
15
  $ARGUMENTS — Tool name, keyword, or --category filter
@@ -28,7 +26,7 @@ Empty arguments enters interactive mode: list all tools for user selection.
28
26
  </context>
29
27
 
30
28
  <invariants>
31
- 1. **Confirmation before execution** — MUST AskUserQuestion before executing tool steps; NEVER auto-execute without user consent
29
+ 1. **Confirmation before execution** — MUST user prompt before executing tool steps; NEVER auto-execute without user consent
32
30
  2. **Sequential step execution** — steps MUST be executed in defined order; NEVER skip or reorder steps unless user explicitly requests skip
33
31
  3. **Blocker escalation** — step failure MUST be reported to user with retry/skip/abort options; NEVER silently skip failed steps
34
32
  4. **Read-only tool definition** — tool execution MUST NOT modify the tool's knowhow document or spec entry; only the target codebase is modified per tool steps
@@ -73,7 +71,7 @@ maestro load --type spec --category <category>
73
71
  Extract tool entries from the "Available Tools" section in output.
74
72
 
75
73
  **Empty args**:
76
- Load all categories, collect tool entries, present to user with AskUserQuestion for selection.
74
+ Load all categories, collect tool entries, present to user with user prompt for selection.
77
75
 
78
76
  ### Step 2: Display Tool
79
77
 
@@ -104,7 +102,7 @@ Follow the tool definition steps in order:
104
102
 
105
103
  **Blocker handling**:
106
104
  - Step fails → report error, ask user: retry / skip / abort
107
- - Needs user input → AskUserQuestion for parameters
105
+ - Needs user input → user prompt for parameters
108
106
  - Prerequisites unmet → show missing items, ask how to proceed
109
107
 
110
108
  ### Step 5: Report Results
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: maestro-tools-register
3
3
  description: "Register tool specs - extract, generate, or optimize Arguments: [<description>] [--extract <path>] [--optimize <name>]"
4
- allowed-tools: Read Write Edit Bash Glob Grep AskUserQuestion Agent
4
+ allowed-tools: Read Write Edit Bash Glob Grep teammate maestro
5
5
  ---
6
6
 
7
7
  <purpose>
@@ -9,9 +9,7 @@ Codify reusable business processes as knowhow documents with `tool: true` in `.w
9
9
  Four modes: Extract, Generate, Optimize, Promote. Short processes inline; long use ref mode.
10
10
  </purpose>
11
11
 
12
- <required_reading>
13
- @~/.maestro/workflows/tools-spec.md
14
- </required_reading>
12
+ > **Required**: Read `~/.pi/agent/packages/pi-maestro-flow/workflows/tools-spec.md` before proceeding.
15
13
 
16
14
  <context>
17
15
  $ARGUMENTS — Intent description
@@ -31,7 +29,7 @@ $ARGUMENTS — Intent description
31
29
  1. **Schema validation** — tool knowhow document MUST include `tool: true`, `category`, `keywords`, and `summary` in YAML frontmatter; missing fields → reject write
32
30
  2. **No duplicate names** — tool title MUST be unique within its category; duplicate detection → E002 warning with overwrite/optimize confirmation
33
31
  3. **Category required** — every tool MUST declare exactly one category from: coding, test, review, arch, debug; empty category → E003
34
- 4. **Confirmation gate** — MUST AskUserQuestion before writing knowhow document and spec ref entry; NEVER persist without user confirmation
32
+ 4. **Confirmation gate** — MUST user prompt before writing knowhow document and spec ref entry; NEVER persist without user confirmation
35
33
  5. **Promote is in-place** — promote mode MUST update existing knowhow frontmatter via `maestro wiki update`; NEVER recreate the document
36
34
  6. **Output boundary** — ALL file writes MUST target .workflow/knowhow/ (tool documents) and .workflow/specs/ (ref entries via maestro spec add) only. NEVER modify source code or files outside these paths
37
35
  7. **Description format** — first line after `### Title` MUST state "Use when ..." (usage timing); this is critical for ref entry summary visibility in spec-load
@@ -44,7 +42,7 @@ $ARGUMENTS — Intent description
44
42
  **GATE 1: Parse → Gather**
45
43
  - REQUIRED: Mode determined (extract/generate/optimize/promote) from argument parsing.
46
44
  - REQUIRED: For optimize/promote modes, target tool/document exists and is loadable.
47
- - BLOCKED if: empty args without user response to AskUserQuestion.
45
+ - BLOCKED if: empty args without user response to user prompt.
48
46
 
49
47
  **GATE 2: Gather → Write**
50
48
  - REQUIRED: Tool name, category, and usage timing confirmed.
@@ -65,7 +63,7 @@ Parse $ARGUMENTS to determine mode:
65
63
  - Contains "optimize/improve" → optimize mode
66
64
  - Contains "promote" or references existing knowhow doc (path/ID) → promote mode
67
65
  - Other → generate mode
68
- - Empty → ask user with AskUserQuestion
66
+ - Empty → ask user with user prompt
69
67
 
70
68
  ### Step 2: Gather Information
71
69
 
@@ -75,7 +73,7 @@ Parse $ARGUMENTS to determine mode:
75
73
 
76
74
  **Generate mode**:
77
75
  - Confirm tool name, applicable roles, target scenario
78
- - If unclear, ask user with AskUserQuestion
76
+ - If unclear, ask user with user prompt
79
77
 
80
78
  **Optimize mode**:
81
79
  - Load existing tool: `maestro search "<name>" --type knowhow` → `maestro load --type knowhow --id <id>`
@@ -121,7 +119,7 @@ Use when {timing/trigger condition}.
121
119
  1. Step one ...
122
120
  ```
123
121
 
124
- **Confirm before writing** — Use `AskUserQuestion` to show the user the planned knowhow document (title, category, keywords, summary, step count) and spec ref entry before persisting:
122
+ **Confirm before writing** — Use `user prompt` to show the user the planned knowhow document (title, category, keywords, summary, step count) and spec ref entry before persisting:
125
123
 
126
124
  ```
127
125
  question: "确认写入以下 knowhow 工具文档?"