maestro-flow 0.3.3 → 0.3.5
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/commands/quality-business-test.md +110 -0
- package/.codex/skills/maestro-init/SKILL.md +167 -167
- package/.codex/skills/maestro-phase-add/SKILL.md +154 -154
- package/.codex/skills/maestro-phase-transition/SKILL.md +173 -173
- package/.codex/skills/maestro-verify/SKILL.md +566 -566
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +5 -5
- package/.codex/skills/manage-codebase-refresh/SKILL.md +5 -5
- package/.codex/skills/manage-issue/SKILL.md +7 -7
- package/.codex/skills/manage-issue-analyze/SKILL.md +7 -7
- package/.codex/skills/manage-issue-discover/SKILL.md +503 -503
- package/.codex/skills/manage-issue-execute/SKILL.md +9 -9
- package/.codex/skills/manage-issue-plan/SKILL.md +8 -8
- package/.codex/skills/manage-learn/SKILL.md +7 -7
- package/.codex/skills/manage-memory/SKILL.md +72 -72
- package/.codex/skills/manage-memory-capture/SKILL.md +86 -86
- package/.codex/skills/manage-status/SKILL.md +2 -2
- package/.codex/skills/quality-business-test/SKILL.md +223 -0
- package/.codex/skills/quality-debug/SKILL.md +5 -5
- package/.codex/skills/quality-integration-test/SKILL.md +544 -544
- package/.codex/skills/quality-refactor/SKILL.md +6 -6
- package/.codex/skills/quality-retrospective/SKILL.md +10 -10
- package/.codex/skills/quality-review/SKILL.md +408 -408
- package/.codex/skills/quality-sync/SKILL.md +6 -6
- package/.codex/skills/quality-test/SKILL.md +5 -5
- package/.codex/skills/quality-test-gen/SKILL.md +447 -447
- package/.codex/skills/spec-add/SKILL.md +5 -5
- package/.codex/skills/spec-load/SKILL.md +5 -5
- package/.codex/skills/spec-map/SKILL.md +5 -5
- package/.codex/skills/spec-setup/SKILL.md +2 -2
- package/chains/_intent-map.json +6 -0
- package/chains/_router.json +14 -0
- package/chains/full-lifecycle.json +15 -0
- package/chains/quality-loop.json +16 -1
- package/chains/singles/business-test.json +26 -0
- package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.d.ts +4 -0
- package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js +47 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +16 -2
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +25 -9
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
- package/dashboard/dist-server/src/agents/cli-agent-runner.d.ts +3 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.js +78 -61
- package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
- package/dashboard/dist-server/src/agents/cli-history-store.d.ts +14 -1
- package/dashboard/dist-server/src/agents/cli-history-store.js +24 -2
- package/dashboard/dist-server/src/agents/cli-history-store.js.map +1 -1
- package/dashboard/dist-server/src/commands/delegate.js +142 -6
- package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
- package/dist/src/agents/cli-agent-runner.d.ts +3 -0
- package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.js +72 -46
- package/dist/src/agents/cli-agent-runner.js.map +1 -1
- package/dist/src/agents/cli-history-store.d.ts +14 -1
- package/dist/src/agents/cli-history-store.d.ts.map +1 -1
- package/dist/src/agents/cli-history-store.js +24 -2
- package/dist/src/agents/cli-history-store.js.map +1 -1
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +65 -5
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/commands/install-backend.d.ts.map +1 -1
- package/dist/src/commands/install-backend.js +5 -2
- package/dist/src/commands/install-backend.js.map +1 -1
- package/dist/src/mcp/delegate-channel-relay.d.ts.map +1 -1
- package/dist/src/mcp/delegate-channel-relay.js +7 -2
- package/dist/src/mcp/delegate-channel-relay.js.map +1 -1
- package/dist/src/mcp/server.js +1 -1
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/tools/index.d.ts +1 -6
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +1 -451
- package/dist/src/tools/index.js.map +1 -1
- package/package.json +3 -2
- package/templates/business-test-report.json +68 -0
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: maestro-phase-add
|
|
3
|
-
description: Add or insert a new phase into the project roadmap with automatic renumbering
|
|
4
|
-
argument-hint: "\"phase name\" [--after N] [--before N]"
|
|
5
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Maestro Phase Add (Single Agent)
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
$maestro-phase-add "authentication"
|
|
14
|
-
$maestro-phase-add "caching-layer" --after 2
|
|
15
|
-
$maestro-phase-add "security-hardening" --before 5
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**Flags**:
|
|
19
|
-
- `"phase name"`: Required. Used as both slug and title (slug = lowercase, hyphens)
|
|
20
|
-
- `--after N`: Insert after phase N (renumbers subsequent phases)
|
|
21
|
-
- `--before N`: Insert before phase N (renumbers from N onward)
|
|
22
|
-
- If neither: append at end
|
|
23
|
-
|
|
24
|
-
**Output**: New phase directory, updated roadmap.md, updated state.json
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Overview
|
|
29
|
-
|
|
30
|
-
Single mutation operation on the project roadmap. Creates a new phase directory with initialized index.json, inserts the phase entry into roadmap.md at the correct position, and handles automatic renumbering of all affected phase directories and references.
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Implementation
|
|
35
|
-
|
|
36
|
-
### Step 1: Parse Arguments
|
|
37
|
-
|
|
38
|
-
Extract:
|
|
39
|
-
- Phase name/slug (required — E001 if missing)
|
|
40
|
-
- `--after N` or `--before N` flag (mutually exclusive)
|
|
41
|
-
- Generate slug: lowercase, replace spaces with hyphens, strip special chars
|
|
42
|
-
|
|
43
|
-
### Step 2: Load Roadmap State
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
cat .workflow/roadmap.md
|
|
47
|
-
cat .workflow/state.json
|
|
48
|
-
ls -d .workflow/phases/*/
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
- Parse existing phases from roadmap.md
|
|
52
|
-
- List existing phase directories
|
|
53
|
-
- Check for duplicate slug (E003 if exists)
|
|
54
|
-
- Verify roadmap.md exists (E002 if not)
|
|
55
|
-
|
|
56
|
-
### Step 3: Calculate Position
|
|
57
|
-
|
|
58
|
-
- If `--after N`: new phase number = N + 1
|
|
59
|
-
- If `--before N`: new phase number = N
|
|
60
|
-
- If neither: new phase number = max_existing + 1
|
|
61
|
-
|
|
62
|
-
### Step 4: Renumber Existing Phases (if inserting)
|
|
63
|
-
|
|
64
|
-
**Only when `--after N` or `--before N` is used.**
|
|
65
|
-
|
|
66
|
-
For each phase with number >= new phase number (process in reverse order to avoid collisions):
|
|
67
|
-
|
|
68
|
-
1. Rename directory: `.workflow/phases/{NN}-{slug}` → `.workflow/phases/{NN+1}-{slug}`
|
|
69
|
-
2. Update index.json inside renamed directory: `"phase": N+1`
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
# Rename in reverse order to prevent collisions
|
|
73
|
-
for dir in $(ls -rd .workflow/phases/*/); do
|
|
74
|
-
# Extract number, if >= insertion point, rename to number+1
|
|
75
|
-
done
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Step 5: Create Phase Directory
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
mkdir -p .workflow/phases/{NN}-{slug}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Format NN as zero-padded 2-digit number (e.g., 03).
|
|
85
|
-
|
|
86
|
-
### Step 6: Initialize Phase index.json
|
|
87
|
-
|
|
88
|
-
Read template from `~/.maestro/templates/index.json` if available, otherwise create:
|
|
89
|
-
|
|
90
|
-
```json
|
|
91
|
-
{
|
|
92
|
-
"phase": <N>,
|
|
93
|
-
"slug": "<slug>",
|
|
94
|
-
"title": "<phase name>",
|
|
95
|
-
"status": "pending",
|
|
96
|
-
"created_at": "<ISO timestamp>",
|
|
97
|
-
"tasks": []
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Write to `.workflow/phases/{NN}-{slug}/index.json`.
|
|
102
|
-
|
|
103
|
-
### Step 7: Update roadmap.md
|
|
104
|
-
|
|
105
|
-
Insert new phase entry at the correct position in roadmap.md:
|
|
106
|
-
- Match the existing phase entry format
|
|
107
|
-
- If inserting, update all subsequent phase numbers in the document
|
|
108
|
-
|
|
109
|
-
### Step 8: Update state.json
|
|
110
|
-
|
|
111
|
-
If renumbering affected `current_phase` or `phases_completed`:
|
|
112
|
-
- Adjust `current_phase` number if it was shifted
|
|
113
|
-
- Adjust all entries in `phases_completed` that were shifted
|
|
114
|
-
|
|
115
|
-
### Step 9: Completion Report
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
=== PHASE ADDED ===
|
|
119
|
-
Phase: {NN} - {phase name}
|
|
120
|
-
Location: .workflow/phases/{NN}-{slug}/
|
|
121
|
-
|
|
122
|
-
{if renumbered}
|
|
123
|
-
Renumbered: Phases {start}-{end} shifted by +1
|
|
124
|
-
{endif}
|
|
125
|
-
|
|
126
|
-
Updated:
|
|
127
|
-
.workflow/roadmap.md
|
|
128
|
-
.workflow/phases/{NN}-{slug}/index.json
|
|
129
|
-
{if renumbered}.workflow/state.json{endif}
|
|
130
|
-
|
|
131
|
-
Next steps:
|
|
132
|
-
$maestro-plan "" -- Plan tasks for the new phase
|
|
133
|
-
$
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## Error Handling
|
|
139
|
-
|
|
140
|
-
| Code | Severity | Description | Recovery |
|
|
141
|
-
|------|----------|-------------|----------|
|
|
142
|
-
| E001 | error | Phase name/slug required | Provide phase name as argument |
|
|
143
|
-
| E002 | error | roadmap.md not found | Run maestro-init first |
|
|
144
|
-
| E003 | error | Duplicate phase name/slug exists | Choose a different name |
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Core Rules
|
|
149
|
-
|
|
150
|
-
1. **Reverse-order renumbering** — always rename directories from highest to lowest to prevent collisions
|
|
151
|
-
2. **State consistency** — state.json phase references must be adjusted after renumbering
|
|
152
|
-
3. **Match existing format** — new roadmap.md entries must match the style of existing entries
|
|
153
|
-
4. **Zero-padded numbers** — always use 2-digit format (01, 02, ... 99)
|
|
154
|
-
5. **Slug normalization** — lowercase, hyphens only, no special characters
|
|
1
|
+
---
|
|
2
|
+
name: maestro-phase-add
|
|
3
|
+
description: Add or insert a new phase into the project roadmap with automatic renumbering
|
|
4
|
+
argument-hint: "\"phase name\" [--after N] [--before N]"
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Maestro Phase Add (Single Agent)
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
$maestro-phase-add "authentication"
|
|
14
|
+
$maestro-phase-add "caching-layer" --after 2
|
|
15
|
+
$maestro-phase-add "security-hardening" --before 5
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Flags**:
|
|
19
|
+
- `"phase name"`: Required. Used as both slug and title (slug = lowercase, hyphens)
|
|
20
|
+
- `--after N`: Insert after phase N (renumbers subsequent phases)
|
|
21
|
+
- `--before N`: Insert before phase N (renumbers from N onward)
|
|
22
|
+
- If neither: append at end
|
|
23
|
+
|
|
24
|
+
**Output**: New phase directory, updated roadmap.md, updated state.json
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Overview
|
|
29
|
+
|
|
30
|
+
Single mutation operation on the project roadmap. Creates a new phase directory with initialized index.json, inserts the phase entry into roadmap.md at the correct position, and handles automatic renumbering of all affected phase directories and references.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Implementation
|
|
35
|
+
|
|
36
|
+
### Step 1: Parse Arguments
|
|
37
|
+
|
|
38
|
+
Extract:
|
|
39
|
+
- Phase name/slug (required — E001 if missing)
|
|
40
|
+
- `--after N` or `--before N` flag (mutually exclusive)
|
|
41
|
+
- Generate slug: lowercase, replace spaces with hyphens, strip special chars
|
|
42
|
+
|
|
43
|
+
### Step 2: Load Roadmap State
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
cat .workflow/roadmap.md
|
|
47
|
+
cat .workflow/state.json
|
|
48
|
+
ls -d .workflow/phases/*/
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- Parse existing phases from roadmap.md
|
|
52
|
+
- List existing phase directories
|
|
53
|
+
- Check for duplicate slug (E003 if exists)
|
|
54
|
+
- Verify roadmap.md exists (E002 if not)
|
|
55
|
+
|
|
56
|
+
### Step 3: Calculate Position
|
|
57
|
+
|
|
58
|
+
- If `--after N`: new phase number = N + 1
|
|
59
|
+
- If `--before N`: new phase number = N
|
|
60
|
+
- If neither: new phase number = max_existing + 1
|
|
61
|
+
|
|
62
|
+
### Step 4: Renumber Existing Phases (if inserting)
|
|
63
|
+
|
|
64
|
+
**Only when `--after N` or `--before N` is used.**
|
|
65
|
+
|
|
66
|
+
For each phase with number >= new phase number (process in reverse order to avoid collisions):
|
|
67
|
+
|
|
68
|
+
1. Rename directory: `.workflow/phases/{NN}-{slug}` → `.workflow/phases/{NN+1}-{slug}`
|
|
69
|
+
2. Update index.json inside renamed directory: `"phase": N+1`
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Rename in reverse order to prevent collisions
|
|
73
|
+
for dir in $(ls -rd .workflow/phases/*/); do
|
|
74
|
+
# Extract number, if >= insertion point, rename to number+1
|
|
75
|
+
done
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Step 5: Create Phase Directory
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
mkdir -p .workflow/phases/{NN}-{slug}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Format NN as zero-padded 2-digit number (e.g., 03).
|
|
85
|
+
|
|
86
|
+
### Step 6: Initialize Phase index.json
|
|
87
|
+
|
|
88
|
+
Read template from `~/.maestro/templates/index.json` if available, otherwise create:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"phase": <N>,
|
|
93
|
+
"slug": "<slug>",
|
|
94
|
+
"title": "<phase name>",
|
|
95
|
+
"status": "pending",
|
|
96
|
+
"created_at": "<ISO timestamp>",
|
|
97
|
+
"tasks": []
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Write to `.workflow/phases/{NN}-{slug}/index.json`.
|
|
102
|
+
|
|
103
|
+
### Step 7: Update roadmap.md
|
|
104
|
+
|
|
105
|
+
Insert new phase entry at the correct position in roadmap.md:
|
|
106
|
+
- Match the existing phase entry format
|
|
107
|
+
- If inserting, update all subsequent phase numbers in the document
|
|
108
|
+
|
|
109
|
+
### Step 8: Update state.json
|
|
110
|
+
|
|
111
|
+
If renumbering affected `current_phase` or `phases_completed`:
|
|
112
|
+
- Adjust `current_phase` number if it was shifted
|
|
113
|
+
- Adjust all entries in `phases_completed` that were shifted
|
|
114
|
+
|
|
115
|
+
### Step 9: Completion Report
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
=== PHASE ADDED ===
|
|
119
|
+
Phase: {NN} - {phase name}
|
|
120
|
+
Location: .workflow/phases/{NN}-{slug}/
|
|
121
|
+
|
|
122
|
+
{if renumbered}
|
|
123
|
+
Renumbered: Phases {start}-{end} shifted by +1
|
|
124
|
+
{endif}
|
|
125
|
+
|
|
126
|
+
Updated:
|
|
127
|
+
.workflow/roadmap.md
|
|
128
|
+
.workflow/phases/{NN}-{slug}/index.json
|
|
129
|
+
{if renumbered}.workflow/state.json{endif}
|
|
130
|
+
|
|
131
|
+
Next steps:
|
|
132
|
+
$maestro-plan "" -- Plan tasks for the new phase
|
|
133
|
+
$manage-status -- View updated roadmap
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Error Handling
|
|
139
|
+
|
|
140
|
+
| Code | Severity | Description | Recovery |
|
|
141
|
+
|------|----------|-------------|----------|
|
|
142
|
+
| E001 | error | Phase name/slug required | Provide phase name as argument |
|
|
143
|
+
| E002 | error | roadmap.md not found | Run maestro-init first |
|
|
144
|
+
| E003 | error | Duplicate phase name/slug exists | Choose a different name |
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Core Rules
|
|
149
|
+
|
|
150
|
+
1. **Reverse-order renumbering** — always rename directories from highest to lowest to prevent collisions
|
|
151
|
+
2. **State consistency** — state.json phase references must be adjusted after renumbering
|
|
152
|
+
3. **Match existing format** — new roadmap.md entries must match the style of existing entries
|
|
153
|
+
4. **Zero-padded numbers** — always use 2-digit format (01, 02, ... 99)
|
|
154
|
+
5. **Slug normalization** — lowercase, hyphens only, no special characters
|
|
@@ -1,173 +1,173 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: maestro-phase-transition
|
|
3
|
-
description: Mark current or specified phase as complete, extract learnings, advance to next phase
|
|
4
|
-
argument-hint: "[phase-number] [--force]"
|
|
5
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Maestro Phase Transition (Single Agent)
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
$maestro-phase-transition ""
|
|
14
|
-
$maestro-phase-transition "2"
|
|
15
|
-
$maestro-phase-transition "3 --force"
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**Flags**:
|
|
19
|
-
- `[phase-number]`: Phase to transition from (defaults to current_phase from state.json)
|
|
20
|
-
- `--force`: Skip gap checks and force transition even with warnings
|
|
21
|
-
|
|
22
|
-
**Output**: Updated state.json, completed phase index.json, initialized next phase, learnings extracted
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Overview
|
|
27
|
-
|
|
28
|
-
State-machine transition skill. Validates that the current phase meets completion criteria (tasks done, verification passed, no unresolved gaps), marks it complete, extracts learnings, and advances to the next phase. Creates next phase directory if needed.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Implementation
|
|
33
|
-
|
|
34
|
-
### Step 1: Parse Arguments
|
|
35
|
-
|
|
36
|
-
Extract:
|
|
37
|
-
- Phase number (optional, integer)
|
|
38
|
-
- `--force` flag
|
|
39
|
-
|
|
40
|
-
### Step 2: Load State
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
cat .workflow/state.json
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Determine phase number:
|
|
47
|
-
- If provided: use specified phase
|
|
48
|
-
- If omitted: use `current_phase` from state.json
|
|
49
|
-
- If neither: error E001
|
|
50
|
-
|
|
51
|
-
### Step 3: Resolve Phase Directory
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
ls -d .workflow/phases/*/ | grep "^.workflow/phases/0*{N}-"
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Read phase files:
|
|
58
|
-
- `.workflow/phases/{NN}-{slug}/index.json` — phase metadata, task statuses
|
|
59
|
-
- `.workflow/phases/{NN}-{slug}/verification.json` — verification results (if exists)
|
|
60
|
-
- `.workflow/phases/{NN}-{slug}/review.json` — code review results (if exists)
|
|
61
|
-
|
|
62
|
-
### Step 4: Validate Completion
|
|
63
|
-
|
|
64
|
-
Check the following (skip all if `--force`):
|
|
65
|
-
|
|
66
|
-
1. **Task completion**: All tasks in index.json have status "completed" or "skipped"
|
|
67
|
-
2. **Verification passed**: verification.json exists and verdict is not "FAIL" (E002 if failed)
|
|
68
|
-
3. **No critical gaps**: No unresolved critical gaps in verification results (E003)
|
|
69
|
-
4. **Review status**: Check review.json if exists
|
|
70
|
-
- BLOCK verdict → W003 (warning, suggest quality-review fix)
|
|
71
|
-
- No review.json → W004 (warning, suggest running quality-review)
|
|
72
|
-
5. **UAT status**: Check for test failures → W002
|
|
73
|
-
|
|
74
|
-
If warnings only (no errors) and not `--force`: display warnings and ask user to confirm.
|
|
75
|
-
|
|
76
|
-
### Step 5: Mark Phase Complete
|
|
77
|
-
|
|
78
|
-
Update `.workflow/phases/{NN}-{slug}/index.json`:
|
|
79
|
-
```json
|
|
80
|
-
{
|
|
81
|
-
"status": "complete",
|
|
82
|
-
"completed_at": "<ISO timestamp>"
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Step 6: Extract Learnings
|
|
87
|
-
|
|
88
|
-
Analyze phase artifacts for learnings:
|
|
89
|
-
1. Read verification.json gaps and resolutions
|
|
90
|
-
2. Read review.json feedback patterns
|
|
91
|
-
3. Read task summaries for recurring themes
|
|
92
|
-
4. Identify patterns: what worked, what didn't, what to carry forward
|
|
93
|
-
|
|
94
|
-
Append to `.workflow/specs/learnings.md`:
|
|
95
|
-
```markdown
|
|
96
|
-
## Phase {N}: {slug}
|
|
97
|
-
**Completed**: {date}
|
|
98
|
-
|
|
99
|
-
### What Worked
|
|
100
|
-
- {items}
|
|
101
|
-
|
|
102
|
-
### Challenges
|
|
103
|
-
- {items}
|
|
104
|
-
|
|
105
|
-
### Carry Forward
|
|
106
|
-
- {items}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Step 7: Initialize Next Phase
|
|
110
|
-
|
|
111
|
-
Determine next phase number = N + 1.
|
|
112
|
-
|
|
113
|
-
Check if next phase directory exists:
|
|
114
|
-
- If exists: verify index.json has status "pending", update to "active"
|
|
115
|
-
- If not exists: create directory and initialize
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
mkdir -p .workflow/phases/{NN+1}-{next_slug}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Write `index.json` for next phase (read template from `~/.maestro/templates/index.json` if available):
|
|
122
|
-
```json
|
|
123
|
-
{
|
|
124
|
-
"phase": <N+1>,
|
|
125
|
-
"status": "active",
|
|
126
|
-
"created_at": "<ISO timestamp>"
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Step 8: Update Project State
|
|
131
|
-
|
|
132
|
-
Update `.workflow/state.json`:
|
|
133
|
-
- `current_phase`: N + 1
|
|
134
|
-
- `phases_completed`: append phase N
|
|
135
|
-
|
|
136
|
-
### Step 9: Completion Report
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
=== PHASE TRANSITION ===
|
|
140
|
-
From: Phase {N} ({slug}) → COMPLETE
|
|
141
|
-
To: Phase {N+1} ({next_slug}) → ACTIVE
|
|
142
|
-
|
|
143
|
-
Learnings extracted: .workflow/specs/learnings.md
|
|
144
|
-
State updated: .workflow/state.json
|
|
145
|
-
|
|
146
|
-
Next steps:
|
|
147
|
-
$maestro-plan "" -- Plan tasks for Phase {N+1}
|
|
148
|
-
$
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## Error Handling
|
|
154
|
-
|
|
155
|
-
| Code | Severity | Description | Recovery |
|
|
156
|
-
|------|----------|-------------|----------|
|
|
157
|
-
| E001 | error | Phase number required and could not determine | Specify phase number explicitly |
|
|
158
|
-
| E002 | error | Phase has not passed verification | Run maestro-verify first |
|
|
159
|
-
| E003 | error | Phase has unresolved critical gaps | Fix gaps, re-verify |
|
|
160
|
-
| W001 | warning | Phase has warnings but no blockers | Proceed with confirmation |
|
|
161
|
-
| W002 | warning | UAT test failures exist | Review recommended |
|
|
162
|
-
| W003 | warning | Code review verdict is BLOCK | Fix review findings first |
|
|
163
|
-
| W004 | warning | Code review not yet run | Run quality-review first |
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## Core Rules
|
|
168
|
-
|
|
169
|
-
1. **Verify before transition** — refuse to transition without verification (unless --force)
|
|
170
|
-
2. **Learnings are mandatory** — always extract and persist learnings, even if minimal
|
|
171
|
-
3. **Next phase must be ready** — create directory and index.json before reporting success
|
|
172
|
-
4. **State consistency** — state.json and index.json must agree at all times
|
|
173
|
-
5. **Warnings need acknowledgment** — display warnings and require user confirmation (unless --force)
|
|
1
|
+
---
|
|
2
|
+
name: maestro-phase-transition
|
|
3
|
+
description: Mark current or specified phase as complete, extract learnings, advance to next phase
|
|
4
|
+
argument-hint: "[phase-number] [--force]"
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Maestro Phase Transition (Single Agent)
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
$maestro-phase-transition ""
|
|
14
|
+
$maestro-phase-transition "2"
|
|
15
|
+
$maestro-phase-transition "3 --force"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Flags**:
|
|
19
|
+
- `[phase-number]`: Phase to transition from (defaults to current_phase from state.json)
|
|
20
|
+
- `--force`: Skip gap checks and force transition even with warnings
|
|
21
|
+
|
|
22
|
+
**Output**: Updated state.json, completed phase index.json, initialized next phase, learnings extracted
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Overview
|
|
27
|
+
|
|
28
|
+
State-machine transition skill. Validates that the current phase meets completion criteria (tasks done, verification passed, no unresolved gaps), marks it complete, extracts learnings, and advances to the next phase. Creates next phase directory if needed.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Implementation
|
|
33
|
+
|
|
34
|
+
### Step 1: Parse Arguments
|
|
35
|
+
|
|
36
|
+
Extract:
|
|
37
|
+
- Phase number (optional, integer)
|
|
38
|
+
- `--force` flag
|
|
39
|
+
|
|
40
|
+
### Step 2: Load State
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
cat .workflow/state.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Determine phase number:
|
|
47
|
+
- If provided: use specified phase
|
|
48
|
+
- If omitted: use `current_phase` from state.json
|
|
49
|
+
- If neither: error E001
|
|
50
|
+
|
|
51
|
+
### Step 3: Resolve Phase Directory
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
ls -d .workflow/phases/*/ | grep "^.workflow/phases/0*{N}-"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Read phase files:
|
|
58
|
+
- `.workflow/phases/{NN}-{slug}/index.json` — phase metadata, task statuses
|
|
59
|
+
- `.workflow/phases/{NN}-{slug}/verification.json` — verification results (if exists)
|
|
60
|
+
- `.workflow/phases/{NN}-{slug}/review.json` — code review results (if exists)
|
|
61
|
+
|
|
62
|
+
### Step 4: Validate Completion
|
|
63
|
+
|
|
64
|
+
Check the following (skip all if `--force`):
|
|
65
|
+
|
|
66
|
+
1. **Task completion**: All tasks in index.json have status "completed" or "skipped"
|
|
67
|
+
2. **Verification passed**: verification.json exists and verdict is not "FAIL" (E002 if failed)
|
|
68
|
+
3. **No critical gaps**: No unresolved critical gaps in verification results (E003)
|
|
69
|
+
4. **Review status**: Check review.json if exists
|
|
70
|
+
- BLOCK verdict → W003 (warning, suggest quality-review fix)
|
|
71
|
+
- No review.json → W004 (warning, suggest running quality-review)
|
|
72
|
+
5. **UAT status**: Check for test failures → W002
|
|
73
|
+
|
|
74
|
+
If warnings only (no errors) and not `--force`: display warnings and ask user to confirm.
|
|
75
|
+
|
|
76
|
+
### Step 5: Mark Phase Complete
|
|
77
|
+
|
|
78
|
+
Update `.workflow/phases/{NN}-{slug}/index.json`:
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"status": "complete",
|
|
82
|
+
"completed_at": "<ISO timestamp>"
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Step 6: Extract Learnings
|
|
87
|
+
|
|
88
|
+
Analyze phase artifacts for learnings:
|
|
89
|
+
1. Read verification.json gaps and resolutions
|
|
90
|
+
2. Read review.json feedback patterns
|
|
91
|
+
3. Read task summaries for recurring themes
|
|
92
|
+
4. Identify patterns: what worked, what didn't, what to carry forward
|
|
93
|
+
|
|
94
|
+
Append to `.workflow/specs/learnings.md`:
|
|
95
|
+
```markdown
|
|
96
|
+
## Phase {N}: {slug}
|
|
97
|
+
**Completed**: {date}
|
|
98
|
+
|
|
99
|
+
### What Worked
|
|
100
|
+
- {items}
|
|
101
|
+
|
|
102
|
+
### Challenges
|
|
103
|
+
- {items}
|
|
104
|
+
|
|
105
|
+
### Carry Forward
|
|
106
|
+
- {items}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Step 7: Initialize Next Phase
|
|
110
|
+
|
|
111
|
+
Determine next phase number = N + 1.
|
|
112
|
+
|
|
113
|
+
Check if next phase directory exists:
|
|
114
|
+
- If exists: verify index.json has status "pending", update to "active"
|
|
115
|
+
- If not exists: create directory and initialize
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
mkdir -p .workflow/phases/{NN+1}-{next_slug}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Write `index.json` for next phase (read template from `~/.maestro/templates/index.json` if available):
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"phase": <N+1>,
|
|
125
|
+
"status": "active",
|
|
126
|
+
"created_at": "<ISO timestamp>"
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Step 8: Update Project State
|
|
131
|
+
|
|
132
|
+
Update `.workflow/state.json`:
|
|
133
|
+
- `current_phase`: N + 1
|
|
134
|
+
- `phases_completed`: append phase N
|
|
135
|
+
|
|
136
|
+
### Step 9: Completion Report
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
=== PHASE TRANSITION ===
|
|
140
|
+
From: Phase {N} ({slug}) → COMPLETE
|
|
141
|
+
To: Phase {N+1} ({next_slug}) → ACTIVE
|
|
142
|
+
|
|
143
|
+
Learnings extracted: .workflow/specs/learnings.md
|
|
144
|
+
State updated: .workflow/state.json
|
|
145
|
+
|
|
146
|
+
Next steps:
|
|
147
|
+
$maestro-plan "" -- Plan tasks for Phase {N+1}
|
|
148
|
+
$manage-status -- View project dashboard
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Error Handling
|
|
154
|
+
|
|
155
|
+
| Code | Severity | Description | Recovery |
|
|
156
|
+
|------|----------|-------------|----------|
|
|
157
|
+
| E001 | error | Phase number required and could not determine | Specify phase number explicitly |
|
|
158
|
+
| E002 | error | Phase has not passed verification | Run maestro-verify first |
|
|
159
|
+
| E003 | error | Phase has unresolved critical gaps | Fix gaps, re-verify |
|
|
160
|
+
| W001 | warning | Phase has warnings but no blockers | Proceed with confirmation |
|
|
161
|
+
| W002 | warning | UAT test failures exist | Review recommended |
|
|
162
|
+
| W003 | warning | Code review verdict is BLOCK | Fix review findings first |
|
|
163
|
+
| W004 | warning | Code review not yet run | Run quality-review first |
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Core Rules
|
|
168
|
+
|
|
169
|
+
1. **Verify before transition** — refuse to transition without verification (unless --force)
|
|
170
|
+
2. **Learnings are mandatory** — always extract and persist learnings, even if minimal
|
|
171
|
+
3. **Next phase must be ready** — create directory and index.json before reporting success
|
|
172
|
+
4. **State consistency** — state.json and index.json must agree at all times
|
|
173
|
+
5. **Warnings need acknowledgment** — display warnings and require user confirmation (unless --force)
|