maestro-flow-one 0.2.33 → 0.2.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/maestro-flow/commands/learn/investigate.md +151 -152
  2. package/maestro-flow/commands/learn/second-opinion.md +118 -122
  3. package/maestro-flow/commands/lifecycle/analyze.md +215 -266
  4. package/maestro-flow/commands/lifecycle/blueprint.md +189 -204
  5. package/maestro-flow/commands/lifecycle/brainstorm.md +209 -213
  6. package/maestro-flow/commands/lifecycle/companion.md +531 -531
  7. package/maestro-flow/commands/lifecycle/composer.md +188 -179
  8. package/maestro-flow/commands/lifecycle/execute.md +183 -184
  9. package/maestro-flow/commands/lifecycle/fork.md +111 -110
  10. package/maestro-flow/commands/lifecycle/grill.md +175 -176
  11. package/maestro-flow/commands/lifecycle/guard.md +103 -102
  12. package/maestro-flow/commands/lifecycle/impeccable.md +311 -268
  13. package/maestro-flow/commands/lifecycle/init.md +130 -131
  14. package/maestro-flow/commands/lifecycle/merge.md +87 -80
  15. package/maestro-flow/commands/lifecycle/next.md +253 -257
  16. package/maestro-flow/commands/lifecycle/overlay.md +188 -178
  17. package/maestro-flow/commands/lifecycle/plan.md +225 -211
  18. package/maestro-flow/commands/lifecycle/quick.md +83 -77
  19. package/maestro-flow/commands/lifecycle/roadmap.md +173 -186
  20. package/maestro-flow/commands/lifecycle/swarm-workflow.md +243 -264
  21. package/maestro-flow/commands/lifecycle/tools-execute.md +122 -117
  22. package/maestro-flow/commands/lifecycle/tools-register.md +162 -157
  23. package/maestro-flow/commands/lifecycle/ui-codify.md +117 -100
  24. package/maestro-flow/commands/lifecycle/universal-workflow.md +548 -561
  25. package/maestro-flow/commands/lifecycle/update.md +122 -119
  26. package/maestro-flow/commands/manage/codebase-rebuild.md +87 -85
  27. package/maestro-flow/commands/manage/harvest.md +97 -95
  28. package/maestro-flow/commands/manage/issue-discover.md +83 -81
  29. package/maestro-flow/commands/manage/issue.md +72 -73
  30. package/maestro-flow/commands/manage/kg-extractors.md +128 -0
  31. package/maestro-flow/commands/manage/knowhow-capture.md +92 -82
  32. package/maestro-flow/commands/manage/knowhow.md +83 -79
  33. package/maestro-flow/commands/manage/knowledge-audit.md +105 -88
  34. package/maestro-flow/commands/manage/status.md +62 -52
  35. package/maestro-flow/commands/manage/wiki.md +82 -71
  36. package/maestro-flow/commands/milestone/audit.md +4 -10
  37. package/maestro-flow/commands/milestone/complete.md +6 -7
  38. package/maestro-flow/commands/milestone/release.md +136 -145
  39. package/maestro-flow/commands/quality/auto-test.md +153 -136
  40. package/maestro-flow/commands/quality/debug.md +159 -120
  41. package/maestro-flow/commands/quality/refactor.md +105 -67
  42. package/maestro-flow/commands/quality/retrospective.md +123 -77
  43. package/maestro-flow/commands/quality/review.md +155 -128
  44. package/maestro-flow/commands/quality/sync.md +88 -52
  45. package/maestro-flow/commands/quality/test.md +147 -117
  46. package/maestro-flow/commands/spec/add.md +77 -70
  47. package/maestro-flow/commands/spec/setup.md +49 -52
  48. package/package.json +1 -1
@@ -1,119 +1,122 @@
1
- ---
2
- name: maestro-update
3
- description: Detect version, preview changes, apply workflow upgrades
4
- argument-hint: "[--dry-run] [--force] [--setup-only]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - AskUserQuestion
13
- ---
14
- <purpose>
15
- Version router — detect current version, run schema migration to latest, then follow the version-specific smart upgrade workflow.
16
-
17
- Migration scripts live in two layers:
18
- - **Schema** (`src/migrations/`): code-level state.json transforms, auto-chained by registry
19
- - **Workflow** (`~/.maestro/workflows/updates/`): version-specific upgrade guides with environment setup
20
-
21
- Schema migrations handle the mechanical version bump. Workflow docs handle the smart part — what the user needs to know, configure, or verify for that version. The router runs schema first, then loads the matching workflow doc.
22
- </purpose>
23
-
24
- <context>
25
- $ARGUMENTS optional flags.
26
-
27
- **Flags:**
28
- - `--dry-run` -- Preview migration plan without executing
29
- - `--force` -- Skip confirmation prompts
30
- - `--setup-only` -- Skip schema migration, run only the setup for current version
31
-
32
- **Version source:** `.workflow/state.json` `version` field
33
-
34
- **Workflow docs:** `~/.maestro/workflows/updates/`
35
- - `update-v{TO}-setup.md` — post-migration setup for version {TO}
36
-
37
- **Schema registry:** `src/migrations/` handles all intermediate version bumps automatically
38
- </context>
39
-
40
- <execution>
41
-
42
- ### Step 1: Detect Version
43
-
44
- ```
45
- 1. Read .workflow/state.json → extract version (default "1.0" if missing)
46
- 2. Display:
47
- === Maestro Update ===
48
- Current version: v{version}
49
- ```
50
-
51
- IF `--setup-only`:
52
- → Glob: ~/.maestro/workflows/updates/update-v{version}-setup.md
53
- → IF exists: follow that document completely, then EXIT
54
- IF not exists: display "No setup script for v{version}" EXIT
55
-
56
- ### Step 2: Check for Updates
57
-
58
- ```
59
- 1. Run: npx tsx src/migrations/run.ts "$(pwd)" --dry-run --json
60
- 2. Parse JSON output
61
- 3. IF status = "up-to-date":
62
- Display "Already up to date (v{version})"
63
- Glob: ~/.maestro/workflows/updates/update-v{version}-setup.md
64
- IF exists: AskUserQuestion "Run setup for v{version}?" load and follow
65
- → EXIT
66
-
67
- 4. Display target:
68
- Update available: v{current} → v{target}
69
- Schema migrations: {N} step(s) (handled automatically)
70
- ```
71
-
72
- IF `--dry-run` display info and EXIT.
73
-
74
- ### Step 3: Execute
75
-
76
- ```
77
- 1. Confirm (unless --force):
78
- AskUserQuestion: "Upgrade v{current} → v{target}?"
79
- Options: [执行 / 取消]
80
-
81
- 2. Create backup:
82
- Bash: cp .workflow/state.json .workflow/state.json.backup-v{current}-{timestamp}
83
-
84
- 3. Run schema migration (handles all intermediate steps automatically):
85
- Bash: npx tsx src/migrations/run.ts "$(pwd)" --json
86
- Parse result, display changes.
87
-
88
- 4. IF failed → display backup restore command → EXIT
89
-
90
- 5. Load version-specific setup:
91
- Read: ~/.maestro/workflows/updates/update-v{target}-setup.md
92
- IF exists follow completely (hooks, deps, knowledge system config)
93
-
94
- 6. Display: "v{current} → v{target}: done"
95
- ```
96
-
97
- ### Step 4: Summary
98
-
99
- ```
100
- === Update Complete ===
101
- Version: v{current} → v{target}
102
- Backup: .workflow/state.json.backup-v{current}-{timestamp}
103
-
104
- Next steps:
105
- /manage-status -- Verify project state
106
- /maestro -- Continue workflow
107
- ```
108
-
109
- </execution>
110
-
111
- <success_criteria>
112
- - [ ] Current version detected from state.json
113
- - [ ] Schema migrations run automatically (no manual intermediate steps)
114
- - [ ] Backup created before migration
115
- - [ ] Version-specific setup doc loaded and followed (if exists)
116
- - [ ] --setup-only runs only setup for current version
117
- - [ ] --dry-run previews without executing
118
- - [ ] Summary shows version change and backup path
119
- </success_criteria>
1
+ ---
2
+ name: maestro-update
3
+ description: Detect version, preview changes, apply workflow upgrades
4
+ argument-hint: "[--dry-run] [--force] [--setup-only]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - AskUserQuestion
13
+ ---
14
+ <purpose>
15
+ Detect current version, run schema migration to latest, then follow the version-specific upgrade workflow.
16
+ Schema (`src/migrations/`) handles transforms; workflow docs (`~/.maestro/workflows/updates/`) handle setup.
17
+ </purpose>
18
+
19
+ <context>
20
+ $ARGUMENTS — optional flags.
21
+
22
+ **Flags:**
23
+ - `--dry-run` -- Preview migration plan without executing
24
+ - `--force` -- Skip confirmation prompts
25
+ - `--setup-only` -- Skip schema migration, run only the setup for current version
26
+
27
+ **Version source:** `.workflow/state.json` → `version` field
28
+
29
+ **Workflow docs:** `~/.maestro/workflows/updates/`
30
+ - `update-v{TO}-setup.md` post-migration setup for version {TO}
31
+
32
+ **Schema registry:** `src/migrations/` handles all intermediate version bumps automatically
33
+ </context>
34
+
35
+ <execution>
36
+
37
+ ### Step 1: Detect Version
38
+
39
+ ```
40
+ 1. Read .workflow/state.json → extract version (default "1.0" if missing)
41
+ 2. Display:
42
+ === Maestro Update ===
43
+ Current version: v{version}
44
+ ```
45
+
46
+ IF `--setup-only`:
47
+ Glob: ~/.maestro/workflows/updates/update-v{version}-setup.md
48
+ IF exists: follow that document completely, then EXIT
49
+ → IF not exists: display "No setup script for v{version}" → EXIT
50
+
51
+ ### Step 2: Check for Updates
52
+
53
+ ```
54
+ 1. Run: npx tsx src/migrations/run.ts "$(pwd)" --dry-run --json
55
+ 2. Parse JSON output
56
+ 3. IF status = "up-to-date":
57
+ Display "Already up to date (v{version})"
58
+ → Glob: ~/.maestro/workflows/updates/update-v{version}-setup.md
59
+ IF exists: AskUserQuestion "Run setup for v{version}?" load and follow
60
+ EXIT
61
+
62
+ 4. Display target:
63
+ Update available: v{current} → v{target}
64
+ Schema migrations: {N} step(s) (handled automatically)
65
+ ```
66
+
67
+ IF `--dry-run` → display info and EXIT.
68
+
69
+ ### Step 3: Execute
70
+
71
+ ```
72
+ 1. Confirm (unless --force):
73
+ AskUserQuestion: "Upgrade v{current} → v{target}?"
74
+ Options: [执行 / 取消]
75
+
76
+ 2. Create backup:
77
+ Bash: cp .workflow/state.json .workflow/state.json.backup-v{current}-{timestamp}
78
+
79
+ 3. Run schema migration (handles all intermediate steps automatically):
80
+ Bash: npx tsx src/migrations/run.ts "$(pwd)" --json
81
+ Parse result, display changes.
82
+
83
+ 4. IF failed → display backup restore command → EXIT
84
+
85
+ 5. Load version-specific setup:
86
+ Read: ~/.maestro/workflows/updates/update-v{target}-setup.md
87
+ IF exists → follow completely (hooks, deps, knowledge system config)
88
+
89
+ 6. Display: "v{current} → v{target}: done"
90
+ ```
91
+
92
+ ### Step 4: Summary
93
+
94
+ ```
95
+ === Update Complete ===
96
+ Version: v{current} → v{target}
97
+ Backup: .workflow/state.json.backup-v{current}-{timestamp}
98
+
99
+ Next steps:
100
+ /manage-status -- Verify project state
101
+ /maestro -- Continue workflow
102
+ ```
103
+
104
+ </execution>
105
+
106
+ <success_criteria>
107
+ - [ ] Current version detected from state.json
108
+ - [ ] Schema migrations run automatically (no manual intermediate steps)
109
+ - [ ] Backup created before migration
110
+ - [ ] Version-specific setup doc loaded and followed (if exists)
111
+ - [ ] --setup-only runs only setup for current version
112
+ - [ ] --dry-run previews without executing
113
+ - [ ] Summary shows version change and backup path
114
+ </success_criteria>
115
+
116
+ <completion>
117
+ ### Next-step routing
118
+ | Condition | Suggestion |
119
+ |-----------|-----------|
120
+ | Update complete | `/manage-status` to verify project state |
121
+ | Want to continue workflow | `/maestro` |
122
+ </completion>
@@ -1,85 +1,87 @@
1
- ---
2
- name: manage-codebase-rebuild
3
- description: Rebuild all codebase documentation from scratch
4
- argument-hint: "[--focus <area>] [--force] [--skip-commit]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
-
16
- <purpose>
17
- Perform a full rebuild of the .workflow/codebase/ documentation system from scratch. Scans the entire project source to identify components, features, requirements, and ADRs, then spawns parallel workflow-codebase-mapper agents to generate all documentation artifacts. This is a destructive operation that overwrites existing codebase docs.
18
-
19
- Can run before or after `/maestro-init` -- works on any codebase with source files. Also serves the previous `spec-map` use case via `--focus <area>` for scoped dimension analysis.
20
- </purpose>
21
-
22
- <required_reading>
23
- @~/.maestro/workflows/codebase-rebuild.md
24
- </required_reading>
25
-
26
- <context>
27
- $ARGUMENTS -- optional flags.
28
-
29
- **Flags:**
30
- - `--focus <area>` -- Scope mapper agents to a single domain (e.g., `auth`, `api`, `database`). When omitted, all 4 mappers run on the full codebase.
31
- - `--force` -- Skip confirmation prompt and proceed directly
32
- - `--skip-commit` -- Do not auto-commit after rebuild
33
-
34
- **Mapper agent assignments (when `--focus` omitted):**
35
- | Agent | Focus | Output file |
36
- |-------|-------|-------------|
37
- | Mapper 1 | **Tech stack** -- languages, frameworks, dependencies, build system | `tech-stack.md` |
38
- | Mapper 2 | **Architecture** -- layers, module boundaries, data flow, entry points | `architecture.md` |
39
- | Mapper 3 | **Features** -- capabilities, API surface, user-facing functionality | `features.md` |
40
- | Mapper 4 | **Cross-cutting concerns** -- error handling, logging, auth, config, testing | `concerns.md` |
41
-
42
- **State files:**
43
- - `.workflow/` -- must be initialized (project.md, state.json exist)
44
- - `.workflow/codebase/` -- target directory (will be cleared and rebuilt)
45
- - `.workflow/codebase/doc-index.json` -- generated documentation index
46
- - `.workflow/codebase/knowledge-graph.json` -- Knowledge Graph with nodes, edges, layers, and tour (generated by `maestro kg index`)
47
- </context>
48
-
49
- <execution>
50
- Follow '~/.maestro/workflows/codebase-rebuild.md' completely.
51
-
52
- **When `--focus <area>` is set:** pass the area string to each mapper agent as scoping context; only regenerate the docs relevant to that scope (leave others untouched unless missing).
53
-
54
- **Next-step routing on completion:**
55
- - View updated project state → `/manage-status`
56
- - Incremental updates later → `/quality-sync`
57
- - Verify KG stats → `maestro kg stats`
58
- - Verify wiki integration → `maestro search "kg" --type knowhow`
59
- - Future change impact `maestro kg diff-wiki`
60
- </execution>
61
-
62
- <error_codes>
63
- | Code | Severity | Condition | Recovery |
64
- |------|----------|-----------|----------|
65
- | E001 | error | .workflow/ not initialized | Run maestro-init first to create .workflow/ |
66
- | W001 | warning | A mapper agent failed (partial results) | Retry failed mapper or accept partial results |
67
- | W002 | warning | `.workflow/codebase/` already exists -- user prompted for rebuild/skip | check_existing |
68
- | W003 | warning | KG validation failed (graph written with valid=false) | Review .kg-tmp/ artifacts, re-run KG pipeline |
69
- | W004 | warning | Wiki index rebuild failed after KG generation | Non-fatal, retries on next wiki access |
70
- </error_codes>
71
-
72
- <success_criteria>
73
- - [ ] User confirmed rebuild (or --force used)
74
- - [ ] .workflow/codebase/ cleared and rebuilt from scratch (or scoped subset when --focus set)
75
- - [ ] All 4 mapper agents spawned (failures logged as W001)
76
- - [ ] doc-index.json generated and valid
77
- - [ ] All documentation files regenerated
78
- - [ ] state.json updated with rebuild timestamp
79
- - [ ] project.md Tech Stack section updated if changes detected
80
- - [ ] KG pipeline executed (`maestro kg index`)
81
- - [ ] knowledge-graph.json generated in .workflow/codebase/
82
- - [ ] KG nodes indexed as virtual wiki entries (automatic via WikiIndexer on next wiki access)
83
- - [ ] Next step routing: `/manage-status` or `/quality-sync` for incremental updates later
84
- - [ ] KG impact check available: `maestro kg diff-wiki` for future change impact analysis
85
- </success_criteria>
1
+ ---
2
+ name: manage-codebase-rebuild
3
+ description: Rebuild all codebase documentation from scratch
4
+ argument-hint: "[--focus <area>] [--force] [--skip-commit]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+
16
+ <purpose>
17
+ Full rebuild of `.workflow/codebase/` docs: 4 parallel mapper agents tech-stack, architecture, features, concerns. Destructive overwrites existing docs.
18
+ </purpose>
19
+
20
+ <required_reading>
21
+ @~/.maestro/workflows/codebase-rebuild.md
22
+ </required_reading>
23
+
24
+ <context>
25
+ $ARGUMENTS -- optional flags.
26
+
27
+ **Flags:**
28
+ - `--focus <area>` -- Scope mapper agents to a single domain (e.g., `auth`, `api`, `database`). When omitted, all 4 mappers run on the full codebase.
29
+ - `--force` -- Skip confirmation prompt and proceed directly
30
+ - `--skip-commit` -- Do not auto-commit after rebuild
31
+
32
+ **Mapper agent assignments (when `--focus` omitted):**
33
+ | Agent | Focus | Output file |
34
+ |-------|-------|-------------|
35
+ | Mapper 1 | **Tech stack** -- languages, frameworks, dependencies, build system | `tech-stack.md` |
36
+ | Mapper 2 | **Architecture** -- layers, module boundaries, data flow, entry points | `architecture.md` |
37
+ | Mapper 3 | **Features** -- capabilities, API surface, user-facing functionality | `features.md` |
38
+ | Mapper 4 | **Cross-cutting concerns** -- error handling, logging, auth, config, testing | `concerns.md` |
39
+
40
+ **State files:**
41
+ - `.workflow/` -- must be initialized (project.md, state.json exist)
42
+ - `.workflow/codebase/` -- target directory (will be cleared and rebuilt)
43
+ - `.workflow/codebase/doc-index.json` -- generated documentation index
44
+ - `.workflow/codebase/knowledge-graph.json` -- Knowledge Graph with nodes, edges, layers, and tour (generated by `maestro kg index`)
45
+ </context>
46
+
47
+ <execution>
48
+ Follow '~/.maestro/workflows/codebase-rebuild.md' completely.
49
+
50
+ **When `--focus <area>` is set:** pass the area string to each mapper agent as scoping context; only regenerate the docs relevant to that scope (leave others untouched unless missing).
51
+
52
+ </execution>
53
+
54
+ <completion>
55
+ ### Next-step routing
56
+
57
+ | Condition | Suggestion |
58
+ |-----------|-----------|
59
+ | View updated state | `/manage-status` |
60
+ | Incremental updates later | `/quality-sync` |
61
+ | Verify KG stats | `maestro kg stats` |
62
+ | Future change impact | `maestro kg diff-wiki` |
63
+ </completion>
64
+
65
+ <error_codes>
66
+ | Code | Severity | Condition | Recovery |
67
+ |------|----------|-----------|----------|
68
+ | E001 | error | .workflow/ not initialized | Run maestro-init first to create .workflow/ |
69
+ | W001 | warning | A mapper agent failed (partial results) | Retry failed mapper or accept partial results |
70
+ | W002 | warning | `.workflow/codebase/` already exists -- user prompted for rebuild/skip | check_existing |
71
+ | W003 | warning | KG validation failed (graph written with valid=false) | Review .kg-tmp/ artifacts, re-run KG pipeline |
72
+ | W004 | warning | Wiki index rebuild failed after KG generation | Non-fatal, retries on next wiki access |
73
+ </error_codes>
74
+
75
+ <success_criteria>
76
+ - [ ] User confirmed rebuild (or --force used)
77
+ - [ ] .workflow/codebase/ cleared and rebuilt from scratch (or scoped subset when --focus set)
78
+ - [ ] All 4 mapper agents spawned (failures logged as W001)
79
+ - [ ] doc-index.json generated and valid
80
+ - [ ] All documentation files regenerated
81
+ - [ ] state.json updated with rebuild timestamp
82
+ - [ ] project.md Tech Stack section updated if changes detected
83
+ - [ ] KG pipeline executed (`maestro kg index`)
84
+ - [ ] knowledge-graph.json generated in .workflow/codebase/
85
+ - [ ] KG nodes indexed as virtual wiki entries (automatic via WikiIndexer on next wiki access)
86
+ - [ ] Next step routed
87
+ </success_criteria>
@@ -1,95 +1,97 @@
1
- ---
2
- name: manage-harvest
3
- description: Extract knowledge from artifacts into wiki/spec/issues
4
- argument-hint: "[<session-id|path>] [--to wiki|spec|issue|auto] [--source <type>] [--recent N] [--dry-run] [-y]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
- <purpose>
16
- Extract knowledge fragments from workflow artifacts (analysis results, brainstorm outputs, debug sessions, lite-plan/fix results, scratchpad notes, completed sessions) and route them into the project's three knowledge stores: wiki entries, spec conventions, and trackable issues.
17
-
18
- Complements `quality-retrospective` (which is phase-scoped) by harvesting from **any** workflow artifact. Prevents knowledge loss from completed analysis and planning sessions that would otherwise only exist as stale files.
19
-
20
- **Closed-loop**: harvest extracts → wiki/spec/issue stores → downstream commands consume (wiki-digest, spec-load, maestro-plan --gaps).
21
- </purpose>
22
-
23
- <required_reading>
24
- @~/.maestro/workflows/harvest.md
25
- </required_reading>
26
-
27
- <deferred_reading>
28
- - @~/.maestro/workflows/issue.md (issues.jsonl schema for issue routing — read when creating issues in Stage 6c)
29
- - @~/.maestro/workflows/specs-add.md (spec entry format — read when routing to spec in Stage 6b)
30
- </deferred_reading>
31
-
32
- <context>
33
- Arguments: $ARGUMENTS
34
-
35
- **Modes (auto-detected):**
36
- - No arguments → `scan` mode: discover all harvestable artifacts, interactive selection
37
- - `<session-id>` (e.g., `ANL-auth-20260410`, `WFS-xxx`) → `session` mode: harvest specific session
38
- - `<path>` (e.g., `.workflow/.analysis/ANL-auth-20260410/`) → `path` mode: harvest from explicit directory
39
-
40
- Flags, source registry (scan paths), and storage locations defined in workflow harvest.md.
41
- </context>
42
-
43
- <execution>
44
- Follow '~/.maestro/workflows/harvest.md' Stages 1-8 in order.
45
-
46
- **Key invariants:**
47
- 1. **Read-only until Stage 6** — extraction and classification happen in-memory.
48
- 2. **Dedup before write** check harvest-log.jsonl and existing stores before each write.
49
- 3. **Never modify source artifacts** — harvest is purely extractive.
50
- 4. **Dedup contract with parallel writers** — when appending to `issues.jsonl`, set `source: "harvest"` on each row so concurrent writers (e.g. `manage-issue-discover` with `source: "discover"`) can be distinguished and deduplicated.
51
-
52
- Extraction patterns, classification rules, routing infrastructure, and fragment ID scheme defined in workflow harvest.md.
53
-
54
- **Next-step routing on completion:**
55
- - Review wiki entries → `maestro wiki list --type note`
56
- - Connect wiki graph → `/manage-wiki connect --fix`
57
- - Triage issues `/manage-issue list --source harvest`
58
- - View specs `/spec-load --role implement`
59
- - Full retrospective `/quality-retrospective`
60
- </execution>
61
-
62
- <error_codes>
63
- | Code | Severity | Condition | Recovery |
64
- |------|----------|-----------|----------|
65
- | E001 | error | `.workflow/` not initialized | Run `/maestro-init` first |
66
- | E002 | error | Invalid `--to` target (must be: wiki, spec, issue, auto) | Display valid options |
67
- | E003 | error | Invalid `--source` type | Display valid source types from registry |
68
- | E004 | error | Session ID not found in any source path | Show available sessions with `--source all` |
69
- | E005 | error | Path does not exist or contains no parseable artifacts | Verify path and file structure |
70
- | W001 | warning | No harvestable artifacts found within `--recent` window | Widen time window or check `.workflow/` contents |
71
- | W002 | warning | `maestro wiki create` failed wiki entries saved to `.workflow/harvest/wiki-pending-*.md` | Apply pending entries manually or retry |
72
- | W003 | warning | Some fragments below confidence threshold logged but not routed | Lower `--min-confidence` to include |
73
- | W004 | warning | Duplicate fragments skipped | Review harvest-log.jsonl for prior routing |
74
- | W005 | warning | `.workflow/issues/` directory missing | Auto-create directory and empty issues.jsonl |
75
- </error_codes>
76
-
77
- <success_criteria>
78
- - [ ] Mode correctly resolved (scan / session / path)
79
- - [ ] Source artifacts discovered and listed with metadata
80
- - [ ] User selected artifact(s) to harvest (or auto-selected via session/path mode)
81
- - [ ] All files in selected artifacts loaded and parsed
82
- - [ ] Knowledge fragments extracted with category, confidence, tags
83
- - [ ] Fragments filtered by `--min-confidence`
84
- - [ ] Routing classification applied (auto or forced by `--to`)
85
- - [ ] Dedup check passed against harvest-log.jsonl and existing stores
86
- - [ ] If `--dry-run`: preview displayed, no files written
87
- - [ ] If not dry-run: all routed items written to target stores
88
- - [ ] Wiki entries created via `maestro wiki create` (or fallback to pending files)
89
- - [ ] Spec entries added via `spec-add` mechanism
90
- - [ ] Issue entries appended to `issues.jsonl` with canonical schema
91
- - [ ] `harvest-log.jsonl` updated with provenance for each routed item
92
- - [ ] `harvest-report-{date}.md` written with full summary
93
- - [ ] No source artifacts modified
94
- - [ ] Summary displayed with counts and next-step routing
95
- </success_criteria>
1
+ ---
2
+ name: manage-harvest
3
+ description: Extract knowledge from artifacts into wiki/spec/issues
4
+ argument-hint: "[<session-id|path>] [--to wiki|spec|issue|auto] [--source <type>] [--recent N] [--dry-run] [-y]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Extract knowledge from workflow artifacts route to wiki/spec/issue stores. Works on any artifact (vs retrospective which is phase-scoped).
17
+ </purpose>
18
+
19
+ <required_reading>
20
+ @~/.maestro/workflows/harvest.md
21
+ </required_reading>
22
+
23
+ <deferred_reading>
24
+ - @~/.maestro/workflows/issue.md (issues.jsonl schema for issue routing — read when creating issues in Stage 6c)
25
+ - @~/.maestro/workflows/specs-add.md (spec entry format — read when routing to spec in Stage 6b)
26
+ </deferred_reading>
27
+
28
+ <context>
29
+ Arguments: $ARGUMENTS
30
+
31
+ **Modes (auto-detected):**
32
+ - No arguments → `scan` mode: discover all harvestable artifacts, interactive selection
33
+ - `<session-id>` (e.g., `ANL-auth-20260410`, `WFS-xxx`) → `session` mode: harvest specific session
34
+ - `<path>` (e.g., `.workflow/.analysis/ANL-auth-20260410/`) → `path` mode: harvest from explicit directory
35
+
36
+ Flags, source registry (scan paths), and storage locations defined in workflow harvest.md.
37
+ </context>
38
+
39
+ <execution>
40
+ Follow '~/.maestro/workflows/harvest.md' Stages 1-8 in order.
41
+
42
+ **Key invariants:**
43
+ 1. **Read-only until Stage 6** — extraction and classification happen in-memory.
44
+ 2. **Dedup before write** — check harvest-log.jsonl and existing stores before each write.
45
+ 3. **Never modify source artifacts** — harvest is purely extractive.
46
+ 4. **Dedup contract with parallel writers** — when appending to `issues.jsonl`, set `source: "harvest"` on each row so concurrent writers (e.g. `manage-issue-discover` with `source: "discover"`) can be distinguished and deduplicated.
47
+
48
+ Extraction patterns, classification rules, routing infrastructure, and fragment ID scheme defined in workflow harvest.md.
49
+
50
+ </execution>
51
+
52
+ <completion>
53
+ ### Next-step routing
54
+
55
+ | Condition | Suggestion |
56
+ |-----------|-----------|
57
+ | Wiki entries created | `maestro wiki list --type note` |
58
+ | Wiki graph needs linking | `/manage-wiki connect --fix` |
59
+ | Issues created | `/manage-issue list --source harvest` |
60
+ | Specs extracted | `/spec-load --role implement` |
61
+ | Full phase retrospective | `/quality-retrospective` |
62
+ </completion>
63
+
64
+ <error_codes>
65
+ | Code | Severity | Condition | Recovery |
66
+ |------|----------|-----------|----------|
67
+ | E001 | error | `.workflow/` not initialized | Run `/maestro-init` first |
68
+ | E002 | error | Invalid `--to` target (must be: wiki, spec, issue, auto) | Display valid options |
69
+ | E003 | error | Invalid `--source` type | Display valid source types from registry |
70
+ | E004 | error | Session ID not found in any source path | Show available sessions with `--source all` |
71
+ | E005 | error | Path does not exist or contains no parseable artifacts | Verify path and file structure |
72
+ | W001 | warning | No harvestable artifacts found within `--recent` window | Widen time window or check `.workflow/` contents |
73
+ | W002 | warning | `maestro wiki create` failed wiki entries saved to `.workflow/harvest/wiki-pending-*.md` | Apply pending entries manually or retry |
74
+ | W003 | warning | Some fragments below confidence threshold logged but not routed | Lower `--min-confidence` to include |
75
+ | W004 | warning | Duplicate fragments skipped | Review harvest-log.jsonl for prior routing |
76
+ | W005 | warning | `.workflow/issues/` directory missing | Auto-create directory and empty issues.jsonl |
77
+ </error_codes>
78
+
79
+ <success_criteria>
80
+ - [ ] Mode correctly resolved (scan / session / path)
81
+ - [ ] Source artifacts discovered and listed with metadata
82
+ - [ ] User selected artifact(s) to harvest (or auto-selected via session/path mode)
83
+ - [ ] All files in selected artifacts loaded and parsed
84
+ - [ ] Knowledge fragments extracted with category, confidence, tags
85
+ - [ ] Fragments filtered by `--min-confidence`
86
+ - [ ] Routing classification applied (auto or forced by `--to`)
87
+ - [ ] Dedup check passed against harvest-log.jsonl and existing stores
88
+ - [ ] If `--dry-run`: preview displayed, no files written
89
+ - [ ] If not dry-run: all routed items written to target stores
90
+ - [ ] Wiki entries created via `maestro wiki create` (or fallback to pending files)
91
+ - [ ] Spec entries added via `spec-add` mechanism
92
+ - [ ] Issue entries appended to `issues.jsonl` with canonical schema
93
+ - [ ] `harvest-log.jsonl` updated with provenance for each routed item
94
+ - [ ] `harvest-report-{date}.md` written with full summary
95
+ - [ ] No source artifacts modified
96
+ - [ ] Summary displayed with counts and next-step routing
97
+ </success_criteria>