maestro-flow 0.4.9 → 0.4.10
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/.agy/agents/cli-explore-agent.md +186 -0
- package/.agy/agents/conceptual-planning-agent.md +244 -0
- package/.agy/agents/impeccable-agent.md +97 -0
- package/.agy/agents/team-supervisor.md +142 -0
- package/.agy/agents/team-worker.md +236 -0
- package/.agy/agents/ui-design-agent.md +286 -0
- package/.agy/agents/workflow-analyzer.md +114 -0
- package/.agy/agents/workflow-codebase-mapper.md +76 -0
- package/.agy/agents/workflow-collab-planner.md +142 -0
- package/.agy/agents/workflow-debugger.md +102 -0
- package/.agy/agents/workflow-executor.md +131 -0
- package/.agy/agents/workflow-external-researcher.md +86 -0
- package/.agy/agents/workflow-integration-checker.md +82 -0
- package/.agy/agents/workflow-nyquist-auditor.md +84 -0
- package/.agy/agents/workflow-phase-researcher.md +84 -0
- package/.agy/agents/workflow-plan-checker.md +89 -0
- package/.agy/agents/workflow-planner.md +194 -0
- package/.agy/agents/workflow-project-researcher.md +73 -0
- package/.agy/agents/workflow-research-synthesizer.md +70 -0
- package/.agy/agents/workflow-reviewer.md +81 -0
- package/.agy/agents/workflow-roadmapper.md +81 -0
- package/.agy/agents/workflow-verifier.md +119 -0
- package/.agy/skills/codify-to-knowhow/SKILL.md +172 -0
- package/.agy/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
- package/.agy/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
- package/.agy/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
- package/.agy/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
- package/.agy/skills/learn-decompose/SKILL.md +118 -0
- package/.agy/skills/learn-follow/SKILL.md +129 -0
- package/.agy/skills/learn-investigate/SKILL.md +154 -0
- package/.agy/skills/learn-retro/SKILL.md +159 -0
- package/.agy/skills/learn-second-opinion/SKILL.md +124 -0
- package/.agy/skills/maestro/SKILL.md +221 -0
- package/.agy/skills/maestro-amend/SKILL.md +162 -0
- package/.agy/skills/maestro-analyze/SKILL.md +135 -0
- package/.agy/skills/maestro-brainstorm/SKILL.md +118 -0
- package/.agy/skills/maestro-collab/SKILL.md +174 -0
- package/.agy/skills/maestro-composer/SKILL.md +180 -0
- package/.agy/skills/maestro-execute/SKILL.md +133 -0
- package/.agy/skills/maestro-fork/SKILL.md +88 -0
- package/.agy/skills/maestro-guard/SKILL.md +101 -0
- package/.agy/skills/maestro-help/SKILL.md +267 -0
- package/.agy/skills/maestro-help/index/catalog.json +184 -0
- package/.agy/skills/maestro-help/phases/01-parse-intent.md +122 -0
- package/.agy/skills/maestro-help/phases/02-search-present.md +181 -0
- package/.agy/skills/maestro-help/phases/03-workflow-guide.md +186 -0
- package/.agy/skills/maestro-impeccable/SKILL.md +250 -0
- package/.agy/skills/maestro-init/SKILL.md +80 -0
- package/.agy/skills/maestro-learn/SKILL.md +142 -0
- package/.agy/skills/maestro-merge/SKILL.md +66 -0
- package/.agy/skills/maestro-milestone-audit/SKILL.md +70 -0
- package/.agy/skills/maestro-milestone-complete/SKILL.md +77 -0
- package/.agy/skills/maestro-milestone-release/SKILL.md +98 -0
- package/.agy/skills/maestro-overlay/SKILL.md +177 -0
- package/.agy/skills/maestro-plan/SKILL.md +172 -0
- package/.agy/skills/maestro-player/SKILL.md +176 -0
- package/.agy/skills/maestro-quick/SKILL.md +67 -0
- package/.agy/skills/maestro-ralph/SKILL.md +546 -0
- package/.agy/skills/maestro-ralph-execute/SKILL.md +255 -0
- package/.agy/skills/maestro-roadmap/SKILL.md +170 -0
- package/.agy/skills/maestro-tools-execute/SKILL.md +119 -0
- package/.agy/skills/maestro-tools-register/SKILL.md +159 -0
- package/.agy/skills/maestro-ui-codify/SKILL.md +81 -0
- package/.agy/skills/maestro-update/SKILL.md +175 -0
- package/.agy/skills/maestro-verify/SKILL.md +111 -0
- package/.agy/skills/manage-codebase-rebuild/SKILL.md +77 -0
- package/.agy/skills/manage-codebase-refresh/SKILL.md +59 -0
- package/.agy/skills/manage-harvest/SKILL.md +96 -0
- package/.agy/skills/manage-issue/SKILL.md +72 -0
- package/.agy/skills/manage-issue-discover/SKILL.md +83 -0
- package/.agy/skills/manage-knowhow/SKILL.md +76 -0
- package/.agy/skills/manage-knowhow-capture/SKILL.md +78 -0
- package/.agy/skills/manage-learn/SKILL.md +64 -0
- package/.agy/skills/manage-status/SKILL.md +51 -0
- package/.agy/skills/manage-wiki/SKILL.md +61 -0
- package/.agy/skills/quality-auto-test/SKILL.md +135 -0
- package/.agy/skills/quality-debug/SKILL.md +122 -0
- package/.agy/skills/quality-refactor/SKILL.md +69 -0
- package/.agy/skills/quality-retrospective/SKILL.md +79 -0
- package/.agy/skills/quality-review/SKILL.md +130 -0
- package/.agy/skills/quality-sync/SKILL.md +53 -0
- package/.agy/skills/quality-test/SKILL.md +119 -0
- package/.agy/skills/security-audit/SKILL.md +157 -0
- package/.agy/skills/skill-iter-tune/SKILL.md +381 -0
- package/.agy/skills/skill-iter-tune/phases/01-setup.md +144 -0
- package/.agy/skills/skill-iter-tune/phases/02-execute.md +292 -0
- package/.agy/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
- package/.agy/skills/skill-iter-tune/phases/04-improve.md +198 -0
- package/.agy/skills/skill-iter-tune/phases/05-report.md +166 -0
- package/.agy/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
- package/.agy/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
- package/.agy/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
- package/.agy/skills/spec-add/SKILL.md +67 -0
- package/.agy/skills/spec-load/SKILL.md +70 -0
- package/.agy/skills/spec-remove/SKILL.md +50 -0
- package/.agy/skills/spec-setup/SKILL.md +47 -0
- package/.agy/skills/team-coordinate/SKILL.md +267 -0
- package/.agy/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
- package/.agy/skills/team-coordinate/roles/coordinator/commands/dispatch.md +131 -0
- package/.agy/skills/team-coordinate/roles/coordinator/commands/monitor.md +348 -0
- package/.agy/skills/team-coordinate/roles/coordinator/role.md +362 -0
- package/.agy/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
- package/.agy/skills/team-coordinate/specs/pipelines.md +97 -0
- package/.agy/skills/team-coordinate/specs/quality-gates.md +112 -0
- package/.agy/skills/team-coordinate/specs/role-spec-template.md +198 -0
- package/.agy/skills/team-executor/SKILL.md +180 -0
- package/.agy/skills/team-executor/roles/executor/commands/monitor.md +235 -0
- package/.agy/skills/team-executor/roles/executor/role.md +171 -0
- package/.agy/skills/team-executor/specs/session-schema.md +264 -0
- package/.agy/skills/team-lifecycle-v4/SKILL.md +189 -0
- package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +92 -0
- package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
- package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +56 -0
- package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +206 -0
- package/.agy/skills/team-lifecycle-v4/roles/coordinator/role.md +130 -0
- package/.agy/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
- package/.agy/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -0
- package/.agy/skills/team-lifecycle-v4/roles/executor/role.md +64 -0
- package/.agy/skills/team-lifecycle-v4/roles/planner/role.md +82 -0
- package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +34 -0
- package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
- package/.agy/skills/team-lifecycle-v4/roles/reviewer/role.md +65 -0
- package/.agy/skills/team-lifecycle-v4/roles/supervisor/role.md +188 -0
- package/.agy/skills/team-lifecycle-v4/roles/tester/role.md +84 -0
- package/.agy/skills/team-lifecycle-v4/roles/writer/role.md +92 -0
- package/.agy/skills/team-lifecycle-v4/specs/knowledge-transfer.md +114 -0
- package/.agy/skills/team-lifecycle-v4/specs/pipelines.md +140 -0
- package/.agy/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
- package/.agy/skills/team-lifecycle-v4/templates/architecture.md +254 -0
- package/.agy/skills/team-lifecycle-v4/templates/epics.md +196 -0
- package/.agy/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
- package/.agy/skills/team-lifecycle-v4/templates/requirements.md +224 -0
- package/.agy/skills/team-quality-assurance/SKILL.md +148 -0
- package/.agy/skills/team-quality-assurance/roles/analyst/role.md +85 -0
- package/.agy/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
- package/.agy/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +111 -0
- package/.agy/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +235 -0
- package/.agy/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
- package/.agy/skills/team-quality-assurance/roles/executor/role.md +62 -0
- package/.agy/skills/team-quality-assurance/roles/generator/role.md +65 -0
- package/.agy/skills/team-quality-assurance/roles/scout/role.md +72 -0
- package/.agy/skills/team-quality-assurance/roles/strategist/role.md +69 -0
- package/.agy/skills/team-quality-assurance/specs/pipelines.md +115 -0
- package/.agy/skills/team-quality-assurance/specs/team-config.json +131 -0
- package/.agy/skills/team-review/SKILL.md +149 -0
- package/.agy/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
- package/.agy/skills/team-review/roles/coordinator/commands/dispatch.md +91 -0
- package/.agy/skills/team-review/roles/coordinator/commands/monitor.md +209 -0
- package/.agy/skills/team-review/roles/coordinator/role.md +132 -0
- package/.agy/skills/team-review/roles/fixer/role.md +74 -0
- package/.agy/skills/team-review/roles/reviewer/role.md +66 -0
- package/.agy/skills/team-review/roles/scanner/role.md +77 -0
- package/.agy/skills/team-review/specs/dimensions.md +82 -0
- package/.agy/skills/team-review/specs/finding-schema.json +82 -0
- package/.agy/skills/team-review/specs/pipelines.md +102 -0
- package/.agy/skills/team-review/specs/team-config.json +27 -0
- package/.agy/skills/team-tech-debt/SKILL.md +133 -0
- package/.agy/skills/team-tech-debt/roles/assessor/role.md +76 -0
- package/.agy/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
- package/.agy/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +156 -0
- package/.agy/skills/team-tech-debt/roles/coordinator/commands/monitor.md +198 -0
- package/.agy/skills/team-tech-debt/roles/coordinator/role.md +123 -0
- package/.agy/skills/team-tech-debt/roles/executor/role.md +76 -0
- package/.agy/skills/team-tech-debt/roles/planner/role.md +68 -0
- package/.agy/skills/team-tech-debt/roles/scanner/role.md +90 -0
- package/.agy/skills/team-tech-debt/roles/validator/role.md +78 -0
- package/.agy/skills/team-tech-debt/specs/pipelines.md +47 -0
- package/.agy/skills/team-tech-debt/specs/team-config.json +129 -0
- package/.agy/skills/team-testing/SKILL.md +144 -0
- package/.agy/skills/team-testing/roles/analyst/role.md +101 -0
- package/.agy/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
- package/.agy/skills/team-testing/roles/coordinator/commands/dispatch.md +108 -0
- package/.agy/skills/team-testing/roles/coordinator/commands/monitor.md +242 -0
- package/.agy/skills/team-testing/roles/coordinator/role.md +134 -0
- package/.agy/skills/team-testing/roles/executor/role.md +95 -0
- package/.agy/skills/team-testing/roles/generator/role.md +95 -0
- package/.agy/skills/team-testing/roles/strategist/role.md +81 -0
- package/.agy/skills/team-testing/specs/pipelines.md +101 -0
- package/.agy/skills/team-testing/specs/team-config.json +93 -0
- package/.agy/skills/wiki-connect/SKILL.md +64 -0
- package/.agy/skills/wiki-digest/SKILL.md +70 -0
- package/.agy/skills/workflow-skill-designer/SKILL.md +506 -0
- package/.agy/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
- package/.agy/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
- package/.agy/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
- package/.agy/skills/workflow-skill-designer/phases/04-validation.md +471 -0
- package/package.json +3 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: learn-second-opinion
|
|
3
|
+
description: Get alternative perspectives — review, challenge, or consult
|
|
4
|
+
argument-hint: <target> [--mode review|challenge|consult]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- ask_question
|
|
7
|
+
- define_subagent
|
|
8
|
+
- grep_search
|
|
9
|
+
- invoke_subagent
|
|
10
|
+
- manage_subagents
|
|
11
|
+
- run_command
|
|
12
|
+
- send_message
|
|
13
|
+
- view_file
|
|
14
|
+
- write_to_file
|
|
15
|
+
---
|
|
16
|
+
<purpose>
|
|
17
|
+
Structured second-opinion on code, decisions, or plans. Three modes:
|
|
18
|
+
- **review** (default): 3 parallel agents (pragmatist, purist, strategist)
|
|
19
|
+
- **challenge**: single adversarial agent — break assumptions, propose alternatives
|
|
20
|
+
- **consult**: interactive Q&A — agent studies target, answers your questions
|
|
21
|
+
|
|
22
|
+
Findings persist to `specs/learnings.md` as `<spec-entry>` blocks.
|
|
23
|
+
</purpose>
|
|
24
|
+
|
|
25
|
+
<context>
|
|
26
|
+
$ARGUMENTS — target and optional mode flag.
|
|
27
|
+
|
|
28
|
+
**Target resolution** (auto-detected):
|
|
29
|
+
| Input | Resolution |
|
|
30
|
+
|-------|-----------|
|
|
31
|
+
| File path | Read file content |
|
|
32
|
+
| Wiki ID (`<type>-<slug>`) | `maestro wiki get <id>` |
|
|
33
|
+
| `HEAD` / `staged` | `git diff HEAD` / `git diff --staged` |
|
|
34
|
+
| Phase number | Resolve via state.json.artifacts[] → plan.json |
|
|
35
|
+
|
|
36
|
+
**Flags**: `--mode review|challenge|consult` (default: review)
|
|
37
|
+
|
|
38
|
+
**Pre-load** (optional): `Skill("spec-load")` for conventions + `maestro wiki search "<target topic>"` for related entries.
|
|
39
|
+
|
|
40
|
+
**Output**: `.workflow/knowhow/KNW-opinion-{slug}-{YYYY-MM-DD}.md`
|
|
41
|
+
</context>
|
|
42
|
+
|
|
43
|
+
<state_machine>
|
|
44
|
+
|
|
45
|
+
<states>
|
|
46
|
+
S_RESOLVE — 解析 target PERSIST: —
|
|
47
|
+
S_CONTEXT — 加载 specs/wiki 上下文 PERSIST: —
|
|
48
|
+
S_EXECUTE — 按 mode 执行分析 PERSIST: —
|
|
49
|
+
S_SYNTHESIZE — 综合观点、生成报告 PERSIST: outputs
|
|
50
|
+
S_PERSIST — 写文件、append specs/learnings.md PERSIST: knowhow files
|
|
51
|
+
</states>
|
|
52
|
+
|
|
53
|
+
<transitions>
|
|
54
|
+
|
|
55
|
+
S_RESOLVE:
|
|
56
|
+
→ S_CONTEXT WHEN: target resolved DO: read target content
|
|
57
|
+
→ S_RESOLVE WHEN: unresolvable DO: ask_question for clarification
|
|
58
|
+
|
|
59
|
+
S_CONTEXT:
|
|
60
|
+
→ S_EXECUTE DO: load specs + wiki search (optional, proceed without)
|
|
61
|
+
|
|
62
|
+
S_EXECUTE:
|
|
63
|
+
→ S_SYNTHESIZE WHEN: mode == review DO: A_REVIEW
|
|
64
|
+
→ S_SYNTHESIZE WHEN: mode == challenge DO: A_CHALLENGE
|
|
65
|
+
→ S_SYNTHESIZE WHEN: mode == consult DO: A_CONSULT
|
|
66
|
+
|
|
67
|
+
S_SYNTHESIZE:
|
|
68
|
+
→ S_PERSIST DO: merge perspectives → agreements, disagreements, verdict, top 3 recommendations
|
|
69
|
+
|
|
70
|
+
S_PERSIST:
|
|
71
|
+
→ END DO: write KNW-opinion + append <spec-entry> blocks to specs/learnings.md
|
|
72
|
+
|
|
73
|
+
</transitions>
|
|
74
|
+
|
|
75
|
+
<actions>
|
|
76
|
+
|
|
77
|
+
### A_REVIEW
|
|
78
|
+
Spawn 3 Agents in single message:
|
|
79
|
+
|
|
80
|
+
| Agent | Focus | Question |
|
|
81
|
+
|-------|-------|----------|
|
|
82
|
+
| Pragmatist | simplicity, YAGNI, maintenance | "Simplest thing that works? Maintenance burden?" |
|
|
83
|
+
| Purist | correctness, edge cases, type safety | "What assumptions can be violated?" |
|
|
84
|
+
| Strategist | scalability, architecture alignment | "Supports future growth? Fits architecture?" |
|
|
85
|
+
|
|
86
|
+
Each returns: persona, verdict (approve/concern/reject), confidence, findings[{severity, description, location, suggestion}], summary.
|
|
87
|
+
|
|
88
|
+
### A_CHALLENGE
|
|
89
|
+
Spawn 1 adversarial Agent:
|
|
90
|
+
- Find weakest assumption
|
|
91
|
+
- Propose concrete breaking scenario
|
|
92
|
+
- Identify single biggest risk
|
|
93
|
+
- Suggest alternative approach
|
|
94
|
+
- Apply forcing questions: "What invalidates this?", "Simplest thing that breaks this?", "What would you regret in 6 months?", "What implicit contract isn't enforced?"
|
|
95
|
+
|
|
96
|
+
### A_CONSULT
|
|
97
|
+
Interactive loop:
|
|
98
|
+
1. Agent studies target
|
|
99
|
+
2. Display "Target loaded. What would you like to know?"
|
|
100
|
+
3. ask_question → Agent answers with code refs → repeat until "done"
|
|
101
|
+
4. Compile Q&A into report
|
|
102
|
+
|
|
103
|
+
</actions>
|
|
104
|
+
|
|
105
|
+
</state_machine>
|
|
106
|
+
|
|
107
|
+
<error_codes>
|
|
108
|
+
| Code | Condition | Recovery |
|
|
109
|
+
|------|-----------|----------|
|
|
110
|
+
| E002 | Unknown --mode value | Use: review, challenge, or consult |
|
|
111
|
+
| W001 | One review agent failed | Proceed with available perspectives |
|
|
112
|
+
</error_codes>
|
|
113
|
+
|
|
114
|
+
<success_criteria>
|
|
115
|
+
- [ ] Mode executed: review (3 parallel agents) / challenge (adversarial) / consult (interactive Q&A)
|
|
116
|
+
- [ ] Synthesis with agreements, disagreements, verdict
|
|
117
|
+
- [ ] Report written + findings appended to specs/learnings.md
|
|
118
|
+
</success_criteria>
|
|
119
|
+
|
|
120
|
+
<next_step_routing>
|
|
121
|
+
- Create issue → `/manage-issue create <description>`
|
|
122
|
+
- Decompose patterns → `/learn-decompose <path>`
|
|
123
|
+
- Follow code → `/learn-follow <path>`
|
|
124
|
+
</next_step_routing>
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maestro
|
|
3
|
+
description: Auto-route intent to optimal command chain
|
|
4
|
+
argument-hint: <intent> [-y] [-c] [--dry-run] [--exec auto|cli|internal] [--tool <name>] [--super]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- ask_question
|
|
7
|
+
- define_subagent
|
|
8
|
+
- grep_search
|
|
9
|
+
- invoke_subagent
|
|
10
|
+
- manage_subagents
|
|
11
|
+
- replace_file_content
|
|
12
|
+
- run_command
|
|
13
|
+
- send_message
|
|
14
|
+
- view_file
|
|
15
|
+
- write_to_file
|
|
16
|
+
---
|
|
17
|
+
<purpose>
|
|
18
|
+
Orchestrate all maestro commands based on user intent and project state.
|
|
19
|
+
Classify intent → select chain → create session → dispatch to `maestro-ralph-execute`.
|
|
20
|
+
|
|
21
|
+
Entry points:
|
|
22
|
+
- **`/maestro "intent"`** — Intent-based: classify → chain → execute
|
|
23
|
+
- **`/maestro -c`** — Resume previous session
|
|
24
|
+
- **`/maestro --dry-run "intent"`** — Show chain, no execution
|
|
25
|
+
- **`/maestro --super "intent"`** — Production-ready mode (read maestro-super.md)
|
|
26
|
+
|
|
27
|
+
Session: `.workflow/.maestro/{session_id}/status.json`
|
|
28
|
+
</purpose>
|
|
29
|
+
|
|
30
|
+
<deferred_reading>
|
|
31
|
+
- [maestro.md](~/.maestro/workflows/maestro.md) — read at execution start for intent analysis + chain selection
|
|
32
|
+
- [maestro-super.md](~/.maestro/workflows/maestro-super.md) — read when `--super` flag active
|
|
33
|
+
</deferred_reading>
|
|
34
|
+
|
|
35
|
+
<context>
|
|
36
|
+
$ARGUMENTS — user intent text, or special keywords.
|
|
37
|
+
|
|
38
|
+
**Keywords:** `continue`/`next`/`go` → state-based routing; `status` → `Skill("manage-status")`
|
|
39
|
+
|
|
40
|
+
**Flags:**
|
|
41
|
+
- `-y` / `--yes` — Auto mode: skip clarification, skip confirmation, auto-skip on errors
|
|
42
|
+
- `-c` / `--continue` — Resume previous session
|
|
43
|
+
- `--dry-run` — Show chain without executing
|
|
44
|
+
- `--exec <mode>` — `auto` (default), `cli`, `internal`
|
|
45
|
+
- `--tool <name>` — CLI tool for delegates (default: claude)
|
|
46
|
+
- `--super` — Read and follow `maestro-super.md`
|
|
47
|
+
</context>
|
|
48
|
+
|
|
49
|
+
<invariants>
|
|
50
|
+
1. **All chains dispatch via maestro-ralph-execute** — maestro never executes steps directly
|
|
51
|
+
2. **Session before execution** — status.json created before any step runs
|
|
52
|
+
3. **Auto flags only to supporting commands** — unlisted commands execute as-is
|
|
53
|
+
4. **Decomposition contract shared with maestro-ralph** — broad/lifecycle intents run S_DECOMPOSE producing the SAME additive block (`boundary_contract`, `execution_criteria`, `task_decomposition`, `goal_checklist_path`) + `goal-checklist.md`, then EMIT the `/goal` bind prompt. Reference maestro-ralph `A_DECOMPOSE_TASKS` for the full spec; do not duplicate logic
|
|
54
|
+
5. **Status JSON: schema-additive + step-dynamic** — decomposition fields OPTIONAL (absent → old flat-chain behavior); `steps[]` is a living array grown at runtime by ralph-execute's `post-goal-audit`. Never remove/rename existing fields
|
|
55
|
+
</invariants>
|
|
56
|
+
|
|
57
|
+
<state_machine>
|
|
58
|
+
|
|
59
|
+
<states>
|
|
60
|
+
S_PARSE — 解析参数、检测 flags PERSIST: —
|
|
61
|
+
S_RESUME — 扫描已有 session、恢复执行 PERSIST: —
|
|
62
|
+
S_CLASSIFY — 意图分类、chain 选择 PERSIST: —
|
|
63
|
+
S_DECOMPOSE — 边界澄清、写执行准则+子目标清单 PERSIST: session.boundary_contract, .execution_criteria, .task_decomposition
|
|
64
|
+
S_CREATE — 创建 session + status.json PERSIST: session (全量)
|
|
65
|
+
S_DRY_RUN — 显示 chain 后结束 PERSIST: —
|
|
66
|
+
S_CONFIRM — 用户确认(auto_mode 跳过) PERSIST: —
|
|
67
|
+
S_DISPATCH — 移交 maestro-ralph-execute PERSIST: —
|
|
68
|
+
S_FALLBACK — 意图无法分类、请求输入 PERSIST: —
|
|
69
|
+
</states>
|
|
70
|
+
|
|
71
|
+
<transitions>
|
|
72
|
+
|
|
73
|
+
S_PARSE:
|
|
74
|
+
→ S_RESUME WHEN: -c / --continue flag
|
|
75
|
+
→ S_CLASSIFY WHEN: intent text present
|
|
76
|
+
→ S_CLASSIFY WHEN: keyword "continue"/"next"/"go" DO: A_STATE_BASED_ROUTE
|
|
77
|
+
→ S_FALLBACK WHEN: no intent AND no flags
|
|
78
|
+
|
|
79
|
+
S_RESUME:
|
|
80
|
+
→ S_DISPATCH WHEN: session found DO: A_LOCATE_SESSION
|
|
81
|
+
→ S_FALLBACK WHEN: no session found
|
|
82
|
+
|
|
83
|
+
S_CLASSIFY:
|
|
84
|
+
→ S_DECOMPOSE WHEN: chain resolved DO: A_CLASSIFY_INTENT
|
|
85
|
+
→ S_FALLBACK WHEN: no match AND auto_mode
|
|
86
|
+
→ S_CLASSIFY WHEN: no match AND not auto_mode DO: A_CLARIFY
|
|
87
|
+
GUARD: max 2 clarification rounds → S_FALLBACK
|
|
88
|
+
|
|
89
|
+
S_DECOMPOSE:
|
|
90
|
+
→ S_CREATE DO: A_DECOMPOSE_TASKS
|
|
91
|
+
GUARD: broad intent (重构/全面/重写/迁移/overhaul/migrate/rewrite) on a multi-step lifecycle chain → MUST clarify even if auto_mode
|
|
92
|
+
GUARD: single-step chain OR narrow intent OR chain ∈ {status,init,quick} → skip decomposition (pass through)
|
|
93
|
+
|
|
94
|
+
S_CREATE:
|
|
95
|
+
→ S_DRY_RUN WHEN: --dry-run flag DO: A_CREATE_SESSION
|
|
96
|
+
→ S_CONFIRM WHEN: not auto_mode DO: A_CREATE_SESSION
|
|
97
|
+
→ S_DISPATCH WHEN: auto_mode DO: A_CREATE_SESSION
|
|
98
|
+
|
|
99
|
+
S_DRY_RUN:
|
|
100
|
+
→ END DO: display chain with step types
|
|
101
|
+
|
|
102
|
+
S_CONFIRM:
|
|
103
|
+
→ S_DISPATCH WHEN: user confirms
|
|
104
|
+
→ S_PARSE WHEN: user wants to modify
|
|
105
|
+
→ END WHEN: user cancels
|
|
106
|
+
|
|
107
|
+
S_DISPATCH:
|
|
108
|
+
→ END DO: view_file(AbsolutePath="<agy-skills-dir>/maestro-ralph-execute/SKILL.md") + execute inline
|
|
109
|
+
|
|
110
|
+
S_FALLBACK:
|
|
111
|
+
→ S_CLASSIFY WHEN: user provides new intent DO: ask_question
|
|
112
|
+
→ END WHEN: user cancels
|
|
113
|
+
|
|
114
|
+
</transitions>
|
|
115
|
+
|
|
116
|
+
<actions>
|
|
117
|
+
|
|
118
|
+
### A_STATE_BASED_ROUTE
|
|
119
|
+
|
|
120
|
+
1. Read `.workflow/state.json` → determine next logical step
|
|
121
|
+
2. Convert to equivalent intent for chain classification
|
|
122
|
+
|
|
123
|
+
### A_LOCATE_SESSION
|
|
124
|
+
|
|
125
|
+
1. Scan `.workflow/.maestro/*/status.json`, filter `status == "running"`, sort DESC
|
|
126
|
+
2. Take most recent; if not found → S_FALLBACK
|
|
127
|
+
|
|
128
|
+
### A_CLASSIFY_INTENT
|
|
129
|
+
|
|
130
|
+
1. Read `~/.maestro/workflows/maestro.md` from deferred_reading
|
|
131
|
+
2. Match intent to best task_type via chain catalog (semantic, AI-driven)
|
|
132
|
+
3. Select chain from chainMap
|
|
133
|
+
4. Determine per-step type: `internal` (Skill) or `external` (delegate)
|
|
134
|
+
|
|
135
|
+
### A_CLARIFY
|
|
136
|
+
|
|
137
|
+
1. `ask_question` with parsed intent + available chain options
|
|
138
|
+
2. Re-classify with user response
|
|
139
|
+
|
|
140
|
+
### A_DECOMPOSE_TASKS
|
|
141
|
+
|
|
142
|
+
Shares the decomposition contract with maestro-ralph `A_DECOMPOSE_TASKS` — **reference that spec; do not duplicate the table logic here.** Condensed:
|
|
143
|
+
|
|
144
|
+
1. Classify intent breadth (broad: 重构/全面/重写/迁移/overhaul/migrate/rewrite; narrow: single file/function/bug). Skip entirely for narrow / single-step / {status,init,quick} chains
|
|
145
|
+
2. Broad/medium → `ask_question` ≤3 rounds: Scope (in/out) | Constraints (compat/API/perf/test bar) | Definition of Done
|
|
146
|
+
3. Derive `execution_criteria` (3-6 imperative rules) + `task_decomposition` (outcome sub-goals, each `done_when` objectively verifiable and mapped to a ralph evidence artifact: verification.json / review.json / uat.md / test path)
|
|
147
|
+
4. Write `{session_dir}/goal-checklist.md` (same template as maestro-ralph) with `ALL_GOALS_DONE` sentinel; set `goal_checklist_path`
|
|
148
|
+
5. Append a `{ type: "decision", decision: "post-goal-audit", retry_count: 0, max_retries: 2 }` node as the FINAL node — after the last evidence-producing step (verify/review/test), before a milestone-complete/close-out step if the chain ends with one. (Audit needs evidence artifacts to exist.) ralph-execute then dynamically grows `steps[]` for unmet sub-goals
|
|
149
|
+
6. **Emit the `/goal` bind prompt:**
|
|
150
|
+
```
|
|
151
|
+
📋 任务分解完成。复制下面一行设定目标(推荐):
|
|
152
|
+
/goal 当 {session_dir}/goal-checklist.md 中子目标全 [x] 且含 ALL_GOALS_DONE 时达成;否则按执行准则继续推进且不越边界契约
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### A_CREATE_SESSION
|
|
156
|
+
|
|
157
|
+
1. Read `.workflow/state.json` for project context (phase, milestone)
|
|
158
|
+
2. Create `.workflow/.maestro/maestro-{YYYYMMDD-HHMMSS}/status.json`:
|
|
159
|
+
```json
|
|
160
|
+
{ "session_id", "source": "maestro", "intent", "task_type", "chain_name",
|
|
161
|
+
"phase", "milestone", "auto_mode", "exec_mode", "cli_tool",
|
|
162
|
+
"context": { ... }, "steps": [{ "index", "skill", "args", "type", "status": "pending", "goal_ref": null }],
|
|
163
|
+
"waves": [], "current_step": 0, "status": "running",
|
|
164
|
+
"_comment": "↓ OPTIONAL additive block — present only if S_DECOMPOSE ran; absent → old flat-chain behavior",
|
|
165
|
+
"boundary_contract": {}, "execution_criteria": [], "task_decomposition": [], "goal_checklist_path": "" }
|
|
166
|
+
```
|
|
167
|
+
Decomposition fields written ONLY if A_DECOMPOSE_TASKS produced them (additive; never break flat-chain readers)
|
|
168
|
+
3. Initialize tracking via `TodoWrite`. The decomposition goal is bound by the user via the emitted `/goal` prompt
|
|
169
|
+
4. If `--super`: read `maestro-super.md`, follow it completely
|
|
170
|
+
|
|
171
|
+
</actions>
|
|
172
|
+
|
|
173
|
+
</state_machine>
|
|
174
|
+
|
|
175
|
+
<appendix>
|
|
176
|
+
|
|
177
|
+
### Auto-Yes Flag Map
|
|
178
|
+
|
|
179
|
+
| Command | Auto Flag | Effect |
|
|
180
|
+
|---------|-----------|--------|
|
|
181
|
+
| maestro-init | `-y` | Skip interactive questioning |
|
|
182
|
+
| maestro-analyze | `-y` | Skip scoping, auto-deepen |
|
|
183
|
+
| maestro-brainstorm | `-y` | Skip questions, use defaults |
|
|
184
|
+
| maestro-roadmap | `-y` | Skip questions (create/revise/review) |
|
|
185
|
+
| maestro-impeccable | `-y` | Auto-select design variant + skip confirmations |
|
|
186
|
+
| maestro-plan | `-y` | Skip confirmations and clarification |
|
|
187
|
+
| maestro-execute | `-y` | Skip confirmations, blocked auto-continue |
|
|
188
|
+
| quality-auto-test | `-y` | Skip plan confirmation |
|
|
189
|
+
| quality-test | `-y --auto-fix` | Auto-trigger gap-fix loop |
|
|
190
|
+
| quality-retrospective | `-y` | Accept all routing recommendations |
|
|
191
|
+
| maestro-milestone-complete | `-y` | Skip knowledge promotion |
|
|
192
|
+
|
|
193
|
+
Unlisted commands have no auto flags.
|
|
194
|
+
|
|
195
|
+
### Error Codes
|
|
196
|
+
|
|
197
|
+
| Code | Severity | Description | Recovery |
|
|
198
|
+
|------|----------|-------------|----------|
|
|
199
|
+
| E001 | error | No intent and project not initialized | Prompt or suggest maestro-init |
|
|
200
|
+
| E002 | error | Clarity too low after 2 rounds | Show parsed intent, ask rephrase |
|
|
201
|
+
| E003 | error | Chain step failed + user abort | Record partial, suggest -c resume |
|
|
202
|
+
| E004 | error | Resume session not found | Show available sessions |
|
|
203
|
+
| W001 | warning | Ambiguous intent, multiple chains | Present options |
|
|
204
|
+
| W002 | warning | Step completed with warnings | Log and continue |
|
|
205
|
+
| W003 | warning | State suggests different chain | Show discrepancy |
|
|
206
|
+
|
|
207
|
+
### Success Criteria
|
|
208
|
+
|
|
209
|
+
- [ ] Intent classified with task_type, complexity, clarity_score
|
|
210
|
+
- [ ] Broad lifecycle intents decomposed (S_DECOMPOSE, ≤3 boundary questions) sharing maestro-ralph contract; narrow/single-step skip
|
|
211
|
+
- [ ] Decomposition writes additive block + goal-checklist.md + post-goal-audit node; emits /goal bind prompt (no self-call, no phantom create_goal)
|
|
212
|
+
- [ ] Chain selected and confirmed (or auto-confirmed)
|
|
213
|
+
- [ ] Session dir created with status.json before execution; decomposition fields additive-only
|
|
214
|
+
- [ ] Tracking via TodoWrite (Claude); status.json steps[] grown dynamically by ralph-execute post-goal-audit
|
|
215
|
+
- [ ] Auto flags propagated to supporting commands only
|
|
216
|
+
- [ ] All chains dispatched via maestro-ralph-execute
|
|
217
|
+
- [ ] Low-complexity intents routed to maestro-quick
|
|
218
|
+
- [ ] (super) Requirements validated before roadmap
|
|
219
|
+
- [ ] (super) Each milestone scored >= 80%
|
|
220
|
+
|
|
221
|
+
</appendix>
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maestro-amend
|
|
3
|
+
description: Generate overlays to fix workflow command deficiencies
|
|
4
|
+
argument-hint: [description] [--from-verify <dir>] [--from-review <dir>] [--from-session <id>] [--from-issues ISS-xxx,...] [--scan] [--dry-run]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- ask_question
|
|
7
|
+
- grep_search
|
|
8
|
+
- run_command
|
|
9
|
+
- view_file
|
|
10
|
+
- write_to_file
|
|
11
|
+
---
|
|
12
|
+
<purpose>
|
|
13
|
+
Signal-driven overlay generator — collect workflow deficiency signals from multiple sources, diagnose which commands need amendment, batch-generate targeted overlays. All amendments use overlay system (`~/.maestro/overlays/*.json`) — non-invasive, idempotent, survives reinstall.
|
|
14
|
+
|
|
15
|
+
Differs from `/maestro-overlay` (single explicit intent). This command **discovers** what needs amending by analyzing workflow artifacts.
|
|
16
|
+
</purpose>
|
|
17
|
+
|
|
18
|
+
<required_reading>
|
|
19
|
+
@~/.maestro/workflows/overlays.md
|
|
20
|
+
@~/.maestro/cli-tools.json
|
|
21
|
+
</required_reading>
|
|
22
|
+
|
|
23
|
+
<context>
|
|
24
|
+
$ARGUMENTS — optional description and/or source flags.
|
|
25
|
+
|
|
26
|
+
**Signal sources**:
|
|
27
|
+
|
|
28
|
+
| Flag | Source | Collects |
|
|
29
|
+
|------|--------|----------|
|
|
30
|
+
| `--from-verify <dir>` | verification.json | Workflow gaps from verify failures |
|
|
31
|
+
| `--from-review <dir>` | review.json | Process deficiencies from code review |
|
|
32
|
+
| `--from-session <id>` | Session artifacts | Problems during workflow execution |
|
|
33
|
+
| `--from-issues ISS-xxx,...` | issues.jsonl | Issues tracing to command deficiency |
|
|
34
|
+
| `--scan` | Auto-scan .workflow/ | Discover all workflow-related signals |
|
|
35
|
+
| _(positional text)_ | User description | Direct observation |
|
|
36
|
+
|
|
37
|
+
Multiple combinable. No flags + no description → interactive (scan + ask_question).
|
|
38
|
+
|
|
39
|
+
**Control**: `--dry-run` (preview, don't install), `-y` (skip confirmations)
|
|
40
|
+
|
|
41
|
+
**CLI targeting**: `"cli": "claude"` (default, patches .claude/commands/), `"codex"` (patches .codex/skills/), `"both"` (both paths)
|
|
42
|
+
|
|
43
|
+
**Output**: `~/.maestro/overlays/amend-{slug}.json` + optional `~/.maestro/overlays/docs/amend-{slug}.md`
|
|
44
|
+
</context>
|
|
45
|
+
|
|
46
|
+
<state_machine>
|
|
47
|
+
|
|
48
|
+
<states>
|
|
49
|
+
S_COLLECT — 收集信号(从 flags / scan / description) PERSIST: —
|
|
50
|
+
S_DIAGNOSE — 映射信号到命令补丁 PERSIST: —
|
|
51
|
+
S_GROUP — 分组、规划 overlay 粒度 PERSIST: —
|
|
52
|
+
S_PREVIEW — 展示注入点地图、用户确认 PERSIST: —
|
|
53
|
+
S_DRAFT — 生成 overlay JSON PERSIST: overlay files
|
|
54
|
+
S_INSTALL — 安装 overlay PERSIST: command files
|
|
55
|
+
S_REPORT — 报告摘要 + post-patch routing PERSIST: —
|
|
56
|
+
</states>
|
|
57
|
+
|
|
58
|
+
<transitions>
|
|
59
|
+
|
|
60
|
+
S_COLLECT:
|
|
61
|
+
→ S_DIAGNOSE WHEN: signals found DO: A_COLLECT_SIGNALS
|
|
62
|
+
→ ERROR(E001) WHEN: no signals from any source
|
|
63
|
+
|
|
64
|
+
S_DIAGNOSE:
|
|
65
|
+
→ S_GROUP WHEN: command deficiencies identified DO: A_DIAGNOSE_SIGNALS
|
|
66
|
+
→ ERROR(E003) WHEN: all signals are code bugs (not command gaps)
|
|
67
|
+
|
|
68
|
+
S_GROUP:
|
|
69
|
+
→ S_PREVIEW DO: A_GROUP_OVERLAYS
|
|
70
|
+
|
|
71
|
+
S_PREVIEW:
|
|
72
|
+
→ S_DRAFT WHEN: user confirms "Apply all" or selects patches
|
|
73
|
+
→ S_PREVIEW WHEN: user selects "Edit" DO: modify signal target/section
|
|
74
|
+
→ END WHEN: user cancels
|
|
75
|
+
|
|
76
|
+
S_DRAFT:
|
|
77
|
+
→ S_INSTALL WHEN: not --dry-run DO: A_DRAFT_OVERLAYS
|
|
78
|
+
→ END WHEN: --dry-run DO: display JSON + section map preview
|
|
79
|
+
|
|
80
|
+
S_INSTALL:
|
|
81
|
+
→ S_REPORT DO: A_INSTALL_OVERLAYS (`maestro overlay add`, retry max 2 on validation failure)
|
|
82
|
+
|
|
83
|
+
S_REPORT:
|
|
84
|
+
→ END DO: display summary (signals collected/applied/skipped, overlay details, skipped code-bug routing)
|
|
85
|
+
|
|
86
|
+
</transitions>
|
|
87
|
+
|
|
88
|
+
<actions>
|
|
89
|
+
|
|
90
|
+
### A_COLLECT_SIGNALS
|
|
91
|
+
|
|
92
|
+
**If source flags**: extract signals from each specified source.
|
|
93
|
+
**If --scan or interactive**: scan .workflow/ for:
|
|
94
|
+
- verification.json → must_have_failures, anti_patterns (filter for command gap direction)
|
|
95
|
+
- review.json → findings tagged "process" or "workflow"
|
|
96
|
+
- debug understanding.md → root causes with workflow/command cause_type
|
|
97
|
+
- issues.jsonl → status=open AND tags include "workflow"/"command"
|
|
98
|
+
- execution summaries → plan deviations suggesting missing command step
|
|
99
|
+
|
|
100
|
+
**If only description**: parse for affected command(s), what's missing, expected behavior.
|
|
101
|
+
|
|
102
|
+
### A_DIAGNOSE_SIGNALS
|
|
103
|
+
|
|
104
|
+
Per signal, determine:
|
|
105
|
+
- signal_id, source, description, target_command, target_section, patch_mode, fix_direction, severity
|
|
106
|
+
|
|
107
|
+
**Section mapping**:
|
|
108
|
+
|
|
109
|
+
| Signal pattern | Section | Mode |
|
|
110
|
+
|---------------|---------|------|
|
|
111
|
+
| Missing pre-check/gate | execution | prepend |
|
|
112
|
+
| Missing post-step/verification | execution | append |
|
|
113
|
+
| Missing reading/context | required_reading / deferred_reading | append |
|
|
114
|
+
| Incomplete success criteria | success_criteria | append |
|
|
115
|
+
| Missing error handling | error_codes | append |
|
|
116
|
+
| Scope/context gap | context | append |
|
|
117
|
+
| Entirely new concern | _(new section)_ | new-section |
|
|
118
|
+
|
|
119
|
+
Read pristine source from `$PKG_ROOT/.claude/commands/<name>.md` to confirm section.
|
|
120
|
+
Classify: command deficiency → proceed; code bug → skip (suggest /maestro-quick).
|
|
121
|
+
|
|
122
|
+
### A_GROUP_OVERLAYS
|
|
123
|
+
|
|
124
|
+
Group by target command + section (merge same command+section).
|
|
125
|
+
Granularity: 1-2 signals → `patch-{command}-{slug}.json`; 3+ cross-command → `amend-{slug}.json`.
|
|
126
|
+
Read target commands to verify sections exist, check existing overlays.
|
|
127
|
+
|
|
128
|
+
Display section map with injection points per target command.
|
|
129
|
+
|
|
130
|
+
### A_DRAFT_OVERLAYS
|
|
131
|
+
|
|
132
|
+
Build overlay JSON per schema: name, description, targets[], cli, priority (60), enabled, patches[{section, mode, content}].
|
|
133
|
+
Content rules: heading includes `(patch: SIG-NNN)`, concise, supplementary doc to `~/.maestro/overlays/docs/` if >10 lines.
|
|
134
|
+
|
|
135
|
+
### A_INSTALL_OVERLAYS
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
maestro overlay add ~/.maestro/overlays/amend-{slug}.json
|
|
139
|
+
```
|
|
140
|
+
On validation failure: fix JSON, retry (max 2).
|
|
141
|
+
|
|
142
|
+
</actions>
|
|
143
|
+
|
|
144
|
+
</state_machine>
|
|
145
|
+
|
|
146
|
+
<error_codes>
|
|
147
|
+
| Code | Condition | Recovery |
|
|
148
|
+
|------|-----------|----------|
|
|
149
|
+
| E001 | No signals from any source | Verify artifact paths or provide description |
|
|
150
|
+
| E003 | All signals are code bugs, not command gaps | Use /maestro-quick or /maestro-plan --gaps |
|
|
151
|
+
| E004 | Overlay validation failed after 2 retries | Review JSON manually |
|
|
152
|
+
| W001 | Some signals skipped (code bugs) | Route to appropriate fix command |
|
|
153
|
+
| W002 | Target command has >= 3 existing overlays | Consider consolidating |
|
|
154
|
+
</error_codes>
|
|
155
|
+
|
|
156
|
+
<success_criteria>
|
|
157
|
+
- [ ] Signals classified: command deficiency vs code bug
|
|
158
|
+
- [ ] Pristine command sources read to verify injection points
|
|
159
|
+
- [ ] Section map with injection points confirmed by user
|
|
160
|
+
- [ ] Overlay JSON installed successfully; command files contain overlay markers
|
|
161
|
+
- [ ] Skipped code-bug signals routed to alternatives
|
|
162
|
+
</success_criteria>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maestro-analyze
|
|
3
|
+
description: Use when a topic needs structured multi-dimensional investigation before planning or decision-making
|
|
4
|
+
argument-hint: [phase|topic] [-y] [-c] [-q] [--gaps [ISS-ID]]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- ask_question
|
|
7
|
+
- define_subagent
|
|
8
|
+
- grep_search
|
|
9
|
+
- invoke_subagent
|
|
10
|
+
- manage_subagents
|
|
11
|
+
- replace_file_content
|
|
12
|
+
- run_command
|
|
13
|
+
- send_message
|
|
14
|
+
- view_file
|
|
15
|
+
- write_to_file
|
|
16
|
+
---
|
|
17
|
+
<purpose>
|
|
18
|
+
Perform multi-dimensional analysis of a technical proposal, decision, or architecture choice through iterative CLI-assisted exploration and interactive discussion. Produces a discussion timeline (discussion.md) with evolving understanding, multi-perspective findings, Decision Recording Protocol, Intent Coverage tracking, and a final conclusions package with Go/No-Go recommendation.
|
|
19
|
+
|
|
20
|
+
Combines structured 6-dimension scoring with iterative deepening and decision extraction. Replaces both analysis and decision-capture workflows — produces analysis.md (scoring) AND context.md (Locked/Free/Deferred decisions for plan).
|
|
21
|
+
|
|
22
|
+
Use `-q` for quick decision extraction only (skip exploration + scoring).
|
|
23
|
+
|
|
24
|
+
Use `--gaps` for issue-focused root cause analysis (replaces manage-issue-analyze). Loads issues from issues.jsonl, performs CLI exploration against issue context/location, synthesizes root cause into issue.analysis, and outputs context.md for downstream `plan --gaps`.
|
|
25
|
+
</purpose>
|
|
26
|
+
|
|
27
|
+
<required_reading>
|
|
28
|
+
@~/.maestro/workflows/analyze.md
|
|
29
|
+
</required_reading>
|
|
30
|
+
|
|
31
|
+
<deferred_reading>
|
|
32
|
+
- [state.json](~/.maestro/templates/state.json) — read when registering artifact
|
|
33
|
+
- [issue-gaps-analyze.md](~/.maestro/workflows/issue-gaps-analyze.md) — read when --gaps is triggered
|
|
34
|
+
</deferred_reading>
|
|
35
|
+
|
|
36
|
+
<context>
|
|
37
|
+
$ARGUMENTS -- phase number for milestone-scoped, topic text for adhoc/standalone mode, no args for milestone-wide.
|
|
38
|
+
|
|
39
|
+
**Flags:**
|
|
40
|
+
- `-y` / `--yes`: Auto mode — skip interactive scoping, use recommended defaults, auto-deepen
|
|
41
|
+
- `-c` / `--continue`: Resume from existing session (auto-detect session folder + discussion.md)
|
|
42
|
+
- `-q` / `--quick`: Quick mode — skip exploration + scoring, go straight to decision extraction (context.md only)
|
|
43
|
+
- `--gaps [ISS-ID]`: Issue root cause analysis mode. If ISS-ID provided, analyze single issue. If omitted, analyze all open/registered issues from issues.jsonl.
|
|
44
|
+
|
|
45
|
+
Scope routing, output directory format, artifact registration schema, and output artifact listing are defined in workflow analyze.md (Scope Routing and Output Structure sections).
|
|
46
|
+
|
|
47
|
+
### Role Knowledge
|
|
48
|
+
`maestro wiki list --category debug` → select relevant → `maestro wiki load`
|
|
49
|
+
</context>
|
|
50
|
+
|
|
51
|
+
<execution>
|
|
52
|
+
Follow '~/.maestro/workflows/analyze.md' completely.
|
|
53
|
+
|
|
54
|
+
### --gaps Mode (Issue Root Cause Analysis)
|
|
55
|
+
|
|
56
|
+
When `--gaps` flag is present, follow `~/.maestro/workflows/issue-gaps-analyze.md` instead of the standard analyze pipeline:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Phase 1: Load issues from .workflow/issues/issues.jsonl
|
|
60
|
+
- If ISS-ID provided: load single issue
|
|
61
|
+
- If no ISS-ID: filter issues where status = open | registered
|
|
62
|
+
- Validate: at least 1 issue loaded, else error E_NO_ISSUES
|
|
63
|
+
|
|
64
|
+
Phase 2: CLI exploration per issue
|
|
65
|
+
- For each issue: build exploration prompt from issue.title, description, context, related_files
|
|
66
|
+
- Run maestro delegate --role analyze --mode analysis with codebase context
|
|
67
|
+
- Gather affected files, call chains, root cause evidence
|
|
68
|
+
|
|
69
|
+
Phase 3: Root cause synthesis → write issue.analysis
|
|
70
|
+
- Parse CLI output into analysis record: { root_cause, affected_files, impact_scope, fix_direction, confidence, analyzed_at, tool, depth }
|
|
71
|
+
- Write analysis record to issue in issues.jsonl
|
|
72
|
+
- Append history entry: { action: "analyzed", at: <ISO>, by: "maestro-analyze --gaps" }
|
|
73
|
+
|
|
74
|
+
Phase 4: Output context.md for downstream plan --gaps
|
|
75
|
+
- Aggregate all analyzed issues into context.md with root causes and fix directions
|
|
76
|
+
- Register ANL artifact in state.json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Handoff:** context.md is consumed by maestro-plan (loads Locked/Free/Deferred decisions). In --gaps mode, context.md contains issue root causes for `plan --gaps` consumption.
|
|
80
|
+
|
|
81
|
+
**Next-step routing on completion:**
|
|
82
|
+
|
|
83
|
+
Phase/Milestone scope:
|
|
84
|
+
- Go recommendation, UI work needed → `/maestro-impeccable build {target}`
|
|
85
|
+
- Go recommendation, ready to plan → `/maestro-plan` or `/maestro-plan {phase}`
|
|
86
|
+
- No-Go recommendation → revisit requirements or `/maestro-brainstorm {topic}`
|
|
87
|
+
|
|
88
|
+
Adhoc/Standalone scope:
|
|
89
|
+
- Ready to plan → `/maestro-plan --dir {scratch_dir}`
|
|
90
|
+
- Need more exploration → `/maestro-analyze {topic} -c`
|
|
91
|
+
|
|
92
|
+
Gaps scope:
|
|
93
|
+
- Issues analyzed → `/maestro-plan --gaps` (plan fix tasks linked to issues)
|
|
94
|
+
- Need more context → `/maestro-analyze --gaps {ISS-ID}` (re-analyze specific issue)
|
|
95
|
+
</execution>
|
|
96
|
+
|
|
97
|
+
<error_codes>
|
|
98
|
+
| Code | Severity | Condition | Recovery |
|
|
99
|
+
|------|----------|-----------|----------|
|
|
100
|
+
| E001 | error | No args and no roadmap (cannot determine scope) | Prompt user for topic text or create roadmap first |
|
|
101
|
+
| W001 | warning | CLI exploration failed | Continue with available context, note limitation |
|
|
102
|
+
| W002 | warning | CLI analysis timeout | Retry with shorter prompt, or skip perspective |
|
|
103
|
+
| W003 | warning | Insufficient evidence for scoring dimensions | Note low-confidence dimensions, proceed with available evidence |
|
|
104
|
+
| W004 | warning | Max rounds reached (5) | Force synthesis, offer continuation option |
|
|
105
|
+
| E_NO_ISSUES | error | --gaps but no open/registered issues found | Suggest `/manage-issue-discover` or `/manage-issue create` |
|
|
106
|
+
| E_ISSUE_NOT_FOUND | error | --gaps with ISS-ID but issue not found | Suggest `/manage-issue list` to find valid IDs |
|
|
107
|
+
</error_codes>
|
|
108
|
+
|
|
109
|
+
<success_criteria>
|
|
110
|
+
Full mode:
|
|
111
|
+
- [ ] CLI exploration completed with code anchors and call chains
|
|
112
|
+
- [ ] discussion.md created with full timeline, TOC, Current Understanding
|
|
113
|
+
- [ ] analysis.md written with all 6 dimensions scored with evidence
|
|
114
|
+
- [ ] conclusions.json created with recommendations and decision trail
|
|
115
|
+
- [ ] Intent Coverage tracked and verified (no unresolved ❌ items)
|
|
116
|
+
- [ ] Confidence tracking initialized (Step 4.6) and re-scored each round (Step 5.8)
|
|
117
|
+
- [ ] Readiness gate checked before synthesis (Step 5.10)
|
|
118
|
+
- [ ] Pressure pass completed ≥ 1 time before Step 6
|
|
119
|
+
- [ ] Confidence summary with factor decomposition written to analysis.md
|
|
120
|
+
|
|
121
|
+
Gaps mode:
|
|
122
|
+
- [ ] Issues loaded from issues.jsonl (all open/registered, or single ISS-ID)
|
|
123
|
+
- [ ] CLI exploration executed per issue with codebase context
|
|
124
|
+
- [ ] Analysis record attached to each issue in issues.jsonl
|
|
125
|
+
- [ ] context.md written with aggregated root causes for plan --gaps
|
|
126
|
+
|
|
127
|
+
Both modes (full + quick):
|
|
128
|
+
- [ ] context.md written with all decisions classified as Locked/Free/Deferred
|
|
129
|
+
- [ ] Gray areas identified through phase-specific analysis
|
|
130
|
+
- [ ] Decision Recording Protocol applied to all decisions
|
|
131
|
+
- [ ] Scope creep redirected to Deferred section
|
|
132
|
+
- [ ] Deferred items auto-created as issues (if any)
|
|
133
|
+
- [ ] Artifact registered in state.json with correct scope/milestone/phase
|
|
134
|
+
- [ ] Next step routed (impeccable/plan for Go, brainstorm for No-Go)
|
|
135
|
+
</success_criteria>
|