pi-maestro-flow 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -72
- package/agents/cross-role-reviewer.md +1 -1
- package/agents/impeccable-agent.md +1 -1
- package/agents/ralph-executor.md +1 -1
- package/agents/team-worker.md +1 -1
- package/agents/workflow-analyzer.md +1 -1
- package/agents/workflow-codebase-mapper.md +1 -1
- package/agents/workflow-collab-planner.md +1 -1
- package/agents/workflow-debugger.md +1 -1
- package/agents/workflow-executor.md +1 -1
- package/agents/workflow-integration-checker.md +1 -1
- package/agents/workflow-nyquist-auditor.md +1 -1
- package/agents/workflow-phase-researcher.md +1 -1
- package/agents/workflow-planner.md +1 -1
- package/agents/workflow-project-researcher.md +1 -1
- package/agents/workflow-reviewer.md +1 -1
- package/agents/workflow-verifier.md +1 -1
- package/package.json +18 -4
- package/skills/codify-to-knowhow/SKILL.md +1 -1
- package/skills/delegation-check/SKILL.md +1 -1
- package/skills/domain-add/SKILL.md +5 -5
- package/skills/insight-challenge/SKILL.md +1 -1
- package/skills/learn-decompose/SKILL.md +4 -4
- package/skills/learn-follow/SKILL.md +5 -5
- package/skills/learn-investigate/SKILL.md +5 -5
- package/skills/learn-second-opinion/SKILL.md +5 -5
- package/skills/maestro/SKILL.md +8 -8
- package/skills/maestro-amend/SKILL.md +4 -4
- package/skills/maestro-analyze/SKILL.md +9 -9
- package/skills/maestro-blueprint/SKILL.md +7 -7
- package/skills/maestro-brainstorm/SKILL.md +10 -10
- package/skills/maestro-collab/SKILL.md +4 -4
- package/skills/maestro-companion/SKILL.md +3 -3
- package/skills/maestro-composer/SKILL.md +10 -10
- package/skills/maestro-execute/SKILL.md +8 -8
- package/skills/maestro-fork/SKILL.md +7 -7
- package/skills/maestro-grill/SKILL.md +12 -12
- package/skills/maestro-guard/SKILL.md +5 -5
- package/skills/maestro-help/SKILL.md +3 -3
- package/skills/maestro-impeccable/SKILL.md +7 -7
- package/skills/maestro-init/SKILL.md +8 -8
- package/skills/maestro-merge/SKILL.md +6 -6
- package/skills/maestro-milestone-audit/SKILL.md +3 -3
- package/skills/maestro-milestone-complete/SKILL.md +8 -8
- package/skills/maestro-milestone-release/SKILL.md +9 -9
- package/skills/maestro-next/SKILL.md +5 -5
- package/skills/maestro-overlay/SKILL.md +19 -19
- package/skills/maestro-plan/SKILL.md +8 -8
- package/skills/maestro-player/SKILL.md +5 -5
- package/skills/maestro-quick/SKILL.md +5 -5
- package/skills/maestro-ralph/SKILL.md +15 -15
- package/skills/maestro-ralph-cli/SKILL.md +6 -6
- package/skills/maestro-ralph-cli-execute/SKILL.md +2 -2
- package/skills/maestro-ralph-execute/SKILL.md +4 -4
- package/skills/maestro-ralph-v2/SKILL.md +17 -17
- package/skills/maestro-roadmap/SKILL.md +7 -7
- package/skills/maestro-swarm-workflow/SKILL.md +9 -9
- package/skills/maestro-tools-execute/SKILL.md +5 -5
- package/skills/maestro-tools-register/SKILL.md +7 -7
- package/skills/maestro-ui-codify/SKILL.md +8 -8
- package/skills/maestro-universal-workflow/SKILL.md +15 -15
- package/skills/maestro-update/SKILL.md +10 -10
- package/skills/manage-codebase-rebuild/SKILL.md +4 -4
- package/skills/manage-drift-realign/SKILL.md +7 -7
- package/skills/manage-harvest/SKILL.md +5 -5
- package/skills/manage-issue/SKILL.md +4 -4
- package/skills/manage-issue-discover/SKILL.md +7 -7
- package/skills/manage-kg-extractors/SKILL.md +3 -3
- package/skills/manage-knowhow/SKILL.md +3 -3
- package/skills/manage-knowhow-capture/SKILL.md +4 -4
- package/skills/manage-knowledge-audit/SKILL.md +5 -5
- package/skills/manage-status/SKILL.md +3 -3
- package/skills/manage-wiki/SKILL.md +5 -5
- package/skills/odyssey-debug/SKILL.md +13 -13
- package/skills/odyssey-improve/SKILL.md +15 -15
- package/skills/odyssey-planex/SKILL.md +16 -16
- package/skills/odyssey-review-test-fix/SKILL.md +11 -11
- package/skills/odyssey-ui/SKILL.md +10 -10
- package/skills/prompt-generator/SKILL.md +5 -5
- package/skills/quality-auto-test/SKILL.md +3 -3
- package/skills/quality-debug/SKILL.md +3 -3
- package/skills/quality-refactor/SKILL.md +3 -3
- package/skills/quality-retrospective/SKILL.md +9 -9
- package/skills/quality-review/SKILL.md +4 -4
- package/skills/quality-sync/SKILL.md +3 -3
- package/skills/quality-test/SKILL.md +4 -4
- package/skills/scholar-anti-ai-writing/SKILL.md +1 -1
- package/skills/scholar-citation-verify/SKILL.md +1 -1
- package/skills/scholar-experiment/SKILL.md +2 -2
- package/skills/scholar-ideation/SKILL.md +7 -7
- package/skills/scholar-latex-organizer/SKILL.md +1 -1
- package/skills/scholar-publish/SKILL.md +3 -3
- package/skills/scholar-rebuttal-pro/SKILL.md +3 -3
- package/skills/scholar-review/SKILL.md +1 -1
- package/skills/scholar-writing/SKILL.md +1 -1
- package/skills/security-audit/SKILL.md +2 -2
- package/skills/skill-generator/SKILL.md +3 -3
- package/skills/skill-iter-tune/SKILL.md +3 -3
- package/skills/skill-simplify/SKILL.md +1 -1
- package/skills/skill-tuning/SKILL.md +1 -1
- package/skills/spec-add/SKILL.md +5 -5
- package/skills/spec-load/SKILL.md +3 -3
- package/skills/spec-remove/SKILL.md +4 -4
- package/skills/spec-setup/SKILL.md +6 -6
- package/skills/team-adversarial-swarm/SKILL.md +5 -5
- package/skills/team-arch-opt/SKILL.md +2 -2
- package/skills/team-brainstorm/SKILL.md +3 -3
- package/skills/team-coordinate/SKILL.md +4 -4
- package/skills/team-designer/SKILL.md +1 -1
- package/skills/team-executor/SKILL.md +3 -3
- package/skills/team-frontend/SKILL.md +2 -2
- package/skills/team-frontend-debug/SKILL.md +3 -3
- package/skills/team-interactive-craft/SKILL.md +2 -2
- package/skills/team-issue/SKILL.md +3 -3
- package/skills/team-lifecycle-v4/SKILL.md +4 -4
- package/skills/team-motion-design/SKILL.md +2 -2
- package/skills/team-perf-opt/SKILL.md +3 -3
- package/skills/team-planex/SKILL.md +2 -2
- package/skills/team-quality-assurance/SKILL.md +3 -3
- package/skills/team-review/SKILL.md +3 -3
- package/skills/team-roadmap-dev/SKILL.md +3 -3
- package/skills/team-swarm/SKILL.md +4 -4
- package/skills/team-tech-debt/SKILL.md +2 -2
- package/skills/team-testing/SKILL.md +3 -3
- package/skills/team-ui-polish/SKILL.md +2 -2
- package/skills/team-uidesign/SKILL.md +2 -2
- package/skills/team-ultra-analyze/SKILL.md +4 -4
- package/skills/team-ux-improve/SKILL.md +3 -3
- package/skills/team-visual-a11y/SKILL.md +2 -2
- package/skills/workflow-skill-designer/SKILL.md +8 -8
- package/templates/business-test-report.json +68 -0
- package/templates/config.json +48 -0
- package/templates/context.md +16 -0
- package/templates/doc-index.json +11 -0
- package/templates/index.json +68 -0
- package/templates/issue.json +36 -0
- package/templates/plan.json +38 -0
- package/templates/project.md +60 -0
- package/templates/reflection-log.md +20 -0
- package/templates/roadmap.md +45 -0
- package/templates/scratch-index.json +19 -0
- package/templates/search-tool.json +1 -0
- package/templates/search-tools.md +47 -0
- package/templates/state.json +18 -0
- package/templates/task-summary.md +21 -0
- package/templates/task.json +89 -0
- package/templates/terminology-template.json +22 -0
- package/templates/uat.md +21 -0
- package/templates/validation.json +31 -0
- package/templates/verification.json +37 -0
- package/templates/workflow.md +14 -0
- package/templates/worktree-scope.json +9 -0
- package/templates/worktrees.json +26 -0
- package/workflows/agy-instructions.md +156 -0
- package/workflows/analyze.md +768 -0
- package/workflows/auto-test.md +705 -0
- package/workflows/blueprint.md +406 -0
- package/workflows/boundary-grill.md +50 -0
- package/workflows/brainstorm.md +508 -0
- package/workflows/business-test.md +574 -0
- package/workflows/chinese-response.md +25 -0
- package/workflows/claude-instructions.md +167 -0
- package/workflows/codebase-rebuild.md +267 -0
- package/workflows/codebase-refresh.md +168 -0
- package/workflows/codex-instructions.md +156 -0
- package/workflows/coding-philosophy.md +70 -0
- package/workflows/command-authoring.md +823 -0
- package/workflows/debug.md +409 -0
- package/workflows/delegate-usage.md +99 -0
- package/workflows/domain-add.md +121 -0
- package/workflows/drift-realign.md +396 -0
- package/workflows/execute.md +631 -0
- package/workflows/explore-usage.md +93 -0
- package/workflows/finish-work.md +124 -0
- package/workflows/fork.md +162 -0
- package/workflows/grill.md +494 -0
- package/workflows/harvest.md +478 -0
- package/workflows/impeccable.md +168 -0
- package/workflows/init.md +157 -0
- package/workflows/instruction-authoring-guide.md +97 -0
- package/workflows/integration-test.md +186 -0
- package/workflows/interview-mechanics.md +8 -0
- package/workflows/issue-analyze.md +20 -0
- package/workflows/issue-discover.md +238 -0
- package/workflows/issue-execute.md +110 -0
- package/workflows/issue-gaps-analyze.codex.md +256 -0
- package/workflows/issue-gaps-analyze.md +215 -0
- package/workflows/issue-plan.md +110 -0
- package/workflows/issue.md +338 -0
- package/workflows/knowhow.md +429 -0
- package/workflows/knowledge-audit.md +355 -0
- package/workflows/learn.md +271 -0
- package/workflows/maestro-chain-execute.md +20 -0
- package/workflows/maestro-link-coordinate.md +114 -0
- package/workflows/maestro-super.md +120 -0
- package/workflows/maestro.md +501 -0
- package/workflows/map.md +74 -0
- package/workflows/merge.md +122 -0
- package/workflows/milestone-audit.md +155 -0
- package/workflows/milestone-complete.md +167 -0
- package/workflows/milestone-release.md +82 -0
- package/workflows/odyssey-base-codex.md +305 -0
- package/workflows/odyssey-base.md +256 -0
- package/workflows/overlays.md +109 -0
- package/workflows/plan.md +520 -0
- package/workflows/quick.md +350 -0
- package/workflows/ralph-amend-goal.md +177 -0
- package/workflows/refactor.md +87 -0
- package/workflows/retrospective.md +471 -0
- package/workflows/review.md +448 -0
- package/workflows/roadmap-common.md +193 -0
- package/workflows/roadmap.md +106 -0
- package/workflows/shell-exec-protocol.md +30 -0
- package/workflows/skill-authoring.md +265 -0
- package/workflows/spec-generate.md +475 -0
- package/workflows/specs-add.md +123 -0
- package/workflows/specs-load.md +76 -0
- package/workflows/specs-remove.md +104 -0
- package/workflows/specs-setup.md +316 -0
- package/workflows/status.md +149 -0
- package/workflows/sync.md +116 -0
- package/workflows/tdd.md +255 -0
- package/workflows/test-gen.md +226 -0
- package/workflows/test.md +385 -0
- package/workflows/tools-spec.md +70 -0
- package/workflows/ui-codify-extract.md +372 -0
- package/workflows/ui-codify-knowhow.md +258 -0
- package/workflows/ui-codify-package.md +159 -0
- package/workflows/ui-codify.md +227 -0
- package/workflows/ui-design.md +393 -0
- package/workflows/ui-style.md +201 -0
- package/workflows/verify.md +557 -0
- package/workflows/wiki-connect.md +153 -0
- package/workflows/wiki-digest.md +180 -0
- package/workflows/wiki-manage.md +113 -0
|
@@ -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
|
|
4
|
+
allowed-tools: Read Write Edit Bash Glob Grep maestro
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<purpose>
|
|
@@ -10,7 +10,7 @@ Ralph builds/evaluates; ralph-execute runs steps. Session: `.workflow/.maestro/r
|
|
|
10
10
|
</purpose>
|
|
11
11
|
|
|
12
12
|
<deferred_reading>
|
|
13
|
-
- [ralph-amend-goal.md](~/.maestro/workflows/ralph-amend-goal.md) — read when `--amend` flag active for goal amendment flow
|
|
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
|
|
14
14
|
</deferred_reading>
|
|
15
15
|
|
|
16
16
|
<context>
|
|
@@ -46,7 +46,7 @@ Remaining → intent (amend_mode 时为 change_request)
|
|
|
46
46
|
12. **Invariant violation = BLOCK** — 违反上述任一 invariant 即阻断当前操作。不得以 "效率" 或 "意图明确" 为由绕过。特别是 invariant 1(ralph 不执行 step)和 invariant 6(completion_confirmed 由 CLI 写入)不可隐性违反。
|
|
47
47
|
13. **Delegate fallback 必须标记** — A_DELEGATE_EVALUATE 解析 verdict 失败时 fallback 为 "fix",但 MUST 在 decisions.ndjson 记录 `"parse_failed": true, "confidence_score": 0`,后续 step 继承 LOW CONFIDENCE 标记。
|
|
48
48
|
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 跳过
|
|
49
|
+
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
50
|
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
51
|
</invariants>
|
|
52
52
|
|
|
@@ -129,7 +129,7 @@ S_CONFIRM:
|
|
|
129
129
|
→ END WHEN: user selects "Cancel"
|
|
130
130
|
|
|
131
131
|
S_DISPATCH:
|
|
132
|
-
→ END DO:
|
|
132
|
+
→ END DO: invoke /skill: "maestro-ralph-execute" })
|
|
133
133
|
|
|
134
134
|
S_DECISION_EVAL: (decision 节点 == `step.decision` 非空,下述 gate 名取自该字段)
|
|
135
135
|
→ S_APPLY_VERDICT WHEN: quality-gate (post-execute, post-business-test, post-review, post-test, post-frontend-verify)
|
|
@@ -162,16 +162,16 @@ S_APPLY_VERDICT:
|
|
|
162
162
|
GUARD: confidence_score < 60 AND proceed → override to fix
|
|
163
163
|
GUARD: confidence_score > 95 AND fix AND retry > 0 → suggest proceed
|
|
164
164
|
GUARD: auto_confirm → skip user prompt, apply adjusted verdict
|
|
165
|
-
GUARD: not auto_confirm →
|
|
165
|
+
GUARD: not auto_confirm → user prompt with override options
|
|
166
166
|
GUARD: post-reground + drifted + confidence_score >= 60 → A_REGROUND_HALT(漂移熔断为安全门,auto_confirm 不跳过)
|
|
167
167
|
|
|
168
168
|
S_AMEND_GOAL:
|
|
169
169
|
→ S_DISPATCH WHEN: change applied + user confirmed DO: A_AMEND_GOAL
|
|
170
170
|
→ END WHEN: user cancels
|
|
171
|
-
GUARD: RISK_LEVEL=high → auto_confirm 无效,必须
|
|
171
|
+
GUARD: RISK_LEVEL=high → auto_confirm 无效,必须 user prompt
|
|
172
172
|
|
|
173
173
|
S_FALLBACK:
|
|
174
|
-
→ S_PARSE_ROUTE WHEN: user provides input DO:
|
|
174
|
+
→ S_PARSE_ROUTE WHEN: user provides input DO: user prompt
|
|
175
175
|
→ END WHEN: user cancels
|
|
176
176
|
|
|
177
177
|
</transitions>
|
|
@@ -203,7 +203,7 @@ S_FALLBACK:
|
|
|
203
203
|
| 3 | 未派生 → 取最新 in-progress artifact 的 phase | false |
|
|
204
204
|
| 4 | 仍无 → state.json 首个 incomplete phase | false |
|
|
205
205
|
| 5 | position 将是 brainstorm/blueprint/init/roadmap/analyze-macro → phase = null | n/a |
|
|
206
|
-
| 6 | 仍模糊 → `
|
|
206
|
+
| 6 | 仍模糊 → `user prompt` | 由用户回答确定 |
|
|
207
207
|
|
|
208
208
|
**D-007 Phase→Milestone 反查**(数字 phase 已解析时):
|
|
209
209
|
```
|
|
@@ -317,9 +317,9 @@ wants_roadmap = (--roadmap flag)
|
|
|
317
317
|
| intent 显式指定 phase 编号(如 "phase 2"、"P3") | `independent` | 用户明确针对单个 phase |
|
|
318
318
|
| milestone 仅含 1 个 phase(读 state.json) | `independent` | 统一无意义 |
|
|
319
319
|
| milestone 含多个 phase + `auto_confirm` | `unified` | 自动模式倾向高效 |
|
|
320
|
-
| milestone 含多个 phase + 非 `auto_confirm` | →
|
|
320
|
+
| milestone 含多个 phase + 非 `auto_confirm` | → user prompt | 征询用户选择 |
|
|
321
321
|
|
|
322
|
-
**
|
|
322
|
+
**user prompt** (仅当 milestone 含 ≥2 phase 且非 auto_confirm):
|
|
323
323
|
|
|
324
324
|
```
|
|
325
325
|
question: "当前里程碑含 {N} 个 phase,选择规划模式?"
|
|
@@ -346,7 +346,7 @@ Runs once before chain build; additive to status.json. 设 `session.decompositio
|
|
|
346
346
|
| named single file/function/bug, "fix X", "add Y to Z" | narrow | skip — auto-derive |
|
|
347
347
|
| otherwise | medium | clarify unless auto_confirm |
|
|
348
348
|
|
|
349
|
-
**2. Clarify boundary** (broad/medium) — `
|
|
349
|
+
**2. Clarify boundary** (broad/medium) — `user prompt`, ≤3 rounds, options pre-filled from intent + a quick Glob/Grep scan of the target module:
|
|
350
350
|
|
|
351
351
|
| Round | Question | Drives |
|
|
352
352
|
|-------|----------|--------|
|
|
@@ -632,7 +632,7 @@ GUARD: `task_decomposition` 存在(周期触发,见 build rule 5.5)
|
|
|
632
632
|
- 把下一个未完成的 `plan` step 改为 `maestro-plan --from analyze:{analyze_macro_id}`,去掉 `{phase}`,`source_artifact_ref = analyze:{analyze_macro_id}`
|
|
633
633
|
- 后续 `execute` 等沿用同一 standalone scope(不带 `{phase}`,由 plan 写出的 task 列表驱动)
|
|
634
634
|
4. 路径 C(`unknown`):
|
|
635
|
-
- 非 auto_confirm →
|
|
635
|
+
- 非 auto_confirm → user prompt 二选一(roadmap 多发布 / 单一计划);auto_confirm → 默认路径 B(单一计划,不引入 roadmap)
|
|
636
636
|
5. Reindex steps,标 decision completed,write status.json
|
|
637
637
|
6. Display: ◆ Scope verdict: {verdict} → {kept|collapsed to standalone via analyze:{ANL_ID}}
|
|
638
638
|
|
|
@@ -668,12 +668,12 @@ GUARD: `task_decomposition` 存在(周期触发,见 build rule 5.5)
|
|
|
668
668
|
| Phase | 行为 | 产出 |
|
|
669
669
|
|-------|------|------|
|
|
670
670
|
| 1. 快照 | 读 `task_decomposition` + `boundary_contract` + 已完成 steps 的 `completion_summary` | Display: 目标列表 + 进度 |
|
|
671
|
-
| 2. 解析 | `change_request` 非空 → 直接用;为空 →
|
|
671
|
+
| 2. 解析 | `change_request` 非空 → 直接用;为空 → user prompt(修改/新增/移除/调整边界) | `change_type` + `change_request` |
|
|
672
672
|
| 3. Mini Grill | `maestro delegate --to {session.cli_tool} --mode analysis`:评估影响 | RISK_LEVEL + AFFECTED_GOALS + INVALIDATED_STEPS + NEW_GAPS |
|
|
673
|
-
| 4. 确认 |
|
|
673
|
+
| 4. 确认 | user prompt:应用并继续 / 仅改目标 / 取消 | 用户选择 |
|
|
674
674
|
| 5. 应用 | 归档旧目标(`superseded`)→ 写入新目标(`origin: CHG-xxx`)→ 重建链路 → write status.json | handoff ralph-execute |
|
|
675
675
|
|
|
676
|
-
GUARD: `RISK_LEVEL == high` →
|
|
676
|
+
GUARD: `RISK_LEVEL == high` → user prompt 不跳过(auto_confirm 无效)
|
|
677
677
|
GUARD: 已完成(`status: "done"`)的目标不可 supersede(skip + warn)
|
|
678
678
|
|
|
679
679
|
</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
|
|
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 →
|
|
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 | 仍模糊 → `
|
|
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` | →
|
|
338
|
+
| milestone 含多个 phase + 非 `auto_confirm` | → user prompt | 征询用户选择 |
|
|
339
339
|
|
|
340
|
-
**
|
|
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) — `
|
|
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
|
|
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 → `
|
|
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
|
|
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 通过 `
|
|
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. `
|
|
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 触发 `
|
|
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
|
|
4
|
+
allowed-tools: Read Write Edit Bash Glob Grep teammate maestro
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<purpose>
|
|
@@ -11,7 +11,7 @@ Session: `.workflow/.maestro/ralph-v2-{YYYYMMDD-HHmmss}/status.json`
|
|
|
11
11
|
</purpose>
|
|
12
12
|
|
|
13
13
|
<deferred_reading>
|
|
14
|
-
- [ralph-amend-goal.md](~/.maestro/workflows/ralph-amend-goal.md) — read when `--amend` flag active for goal amendment flow
|
|
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
|
|
15
15
|
</deferred_reading>
|
|
16
16
|
|
|
17
17
|
<context>
|
|
@@ -180,7 +180,7 @@ S_APPLY_VERDICT:
|
|
|
180
180
|
GUARD: confidence_score < 60 AND proceed → override to fix
|
|
181
181
|
GUARD: confidence_score > 95 AND fix AND retry > 0 → suggest proceed
|
|
182
182
|
GUARD: auto_confirm → skip user prompt, apply adjusted verdict
|
|
183
|
-
GUARD: not auto_confirm →
|
|
183
|
+
GUARD: not auto_confirm → user prompt with override options
|
|
184
184
|
GUARD: post-reground + drifted + confidence >= 60 → A_REGROUND_HALT(auto_confirm 不跳过)
|
|
185
185
|
|
|
186
186
|
S_HANDLE_FAIL:
|
|
@@ -210,7 +210,7 @@ S_SESSION_DONE:
|
|
|
210
210
|
| 3 | 未派生 → 取最新 in-progress artifact 的 phase | false |
|
|
211
211
|
| 4 | 仍无 → state.json 首个 incomplete phase | false |
|
|
212
212
|
| 5 | position 将是 brainstorm/blueprint/init/roadmap/analyze-macro → phase = null | n/a |
|
|
213
|
-
| 6 | 仍模糊 → `
|
|
213
|
+
| 6 | 仍模糊 → `user prompt` | 由用户回答确定 |
|
|
214
214
|
|
|
215
215
|
**D-007 Phase→Milestone 反查**(数字 phase 已解析时):
|
|
216
216
|
```
|
|
@@ -324,9 +324,9 @@ wants_roadmap = (--roadmap flag)
|
|
|
324
324
|
| intent 显式指定 phase 编号(如 "phase 2"、"P3") | `independent` | 用户明确针对单个 phase |
|
|
325
325
|
| milestone 仅含 1 个 phase(读 state.json) | `independent` | 统一无意义 |
|
|
326
326
|
| milestone 含多个 phase + `auto_confirm` | `unified` | 自动模式倾向高效 |
|
|
327
|
-
| milestone 含多个 phase + 非 `auto_confirm` | →
|
|
327
|
+
| milestone 含多个 phase + 非 `auto_confirm` | → user prompt | 征询用户选择 |
|
|
328
328
|
|
|
329
|
-
**
|
|
329
|
+
**user prompt** (仅当 milestone 含 ≥2 phase 且非 auto_confirm):
|
|
330
330
|
|
|
331
331
|
```
|
|
332
332
|
question: "当前里程碑含 {N} 个 phase,选择规划模式?"
|
|
@@ -353,7 +353,7 @@ Runs once before chain build; additive to status.json. 设 `session.decompositio
|
|
|
353
353
|
| named single file/function/bug, "fix X", "add Y to Z" | narrow | skip — auto-derive |
|
|
354
354
|
| otherwise | medium | clarify unless auto_confirm |
|
|
355
355
|
|
|
356
|
-
**2. Clarify boundary** (broad/medium) — `
|
|
356
|
+
**2. Clarify boundary** (broad/medium) — `user prompt`, ≤3 rounds, options pre-filled from intent + a quick Glob/Grep scan of the target module:
|
|
357
357
|
|
|
358
358
|
| Round | Question | Drives |
|
|
359
359
|
|-------|----------|--------|
|
|
@@ -571,7 +571,7 @@ Execution criteria: {session.execution_criteria joined by '; '}
|
|
|
571
571
|
> 执行 Agent 不传 name,结果通过 task-notification `<result>` 自动回传主流程。executor 内部编排也用 unnamed Agent(子结果自动回流 executor,嵌套套娃模型)。
|
|
572
572
|
|
|
573
573
|
```
|
|
574
|
-
|
|
574
|
+
teammate({
|
|
575
575
|
subagent_type: "ralph-executor",
|
|
576
576
|
description: "执行 step {index}: {step.skill} [{resolved_agent_name}]",
|
|
577
577
|
prompt: `Session: {session_id}
|
|
@@ -739,7 +739,7 @@ Agent({
|
|
|
739
739
|
**Mode: `agent`(默认)** — 同步 Agent 评估:
|
|
740
740
|
|
|
741
741
|
```
|
|
742
|
-
|
|
742
|
+
teammate({
|
|
743
743
|
description: "评估 {decision} 质量门(同步评估 Agent,不传 name)",
|
|
744
744
|
prompt: "PURPOSE: 评估 {decision} 质量门结果
|
|
745
745
|
TASK: 读取以下结果文件 | 分析状态 | 评估严重性 | 给出建议
|
|
@@ -803,7 +803,7 @@ Bash({
|
|
|
803
803
|
1. Read `session.task_decomposition` from status.json
|
|
804
804
|
2. Dispatch audit(按 `evaluate_via` 模式,默认 `agent`):
|
|
805
805
|
```
|
|
806
|
-
|
|
806
|
+
teammate({
|
|
807
807
|
description: "审计子目标完成情况(同步评估 Agent,不传 name)",
|
|
808
808
|
prompt: "PURPOSE: 审计未完成子目标,判定 met / unmet
|
|
809
809
|
TASK:
|
|
@@ -839,7 +839,7 @@ Bash({
|
|
|
839
839
|
1. Read status.json:intent, boundary_contract, completed steps, done goals
|
|
840
840
|
2. Dispatch reground(按 `evaluate_via` 模式,默认 `agent`):
|
|
841
841
|
```
|
|
842
|
-
|
|
842
|
+
teammate({
|
|
843
843
|
description: "意图保真检查(同步评估 Agent,不传 name)",
|
|
844
844
|
prompt: "PURPOSE: 意图保真检查 — 对照 intent 验证累积执行是否漂移
|
|
845
845
|
TASK:
|
|
@@ -905,7 +905,7 @@ Bash({
|
|
|
905
905
|
|
|
906
906
|
1. 路径 A(`large` 且 `wants_roadmap`):保持 roadmap+analyze,`plan` 选 phase 列
|
|
907
907
|
2. 路径 B(`medium`/`small`,或 `large` 非 `wants_roadmap`):删除未完成的 `roadmap` + `analyze` step,`plan` 改为 `--from analyze:{ANL_ID}`
|
|
908
|
-
3. 路径 C(`unknown`):非 auto_confirm →
|
|
908
|
+
3. 路径 C(`unknown`):非 auto_confirm → user prompt;auto_confirm → 默认路径 B
|
|
909
909
|
4. Reindex steps,标 decision completed
|
|
910
910
|
|
|
911
911
|
### A_APPLY_GOAL_FIX / A_APPLY_GOAL_DONE
|
|
@@ -931,14 +931,14 @@ Bash({
|
|
|
931
931
|
| Phase | 行为 | 产出 |
|
|
932
932
|
|-------|------|------|
|
|
933
933
|
| 1. 快照 | 读 `task_decomposition` + `boundary_contract` + 已完成 steps 的 `completion_summary` | Display: 目标列表 + 进度 |
|
|
934
|
-
| 2. 解析 | `change_request` 非空 → 直接用;为空 →
|
|
934
|
+
| 2. 解析 | `change_request` 非空 → 直接用;为空 → user prompt(修改/新增/移除/调整边界) | `change_type` + `change_request` |
|
|
935
935
|
| 3. Mini Grill | Agent 评估影响 | RISK_LEVEL + AFFECTED_GOALS + INVALIDATED_STEPS + NEW_GAPS |
|
|
936
|
-
| 4. 确认 |
|
|
936
|
+
| 4. 确认 | user prompt:应用并继续 / 仅改目标 / 取消 | 用户选择 |
|
|
937
937
|
| 5. 应用 | 归档旧目标(`superseded`)→ 写入新目标(`origin: CHG-xxx`)→ 重建链路 → write status.json | re-dispatch |
|
|
938
938
|
|
|
939
939
|
**Phase 3 Agent prompt:**
|
|
940
940
|
```
|
|
941
|
-
|
|
941
|
+
teammate({
|
|
942
942
|
description: "Amend impact analysis(同步评估 Agent,不传 name)",
|
|
943
943
|
prompt: "PURPOSE: 评估目标修改对 running session 的影响
|
|
944
944
|
TASK:
|
|
@@ -962,7 +962,7 @@ CONSTRAINTS: 只评估不修改文件"
|
|
|
962
962
|
})
|
|
963
963
|
```
|
|
964
964
|
|
|
965
|
-
GUARD: `RISK_LEVEL == high` →
|
|
965
|
+
GUARD: `RISK_LEVEL == high` → user prompt 不跳过(auto_confirm 无效)
|
|
966
966
|
GUARD: 已完成(`status: "done"`)的目标不可 supersede(skip + warn)
|
|
967
967
|
旧目标标 `superseded`(`superseded_by` + `superseded_at`),新目标标 `origin: "CHG-xxx"`。`goal_changelog` 含完整 `before/after` + `impact_assessment`。
|
|
968
968
|
|
|
@@ -1163,7 +1163,7 @@ E001–E006, W001–W004 适用。Agent 新增:
|
|
|
1163
1163
|
### Success Criteria
|
|
1164
1164
|
|
|
1165
1165
|
- [ ] ralph-v2 owns full step loop: locate → resolve → dispatch → wait task-notification → extract → drift → complete → next
|
|
1166
|
-
- [ ] One agent per step — `
|
|
1166
|
+
- [ ] One agent per step — `teammate({ subagent_type: "ralph-executor" })` 每步派发一个 unnamed executor
|
|
1167
1167
|
- [ ] Executor 内调 `maestro ralph next` 获取 skill prompt 并执行,内部编排用 unnamed Agent(子结果回流 executor)
|
|
1168
1168
|
- [ ] Executor 结果通过 task-notification `<result>` 自动回传主流程
|
|
1169
1169
|
- [ ] 主流程调 `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
|
|
4
|
+
allowed-tools: Read Write Edit Bash Glob Grep teammate maestro
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<purpose>
|
|
@@ -11,12 +11,12 @@ Pipeline: brainstorm/blueprint/analyze → **roadmap** → analyze {milestone}
|
|
|
11
11
|
</purpose>
|
|
12
12
|
|
|
13
13
|
<required_reading>
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
~/.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
18
|
<deferred_reading>
|
|
19
|
-
- [roadmap.md](~/.maestro/workflows/roadmap.md) — read for roadmap generation workflow
|
|
19
|
+
- [roadmap.md](~/.pi/agent/packages/pi-maestro-flow/workflows/roadmap.md) — read for roadmap generation workflow
|
|
20
20
|
</deferred_reading>
|
|
21
21
|
|
|
22
22
|
<context>
|
|
@@ -48,7 +48,7 @@ $ARGUMENTS -- requirement text, @file reference, or upstream context source.
|
|
|
48
48
|
</context>
|
|
49
49
|
|
|
50
50
|
<interview_protocol>
|
|
51
|
-
Follows
|
|
51
|
+
Follows ~/.pi/agent/packages/pi-maestro-flow/workflows/interview-mechanics.md standard.
|
|
52
52
|
|
|
53
53
|
**Interaction mode**: convergent menu-driven
|
|
54
54
|
**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 +60,8 @@ Follows @~/.maestro/workflows/interview-mechanics.md standard.
|
|
|
60
60
|
|
|
61
61
|
<execution>
|
|
62
62
|
|
|
63
|
-
1. Read
|
|
64
|
-
2. Read
|
|
63
|
+
1. Read `~/.pi/agent/packages/pi-maestro-flow/workflows/roadmap-common.md` (always — shared logic)
|
|
64
|
+
2. Read `~/.pi/agent/packages/pi-maestro-flow/workflows/roadmap.md`, follow its process
|
|
65
65
|
|
|
66
66
|
Sub-modes:
|
|
67
67
|
- **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
|
|
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:
|
|
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**: 多命中(同一优先级内多个关键词匹配不同脚本)→
|
|
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 |
|
|
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
|
|
4
|
+
allowed-tools: Read Write Edit Bash Glob Grep teammate maestro
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<purpose>
|
|
@@ -10,7 +10,7 @@ Direct (by name) or category-based (list + select) invocation.
|
|
|
10
10
|
</purpose>
|
|
11
11
|
|
|
12
12
|
<required_reading>
|
|
13
|
-
|
|
13
|
+
~/.pi/agent/packages/pi-maestro-flow/workflows/tools-spec.md
|
|
14
14
|
</required_reading>
|
|
15
15
|
|
|
16
16
|
<context>
|
|
@@ -28,7 +28,7 @@ Empty arguments enters interactive mode: list all tools for user selection.
|
|
|
28
28
|
</context>
|
|
29
29
|
|
|
30
30
|
<invariants>
|
|
31
|
-
1. **Confirmation before execution** — MUST
|
|
31
|
+
1. **Confirmation before execution** — MUST user prompt before executing tool steps; NEVER auto-execute without user consent
|
|
32
32
|
2. **Sequential step execution** — steps MUST be executed in defined order; NEVER skip or reorder steps unless user explicitly requests skip
|
|
33
33
|
3. **Blocker escalation** — step failure MUST be reported to user with retry/skip/abort options; NEVER silently skip failed steps
|
|
34
34
|
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 +73,7 @@ maestro load --type spec --category <category>
|
|
|
73
73
|
Extract tool entries from the "Available Tools" section in output.
|
|
74
74
|
|
|
75
75
|
**Empty args**:
|
|
76
|
-
Load all categories, collect tool entries, present to user with
|
|
76
|
+
Load all categories, collect tool entries, present to user with user prompt for selection.
|
|
77
77
|
|
|
78
78
|
### Step 2: Display Tool
|
|
79
79
|
|
|
@@ -104,7 +104,7 @@ Follow the tool definition steps in order:
|
|
|
104
104
|
|
|
105
105
|
**Blocker handling**:
|
|
106
106
|
- Step fails → report error, ask user: retry / skip / abort
|
|
107
|
-
- Needs user input →
|
|
107
|
+
- Needs user input → user prompt for parameters
|
|
108
108
|
- Prerequisites unmet → show missing items, ask how to proceed
|
|
109
109
|
|
|
110
110
|
### 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
|
|
4
|
+
allowed-tools: Read Write Edit Bash Glob Grep teammate maestro
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<purpose>
|
|
@@ -10,7 +10,7 @@ Four modes: Extract, Generate, Optimize, Promote. Short processes inline; long u
|
|
|
10
10
|
</purpose>
|
|
11
11
|
|
|
12
12
|
<required_reading>
|
|
13
|
-
|
|
13
|
+
~/.pi/agent/packages/pi-maestro-flow/workflows/tools-spec.md
|
|
14
14
|
</required_reading>
|
|
15
15
|
|
|
16
16
|
<context>
|
|
@@ -31,7 +31,7 @@ $ARGUMENTS — Intent description
|
|
|
31
31
|
1. **Schema validation** — tool knowhow document MUST include `tool: true`, `category`, `keywords`, and `summary` in YAML frontmatter; missing fields → reject write
|
|
32
32
|
2. **No duplicate names** — tool title MUST be unique within its category; duplicate detection → E002 warning with overwrite/optimize confirmation
|
|
33
33
|
3. **Category required** — every tool MUST declare exactly one category from: coding, test, review, arch, debug; empty category → E003
|
|
34
|
-
4. **Confirmation gate** — MUST
|
|
34
|
+
4. **Confirmation gate** — MUST user prompt before writing knowhow document and spec ref entry; NEVER persist without user confirmation
|
|
35
35
|
5. **Promote is in-place** — promote mode MUST update existing knowhow frontmatter via `maestro wiki update`; NEVER recreate the document
|
|
36
36
|
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
37
|
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 +44,7 @@ $ARGUMENTS — Intent description
|
|
|
44
44
|
**GATE 1: Parse → Gather**
|
|
45
45
|
- REQUIRED: Mode determined (extract/generate/optimize/promote) from argument parsing.
|
|
46
46
|
- REQUIRED: For optimize/promote modes, target tool/document exists and is loadable.
|
|
47
|
-
- BLOCKED if: empty args without user response to
|
|
47
|
+
- BLOCKED if: empty args without user response to user prompt.
|
|
48
48
|
|
|
49
49
|
**GATE 2: Gather → Write**
|
|
50
50
|
- REQUIRED: Tool name, category, and usage timing confirmed.
|
|
@@ -65,7 +65,7 @@ Parse $ARGUMENTS to determine mode:
|
|
|
65
65
|
- Contains "optimize/improve" → optimize mode
|
|
66
66
|
- Contains "promote" or references existing knowhow doc (path/ID) → promote mode
|
|
67
67
|
- Other → generate mode
|
|
68
|
-
- Empty → ask user with
|
|
68
|
+
- Empty → ask user with user prompt
|
|
69
69
|
|
|
70
70
|
### Step 2: Gather Information
|
|
71
71
|
|
|
@@ -75,7 +75,7 @@ Parse $ARGUMENTS to determine mode:
|
|
|
75
75
|
|
|
76
76
|
**Generate mode**:
|
|
77
77
|
- Confirm tool name, applicable roles, target scenario
|
|
78
|
-
- If unclear, ask user with
|
|
78
|
+
- If unclear, ask user with user prompt
|
|
79
79
|
|
|
80
80
|
**Optimize mode**:
|
|
81
81
|
- Load existing tool: `maestro search "<name>" --type knowhow` → `maestro load --type knowhow --id <id>`
|
|
@@ -121,7 +121,7 @@ Use when {timing/trigger condition}.
|
|
|
121
121
|
1. Step one ...
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
**Confirm before writing** — Use `
|
|
124
|
+
**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
125
|
|
|
126
126
|
```
|
|
127
127
|
question: "确认写入以下 knowhow 工具文档?"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: maestro-ui-codify
|
|
3
3
|
description: "Extract design system from code, generate reference package, persist as knowledge assets Arguments: <source-path> [--package-name <name>] [--output-dir <path>] [--overwrite]"
|
|
4
|
-
allowed-tools: Read Write Edit Bash Glob Grep
|
|
4
|
+
allowed-tools: Read Write Edit Bash Glob Grep teammate maestro
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<purpose>
|
|
@@ -10,10 +10,10 @@ Extract design system from source code into tokens, reference package, and knowl
|
|
|
10
10
|
</purpose>
|
|
11
11
|
|
|
12
12
|
<deferred_reading>
|
|
13
|
-
- [ui-codify.md](~/.maestro/workflows/ui-codify.md) — read always (main workflow orchestrator)
|
|
14
|
-
- [ui-codify-extract.md](~/.maestro/workflows/ui-codify-extract.md) — read when Phase 2 starts (style extraction with 3 agents)
|
|
15
|
-
- [ui-codify-package.md](~/.maestro/workflows/ui-codify-package.md) — read when Phase 3 starts (reference package generation)
|
|
16
|
-
- [ui-codify-knowhow.md](~/.maestro/workflows/ui-codify-knowhow.md) — read when Phase 4 starts (knowledge asset generation)
|
|
13
|
+
- [ui-codify.md](~/.pi/agent/packages/pi-maestro-flow/workflows/ui-codify.md) — read always (main workflow orchestrator)
|
|
14
|
+
- [ui-codify-extract.md](~/.pi/agent/packages/pi-maestro-flow/workflows/ui-codify-extract.md) — read when Phase 2 starts (style extraction with 3 agents)
|
|
15
|
+
- [ui-codify-package.md](~/.pi/agent/packages/pi-maestro-flow/workflows/ui-codify-package.md) — read when Phase 3 starts (reference package generation)
|
|
16
|
+
- [ui-codify-knowhow.md](~/.pi/agent/packages/pi-maestro-flow/workflows/ui-codify-knowhow.md) — read when Phase 4 starts (knowledge asset generation)
|
|
17
17
|
</deferred_reading>
|
|
18
18
|
|
|
19
19
|
<context>
|
|
@@ -31,7 +31,7 @@ Flags:
|
|
|
31
31
|
<invariants>
|
|
32
32
|
1. **Source read-only** — the source path being analyzed MUST NOT be modified; extraction is purely read-only
|
|
33
33
|
2. **Phase-sequential loading** — workflow files (ui-codify-extract, ui-codify-package, ui-codify-knowhow) MUST be read only when their phase starts; NEVER load all phases eagerly
|
|
34
|
-
3. **User confirmation before knowhow** — Phase 3→4 gate MUST present
|
|
34
|
+
3. **User confirmation before knowhow** — Phase 3→4 gate MUST present user prompt before generating knowledge assets; NEVER auto-proceed to knowhow generation
|
|
35
35
|
4. **Overwrite protection** — existing package directory MUST NOT be overwritten without `--overwrite` flag (E003)
|
|
36
36
|
5. **Artifact completeness** — all 5 required artifacts MUST exist before reporting completion; NEVER skip artifact verification
|
|
37
37
|
6. **Token-first extraction** — design-tokens.json MUST be generated before layout-templates.json; layout extraction depends on token foundation
|
|
@@ -48,7 +48,7 @@ maestro load --type spec --category ui
|
|
|
48
48
|
|
|
49
49
|
## 2. Execute Workflow
|
|
50
50
|
|
|
51
|
-
Route to `~/.maestro/workflows/ui-codify.md` and follow completely.
|
|
51
|
+
Route to `~/.pi/agent/packages/pi-maestro-flow/workflows/ui-codify.md` and follow completely.
|
|
52
52
|
|
|
53
53
|
The workflow orchestrates 4 phases with deferred loading of phase-specific workflow files. Each phase reads its workflow file only when execution reaches that phase.
|
|
54
54
|
|
|
@@ -66,7 +66,7 @@ The workflow orchestrates 4 phases with deferred loading of phase-specific workf
|
|
|
66
66
|
**GATE Phase 3 → Phase 4: Package → Knowhow**
|
|
67
67
|
- REQUIRED: preview.html + preview.css generated as interactive showcase.
|
|
68
68
|
- BLOCKED if missing: preview artifacts not generated — knowhow phase needs rendered reference for validation.
|
|
69
|
-
- REQUIRED:
|
|
69
|
+
- REQUIRED: user prompt confirmation before proceeding to knowhow generation:
|
|
70
70
|
```
|
|
71
71
|
question: "Preview 生成完成。是否继续将设计系统持久化为 knowhow 知识资产?"
|
|
72
72
|
options:
|