maestro-flow 0.3.9 → 0.3.11
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/.claude/agents/workflow-collab-planner.md +1 -1
- package/.claude/agents/workflow-executor.md +1 -1
- package/.claude/agents/workflow-plan-checker.md +1 -1
- package/.claude/agents/workflow-planner.md +1 -1
- package/.claude/commands/learn-decompose.md +176 -176
- package/.claude/commands/learn-follow.md +167 -167
- package/.claude/commands/learn-retro.md +1 -1
- package/.claude/commands/maestro-analyze.md +46 -3
- package/.claude/commands/maestro-coordinate.md +1 -3
- package/.claude/commands/maestro-execute.md +14 -0
- package/.claude/commands/maestro-plan.md +16 -0
- package/.claude/commands/manage-harvest.md +131 -131
- package/.claude/commands/manage-issue-discover.md +2 -2
- package/.claude/commands/manage-issue.md +5 -5
- package/.claude/commands/spec-add.md +67 -56
- package/.claude/commands/spec-load.md +66 -64
- package/.claude/commands/spec-setup.md +5 -9
- package/.codex/skills/learn-decompose/SKILL.md +119 -0
- package/.codex/skills/learn-follow/SKILL.md +83 -0
- package/.codex/skills/learn-investigate/SKILL.md +83 -0
- package/.codex/skills/learn-retro/SKILL.md +83 -0
- package/.codex/skills/learn-second-opinion/SKILL.md +86 -0
- package/.codex/skills/maestro/SKILL.md +335 -0
- package/.codex/skills/maestro-analyze/SKILL.md +84 -75
- package/.codex/skills/maestro-brainstorm/SKILL.md +452 -463
- package/.codex/skills/maestro-chain/SKILL.md +233 -0
- package/.codex/skills/maestro-coordinate/SKILL.md +167 -278
- package/.codex/skills/maestro-execute/SKILL.md +435 -438
- package/.codex/skills/maestro-fork/SKILL.md +68 -0
- package/.codex/skills/maestro-init/SKILL.md +171 -167
- package/.codex/skills/maestro-learn/SKILL.md +80 -0
- package/.codex/skills/maestro-link-coordinate/SKILL.md +224 -220
- package/.codex/skills/maestro-merge/SKILL.md +62 -0
- package/.codex/skills/maestro-milestone-audit/SKILL.md +108 -103
- package/.codex/skills/maestro-milestone-complete/SKILL.md +155 -149
- package/.codex/skills/maestro-milestone-release/SKILL.md +70 -0
- package/.codex/skills/maestro-overlay/SKILL.md +188 -185
- package/.codex/skills/maestro-plan/SKILL.md +66 -69
- package/.codex/skills/maestro-quick/SKILL.md +26 -23
- package/.codex/skills/maestro-roadmap/SKILL.md +65 -73
- package/.codex/skills/maestro-spec-generate/SKILL.md +66 -74
- package/.codex/skills/maestro-ui-design/SKILL.md +34 -31
- package/.codex/skills/maestro-verify/SKILL.md +556 -566
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +397 -405
- package/.codex/skills/manage-codebase-refresh/SKILL.md +93 -82
- package/.codex/skills/manage-harvest/SKILL.md +82 -0
- package/.codex/skills/manage-issue/SKILL.md +80 -65
- package/.codex/skills/manage-issue-discover/SKILL.md +491 -503
- package/.codex/skills/manage-learn/SKILL.md +190 -186
- package/.codex/skills/manage-memory/SKILL.md +95 -72
- package/.codex/skills/manage-memory-capture/SKILL.md +99 -86
- package/.codex/skills/manage-status/SKILL.md +102 -89
- package/.codex/skills/quality-business-test/SKILL.md +228 -223
- package/.codex/skills/quality-debug/SKILL.md +54 -66
- package/.codex/skills/quality-integration-test/SKILL.md +532 -544
- package/.codex/skills/quality-refactor/SKILL.md +197 -191
- package/.codex/skills/quality-retrospective/SKILL.md +512 -505
- package/.codex/skills/quality-review/SKILL.md +93 -105
- package/.codex/skills/quality-sync/SKILL.md +101 -89
- package/.codex/skills/quality-test/SKILL.md +202 -198
- package/.codex/skills/quality-test-gen/SKILL.md +93 -104
- package/.codex/skills/spec-add/SKILL.md +58 -39
- package/.codex/skills/spec-load/SKILL.md +45 -40
- package/.codex/skills/spec-map/SKILL.md +180 -182
- package/.codex/skills/spec-setup/SKILL.md +94 -76
- package/.codex/skills/team-coordinate/SKILL.md +346 -357
- package/.codex/skills/team-executor/SKILL.md +70 -112
- package/.codex/skills/team-lifecycle-v4/SKILL.md +311 -299
- package/.codex/skills/team-quality-assurance/SKILL.md +234 -227
- package/.codex/skills/team-review/SKILL.md +232 -225
- package/.codex/skills/team-tech-debt/SKILL.md +78 -100
- package/.codex/skills/team-testing/SKILL.md +242 -235
- package/.codex/skills/wiki-connect/SKILL.md +75 -0
- package/.codex/skills/wiki-digest/SKILL.md +87 -0
- package/README.md +14 -11
- package/README.zh-CN.md +14 -11
- package/chains/issue-lifecycle.json +13 -13
- package/chains/singles/issue-analyze.json +3 -3
- package/chains/singles/issue-execute.json +3 -3
- package/chains/singles/issue-plan.json +3 -3
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js +2 -2
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/coordinator/chain-map.js +3 -3
- package/dashboard/dist-server/dashboard/src/server/coordinator/chain-map.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js +34 -0
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/specs.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/specs.js +75 -30
- package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/state/event-bus.d.ts +5 -0
- package/dashboard/dist-server/dashboard/src/server/state/event-bus.js +5 -0
- package/dashboard/dist-server/dashboard/src/server/state/event-bus.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js +2 -3
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js +5 -0
- package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/issue-types.d.ts +5 -0
- package/dashboard/dist-server/dashboard/src/shared/issue-types.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/normalize-task.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/shared/normalize-task.js +75 -0
- package/dashboard/dist-server/dashboard/src/shared/normalize-task.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/shared/team-types.d.ts +21 -0
- package/dashboard/dist-server/dashboard/src/shared/team-types.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/types.d.ts +3 -2
- package/dashboard/dist-server/dashboard/src/shared/ws-protocol.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/shared/ws-protocol.js.map +1 -1
- package/dashboard/dist-server/src/hooks/constants.d.ts +92 -12
- package/dashboard/dist-server/src/hooks/constants.js +151 -16
- package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
- package/dashboard/dist-server/src/types/index.d.ts +5 -0
- package/dist/src/commands/collab.d.ts +1 -34
- package/dist/src/commands/collab.d.ts.map +1 -1
- package/dist/src/commands/collab.js +8 -76
- package/dist/src/commands/collab.js.map +1 -1
- package/dist/src/commands/hooks.d.ts +5 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +115 -10
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/install-ui/InstallConfirm.d.ts +3 -1
- package/dist/src/commands/install-ui/InstallConfirm.d.ts.map +1 -1
- package/dist/src/commands/install-ui/InstallConfirm.js +3 -1
- package/dist/src/commands/install-ui/InstallConfirm.js.map +1 -1
- package/dist/src/commands/install-ui/InstallExecution.d.ts.map +1 -1
- package/dist/src/commands/install-ui/InstallExecution.js +5 -1
- package/dist/src/commands/install-ui/InstallExecution.js.map +1 -1
- package/dist/src/commands/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/commands/install-ui/InstallFlow.js +7 -3
- package/dist/src/commands/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/commands/install-ui/StatuslineConfig.d.ts +6 -1
- package/dist/src/commands/install-ui/StatuslineConfig.d.ts.map +1 -1
- package/dist/src/commands/install-ui/StatuslineConfig.js +27 -5
- package/dist/src/commands/install-ui/StatuslineConfig.js.map +1 -1
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +7 -2
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/hooks/__tests__/statusline-visual-test.d.ts +7 -0
- package/dist/src/hooks/__tests__/statusline-visual-test.d.ts.map +1 -0
- package/dist/src/hooks/__tests__/statusline-visual-test.js +236 -0
- package/dist/src/hooks/__tests__/statusline-visual-test.js.map +1 -0
- package/dist/src/hooks/constants.d.ts +92 -12
- package/dist/src/hooks/constants.d.ts.map +1 -1
- package/dist/src/hooks/constants.js +151 -16
- package/dist/src/hooks/constants.js.map +1 -1
- package/dist/src/hooks/guards/index.d.ts +2 -0
- package/dist/src/hooks/guards/index.d.ts.map +1 -1
- package/dist/src/hooks/guards/index.js +2 -0
- package/dist/src/hooks/guards/index.js.map +1 -1
- package/dist/src/hooks/guards/preflight-guard.d.ts +29 -0
- package/dist/src/hooks/guards/preflight-guard.d.ts.map +1 -0
- package/dist/src/hooks/guards/preflight-guard.js +95 -0
- package/dist/src/hooks/guards/preflight-guard.js.map +1 -0
- package/dist/src/hooks/guards/spec-validator.d.ts +25 -0
- package/dist/src/hooks/guards/spec-validator.d.ts.map +1 -0
- package/dist/src/hooks/guards/spec-validator.js +66 -0
- package/dist/src/hooks/guards/spec-validator.js.map +1 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +1 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.d.ts +21 -0
- package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -0
- package/dist/src/hooks/keyword-spec-injector.js +96 -0
- package/dist/src/hooks/keyword-spec-injector.js.map +1 -0
- package/dist/src/hooks/plugins/spec-injection-plugin.d.ts +2 -1
- package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
- package/dist/src/hooks/plugins/spec-injection-plugin.js +21 -12
- package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
- package/dist/src/hooks/preflight-core.d.ts +37 -0
- package/dist/src/hooks/preflight-core.d.ts.map +1 -0
- package/dist/src/hooks/preflight-core.js +86 -0
- package/dist/src/hooks/preflight-core.js.map +1 -0
- package/dist/src/hooks/spec-bridge.d.ts +40 -0
- package/dist/src/hooks/spec-bridge.d.ts.map +1 -0
- package/dist/src/hooks/spec-bridge.js +97 -0
- package/dist/src/hooks/spec-bridge.js.map +1 -0
- package/dist/src/hooks/spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/spec-injector.js +18 -12
- package/dist/src/hooks/spec-injector.js.map +1 -1
- package/dist/src/hooks/statusline.d.ts +8 -17
- package/dist/src/hooks/statusline.d.ts.map +1 -1
- package/dist/src/hooks/statusline.js +269 -112
- package/dist/src/hooks/statusline.js.map +1 -1
- package/dist/src/i18n/locales/en.d.ts.map +1 -1
- package/dist/src/i18n/locales/en.js +5 -0
- package/dist/src/i18n/locales/en.js.map +1 -1
- package/dist/src/i18n/locales/zh.d.ts.map +1 -1
- package/dist/src/i18n/locales/zh.js +5 -0
- package/dist/src/i18n/locales/zh.js.map +1 -1
- package/dist/src/i18n/types.d.ts +5 -0
- package/dist/src/i18n/types.d.ts.map +1 -1
- package/dist/src/team/phase-orchestrator.d.ts +52 -0
- package/dist/src/team/phase-orchestrator.d.ts.map +1 -0
- package/dist/src/team/phase-orchestrator.js +165 -0
- package/dist/src/team/phase-orchestrator.js.map +1 -0
- package/dist/src/team/phase-types.d.ts +51 -0
- package/dist/src/team/phase-types.d.ts.map +1 -0
- package/dist/src/team/phase-types.js +41 -0
- package/dist/src/team/phase-types.js.map +1 -0
- package/dist/src/tools/collab-adapter.d.ts +17 -0
- package/dist/src/tools/collab-adapter.d.ts.map +1 -1
- package/dist/src/tools/collab-adapter.js +138 -0
- package/dist/src/tools/collab-adapter.js.map +1 -1
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +6 -0
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/merge-validator.d.ts +24 -0
- package/dist/src/tools/merge-validator.d.ts.map +1 -0
- package/dist/src/tools/merge-validator.js +220 -0
- package/dist/src/tools/merge-validator.js.map +1 -0
- package/dist/src/tools/spec-entry-parser.d.ts +56 -0
- package/dist/src/tools/spec-entry-parser.d.ts.map +1 -0
- package/dist/src/tools/spec-entry-parser.js +196 -0
- package/dist/src/tools/spec-entry-parser.js.map +1 -0
- package/dist/src/tools/spec-init.d.ts.map +1 -1
- package/dist/src/tools/spec-init.js +66 -92
- package/dist/src/tools/spec-init.js.map +1 -1
- package/dist/src/tools/spec-keyword-index.d.ts +30 -0
- package/dist/src/tools/spec-keyword-index.d.ts.map +1 -0
- package/dist/src/tools/spec-keyword-index.js +101 -0
- package/dist/src/tools/spec-keyword-index.js.map +1 -0
- package/dist/src/tools/spec-loader.d.ts +3 -3
- package/dist/src/tools/spec-loader.d.ts.map +1 -1
- package/dist/src/tools/spec-loader.js +49 -23
- package/dist/src/tools/spec-loader.js.map +1 -1
- package/dist/src/tools/team-agents.d.ts +27 -0
- package/dist/src/tools/team-agents.d.ts.map +1 -0
- package/dist/src/tools/team-agents.js +362 -0
- package/dist/src/tools/team-agents.js.map +1 -0
- package/dist/src/tools/team-mailbox.d.ts +40 -0
- package/dist/src/tools/team-mailbox.d.ts.map +1 -0
- package/dist/src/tools/team-mailbox.js +384 -0
- package/dist/src/tools/team-mailbox.js.map +1 -0
- package/dist/src/tools/team-msg.d.ts +17 -8
- package/dist/src/tools/team-msg.d.ts.map +1 -1
- package/dist/src/tools/team-msg.js +110 -13
- package/dist/src/tools/team-msg.js.map +1 -1
- package/dist/src/tools/team-tasks-mcp.d.ts +27 -0
- package/dist/src/tools/team-tasks-mcp.d.ts.map +1 -0
- package/dist/src/tools/team-tasks-mcp.js +408 -0
- package/dist/src/tools/team-tasks-mcp.js.map +1 -0
- package/dist/src/types/index.d.ts +5 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/templates/cli/prompts/workflow-skill-conflict-patterns.txt +3 -3
- package/templates/cli/prompts/workflow-skill-lessons-learned.txt +3 -3
- package/templates/search-tools.md +1 -1
- package/workflows/analyze.md +816 -816
- package/workflows/brainstorm.md +471 -471
- package/workflows/cli-tools-usage.md +44 -27
- package/workflows/codebase-rebuild.md +332 -332
- package/workflows/codebase-refresh.md +240 -240
- package/workflows/delegate-usage.md +3 -3
- package/workflows/execute.md +1 -1
- package/workflows/harvest.md +420 -420
- package/workflows/integration-test.md +343 -343
- package/workflows/issue-analyze.md +6 -2
- package/workflows/issue-discover.md +414 -414
- package/workflows/issue-execute.md +6 -3
- package/workflows/issue-plan.md +5 -2
- package/workflows/maestro-coordinate.codex.md +281 -470
- package/workflows/maestro-coordinate.md +14 -14
- package/workflows/maestro-link-coordinate.md +2 -2
- package/workflows/maestro.codex.md +710 -0
- package/workflows/maestro.md +10 -11
- package/workflows/map.md +111 -111
- package/workflows/milestone-complete.md +176 -176
- package/workflows/plan.md +1 -1
- package/workflows/quick.md +497 -497
- package/workflows/refactor.md +300 -300
- package/workflows/retrospective.md +1 -1
- package/workflows/roadmap.md +335 -335
- package/workflows/spec-generate.md +640 -640
- package/workflows/specs-add.md +46 -81
- package/workflows/specs-load.md +15 -17
- package/workflows/specs-setup.md +40 -161
- package/.claude/commands/manage-issue-analyze.md +0 -62
- package/.claude/commands/manage-issue-execute.md +0 -73
- package/.claude/commands/manage-issue-plan.md +0 -62
- package/.codex/skills/manage-issue-analyze/SKILL.md +0 -207
- package/.codex/skills/manage-issue-execute/SKILL.md +0 -200
- package/.codex/skills/manage-issue-plan/SKILL.md +0 -186
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: manage-issue-plan
|
|
3
|
-
description: Solution planning for a specific issue with codebase-aware step generation
|
|
4
|
-
argument-hint: "<ISS-ID> [--tool gemini|qwen] [--from-analysis]"
|
|
5
|
-
allowed-tools:
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Bash
|
|
9
|
-
- Glob
|
|
10
|
-
- Grep
|
|
11
|
-
- Agent
|
|
12
|
-
- AskUserQuestion
|
|
13
|
-
---
|
|
14
|
-
<purpose>
|
|
15
|
-
Solution planning for a specific issue. Generates a structured, codebase-aware solution with ordered steps, context, and a prompt template for execution. Attaches the solution record to the issue in `.workflow/issues/issues.jsonl`.
|
|
16
|
-
|
|
17
|
-
- **--tool**: CLI tool for planning (default: gemini)
|
|
18
|
-
- **--from-analysis**: Auto-detected; includes analysis context (root_cause, related_files) in the planning prompt if issue.analysis exists
|
|
19
|
-
|
|
20
|
-
For issue CRUD, use `/manage-issue`. For execution, use `/manage-issue-execute`.
|
|
21
|
-
</purpose>
|
|
22
|
-
|
|
23
|
-
<required_reading>
|
|
24
|
-
@~/.maestro/workflows/issue-plan.md
|
|
25
|
-
</required_reading>
|
|
26
|
-
|
|
27
|
-
<deferred_reading>
|
|
28
|
-
- [issue.json template](~/.maestro/templates/issue.json) -- read when building the solution record structure
|
|
29
|
-
</deferred_reading>
|
|
30
|
-
|
|
31
|
-
<context>
|
|
32
|
-
$ARGUMENTS -- ISS-ID (required) + optional flags.
|
|
33
|
-
|
|
34
|
-
**Options:**
|
|
35
|
-
- `<ISS-ID>` -- issue ID in ISS-XXXXXXXX-NNN format (required)
|
|
36
|
-
- `--tool gemini|qwen` -- CLI tool for planning (default: gemini)
|
|
37
|
-
- `--from-analysis` -- explicitly include analysis context (auto-detected if issue.analysis exists)
|
|
38
|
-
|
|
39
|
-
**State files:**
|
|
40
|
-
- `.workflow/issues/issues.jsonl` -- issue records (read + write)
|
|
41
|
-
</context>
|
|
42
|
-
|
|
43
|
-
<execution>
|
|
44
|
-
Follow '~/.maestro/workflows/issue-plan.md' completely.
|
|
45
|
-
</execution>
|
|
46
|
-
|
|
47
|
-
<error_codes>
|
|
48
|
-
| Code | Severity | Condition | Recovery |
|
|
49
|
-
|------|----------|-----------|----------|
|
|
50
|
-
| E_NO_ISSUE_ID | error | No ISS-ID provided in $ARGUMENTS | Display usage hint with example |
|
|
51
|
-
| E_ISSUE_NOT_FOUND | error | ISS-ID not found in issues.jsonl | Suggest `/manage-issue list` to find valid IDs |
|
|
52
|
-
| E_NO_ANALYSIS | warning | No analysis record on issue and --from-analysis specified | Proceed without analysis context, suggest `/manage-issue-analyze` first |
|
|
53
|
-
| E_PLANNING_FAILED | error | CLI planning returned no usable results | Retry with different --tool or report partial output |
|
|
54
|
-
</error_codes>
|
|
55
|
-
|
|
56
|
-
<success_criteria>
|
|
57
|
-
- [ ] Issue loaded and validated from issues.jsonl
|
|
58
|
-
- [ ] Analysis context included in prompt (if available)
|
|
59
|
-
- [ ] CLI planning executed and solution JSON parsed
|
|
60
|
-
- [ ] Solution record attached to issue in issues.jsonl
|
|
61
|
-
- [ ] Solution steps displayed with next-step routing to manage-issue-execute
|
|
62
|
-
</success_criteria>
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: manage-issue-analyze
|
|
3
|
-
description: Root cause analysis for a specific issue via CLI exploration. Gathers codebase context (grep or semantic deep search), runs maestro delegate gemini analysis, and attaches a structured analysis record to the issue in issues.jsonl.
|
|
4
|
-
argument-hint: "<ISS-ID> [--tool gemini|qwen] [--depth standard|deep]"
|
|
5
|
-
allowed-tools: Read, Write, Bash, Glob, Grep
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Issue Analyze
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
$manage-issue-analyze "ISS-20260401-001"
|
|
14
|
-
$manage-issue-analyze "ISS-20260401-001 --depth deep"
|
|
15
|
-
$manage-issue-analyze "ISS-20260401-001 --tool qwen --depth standard"
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**Flags**:
|
|
19
|
-
- `<ISS-ID>` — Issue ID in `ISS-XXXXXXXX-NNN` format (required)
|
|
20
|
-
- `--tool gemini|qwen` — CLI tool for analysis (default: gemini)
|
|
21
|
-
- `--depth standard|deep` — `standard` uses keyword grep; `deep` spawns a semantic explore agent (default: standard)
|
|
22
|
-
|
|
23
|
-
**State files**: `.workflow/issues/issues.jsonl` (read + write)
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Overview
|
|
28
|
-
|
|
29
|
-
Sequential 4-step pipeline: load issue → gather codebase context → run CLI analysis → attach analysis record. The CLI analysis step invokes `maestro delegate --to gemini --mode analysis` to produce a structured root-cause record written back into issues.jsonl. This is the first step in the issue resolution workflow: **analyze → plan → execute**.
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
Load Issue → Gather Context → CLI Analysis → Attach Record
|
|
33
|
-
(validate) (grep / agent) (gemini/qwen) (apply_patch)
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Implementation
|
|
39
|
-
|
|
40
|
-
### Step 1: Load and Validate Issue
|
|
41
|
-
|
|
42
|
-
```javascript
|
|
43
|
-
functions.update_plan({
|
|
44
|
-
explanation: "Starting issue analysis",
|
|
45
|
-
plan: [
|
|
46
|
-
{ step: "Load and validate issue", status: "in_progress" },
|
|
47
|
-
{ step: "Gather codebase context", status: "pending" },
|
|
48
|
-
{ step: "Run CLI analysis", status: "pending" },
|
|
49
|
-
{ step: "Attach analysis record", status: "pending" }
|
|
50
|
-
]
|
|
51
|
-
})
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Read `.workflow/issues/issues.jsonl` line by line. Find the row where `id == <ISS-ID>`. Validate:
|
|
55
|
-
- ISS-ID matches format `ISS-[0-9]{8}-[0-9]{3}`
|
|
56
|
-
- Row found in file
|
|
57
|
-
- Parse fields: `id`, `title`, `description`, `status`, `context`, `related_files`
|
|
58
|
-
|
|
59
|
-
If `status` is not `open` or `registered`, emit W001 but continue.
|
|
60
|
-
|
|
61
|
-
### Step 2: Gather Codebase Context
|
|
62
|
-
|
|
63
|
-
**Standard depth** (default):
|
|
64
|
-
- Grep key terms from `issue.title` + `issue.description` across `src/**` (-C 3)
|
|
65
|
-
- If `issue.related_files` is set, read those files directly
|
|
66
|
-
- Collect file:line references into `contextSummary`
|
|
67
|
-
|
|
68
|
-
**Deep depth**:
|
|
69
|
-
```javascript
|
|
70
|
-
spawn_agent({
|
|
71
|
-
task_name: "ctx-explore",
|
|
72
|
-
fork_turns: "none",
|
|
73
|
-
message: `## TASK ASSIGNMENT
|
|
74
|
-
|
|
75
|
-
### MANDATORY FIRST STEPS
|
|
76
|
-
1. Read: ~/.codex/agents/cli-explore-agent.md
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
Goal: Gather codebase context for issue root-cause analysis.
|
|
81
|
-
Issue: <issue.title>
|
|
82
|
-
Description: <issue.description>
|
|
83
|
-
|
|
84
|
-
TASK: Find all code paths, functions, and modules related to this issue.
|
|
85
|
-
Identify: affected locations (file:line), caller/callee chains, data flow, existing error handling.
|
|
86
|
-
|
|
87
|
-
EXPECTED: JSON with: affected_files [{file, line, snippet, relevance}], related_modules, error_handling_gaps, test_coverage_gaps.
|
|
88
|
-
`
|
|
89
|
-
})
|
|
90
|
-
const ctxResult = wait_agent({ timeout_ms: 1800000 }) // initial spawn: 30 min
|
|
91
|
-
close_agent({ target: "ctx-explore" })
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
```javascript
|
|
95
|
-
functions.update_plan({
|
|
96
|
-
explanation: "Context gathered",
|
|
97
|
-
plan: [
|
|
98
|
-
{ step: "Load and validate issue", status: "completed" },
|
|
99
|
-
{ step: "Gather codebase context", status: "completed" },
|
|
100
|
-
{ step: "Run CLI analysis", status: "in_progress" },
|
|
101
|
-
{ step: "Attach analysis record", status: "pending" }
|
|
102
|
-
]
|
|
103
|
-
})
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Step 3: Run CLI Analysis
|
|
107
|
-
|
|
108
|
-
> **Prompt safety**: `issue.title` and `contextSummary` may contain quotes or shell-special characters. Write the full prompt to a temp file first and reference it via `$(cat ...)` to avoid shell injection.
|
|
109
|
-
|
|
110
|
-
```javascript
|
|
111
|
-
// Build prompt, write to temp file to avoid shell injection
|
|
112
|
-
const promptContent = `PURPOSE: Root cause analysis for issue; identify exact cause, impact scope, fix direction; success = actionable record with file:line evidence.
|
|
113
|
-
Issue: ${issue.id} — ${issue.title}
|
|
114
|
-
TASK: Trace failure path | Map affected components | Assess blast radius | Define fix direction
|
|
115
|
-
MODE: analysis
|
|
116
|
-
CONTEXT: @src/**/* | Memory: ${contextSummary}
|
|
117
|
-
EXPECTED: JSON: root_cause (string), affected_files (string[]), impact_scope (low|medium|high|critical), fix_direction (string), confidence (low|medium|high)
|
|
118
|
-
CONSTRAINTS: Evidence required — file:line for each claim`
|
|
119
|
-
|
|
120
|
-
Write(`/tmp/iss-analyze-${issue.id}.txt`, promptContent)
|
|
121
|
-
functions.exec_command({
|
|
122
|
-
cmd: `maestro delegate "$(cat /tmp/iss-analyze-${issue.id}.txt)" --to ${tool} --mode analysis`,
|
|
123
|
-
workdir: "."
|
|
124
|
-
})
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Parse CLI output into `analysis` object:
|
|
128
|
-
```json
|
|
129
|
-
{
|
|
130
|
-
"root_cause": "...",
|
|
131
|
-
"affected_files": ["src/foo.ts:42"],
|
|
132
|
-
"impact_scope": "medium",
|
|
133
|
-
"fix_direction": "...",
|
|
134
|
-
"analyzed_at": "<ISO>",
|
|
135
|
-
"tool": "<tool>",
|
|
136
|
-
"depth": "<depth>",
|
|
137
|
-
"confidence": "medium"
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Step 4: Attach Analysis Record and Report
|
|
142
|
-
|
|
143
|
-
```javascript
|
|
144
|
-
// Read issues.jsonl, update the matching line in-place
|
|
145
|
-
const historyEntry = { action: "analyzed", at: new Date().toISOString(), by: "manage-issue-analyze", summary: `Root cause: ${analysis.root_cause}` }
|
|
146
|
-
const raw = Read('.workflow/issues/issues.jsonl')
|
|
147
|
-
const updated = raw.split('\n')
|
|
148
|
-
.filter(l => l.trim())
|
|
149
|
-
.map(l => {
|
|
150
|
-
const row = JSON.parse(l)
|
|
151
|
-
if (row.id !== issueId) return l
|
|
152
|
-
row.analysis = analysis
|
|
153
|
-
row.issue_history = [...(row.issue_history || []), historyEntry]
|
|
154
|
-
return JSON.stringify(row)
|
|
155
|
-
})
|
|
156
|
-
.join('\n') + '\n'
|
|
157
|
-
Write('.workflow/issues/issues.jsonl', updated)
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
```javascript
|
|
161
|
-
functions.update_plan({
|
|
162
|
-
explanation: "Analysis complete",
|
|
163
|
-
plan: [
|
|
164
|
-
{ step: "Load and validate issue", status: "completed" },
|
|
165
|
-
{ step: "Gather codebase context", status: "completed" },
|
|
166
|
-
{ step: "Run CLI analysis", status: "completed" },
|
|
167
|
-
{ step: "Attach analysis record", status: "completed" }
|
|
168
|
-
]
|
|
169
|
-
})
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
Display:
|
|
173
|
-
```
|
|
174
|
-
=== ANALYSIS COMPLETE ===
|
|
175
|
-
Issue: <ISS-ID>: <title>
|
|
176
|
-
Root Cause: <root_cause>
|
|
177
|
-
Impact: <impact_scope>
|
|
178
|
-
Confidence: <confidence>
|
|
179
|
-
Affected: <N> files
|
|
180
|
-
|
|
181
|
-
Next: $manage-issue-plan "<ISS-ID>"
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## Error Handling
|
|
187
|
-
|
|
188
|
-
| Code | Severity | Condition | Recovery |
|
|
189
|
-
|------|----------|-----------|----------|
|
|
190
|
-
| E001 | error | No ISS-ID provided | Display usage hint with format example |
|
|
191
|
-
| E002 | error | ISS-ID format invalid | Show correct format `ISS-XXXXXXXX-NNN` |
|
|
192
|
-
| E003 | error | ISS-ID not found in issues.jsonl | Suggest `$manage-issue "list"` |
|
|
193
|
-
| E004 | error | CLI analysis returned no parseable result | Retry with different `--tool`; report partial |
|
|
194
|
-
| W001 | warning | Issue status is not open/registered | Warn, allow analysis to continue |
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
## Core Rules
|
|
199
|
-
|
|
200
|
-
1. **Start immediately**: First action is `update_plan` then issue load — no preamble
|
|
201
|
-
2. **Validate before analysis**: Never run CLI without a valid loaded issue
|
|
202
|
-
3. **Evidence required**: Analysis record must cite file:line — no speculative root causes
|
|
203
|
-
4. **Deep agent lifecycle**: If deep spawned an agent, always `close_agent` before Step 3
|
|
204
|
-
5. **Append-only history**: Append to `issue_history`, never overwrite existing entries
|
|
205
|
-
- *Note*: `spawn_agent` / `wait_agent` / `close_agent` are Codex v4 built-in orchestration functions — they do not need to be listed in `allowed-tools`
|
|
206
|
-
6. **Preserve existing fields**: Patch only `analysis` + `issue_history` — all other fields unchanged
|
|
207
|
-
7. **Next-step routing**: Always display `$manage-issue-plan "<ISS-ID>"` at the end
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: manage-issue-execute
|
|
3
|
-
description: Execute a planned solution for an issue via dual-mode dispatch. Auto-detects server UP (POST to /api/execution/dispatch) or DOWN (direct maestro delegate). Updates issue status on completion with next-step routing to close, debug, or verify.
|
|
4
|
-
argument-hint: "<ISS-ID> [--executor claude-code|codex|gemini] [--dry-run]"
|
|
5
|
-
allowed-tools: Read, Write, Bash, Glob, Grep
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Issue Execute
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
$manage-issue-execute "ISS-20260401-001"
|
|
14
|
-
$manage-issue-execute "ISS-20260401-001 --dry-run"
|
|
15
|
-
$manage-issue-execute "ISS-20260401-001 --executor codex"
|
|
16
|
-
$manage-issue-execute "ISS-20260401-001 --executor gemini"
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**Flags**:
|
|
20
|
-
- `<ISS-ID>` — Issue ID in `ISS-XXXXXXXX-NNN` format (required)
|
|
21
|
-
- `--executor claude-code|codex|gemini` — Execution agent (default: claude-code)
|
|
22
|
-
- `--dry-run` — Preview constructed prompt and steps without executing
|
|
23
|
-
|
|
24
|
-
**State files**: `.workflow/issues/issues.jsonl` (read + write)
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Overview
|
|
29
|
-
|
|
30
|
-
Sequential 4-step pipeline with conditional dispatch: load issue → dry-run check → detect mode → execute + update. Server-UP path posts to the orchestration API; Server-DOWN path invokes `maestro delegate` directly. This is the third step in the issue resolution workflow: **analyze → plan → execute**.
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
Load Issue → [dry-run?] → Detect Mode → Dispatch → Update Status
|
|
34
|
-
(+ solution (display server UP POST (apply_patch)
|
|
35
|
-
required) + stop) / DOWN / cli
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Implementation
|
|
41
|
-
|
|
42
|
-
### Step 1: Load Issue and Validate Solution
|
|
43
|
-
|
|
44
|
-
```javascript
|
|
45
|
-
functions.update_plan({
|
|
46
|
-
explanation: "Starting issue execution",
|
|
47
|
-
plan: [
|
|
48
|
-
{ step: "Load issue and validate solution", status: "in_progress" },
|
|
49
|
-
{ step: "Detect dispatch mode", status: "pending" },
|
|
50
|
-
{ step: "Execute solution", status: "pending" },
|
|
51
|
-
{ step: "Update issue status", status: "pending" }
|
|
52
|
-
]
|
|
53
|
-
})
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Read `.workflow/issues/issues.jsonl`, find row where `id == <ISS-ID>`. Validate:
|
|
57
|
-
- ISS-ID format `ISS-[0-9]{8}-[0-9]{3}`
|
|
58
|
-
- Row exists in file
|
|
59
|
-
- `issue.solution` is non-null (E002 if missing — run `manage-issue-plan` first)
|
|
60
|
-
|
|
61
|
-
If `--dry-run`: display the full constructed prompt and each step from `issue.solution.steps`, then stop.
|
|
62
|
-
|
|
63
|
-
### Step 2: Detect Dispatch Mode
|
|
64
|
-
|
|
65
|
-
```javascript
|
|
66
|
-
// Read port from config (falls back to MAESTRO_PORT env var, then 3000)
|
|
67
|
-
const configPort = (() => {
|
|
68
|
-
try { return JSON.parse(Read('.workflow/config.json'))?.server?.port } catch { return null }
|
|
69
|
-
})()
|
|
70
|
-
const port = configPort || functions.exec_command({ cmd: "echo ${MAESTRO_PORT:-3000}", workdir: "." }).stdout.trim()
|
|
71
|
-
|
|
72
|
-
const healthCheck = functions.exec_command({
|
|
73
|
-
cmd: `curl -s -o /dev/null -w '%{http_code}' http://localhost:${port}/health`,
|
|
74
|
-
workdir: "."
|
|
75
|
-
})
|
|
76
|
-
const serverUp = healthCheck.stdout.trim() === "200"
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
| Mode | Condition | Action |
|
|
80
|
-
|------|-----------|--------|
|
|
81
|
-
| Server UP | HTTP 200 from /health | POST to `/api/execution/dispatch` |
|
|
82
|
-
| Server DOWN | Any other result | Direct `maestro delegate` execution |
|
|
83
|
-
|
|
84
|
-
```javascript
|
|
85
|
-
functions.update_plan({
|
|
86
|
-
explanation: `Dispatch mode: ${serverUp ? "server" : "cli"}`,
|
|
87
|
-
plan: [
|
|
88
|
-
{ step: "Load issue and validate solution", status: "completed" },
|
|
89
|
-
{ step: "Detect dispatch mode", status: "completed" },
|
|
90
|
-
{ step: "Execute solution", status: "in_progress" },
|
|
91
|
-
{ step: "Update issue status", status: "pending" }
|
|
92
|
-
]
|
|
93
|
-
})
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Step 3: Execute Solution
|
|
97
|
-
|
|
98
|
-
Build the execution prompt from `issue.solution`:
|
|
99
|
-
```
|
|
100
|
-
PURPOSE: Implement solution for '${issue.title}'.
|
|
101
|
-
TASK: ${solution.steps.map(s => `${s.order}. ${s.description} in ${s.file}`).join(' | ')}
|
|
102
|
-
MODE: write
|
|
103
|
-
CONTEXT: @src/**/* | Memory: Approach: ${solution.approach}
|
|
104
|
-
${issue.analysis ? `Root cause: ${issue.analysis.root_cause}` : ''}
|
|
105
|
-
EXPECTED: All steps implemented, all verification criteria met: ${solution.verification.join('; ')}
|
|
106
|
-
CONSTRAINTS: Only modify files listed in steps | No scope creep
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
**Server UP**:
|
|
110
|
-
```javascript
|
|
111
|
-
// Write payload to temp file to avoid shell injection from prompt content
|
|
112
|
-
const payload = JSON.stringify({ issue_id: issue.id, executor, prompt: execPrompt })
|
|
113
|
-
Write(`/tmp/iss-exec-${issue.id}.json`, payload)
|
|
114
|
-
functions.exec_command({
|
|
115
|
-
cmd: `curl -X POST http://localhost:${port}/api/execution/dispatch \
|
|
116
|
-
-H 'Content-Type: application/json' \
|
|
117
|
-
-d @/tmp/iss-exec-${issue.id}.json`,
|
|
118
|
-
workdir: "."
|
|
119
|
-
})
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
**Server DOWN**:
|
|
123
|
-
```javascript
|
|
124
|
-
// Write prompt to temp file to avoid shell injection
|
|
125
|
-
Write(`/tmp/iss-exec-${issue.id}.txt`, execPrompt)
|
|
126
|
-
functions.exec_command({
|
|
127
|
-
cmd: `maestro delegate "$(cat /tmp/iss-exec-${issue.id}.txt)" --to ${executor === 'codex' ? 'codex' : 'claude'} --mode write`,
|
|
128
|
-
workdir: "."
|
|
129
|
-
})
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
Set issue status to `in_progress` before dispatching via apply_patch.
|
|
133
|
-
|
|
134
|
-
### Step 4: Update Issue Status and Report
|
|
135
|
-
|
|
136
|
-
On success:
|
|
137
|
-
```javascript
|
|
138
|
-
// Read issues.jsonl, update the matching line in-place
|
|
139
|
-
const historyEntry = { action: "executed", at: new Date().toISOString(), by: "manage-issue-execute", executor, summary: `Solution executed via ${serverUp ? "server" : "cli"}` }
|
|
140
|
-
const raw = Read('.workflow/issues/issues.jsonl')
|
|
141
|
-
const updated = raw.split('\n')
|
|
142
|
-
.filter(l => l.trim())
|
|
143
|
-
.map(l => {
|
|
144
|
-
const row = JSON.parse(l)
|
|
145
|
-
if (row.id !== issueId) return l
|
|
146
|
-
row.status = "resolved"
|
|
147
|
-
row.issue_history = [...(row.issue_history || []), historyEntry]
|
|
148
|
-
return JSON.stringify(row)
|
|
149
|
-
})
|
|
150
|
-
.join('\n') + '\n'
|
|
151
|
-
Write('.workflow/issues/issues.jsonl', updated)
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
```javascript
|
|
155
|
-
functions.update_plan({
|
|
156
|
-
explanation: "Execution complete",
|
|
157
|
-
plan: [
|
|
158
|
-
{ step: "Load issue and validate solution", status: "completed" },
|
|
159
|
-
{ step: "Detect dispatch mode", status: "completed" },
|
|
160
|
-
{ step: "Execute solution", status: "completed" },
|
|
161
|
-
{ step: "Update issue status", status: "completed" }
|
|
162
|
-
]
|
|
163
|
-
})
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Display next-step routing:
|
|
167
|
-
```
|
|
168
|
-
=== EXECUTION COMPLETE ===
|
|
169
|
-
Issue: <ISS-ID>: <title>
|
|
170
|
-
Executor: <executor>
|
|
171
|
-
Mode: <server|cli>
|
|
172
|
-
Status: resolved
|
|
173
|
-
|
|
174
|
-
Next steps:
|
|
175
|
-
Close: $manage-issue "close <ISS-ID> --resolution fixed"
|
|
176
|
-
Verify: $maestro-verify "<phase>"
|
|
177
|
-
Debug: $quality-debug "<failure description>" (if issues found)
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Error Handling
|
|
183
|
-
|
|
184
|
-
| Code | Severity | Condition | Recovery |
|
|
185
|
-
|------|----------|-----------|----------|
|
|
186
|
-
| E001 | error | No ISS-ID provided | Display usage hint |
|
|
187
|
-
| E002 | error | No solution record on issue | Run `$manage-issue-plan "<ISS-ID>"` first |
|
|
188
|
-
| E003 | error | ISS-ID not found in issues.jsonl | Suggest `$manage-issue "list"` |
|
|
189
|
-
| E004 | error | Server dispatch or CLI execution failed | Log error, revert status to `open`, display failure details |
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## Core Rules
|
|
194
|
-
|
|
195
|
-
1. **Solution required**: Never dispatch without a valid `issue.solution` record
|
|
196
|
-
2. **Dry-run first**: `--dry-run` always stops after displaying prompt — no execution
|
|
197
|
-
3. **Status before dispatch**: Set status to `in_progress` before dispatching, `resolved` on success, `open` on failure
|
|
198
|
-
4. **Revert on failure**: If dispatch fails, revert issue status to `open` via apply_patch
|
|
199
|
-
5. **Preserve history**: Append to `issue_history`, never overwrite existing entries
|
|
200
|
-
6. **Next-step routing**: Always display all three options (close / verify / debug) at the end
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: manage-issue-plan
|
|
3
|
-
description: Solution planning for a specific issue. Auto-detects analysis context, runs maestro delegate planning, and attaches a structured solution record with ordered steps and verification criteria to the issue in issues.jsonl.
|
|
4
|
-
argument-hint: "<ISS-ID> [--tool gemini|qwen] [--from-analysis]"
|
|
5
|
-
allowed-tools: Read, Write, Bash, Glob, Grep
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Issue Plan
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
$manage-issue-plan "ISS-20260401-001"
|
|
14
|
-
$manage-issue-plan "ISS-20260401-001 --from-analysis"
|
|
15
|
-
$manage-issue-plan "ISS-20260401-001 --tool qwen"
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**Flags**:
|
|
19
|
-
- `<ISS-ID>` — Issue ID in `ISS-XXXXXXXX-NNN` format (required)
|
|
20
|
-
- `--tool gemini|qwen` — CLI tool for planning (default: gemini)
|
|
21
|
-
- `--from-analysis` — Explicitly include analysis context. Auto-detected when `issue.analysis` exists.
|
|
22
|
-
|
|
23
|
-
**State files**: `.workflow/issues/issues.jsonl` (read + write)
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Overview
|
|
28
|
-
|
|
29
|
-
Sequential 4-step pipeline: load issue → build planning prompt → run CLI planning → attach solution record. When an analysis record exists (from `manage-issue-analyze`), it is automatically included in the planning prompt to ground the solution in known root cause and affected files. This is the second step in the issue resolution workflow: **analyze → plan → execute**.
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
Load Issue → Build Prompt → CLI Planning → Attach Solution
|
|
33
|
-
(+ analysis (auto-detect (gemini/qwen) (apply_patch)
|
|
34
|
-
context) analysis)
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Implementation
|
|
40
|
-
|
|
41
|
-
### Step 1: Load Issue and Detect Analysis Context
|
|
42
|
-
|
|
43
|
-
```javascript
|
|
44
|
-
functions.update_plan({
|
|
45
|
-
explanation: "Starting issue planning",
|
|
46
|
-
plan: [
|
|
47
|
-
{ step: "Load issue and detect analysis", status: "in_progress" },
|
|
48
|
-
{ step: "Build planning prompt", status: "pending" },
|
|
49
|
-
{ step: "Run CLI planning", status: "pending" },
|
|
50
|
-
{ step: "Attach solution record", status: "pending" }
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Read `.workflow/issues/issues.jsonl`, find the row where `id == <ISS-ID>`. Validate format and existence.
|
|
56
|
-
|
|
57
|
-
Check analysis context:
|
|
58
|
-
- `issue.analysis` non-null → `hasAnalysis = true` (auto-detect, no flag needed)
|
|
59
|
-
- `--from-analysis` present AND `issue.analysis` is null → emit W001, proceed without context
|
|
60
|
-
|
|
61
|
-
### Step 2: Build Planning Prompt
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
PURPOSE: Create a concrete, codebase-aware solution plan for '${issue.title}';
|
|
65
|
-
success = ordered steps with exact file paths, function names, and verification criteria.
|
|
66
|
-
TASK: Define solution approach | Break into ordered steps | Identify files to change | Define verification
|
|
67
|
-
MODE: analysis
|
|
68
|
-
CONTEXT: @src/**/* | Memory: Issue: ${issue.description}
|
|
69
|
-
${hasAnalysis ? `Root cause: ${analysis.root_cause}
|
|
70
|
-
Affected files: ${analysis.affected_files.join(', ')}
|
|
71
|
-
Fix direction: ${analysis.fix_direction}` : ''}
|
|
72
|
-
EXPECTED: JSON: approach (string), steps [{order, description, file, action}],
|
|
73
|
-
verification (string[]), estimated_risk (low|medium|high)
|
|
74
|
-
CONSTRAINTS: Concrete steps only | File:line references required | No speculative changes
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Step 3: Run CLI Planning
|
|
78
|
-
|
|
79
|
-
> **Prompt safety**: `issue.title`, `issue.description`, and analysis fields may contain quotes or shell-special characters. Write the assembled prompt to a temp file before passing to exec_command.
|
|
80
|
-
|
|
81
|
-
```javascript
|
|
82
|
-
// Write prompt to temp file to avoid shell injection
|
|
83
|
-
Write(`/tmp/iss-plan-${issueId}.txt`, prompt)
|
|
84
|
-
functions.exec_command({
|
|
85
|
-
cmd: `maestro delegate "$(cat /tmp/iss-plan-${issueId}.txt)" --to ${tool} --mode analysis`,
|
|
86
|
-
workdir: "."
|
|
87
|
-
})
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Parse CLI output into `solution` object:
|
|
91
|
-
```json
|
|
92
|
-
{
|
|
93
|
-
"approach": "...",
|
|
94
|
-
"steps": [
|
|
95
|
-
{ "order": 1, "description": "...", "file": "src/foo.ts", "action": "modify" },
|
|
96
|
-
{ "order": 2, "description": "...", "file": "src/bar.ts", "action": "add" }
|
|
97
|
-
],
|
|
98
|
-
"verification": ["Run unit tests for X", "Verify Y behavior"],
|
|
99
|
-
"estimated_risk": "medium",
|
|
100
|
-
"planned_at": "<ISO>",
|
|
101
|
-
"tool": "<tool>"
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
```javascript
|
|
106
|
-
functions.update_plan({
|
|
107
|
-
explanation: "Planning complete",
|
|
108
|
-
plan: [
|
|
109
|
-
{ step: "Load issue and detect analysis", status: "completed" },
|
|
110
|
-
{ step: "Build planning prompt", status: "completed" },
|
|
111
|
-
{ step: "Run CLI planning", status: "completed" },
|
|
112
|
-
{ step: "Attach solution record", status: "in_progress" }
|
|
113
|
-
]
|
|
114
|
-
})
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Step 4: Attach Solution Record and Report
|
|
118
|
-
|
|
119
|
-
```javascript
|
|
120
|
-
// Read issues.jsonl, update the matching line in-place
|
|
121
|
-
const historyEntry = { action: "planned", at: new Date().toISOString(), by: "manage-issue-plan", summary: `Approach: ${solution.approach} — ${solution.steps.length} steps` }
|
|
122
|
-
const raw = Read('.workflow/issues/issues.jsonl')
|
|
123
|
-
const updated = raw.split('\n')
|
|
124
|
-
.filter(l => l.trim())
|
|
125
|
-
.map(l => {
|
|
126
|
-
const row = JSON.parse(l)
|
|
127
|
-
if (row.id !== issueId) return l
|
|
128
|
-
row.solution = solution
|
|
129
|
-
row.issue_history = [...(row.issue_history || []), historyEntry]
|
|
130
|
-
return JSON.stringify(row)
|
|
131
|
-
})
|
|
132
|
-
.join('\n') + '\n'
|
|
133
|
-
Write('.workflow/issues/issues.jsonl', updated)
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
```javascript
|
|
137
|
-
functions.update_plan({
|
|
138
|
-
explanation: "Solution attached",
|
|
139
|
-
plan: [
|
|
140
|
-
{ step: "Load issue and detect analysis", status: "completed" },
|
|
141
|
-
{ step: "Build planning prompt", status: "completed" },
|
|
142
|
-
{ step: "Run CLI planning", status: "completed" },
|
|
143
|
-
{ step: "Attach solution record", status: "completed" }
|
|
144
|
-
]
|
|
145
|
-
})
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Display:
|
|
149
|
-
```
|
|
150
|
-
=== SOLUTION PLAN ===
|
|
151
|
-
Issue: <ISS-ID>: <title>
|
|
152
|
-
Approach: <approach>
|
|
153
|
-
Risk: <estimated_risk>
|
|
154
|
-
Steps: <N>
|
|
155
|
-
|
|
156
|
-
Steps:
|
|
157
|
-
1. <description> → <file> (<action>)
|
|
158
|
-
2. <description> → <file> (<action>)
|
|
159
|
-
|
|
160
|
-
Verification:
|
|
161
|
-
- <verification 1>
|
|
162
|
-
|
|
163
|
-
Next: $manage-issue-execute "<ISS-ID>"
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## Error Handling
|
|
169
|
-
|
|
170
|
-
| Code | Severity | Condition | Recovery |
|
|
171
|
-
|------|----------|-----------|----------|
|
|
172
|
-
| E001 | error | No ISS-ID provided | Display usage hint |
|
|
173
|
-
| E002 | error | ISS-ID not found in issues.jsonl | Suggest `$manage-issue "list"` |
|
|
174
|
-
| E003 | error | CLI planning returned no parseable result | Retry with different `--tool` |
|
|
175
|
-
| W001 | warning | `--from-analysis` but no analysis record exists | Proceed without context; suggest `$manage-issue-analyze` |
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## Core Rules
|
|
180
|
-
|
|
181
|
-
1. **Load before plan**: Validate issue existence before any CLI call
|
|
182
|
-
2. **Auto-detect analysis**: Check `issue.analysis` — never require explicit `--from-analysis` if data is present
|
|
183
|
-
3. **Concrete steps only**: Each step must have a file reference — no "investigate further" placeholders
|
|
184
|
-
4. **Preserve existing fields**: Patch only `solution` + `issue_history` — all other issue fields unchanged
|
|
185
|
-
5. **Append-only history**: Append to `issue_history`, never overwrite existing entries
|
|
186
|
-
6. **Next-step routing**: Always display `$manage-issue-execute "<ISS-ID>"` at the end
|