maestro-flow-one 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/.ace-tool/index.json +108 -0
  2. package/bin/maestro-flow.js +30 -0
  3. package/claude/maestro-flow/agents/cli-explore-agent.md +187 -0
  4. package/claude/maestro-flow/agents/conceptual-planning-agent.md +245 -0
  5. package/claude/maestro-flow/agents/team-supervisor.md +143 -0
  6. package/claude/maestro-flow/agents/team-worker.md +237 -0
  7. package/claude/maestro-flow/agents/ui-design-agent.md +286 -0
  8. package/claude/maestro-flow/agents/workflow-analyzer.md +115 -0
  9. package/claude/maestro-flow/agents/workflow-codebase-mapper.md +77 -0
  10. package/claude/maestro-flow/agents/workflow-collab-planner.md +143 -0
  11. package/claude/maestro-flow/agents/workflow-debugger.md +103 -0
  12. package/claude/maestro-flow/agents/workflow-executor.md +129 -0
  13. package/claude/maestro-flow/agents/workflow-external-researcher.md +86 -0
  14. package/claude/maestro-flow/agents/workflow-integration-checker.md +83 -0
  15. package/claude/maestro-flow/agents/workflow-nyquist-auditor.md +85 -0
  16. package/claude/maestro-flow/agents/workflow-phase-researcher.md +85 -0
  17. package/claude/maestro-flow/agents/workflow-plan-checker.md +90 -0
  18. package/claude/maestro-flow/agents/workflow-planner.md +195 -0
  19. package/claude/maestro-flow/agents/workflow-project-researcher.md +74 -0
  20. package/claude/maestro-flow/agents/workflow-research-synthesizer.md +70 -0
  21. package/claude/maestro-flow/agents/workflow-reviewer.md +82 -0
  22. package/claude/maestro-flow/agents/workflow-roadmapper.md +81 -0
  23. package/claude/maestro-flow/agents/workflow-verifier.md +120 -0
  24. package/codex/maestro-flow/agents/team-supervisor.toml +40 -0
  25. package/codex/maestro-flow/agents/team-worker.toml +63 -0
  26. package/maestro-flow/agents/cli-explore-agent.md +187 -0
  27. package/maestro-flow/agents/conceptual-planning-agent.md +245 -0
  28. package/maestro-flow/agents/team-supervisor.md +143 -0
  29. package/maestro-flow/agents/team-worker.md +237 -0
  30. package/maestro-flow/agents/ui-design-agent.md +286 -0
  31. package/maestro-flow/agents/workflow-analyzer.md +115 -0
  32. package/maestro-flow/agents/workflow-codebase-mapper.md +77 -0
  33. package/maestro-flow/agents/workflow-collab-planner.md +143 -0
  34. package/maestro-flow/agents/workflow-debugger.md +103 -0
  35. package/maestro-flow/agents/workflow-executor.md +129 -0
  36. package/maestro-flow/agents/workflow-external-researcher.md +86 -0
  37. package/maestro-flow/agents/workflow-integration-checker.md +83 -0
  38. package/maestro-flow/agents/workflow-nyquist-auditor.md +85 -0
  39. package/maestro-flow/agents/workflow-phase-researcher.md +85 -0
  40. package/maestro-flow/agents/workflow-plan-checker.md +90 -0
  41. package/maestro-flow/agents/workflow-planner.md +195 -0
  42. package/maestro-flow/agents/workflow-project-researcher.md +74 -0
  43. package/maestro-flow/agents/workflow-research-synthesizer.md +70 -0
  44. package/maestro-flow/agents/workflow-reviewer.md +82 -0
  45. package/maestro-flow/agents/workflow-roadmapper.md +81 -0
  46. package/maestro-flow/agents/workflow-verifier.md +120 -0
  47. package/maestro-flow/commands/learn/decompose.md +176 -0
  48. package/maestro-flow/commands/learn/follow.md +167 -0
  49. package/maestro-flow/commands/learn/investigate.md +221 -0
  50. package/maestro-flow/commands/learn/retro.md +303 -0
  51. package/maestro-flow/commands/learn/second-opinion.md +167 -0
  52. package/maestro-flow/commands/lifecycle/amend.md +300 -0
  53. package/maestro-flow/commands/lifecycle/analyze.md +130 -0
  54. package/maestro-flow/commands/lifecycle/brainstorm.md +104 -0
  55. package/maestro-flow/commands/lifecycle/composer.md +354 -0
  56. package/maestro-flow/commands/lifecycle/execute.md +120 -0
  57. package/maestro-flow/commands/lifecycle/fork.md +86 -0
  58. package/maestro-flow/commands/lifecycle/init.md +78 -0
  59. package/maestro-flow/commands/lifecycle/learn.md +140 -0
  60. package/maestro-flow/commands/lifecycle/link-coordinate.md +71 -0
  61. package/maestro-flow/commands/lifecycle/merge.md +61 -0
  62. package/maestro-flow/commands/lifecycle/overlay.md +178 -0
  63. package/maestro-flow/commands/lifecycle/plan.md +154 -0
  64. package/maestro-flow/commands/lifecycle/player.md +404 -0
  65. package/maestro-flow/commands/lifecycle/quick.md +56 -0
  66. package/maestro-flow/commands/lifecycle/roadmap.md +164 -0
  67. package/maestro-flow/commands/lifecycle/ui-design.md +93 -0
  68. package/maestro-flow/commands/lifecycle/update.md +176 -0
  69. package/maestro-flow/commands/lifecycle/verify.md +96 -0
  70. package/maestro-flow/commands/manage/codebase-rebuild.md +75 -0
  71. package/maestro-flow/commands/manage/codebase-refresh.md +57 -0
  72. package/maestro-flow/commands/manage/harvest.md +94 -0
  73. package/maestro-flow/commands/manage/issue-discover.md +77 -0
  74. package/maestro-flow/commands/manage/issue.md +73 -0
  75. package/maestro-flow/commands/manage/knowhow-capture.md +193 -0
  76. package/maestro-flow/commands/manage/knowhow.md +77 -0
  77. package/maestro-flow/commands/manage/learn.md +67 -0
  78. package/maestro-flow/commands/manage/status.md +51 -0
  79. package/maestro-flow/commands/manage/wiki.md +62 -0
  80. package/maestro-flow/commands/milestone/audit.md +68 -0
  81. package/maestro-flow/commands/milestone/complete.md +75 -0
  82. package/maestro-flow/commands/milestone/release.md +96 -0
  83. package/maestro-flow/commands/quality/auto-test.md +128 -0
  84. package/maestro-flow/commands/quality/debug.md +125 -0
  85. package/maestro-flow/commands/quality/refactor.md +55 -0
  86. package/maestro-flow/commands/quality/retrospective.md +78 -0
  87. package/maestro-flow/commands/quality/review.md +114 -0
  88. package/maestro-flow/commands/quality/sync.md +51 -0
  89. package/maestro-flow/commands/quality/test.md +107 -0
  90. package/maestro-flow/commands/spec/add.md +49 -0
  91. package/maestro-flow/commands/spec/load.md +51 -0
  92. package/maestro-flow/commands/spec/remove.md +51 -0
  93. package/maestro-flow/commands/spec/setup.md +51 -0
  94. package/maestro-flow/commands/wiki/connect.md +62 -0
  95. package/maestro-flow/commands/wiki/digest.md +69 -0
  96. package/package.json +1 -1
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: maestro-ui-design
3
+ description: Generate UI design prototypes, select and solidify as code
4
+ argument-hint: "<phase|topic> [--styles N] [--stack <stack>] [--targets <pages>] [--layouts N] [--refine] [--persist] [--full] [-y]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Generate UI design prototypes for a phase or topic. Two workflow paths, auto-selected by skill availability:
17
+
18
+ 1. **Primary (ui-style.md):** Delegates design to ui-ux-pro-max skill. Generates multiple style variants via `--design-system`, user selects, solidifies as code reference. Lightweight and fast.
19
+ 2. **Fallback (ui-design.md):** Self-contained 4-layer pipeline (style → animation → layout → assembly) with 6D attribute space, OKLCH tokens, layout templates, and full prototype matrix. Used when ui-ux-pro-max is unavailable or `--full` is requested.
20
+
21
+ Both paths produce the same output contract: MASTER.md + design-tokens.json + animation-tokens.json + selection.json for downstream plan/execute consumption.
22
+
23
+ Position in pipeline: analyze -> **ui-design** -> plan -> execute -> verify
24
+ </purpose>
25
+
26
+ <deferred_reading>
27
+ - [ui-style.md](~/.maestro/workflows/ui-style.md) — read when SKILL_PATH found (primary path)
28
+ - [ui-design.md](~/.maestro/workflows/ui-design.md) — read when SKILL_PATH empty or --full (fallback path)
29
+ - [index.json](~/.maestro/templates/index.json) — read when updating phase metadata
30
+ - [scratch-index.json](~/.maestro/templates/scratch-index.json) — read when operating in scratch mode
31
+ </deferred_reading>
32
+
33
+ <context>
34
+ $ARGUMENTS — phase number for phase mode, topic text for scratch mode, with optional flags.
35
+
36
+ Flags, workflow routing, scope modes, and output artifacts defined in the routed workflow (ui-style.md or ui-design.md).
37
+
38
+ **Phase mode** (number): resolves phase directory, reads context.md/brainstorm for requirements.
39
+ **Scratch mode** (text): creates `.workflow/scratch/{YYYYMMDD}-ui-design-{slug}/` for standalone exploration.
40
+ </context>
41
+
42
+ <execution>
43
+ ## Workflow Routing
44
+
45
+ Detect ui-ux-pro-max skill availability and route to the appropriate workflow:
46
+
47
+ - **`--full` flag present** → Follow '~/.maestro/workflows/ui-design.md' completely (forced full pipeline)
48
+ - **ui-ux-pro-max found** → Follow '~/.maestro/workflows/ui-style.md' completely (lightweight delegation)
49
+ - **ui-ux-pro-max not found** → Follow '~/.maestro/workflows/ui-design.md' completely (self-contained fallback)
50
+
51
+ Skill detection logic, report format, and complete pipeline steps defined in the routed workflow file.
52
+
53
+ **Next-step routing on completion:**
54
+ - Plan with design reference → /maestro-plan {phase}
55
+ - Refine selected design → /maestro-ui-design {phase} --refine
56
+ - Analyze before planning → /maestro-analyze {phase}
57
+ </execution>
58
+
59
+ <error_codes>
60
+ | Code | Severity | Description | Stage |
61
+ |------|----------|-------------|-------|
62
+ | E001 | error | Phase or topic argument required | parse_input |
63
+ | E002 | error | Phase directory not found | parse_input |
64
+ | E003 | error | Python not available (both paths need Python for ui-ux-pro-max or agent fallback) | setup |
65
+ | E004 | error | --refine requires existing design-ref/ | parse_input |
66
+ | W001 | warning | Design system generation returned partial results | generate |
67
+ | W002 | warning | Prototype rendering failed for one variant | render |
68
+ | W003 | warning | No context.md found, using phase goal only | context |
69
+ | W004 | warning | ui-ux-pro-max not found, falling back to full pipeline | routing |
70
+ </error_codes>
71
+
72
+ <success_criteria>
73
+ **Both paths (common):**
74
+ - [ ] Requirements extracted from phase context (context.md, brainstorm, spec, or user input)
75
+ - [ ] N style variants generated with contrasting design directions
76
+ - [ ] User selected preferred variant (or auto-selected in -y mode)
77
+ - [ ] MASTER.md written with complete design system specification
78
+ - [ ] design-tokens.json written with production-ready tokens (OKLCH colors, component_styles)
79
+ - [ ] animation-tokens.json written (duration, easing, transitions, keyframes)
80
+ - [ ] selection.json recorded with choice metadata
81
+ - [ ] index.json updated with design_ref status
82
+
83
+ **ui-style.md path (primary):**
84
+ - [ ] ui-ux-pro-max --design-system called with product/industry/style keywords
85
+ - [ ] Tokens extracted from ui-ux-pro-max output into structured JSON
86
+
87
+ **ui-design.md path (--full or fallback):**
88
+ - [ ] 6D attribute space used for maximum contrast between variants
89
+ - [ ] Layout templates generated per target (dom_structure + css_layout_rules)
90
+ - [ ] HTML prototypes assembled: styles x layouts x targets
91
+ - [ ] compare.html generated as interactive matrix viewer
92
+ </success_criteria>
93
+ </output>
@@ -0,0 +1,176 @@
1
+ ---
2
+ name: maestro-update
3
+ description: Detect version, preview changes, apply workflow upgrades
4
+ argument-hint: "[--dry-run] [--force]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - AskUserQuestion
13
+ ---
14
+ <purpose>
15
+ Detect the current `.workflow/` schema version, show available migrations, and interactively apply them step-by-step. Uses a migration registry that supports incremental version upgrades (e.g., 1.0 → 2.0 → 3.0).
16
+
17
+ Each migration step is previewed before execution. The user confirms each step in a loop.
18
+ </purpose>
19
+
20
+ <context>
21
+ $ARGUMENTS — optional flags.
22
+
23
+ **Flags:**
24
+ - `--dry-run` -- Preview migration plan without executing
25
+ - `--force` -- Skip confirmation prompts (apply all pending migrations)
26
+
27
+ **Migration registry:** `src/migrations/`
28
+ - Each migration is a standalone file (e.g., `v1-to-v2.ts`) exporting a `MigrationDef`
29
+ - All migrations are registered via `src/migrations/index.ts`
30
+ - Registry auto-chains: detects current version → walks chain → applies in order
31
+ - To add a new migration: create `src/migrations/v{N}-to-v{N+1}.ts`, register in `index.ts`
32
+
33
+ **CLI runner:** `src/migrations/run.ts`
34
+ - Executable entrypoint: `npx tsx src/migrations/run.ts [root] [--dry-run] [--force] [--json]`
35
+ - Outputs JSON (with `--json`) or human-readable text
36
+
37
+ **State version source:** `.workflow/state.json` → `version` field
38
+ </context>
39
+
40
+ <execution>
41
+
42
+ ### Step 1: Detect Current State
43
+
44
+ ```
45
+ 1. Read .workflow/state.json
46
+ 2. Extract version field (default "1.0" if missing)
47
+ 3. Display:
48
+
49
+ === Maestro Workflow Update ===
50
+ Project: {project_name}
51
+ Version: {version}
52
+ Location: {.workflow/ path}
53
+ ```
54
+
55
+ ### Step 2: Dry-Run Preview
56
+
57
+ Run the migration CLI in dry-run + JSON mode to get the full plan:
58
+
59
+ ```bash
60
+ npx tsx src/migrations/run.ts "$(pwd)" --dry-run --json
61
+ ```
62
+
63
+ Parse the JSON output. If status is `up-to-date`:
64
+ ```
65
+ Already up to date (v{version})
66
+ ```
67
+ → EXIT
68
+
69
+ Otherwise display the migration plan:
70
+ ```
71
+ Pending Migrations ({N} step(s)):
72
+
73
+ 1. [v{from} → v{to}] {name}
74
+ {description}
75
+
76
+ 2. [v{from} → v{to}] {name}
77
+ {description}
78
+ ```
79
+
80
+ If `--dry-run` flag was passed by user → display plan and EXIT.
81
+
82
+ ### Step 3: Interactive Confirmation Loop
83
+
84
+ For each migration step (unless `--force`):
85
+
86
+ ```
87
+ LOOP for step_index = 1 to N:
88
+
89
+ Display:
90
+ --- Step {step_index}/{N}: {name} ---
91
+ Version: v{from} → v{to}
92
+
93
+ Changes:
94
+ {description, indented}
95
+
96
+ IF NOT --force:
97
+ AskUserQuestion: "Apply this migration?"
98
+ Options: [yes / skip / abort]
99
+
100
+ - "yes" → proceed to Step 4 (execute)
101
+ - "skip" → WARN "Skipping may break the migration chain"
102
+ continue to next step
103
+ - "abort" → display summary of what was applied so far → EXIT
104
+
105
+ IF --force:
106
+ → proceed to Step 4 (execute)
107
+ ```
108
+
109
+ ### Step 4: Execute Single Migration
110
+
111
+ ```
112
+ 1. Create backup:
113
+ Bash: cp .workflow/state.json .workflow/state.json.backup-v{from}-{timestamp}
114
+
115
+ 2. Run migration:
116
+ Bash: npx tsx src/migrations/run.ts "$(pwd)" --json
117
+
118
+ NOTE: The runner executes ALL pending migrations. For step-by-step control,
119
+ read state.json, call the migration function directly, or use the runner
120
+ which stops on first failure.
121
+
122
+ 3. Parse result JSON and display:
123
+
124
+ {status_icon} Step {N} completed: {name}
125
+ Summary: {summary}
126
+ Changes:
127
+ - {change_1}
128
+ - {change_2}
129
+ - ...
130
+
131
+ 4. If failed:
132
+ Display: "Migration failed: {summary}"
133
+ Display: "Backup available at: {backup_path}"
134
+ Display: "Restore with: cp {backup_path} .workflow/state.json"
135
+ → EXIT
136
+
137
+ 5. Continue loop to next step
138
+ ```
139
+
140
+ ### Step 5: Summary
141
+
142
+ After all steps completed (or user aborted):
143
+
144
+ ```
145
+ === Migration Complete ===
146
+ Applied: {applied_count} / {total_count} migration(s)
147
+ Skipped: {skipped_count}
148
+ Version: v{original} → v{final}
149
+ Backup: .workflow/state.json.backup-v{original}-{timestamp}
150
+
151
+ Next steps:
152
+ /manage-status -- Verify project state
153
+ /maestro -- Continue workflow
154
+ ```
155
+
156
+ </execution>
157
+
158
+ <error_codes>
159
+ | Code | Severity | Condition | Recovery |
160
+ |------|----------|-----------|----------|
161
+ | E001 | error | .workflow/state.json not found | Run /maestro-init first |
162
+ | E002 | error | state.json parse error | Check file for corruption |
163
+ | E003 | error | Migration function failed | Restore from backup |
164
+ | W001 | warning | Skipped migration may break version chain | Re-run /maestro-update later |
165
+ | W002 | warning | tsx not available | Install tsx: npm i -D tsx |
166
+ </error_codes>
167
+
168
+ <success_criteria>
169
+ - [ ] Current version detected from state.json
170
+ - [ ] Dry-run preview shows full migration plan without execution
171
+ - [ ] Each step confirmed interactively (unless --force)
172
+ - [ ] Backup created before each migration
173
+ - [ ] Migration executed and result displayed with change list
174
+ - [ ] Abort stops cleanly with partial summary
175
+ - [ ] Summary shows applied/skipped counts and version change
176
+ </success_criteria>
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: maestro-verify
3
+ description: Verify goals with must-have checks and test coverage validation
4
+ argument-hint: "[phase] [--skip-tests] [--skip-antipattern] [--dir <path>]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Verify execution results through three complementary methods:
17
+ 1. **Goal-Backward verification** — 3-layer check (Truths → Artifacts → Wiring) that validates goals are actually achieved
18
+ 2. **Anti-pattern scan** — detect stubs, placeholders, TODO/FIXME, empty returns in modified files
19
+ 3. **Nyquist test coverage validation** — requirement-to-test mapping with gap classification
20
+
21
+ Supports dual-level verification:
22
+ - **Single plan**: `verify --dir scratch/plan-xxx` — verifies one plan, writes `verification.json` into plan dir
23
+ - **Milestone**: `verify` (no args) — aggregates all execute artifacts for current milestone into `scratch/{YYYYMMDD}-verify-M{N}-{slug}/milestone-verification.json`
24
+
25
+ Registers VRF artifact in state.json on completion.
26
+ </purpose>
27
+
28
+ <required_reading>
29
+ @~/.maestro/workflows/verify.md
30
+ </required_reading>
31
+
32
+ <deferred_reading>
33
+ - [verification.json](~/.maestro/templates/verification.json) — read when generating output
34
+ - [validation.json](~/.maestro/templates/validation.json) — read when generating test output
35
+ </deferred_reading>
36
+
37
+ <context>
38
+ $ARGUMENTS — phase number or no args for milestone-wide, with optional flags.
39
+
40
+ Flags (`--skip-tests`, `--skip-antipattern`, `--dir`), scope routing, output paths, and VRF artifact registration schema are defined in workflow `verify.md`.
41
+
42
+ ### Pre-load context (before verification)
43
+
44
+ 1. **Codebase docs**: If `.workflow/codebase/` exists, read `ARCHITECTURE.md` for expected module wiring and `FEATURES.md` for component mapping. Use in Layer 3 (Connection) checks.
45
+ 2. **Wiki constraints**: Run `maestro wiki search "architecture constraint" --json 2>/dev/null`. If results found, include documented invariants as additional truth checks in Layer 1.
46
+ 3. Both are optional — proceed without if unavailable.
47
+ </context>
48
+
49
+ <execution>
50
+ Follow '~/.maestro/workflows/verify.md' completely.
51
+
52
+ ### Post-verify Knowledge Inquiry
53
+
54
+ After verification completes, evaluate inquiry triggers:
55
+
56
+ 1. **Anti-pattern detection**: If anti-pattern scan found blockers (TODO/FIXME, stubs, empty returns):
57
+ → Ask: "Verification found {N} anti-patterns. Should `quality-rules.md` be updated to enforce these checks? (`/spec-add quality`)"
58
+
59
+ 2. **Constraint violation**: If Goal-Backward check found constraint_violations or missing wiring:
60
+ → Ask: "Verification found architecture constraint violations. Should `architecture-constraints.md` be updated? (`/spec-add arch`)"
61
+
62
+ 3. **Test coverage gaps**: If Nyquist gaps found with recurring pattern (same module/type across tasks):
63
+ → Ask: "Persistent test coverage gap detected in {module}. Should it be added to `test-conventions.md` as a required test area? (`/spec-add test`)"
64
+
65
+ If user confirms, invoke `Skill({ skill: "spec-add", args: "<category> <content>" })`.
66
+
67
+ **Next-step routing on completion:**
68
+ - All checks pass, no gaps → /quality-review
69
+ - Gaps found (must-have failures or anti-pattern blockers) → /maestro-plan --gaps
70
+ - Low test coverage (Nyquist gaps) → /quality-auto-test
71
+
72
+ **Gap-fix closure loop:**
73
+ Gaps found → maestro-plan --gaps → maestro-execute → maestro-verify (re-run)
74
+ </execution>
75
+
76
+ <error_codes>
77
+ | Code | Severity | Condition | Recovery |
78
+ |------|----------|-----------|----------|
79
+ | E001 | error | No executed plans found for verification | Run maestro-execute first |
80
+ | E002 | error | Plan directory not found | Check --dir path |
81
+ | E003 | error | No execution results found (missing summaries) | Run maestro-execute first |
82
+ | W001 | warning | Test coverage below configured threshold | Review coverage gaps |
83
+ | W002 | warning | Anti-pattern blockers found in modified files | Fix blockers before proceeding |
84
+ </error_codes>
85
+
86
+ <success_criteria>
87
+ - [ ] Must-haves established (from convergence.criteria in tasks)
88
+ - [ ] All truths verified with status and evidence (Layer 1)
89
+ - [ ] All artifacts checked at L1 (exists), L2 (substantive), L3 (wired) (Layer 2)
90
+ - [ ] All key links verified with evidence (Layer 3)
91
+ - [ ] Anti-patterns scanned and categorized (unless skipped)
92
+ - [ ] Nyquist test coverage assessed (unless skipped)
93
+ - [ ] Fix plans generated for identified gaps
94
+ - [ ] verification.json written to plan dir (single plan) or milestone verify dir
95
+ - [ ] VRF artifact registered in state.json
96
+ </success_criteria>
@@ -0,0 +1,75 @@
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
+ </context>
47
+
48
+ <execution>
49
+ Follow '~/.maestro/workflows/codebase-rebuild.md' completely.
50
+
51
+ **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).
52
+
53
+ **Next-step routing on completion:**
54
+ - View updated project state → `/manage-status`
55
+ - Incremental updates later → `/manage-codebase-refresh`
56
+ </execution>
57
+
58
+ <error_codes>
59
+ | Code | Severity | Condition | Recovery |
60
+ |------|----------|-----------|----------|
61
+ | E001 | error | .workflow/ not initialized | Run maestro-init first to create .workflow/ |
62
+ | W001 | warning | A mapper agent failed (partial results) | Retry failed mapper or accept partial results |
63
+ | W002 | warning | `.workflow/codebase/` already exists -- user prompted for rebuild/skip | check_existing |
64
+ </error_codes>
65
+
66
+ <success_criteria>
67
+ - [ ] User confirmed rebuild (or --force used)
68
+ - [ ] .workflow/codebase/ cleared and rebuilt from scratch (or scoped subset when --focus set)
69
+ - [ ] All 4 mapper agents spawned (failures logged as W001)
70
+ - [ ] doc-index.json generated and valid
71
+ - [ ] All documentation files regenerated
72
+ - [ ] state.json updated with rebuild timestamp
73
+ - [ ] project.md Tech Stack section updated if changes detected
74
+ - [ ] Next step routing: `/manage-status` or `/manage-codebase-refresh` for incremental updates later
75
+ </success_criteria>
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: manage-codebase-refresh
3
+ description: Refresh codebase docs from recent changes
4
+ argument-hint: "[--since <date>] [--deep]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+
16
+ <purpose>
17
+ Incrementally refresh .workflow/codebase/ documentation based on changes since the last rebuild or refresh. Detects which files have changed (via git diff), identifies which codebase docs are affected, selectively re-runs mapper agents on those areas only, and updates timestamps. Much faster than a full rebuild for ongoing maintenance.
18
+ </purpose>
19
+
20
+ <required_reading>
21
+ @~/.maestro/workflows/codebase-refresh.md
22
+ </required_reading>
23
+
24
+ <context>
25
+ $ARGUMENTS -- optional flags.
26
+
27
+ **Flags:**
28
+ - `--since <date>` -- Override change detection window (ISO date or relative like "3d")
29
+ - `--deep` -- Force deeper re-scan even for files with minor changes
30
+
31
+ **State files:**
32
+ - `.workflow/` -- must be initialized
33
+ - `.workflow/codebase/` -- must contain existing docs (from prior rebuild)
34
+ - `.workflow/codebase/doc-index.json` -- documentation index with timestamps
35
+ - `.workflow/state.json` -- contains `codebase_last_rebuilt` timestamp
36
+ </context>
37
+
38
+ <execution>
39
+ Follow '~/.maestro/workflows/codebase-refresh.md' completely.
40
+ </execution>
41
+
42
+ <error_codes>
43
+ | Code | Meaning |
44
+ |------|----------------------------------------------------------|
45
+ | E001 | .workflow/ not initialized |
46
+ | E002 | No codebase/ docs exist, use codebase-rebuild instead |
47
+ | W001 | No changes detected since last refresh |
48
+ </error_codes>
49
+
50
+ <success_criteria>
51
+ - [ ] Changed files detected via git diff since last refresh
52
+ - [ ] Affected documentation entries identified from doc-index.json
53
+ - [ ] Only affected docs refreshed (selective mapper re-run)
54
+ - [ ] doc-index.json timestamps updated per affected entry
55
+ - [ ] state.json updated with codebase_last_refreshed timestamp
56
+ - [ ] Next step routing: `/manage-status` or `/spec-load` to use updated docs
57
+ </success_criteria>
@@ -0,0 +1,94 @@
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
+
51
+ Extraction patterns, classification rules, routing infrastructure, and fragment ID scheme defined in workflow harvest.md.
52
+
53
+ **Next-step routing on completion:**
54
+ - Review wiki entries → `maestro wiki list --type note`
55
+ - Connect wiki graph → `/wiki-connect --fix`
56
+ - Triage issues → `/manage-issue list --source harvest`
57
+ - View specs → `/spec-load --category learning`
58
+ - Full retrospective → `/quality-retrospective`
59
+ </execution>
60
+
61
+ <error_codes>
62
+ | Code | Severity | Condition | Recovery |
63
+ |------|----------|-----------|----------|
64
+ | E001 | error | `.workflow/` not initialized | Run `/maestro-init` first |
65
+ | E002 | error | Invalid `--to` target (must be: wiki, spec, issue, auto) | Display valid options |
66
+ | E003 | error | Invalid `--source` type | Display valid source types from registry |
67
+ | E004 | error | Session ID not found in any source path | Show available sessions with `--source all` |
68
+ | E005 | error | Path does not exist or contains no parseable artifacts | Verify path and file structure |
69
+ | W001 | warning | No harvestable artifacts found within `--recent` window | Widen time window or check `.workflow/` contents |
70
+ | W002 | warning | `maestro wiki create` failed — wiki entries saved to `.workflow/harvest/wiki-pending-*.md` | Apply pending entries manually or retry |
71
+ | W003 | warning | Some fragments below confidence threshold — logged but not routed | Lower `--min-confidence` to include |
72
+ | W004 | warning | Duplicate fragments skipped | Review harvest-log.jsonl for prior routing |
73
+ | W005 | warning | `.workflow/issues/` directory missing | Auto-create directory and empty issues.jsonl |
74
+ </error_codes>
75
+
76
+ <success_criteria>
77
+ - [ ] Mode correctly resolved (scan / session / path)
78
+ - [ ] Source artifacts discovered and listed with metadata
79
+ - [ ] User selected artifact(s) to harvest (or auto-selected via session/path mode)
80
+ - [ ] All files in selected artifacts loaded and parsed
81
+ - [ ] Knowledge fragments extracted with category, confidence, tags
82
+ - [ ] Fragments filtered by `--min-confidence`
83
+ - [ ] Routing classification applied (auto or forced by `--to`)
84
+ - [ ] Dedup check passed against harvest-log.jsonl and existing stores
85
+ - [ ] If `--dry-run`: preview displayed, no files written
86
+ - [ ] If not dry-run: all routed items written to target stores
87
+ - [ ] Wiki entries created via `maestro wiki create` (or fallback to pending files)
88
+ - [ ] Spec entries added via `spec-add` mechanism
89
+ - [ ] Issue entries appended to `issues.jsonl` with canonical schema
90
+ - [ ] `harvest-log.jsonl` updated with provenance for each routed item
91
+ - [ ] `harvest-report-{date}.md` written with full summary
92
+ - [ ] No source artifacts modified
93
+ - [ ] Summary displayed with counts and next-step routing
94
+ </success_criteria>
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: manage-issue-discover
3
+ description: Discover issues via multi-perspective analysis
4
+ argument-hint: "[multi-perspective | by-prompt \"what to look for\"] [-y|--yes] [--scope=src/**] [--depth=standard|deep]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - Agent
12
+ - AskUserQuestion
13
+ ---
14
+ <purpose>
15
+ Automated issue discovery via multi-perspective codebase analysis (8 perspectives) or prompt-driven exploration. Discovers issues, deduplicates findings, and records them in `.workflow/issues/issues.jsonl`.
16
+
17
+ - **Default (no args)**: Interactive mode selection — choose multi-perspective or prompt-driven.
18
+ - **`multi-perspective`**: 8-perspective parallel agent scan — security, performance, reliability, maintainability, scalability, UX, accessibility, compliance.
19
+ - **`by-prompt "..."`**: Prompt-driven — CLI delegate plans exploration strategy, agents explore iteratively with cross-dimension analysis.
20
+
21
+ For CRUD operations (create, list, update, close, link), use `/manage-issue`.
22
+
23
+ After discovery, use `/maestro-analyze --gaps <ISS-ID>` to perform root cause analysis on individual findings.
24
+ </purpose>
25
+
26
+ <required_reading>
27
+ @~/.maestro/workflows/issue-discover.md
28
+ </required_reading>
29
+
30
+ <deferred_reading>
31
+ - [issue.json template](~/.maestro/templates/issue.json) — read when creating issue records from findings (Step 6/11)
32
+ - [search-tools](~/.maestro/templates/search-tools.md) — search tool priority, passed to agents via workflow
33
+ </deferred_reading>
34
+
35
+ <context>
36
+ $ARGUMENTS -- optional. Parse first token to determine mode.
37
+
38
+ **Modes:**
39
+ - _(empty)_ -- interactive mode selection (AskUserQuestion)
40
+ - `multi-perspective` -- 8-perspective parallel agent scan
41
+ - `by-prompt "..."` -- prompt-driven iterative agent exploration (CLI-planned)
42
+
43
+ **Flags:**
44
+ - `-y` / `--yes` -- auto mode, skip confirmations
45
+ - `--scope=<pattern>` -- file scope (default: `**/*`)
46
+ - `--depth=standard|deep` -- exploration depth (by-prompt only, default: `standard`)
47
+
48
+ **State files:**
49
+ - `.workflow/issues/issues.jsonl` -- issues appended here
50
+ - `.workflow/issues/discoveries/{SESSION_ID}/` -- session artifacts
51
+ </context>
52
+
53
+ <execution>
54
+ Determine mode from $ARGUMENTS:
55
+ - No arguments or empty → interactive selection via AskUserQuestion
56
+ - First token is `multi-perspective` → multi-perspective mode
57
+ - First token is `by-prompt` → prompt-driven mode, remaining tokens are the user prompt
58
+
59
+ Follow '~/.maestro/workflows/issue-discover.md' completely.
60
+ </execution>
61
+
62
+ <error_codes>
63
+ | Code | Severity | Condition | Recovery |
64
+ |------|----------|-----------|----------|
65
+ | E_NO_PROJECT | error | `.workflow/` does not exist | Prompt user to run `/maestro-init` first |
66
+ | E_DISCOVERY_FAILED | error | CLI analysis returned no results | Retry with different tool or report partial findings |
67
+ | E_EMPTY_PROMPT | warning | `by-prompt` used without prompt text | Interactive prompt with suggested options |
68
+ </error_codes>
69
+
70
+ <success_criteria>
71
+ - [ ] Discovery mode correctly determined from arguments
72
+ - [ ] All perspectives analyzed (multi-perspective) or dimensions explored (by-prompt)
73
+ - [ ] Findings deduplicated before issue creation
74
+ - [ ] Issues appended to issues.jsonl with correct schema
75
+ - [ ] Discovery session fully traceable via session directory
76
+ - [ ] Next step routing: `/maestro-analyze --gaps <ISS-ID>` for root cause analysis, or `/manage-issue list` to review all issues
77
+ </success_criteria>