maestro-flow-one 0.1.3 → 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 (100) hide show
  1. package/.ace-tool/index.json +108 -0
  2. package/README.md +10 -10
  3. package/bin/maestro-flow.js +30 -0
  4. package/claude/maestro-flow/SKILL.md +28 -94
  5. package/claude/maestro-flow/agents/cli-explore-agent.md +187 -0
  6. package/claude/maestro-flow/agents/conceptual-planning-agent.md +245 -0
  7. package/claude/maestro-flow/agents/team-supervisor.md +143 -0
  8. package/claude/maestro-flow/agents/team-worker.md +237 -0
  9. package/claude/maestro-flow/agents/ui-design-agent.md +286 -0
  10. package/claude/maestro-flow/agents/workflow-analyzer.md +115 -0
  11. package/claude/maestro-flow/agents/workflow-codebase-mapper.md +77 -0
  12. package/claude/maestro-flow/agents/workflow-collab-planner.md +143 -0
  13. package/claude/maestro-flow/agents/workflow-debugger.md +103 -0
  14. package/claude/maestro-flow/agents/workflow-executor.md +129 -0
  15. package/claude/maestro-flow/agents/workflow-external-researcher.md +86 -0
  16. package/claude/maestro-flow/agents/workflow-integration-checker.md +83 -0
  17. package/claude/maestro-flow/agents/workflow-nyquist-auditor.md +85 -0
  18. package/claude/maestro-flow/agents/workflow-phase-researcher.md +85 -0
  19. package/claude/maestro-flow/agents/workflow-plan-checker.md +90 -0
  20. package/claude/maestro-flow/agents/workflow-planner.md +195 -0
  21. package/claude/maestro-flow/agents/workflow-project-researcher.md +74 -0
  22. package/claude/maestro-flow/agents/workflow-research-synthesizer.md +70 -0
  23. package/claude/maestro-flow/agents/workflow-reviewer.md +82 -0
  24. package/claude/maestro-flow/agents/workflow-roadmapper.md +81 -0
  25. package/claude/maestro-flow/agents/workflow-verifier.md +120 -0
  26. package/claude/maestro-flow/executor.md +328 -0
  27. package/codex/maestro-flow/SKILL.md +18 -0
  28. package/codex/maestro-flow/agents/team-supervisor.toml +40 -0
  29. package/codex/maestro-flow/agents/team-worker.toml +63 -0
  30. package/maestro-flow/agents/cli-explore-agent.md +187 -0
  31. package/maestro-flow/agents/conceptual-planning-agent.md +245 -0
  32. package/maestro-flow/agents/team-supervisor.md +143 -0
  33. package/maestro-flow/agents/team-worker.md +237 -0
  34. package/maestro-flow/agents/ui-design-agent.md +286 -0
  35. package/maestro-flow/agents/workflow-analyzer.md +115 -0
  36. package/maestro-flow/agents/workflow-codebase-mapper.md +77 -0
  37. package/maestro-flow/agents/workflow-collab-planner.md +143 -0
  38. package/maestro-flow/agents/workflow-debugger.md +103 -0
  39. package/maestro-flow/agents/workflow-executor.md +129 -0
  40. package/maestro-flow/agents/workflow-external-researcher.md +86 -0
  41. package/maestro-flow/agents/workflow-integration-checker.md +83 -0
  42. package/maestro-flow/agents/workflow-nyquist-auditor.md +85 -0
  43. package/maestro-flow/agents/workflow-phase-researcher.md +85 -0
  44. package/maestro-flow/agents/workflow-plan-checker.md +90 -0
  45. package/maestro-flow/agents/workflow-planner.md +195 -0
  46. package/maestro-flow/agents/workflow-project-researcher.md +74 -0
  47. package/maestro-flow/agents/workflow-research-synthesizer.md +70 -0
  48. package/maestro-flow/agents/workflow-reviewer.md +82 -0
  49. package/maestro-flow/agents/workflow-roadmapper.md +81 -0
  50. package/maestro-flow/agents/workflow-verifier.md +120 -0
  51. package/maestro-flow/commands/learn/decompose.md +176 -0
  52. package/maestro-flow/commands/learn/follow.md +167 -0
  53. package/maestro-flow/commands/learn/investigate.md +221 -0
  54. package/maestro-flow/commands/learn/retro.md +303 -0
  55. package/maestro-flow/commands/learn/second-opinion.md +167 -0
  56. package/maestro-flow/commands/lifecycle/amend.md +300 -0
  57. package/maestro-flow/commands/lifecycle/analyze.md +130 -0
  58. package/maestro-flow/commands/lifecycle/brainstorm.md +104 -0
  59. package/maestro-flow/commands/lifecycle/composer.md +354 -0
  60. package/maestro-flow/commands/lifecycle/execute.md +120 -0
  61. package/maestro-flow/commands/lifecycle/fork.md +86 -0
  62. package/maestro-flow/commands/lifecycle/init.md +78 -0
  63. package/maestro-flow/commands/lifecycle/learn.md +140 -0
  64. package/maestro-flow/commands/lifecycle/link-coordinate.md +71 -0
  65. package/maestro-flow/commands/lifecycle/merge.md +61 -0
  66. package/maestro-flow/commands/lifecycle/overlay.md +178 -0
  67. package/maestro-flow/commands/lifecycle/plan.md +154 -0
  68. package/maestro-flow/commands/lifecycle/player.md +404 -0
  69. package/maestro-flow/commands/lifecycle/quick.md +56 -0
  70. package/maestro-flow/commands/lifecycle/roadmap.md +164 -0
  71. package/maestro-flow/commands/lifecycle/ui-design.md +93 -0
  72. package/maestro-flow/commands/lifecycle/update.md +176 -0
  73. package/maestro-flow/commands/lifecycle/verify.md +96 -0
  74. package/maestro-flow/commands/manage/codebase-rebuild.md +75 -0
  75. package/maestro-flow/commands/manage/codebase-refresh.md +57 -0
  76. package/maestro-flow/commands/manage/harvest.md +94 -0
  77. package/maestro-flow/commands/manage/issue-discover.md +77 -0
  78. package/maestro-flow/commands/manage/issue.md +73 -0
  79. package/maestro-flow/commands/manage/knowhow-capture.md +193 -0
  80. package/maestro-flow/commands/manage/knowhow.md +77 -0
  81. package/maestro-flow/commands/manage/learn.md +67 -0
  82. package/maestro-flow/commands/manage/status.md +51 -0
  83. package/maestro-flow/commands/manage/wiki.md +62 -0
  84. package/maestro-flow/commands/milestone/audit.md +68 -0
  85. package/maestro-flow/commands/milestone/complete.md +75 -0
  86. package/maestro-flow/commands/milestone/release.md +96 -0
  87. package/maestro-flow/commands/quality/auto-test.md +128 -0
  88. package/maestro-flow/commands/quality/debug.md +125 -0
  89. package/maestro-flow/commands/quality/refactor.md +55 -0
  90. package/maestro-flow/commands/quality/retrospective.md +78 -0
  91. package/maestro-flow/commands/quality/review.md +114 -0
  92. package/maestro-flow/commands/quality/sync.md +51 -0
  93. package/maestro-flow/commands/quality/test.md +107 -0
  94. package/maestro-flow/commands/spec/add.md +49 -0
  95. package/maestro-flow/commands/spec/load.md +51 -0
  96. package/maestro-flow/commands/spec/remove.md +51 -0
  97. package/maestro-flow/commands/spec/setup.md +51 -0
  98. package/maestro-flow/commands/wiki/connect.md +62 -0
  99. package/maestro-flow/commands/wiki/digest.md +69 -0
  100. package/package.json +1 -1
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: maestro-milestone-release
3
+ description: Bump version, generate changelog, tag milestone
4
+ argument-hint: "[<version>] [--bump patch|minor|major] [--dry-run] [--no-tag] [--no-push]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+
16
+ <purpose>
17
+ Package a completed milestone into a releasable version. Bumps the project version (e.g. `package.json`, `pyproject.toml`, or language-specific manifest), generates or appends a changelog entry from phase/milestone summaries and git log, creates an annotated git tag, and optionally pushes to the remote. Runs after `/maestro-milestone-complete` has archived the milestone; serves as the final delivery step in the SDLC loop.
18
+ </purpose>
19
+
20
+ <required_reading>
21
+ @~/.maestro/workflows/milestone-release.md
22
+ </required_reading>
23
+
24
+ <context>
25
+ $ARGUMENTS -- optional explicit version string and flags.
26
+
27
+ **Flags:**
28
+ - `<version>` -- explicit version (e.g. `1.2.0`). If omitted, version is derived from `--bump` or prompted.
29
+ - `--bump patch|minor|major` -- semver bump relative to the current version (default: `minor`)
30
+ - `--dry-run` -- compute the next version, changelog diff, and tag name without writing files or creating tags
31
+ - `--no-tag` -- skip git tag creation (version bump + changelog only)
32
+ - `--no-push` -- skip `git push --follow-tags` after tagging
33
+
34
+ **State files:**
35
+ - `.workflow/state.json` -- current_milestone, previous release version
36
+ - `.workflow/milestones/{milestone}/summary.md` -- milestone summary (from `maestro-milestone-complete`)
37
+ - `.workflow/milestones/{milestone}/audit-report.md` -- audit verdict (must be PASS)
38
+ - `CHANGELOG.md` -- release notes file (created if missing)
39
+ - Version manifest -- `package.json` / `pyproject.toml` / `Cargo.toml` / etc. (auto-detected)
40
+
41
+ **Preconditions:**
42
+ - Current milestone must be completed (audit PASS + `/maestro-milestone-complete` run)
43
+ - Working tree must be clean (no uncommitted changes) unless `--dry-run`
44
+ </context>
45
+
46
+ <execution>
47
+ Follow '~/.maestro/workflows/release.md' completely.
48
+
49
+ **High-level flow:**
50
+ 1. Validate preconditions (milestone completed, clean tree, audit PASS)
51
+ 2. Resolve target version from `<version>` or `--bump` against current manifest
52
+ 3. Collect changes since last release tag: milestone summary + phase summaries + git log between tags
53
+ 4. Generate `CHANGELOG.md` entry (grouped by phase / change type)
54
+ 5. Write version to manifest file(s) + commit with message `chore(release): v{version}`
55
+ 6. Create annotated git tag `v{version}` with release notes body (unless `--no-tag`)
56
+ 7. Push commit + tag to remote (unless `--no-push`)
57
+
58
+ **Report format on completion:**
59
+ ```
60
+ === RELEASE COMPLETE ===
61
+ Version: v{previous} → v{new}
62
+ Milestone: {milestone_name}
63
+ Tag: v{new} {pushed|local-only}
64
+ Changelog: {N} entries written to CHANGELOG.md
65
+ Manifest: {file_path} updated
66
+
67
+ Next steps:
68
+ /maestro-plan {next_phase} -- Start next milestone's first phase
69
+ /manage-status -- View project dashboard
70
+ ```
71
+
72
+ For `--dry-run`, print the computed version, changelog diff, and tag name without side effects.
73
+ </execution>
74
+
75
+ <error_codes>
76
+ | Code | Severity | Condition | Recovery |
77
+ |------|----------|-----------|----------|
78
+ | E001 | error | Current milestone not completed (no milestone-complete run) | Run `/maestro-milestone-complete` first |
79
+ | E002 | error | Audit verdict not PASS | Re-run `/maestro-milestone-audit` and resolve findings |
80
+ | E003 | error | Working tree not clean (uncommitted changes) | Commit or stash changes, then retry |
81
+ | E004 | error | Version manifest not found / unsupported | Add supported manifest or pass `<version>` explicitly with `--no-tag` |
82
+ | E005 | error | Target version not greater than current (would break semver monotonicity) | Choose a higher version or run with explicit `<version>` |
83
+ | W001 | warning | No changes detected since last release tag | Confirm whether release is still desired |
84
+ | W002 | warning | Remote push failed (network / auth) | Retry manually with `git push --follow-tags` |
85
+ </error_codes>
86
+
87
+ <success_criteria>
88
+ - [ ] Preconditions validated (milestone complete, audit PASS, clean tree)
89
+ - [ ] Target version computed and greater than previous
90
+ - [ ] Version manifest(s) updated with new version
91
+ - [ ] CHANGELOG.md contains new entry with milestone summary + grouped changes
92
+ - [ ] Release commit created with conventional message
93
+ - [ ] Annotated git tag created (unless `--no-tag`)
94
+ - [ ] Commit + tag pushed to remote (unless `--no-push` or push failed → W002)
95
+ - [ ] state.json updated with last_release_version + last_release_at timestamp
96
+ </success_criteria>
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: quality-auto-test
3
+ description: Auto-generate and run tests from specs or coverage gaps
4
+ argument-hint: "<phase> [-y] [-c N] [--max-iter <N>] [--layer <L0-L3>] [--strategy <name>] [--dry-run] [--re-run]"
5
+ allowed-tools:
6
+ - spawn_agents_on_csv
7
+ - Read
8
+ - Write
9
+ - Edit
10
+ - Bash
11
+ - Glob
12
+ - Grep
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Run unified automated testing via CSV layer pipeline. Reads project state to auto-select the optimal scenario source — PRD specs (when spec package exists), coverage gaps (when Nyquist audit found gaps), or code exploration (default). All sources converge into a CSV pipeline: discover infrastructure → plan → build scenarios.csv → write tests per layer (spawn_agents_on_csv parallel) → execute → diagnose failures (spawn_agents_on_csv parallel) → iterate → report.
17
+
18
+ Key mechanisms:
19
+ - **Intelligent routing**: Reads `.tests/`, `.workflow/.spec/`, `verification.json` to auto-select source — no mode flag needed
20
+ - **CSV parallel test writing**: Per-layer `spawn_agents_on_csv` — each agent writes one test file independently
21
+ - **CSV parallel failure diagnosis**: Failed scenarios dispatched via `spawn_agents_on_csv` for classification + fix
22
+ - **Unified iteration engine**: Nested inner loop (fix test_defects via diagnosis CSV, max 3/layer) + outer loop (adaptive strategy, max N iterations)
23
+ - **Layers as waves**: L0→L1→L2→L3 sequential (fail-fast on critical), scenarios within layer parallel
24
+ - **Discovery board**: `discoveries.ndjson` shared across all agents/iterations (append-only)
25
+ - **Degenerate modes**: `--max-iter 1` = single-pass generation; default = full iterative cycle
26
+ - **Session persistence**: CSV state + state.json survive context resets, resume from any point
27
+ </purpose>
28
+
29
+ <required_reading>
30
+ @~/.maestro/workflows/auto-test.md
31
+ </required_reading>
32
+
33
+ <context>
34
+ Phase or task: $ARGUMENTS (required — phase number)
35
+
36
+ **Flags:**
37
+ - `--max-iter N` — Maximum outer iterations (default: 5). Set to 1 for single-pass generation only.
38
+ - `--layer L` — Start from or restrict to specific layer (L0|L1|L2|L3)
39
+ - `--dry-run` — Generate test plan only, do not execute
40
+ - `--re-run` — Re-run only previously failed/blocked scenarios
41
+
42
+ **Intelligent routing** (auto-detected from project state):
43
+
44
+ | Priority | Condition | Route | Equivalent to |
45
+ |----------|-----------|-------|---------------|
46
+ | 1 | Active session exists (state.json status=running) | Resume | — |
47
+ | 2 | --re-run flag + previous failures | Re-run | — |
48
+ | 3 | Spec package exists (REQ-*.md) | spec | quality-business-test |
49
+ | 4 | Nyquist gaps exist (verification.json) | gap | quality-test-gen |
50
+ | 5 | Default | code | quality-integration-test |
51
+
52
+ Flags, artifact context resolution, and output formats defined in workflow auto-test.md.
53
+ </context>
54
+
55
+ <execution>
56
+ Follow '~/.maestro/workflows/auto-test.md' completely.
57
+
58
+ **Command-specific extensions (not in workflow):**
59
+
60
+ **Review findings integration** (from related review artifacts):
61
+ - Extract critical/high findings as additional test scenarios, marked `source: "review_finding"`
62
+ - When review verdict is "BLOCK" and review-finding tests fail, suggest quality-debug
63
+
64
+ **Debug root cause integration** (from related debug artifacts):
65
+ - Generate regression test scenarios from confirmed root causes, marked `source: "debug_root_cause"`
66
+
67
+ **Register artifact on completion:**
68
+ ```
69
+ Append to state.json.artifacts[]:
70
+ {
71
+ id: nextArtifactId(artifacts, "test"), // TST-001
72
+ type: "test",
73
+ milestone: current_milestone,
74
+ phase: target_phase,
75
+ scope: "phase",
76
+ path: "scratch/{YYYYMMDD}-auto-test-P{N}-{slug}",
77
+ status: issues == 0 ? "completed" : "failed",
78
+ depends_on: exec_art.id,
79
+ harvested: false,
80
+ created_at: start_time,
81
+ completed_at: now()
82
+ }
83
+ ```
84
+
85
+ **Next-step routing on completion:**
86
+ - Converged (>=95%) → `/maestro-verify {phase}`
87
+ - All requirements verified (spec source) → `/maestro-milestone-audit`
88
+ - Bugs discovered → `/quality-debug --from-auto-test {phase}`
89
+ - Max iter, >80% → `/quality-test {phase}` for manual UAT
90
+ - Max iter, <80% → `/quality-debug {phase}`
91
+ - Coverage still low → `/quality-auto-test {phase} --layer {missing}`
92
+ - Re-run all pass → `/maestro-verify {phase}`
93
+ - Single pass, all pass → `/quality-test {phase}`
94
+ </execution>
95
+
96
+ <error_codes>
97
+ | Code | Severity | Condition | Recovery |
98
+ |------|----------|-----------|----------|
99
+ | E001 | error | Phase argument required (no active sessions) | Prompt user for phase number |
100
+ | E002 | error | Phase not found in artifact registry | Check state.json artifacts |
101
+ | E003 | error | No test framework detected | Install test framework or configure test runner |
102
+ | W001 | warning | One or more test scenarios failed | Auto-iterate or suggest fix options |
103
+ | W002 | warning | Max iterations reached without convergence | Review reflection-log.md, suggest debug |
104
+ | W003 | warning | Degraded spec mode (no full spec package) | Consider running maestro-roadmap --mode full |
105
+ </error_codes>
106
+
107
+ <success_criteria>
108
+ - [ ] Phase resolved from artifact registry
109
+ - [ ] Route auto-selected from project state (spec/gap/code)
110
+ - [ ] Active sessions checked, resume offered if applicable
111
+ - [ ] Scenarios extracted and normalized to unified format
112
+ - [ ] Test infrastructure discovered (framework, patterns, conventions)
113
+ - [ ] test-plan.json generated with layer distribution
114
+ - [ ] User confirmed plan (or --dry-run stopped here)
115
+ - [ ] Tests written following RED-GREEN methodology and existing patterns
116
+ - [ ] Tests executed progressively (L0→L3) with fail-fast on critical
117
+ - [ ] Iteration engine ran (inner: test_defect fix, outer: strategy adjust)
118
+ - [ ] state.json, report.json, reflection-log.md written
119
+ - [ ] Test confidence scored per iteration (Step 7.5) with 5-dimension factor model
120
+ - [ ] Convergence check includes confidence >= 60% alongside pass_rate threshold
121
+ - [ ] Pressure pass completed on highest-pass-rate layer before completion
122
+ - [ ] report.json includes confidence section
123
+ - [ ] index.json updated with auto_test section
124
+ - [ ] If spec source: traceability matrix built, traceability.md written
125
+ - [ ] If failures: issues auto-created in issues.jsonl
126
+ - [ ] If gap source: validation.json gaps updated (MISSING→COVERED)
127
+ - [ ] Next step routed based on convergence status
128
+ </success_criteria>
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: quality-debug
3
+ description: Debug with parallel hypotheses and root cause analysis
4
+ argument-hint: "[issue description] [--from-uat <phase>] [--parallel]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Debug issues using scientific method with subagent isolation and persistent debug state. Three entry modes (standalone, from-UAT, parallel) and structured root cause collection with UAT feedback loop. Full algorithm defined in workflow debug.md.
17
+ </purpose>
18
+
19
+ <required_reading>
20
+ @~/.maestro/workflows/debug.md
21
+ </required_reading>
22
+
23
+ <context>
24
+ User's issue: $ARGUMENTS
25
+
26
+ **Flags:**
27
+ - `--from-uat <phase>` -- Read gaps from phase's uat.md as pre-filled symptoms
28
+ - `--parallel` -- Spawn parallel debug agents (one per gap cluster)
29
+
30
+ **All context via state.json.artifacts[]:**
31
+
32
+ ```
33
+ related = artifacts.filter(a =>
34
+ a.phase === target_phase && a.milestone === current_milestone
35
+ ).sort_by(completed_at asc)
36
+ ```
37
+
38
+ Each artifact's type determines its outputs at `.workflow/{a.path}/`:
39
+ - **execute** → .summaries/, .task/ (source of code changes)
40
+ - **review** → review.json (findings guide hypothesis formation)
41
+ - **debug** → understanding.md, evidence.ndjson (prior investigations, avoid re-investigation)
42
+ - **test** → uat.md (--from-uat gap source), .tests/
43
+
44
+ Extract conclusions from related artifacts that may affect this debug session — review findings guide investigation direction, prior debug avoids redundant work.
45
+
46
+ ### Pre-load context (before hypothesis formation)
47
+
48
+ 1. **Codebase docs**: If `.workflow/codebase/ARCHITECTURE.md` exists, load module boundaries to scope impact analysis and inform hypothesis formation.
49
+ 2. **Wiki prior knowledge**: Run `maestro wiki search "<symptom keywords>" --json 2>/dev/null`. If results found, check for prior investigations on similar issues to avoid re-investigation.
50
+ 3. Both are optional — proceed without if unavailable.
51
+
52
+ **Output**: `DEBUG_DIR = .workflow/scratch/{YYYYMMDD}-debug-P{N}-{slug}/` (P{N} = phase number when phase-scoped; omit for standalone). Output directory rules defined in workflow debug.md Step 4.
53
+ </context>
54
+
55
+ <execution>
56
+ Follow '~/.maestro/workflows/debug.md' completely.
57
+
58
+ **Register artifact on completion (phase-scoped only):**
59
+ ```
60
+ Append to state.json.artifacts[]:
61
+ {
62
+ id: nextArtifactId(artifacts, "debug"), // DBG-001
63
+ type: "debug",
64
+ milestone: current_milestone,
65
+ phase: target_phase,
66
+ scope: "phase",
67
+ path: "scratch/{YYYYMMDD}-debug-P{N}-{slug}",
68
+ status: all_diagnosed ? "completed" : "failed",
69
+ depends_on: triggering_review_id || exec_art.id,
70
+ harvested: false,
71
+ created_at: start_time,
72
+ completed_at: now()
73
+ }
74
+ ```
75
+
76
+ ### Post-debug Knowledge Inquiry
77
+
78
+ After root cause is confirmed, evaluate inquiry triggers:
79
+
80
+ 1. **Recurring pattern**: If root cause matches a recurring pattern (similar to prior debug sessions):
81
+ → Ask: "This root cause pattern has appeared before. Should it be documented in `debug-notes.md` to prevent recurrence? (`/spec-add debug`)"
82
+
83
+ 2. **Non-obvious fix**: If fix involved a non-obvious approach or workaround:
84
+ → Ask: "This fix used a non-obvious strategy. Should it be recorded as a learning? (`/spec-add learning`)"
85
+
86
+ 3. **Architectural gap**: If root cause traces to architectural boundary violation or missing constraint:
87
+ → Ask: "Root cause points to an architectural gap. Should `architecture-constraints.md` be updated? (`/spec-add arch`)"
88
+
89
+ If user confirms, invoke `Skill({ skill: "spec-add", args: "<category> <content>" })`.
90
+
91
+ **Next-step routing on completion:**
92
+ - Root cause found, fix needed → `/maestro-plan {phase} --gaps`
93
+ - Root cause found (from UAT), auto-fix → `/quality-test {phase} --auto-fix`
94
+ - Inconclusive, need more info → `/quality-debug {issue} -c` (resume session)
95
+ - Standalone fix already applied → `/maestro-verify {phase}`
96
+ </execution>
97
+
98
+ <error_codes>
99
+ | Code | Severity | Condition | Recovery |
100
+ |------|----------|-----------|----------|
101
+ | E001 | error | Issue description required (no arguments, no active sessions) | Check arguments format, re-run with correct input |
102
+ | E002 | error | UAT file not found for --from-uat phase | Verify UAT file exists for specified phase |
103
+ | W001 | warning | Existing debug session found, offer resume | Review existing sessions, choose resume or new |
104
+ | W002 | warning | Checkpoint reached, user input needed | Provide requested input to continue |
105
+ | W003 | warning | Some gaps inconclusive, partial diagnosis | Review partial results, retry inconclusive gaps |
106
+ </error_codes>
107
+
108
+ <success_criteria>
109
+ - [ ] Input parsed: standalone, --from-uat, or --parallel mode determined
110
+ - [ ] Active sessions checked and resume offered if applicable
111
+ - [ ] Symptoms gathered (interactive) or loaded from UAT (pre-filled)
112
+ - [ ] Debug output directory created (phase .debug/ or scratch/)
113
+ - [ ] Debug agent(s) spawned with full symptom context
114
+ - [ ] If --parallel: one agent per gap cluster, all concurrent
115
+ - [ ] evidence.ndjson written with structured NDJSON entries
116
+ - [ ] understanding.md tracks evolving understanding per cluster
117
+ - [ ] Root causes collected with fix_direction and affected_files
118
+ - [ ] Multi-factor confidence scored per gap (Step 7.0) replacing simple high/medium/low
119
+ - [ ] Readiness gate checked before ROOT CAUSE declaration
120
+ - [ ] Pressure pass completed on confirmed hypothesis
121
+ - [ ] Confidence table appended to understanding.md
122
+ - [ ] If --from-uat: uat.md gaps updated with diagnosis artifacts
123
+ - [ ] Results unified into diagnosis summary with confidence section
124
+ - [ ] Next step routed (plan --gaps + execute if fix needed, verify if fix applied, resume if inconclusive)
125
+ </success_criteria>
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: quality-refactor
3
+ description: Reduce tech debt with reflection-driven iteration
4
+ argument-hint: "[<scope>]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Task
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Plan and execute targeted refactoring with safety guarantees through analysis, planning, and reflection-driven iteration. Identifies affected files and dependencies, creates a refactoring plan, confirms with the user before execution, then applies changes with test verification after every modification to ensure zero regressions. Each refactoring round records strategy, outcome, and adjustments in reflection-log.md.
17
+ </purpose>
18
+
19
+ <required_reading>
20
+ @~/.maestro/workflows/refactor.md
21
+ </required_reading>
22
+
23
+ <context>
24
+ Scope: $ARGUMENTS (required)
25
+ - Module path: "src/auth" - specific directory
26
+ - Feature area: "authentication" - conceptual scope
27
+ - "all" - full codebase scan
28
+
29
+ If not provided, prompt user for scope.
30
+ </context>
31
+
32
+ <execution>
33
+ Follow '~/.maestro/workflows/refactor.md' completely.
34
+
35
+ **Next-step routing on completion:**
36
+ - All tests pass → `/quality-sync` (update codebase docs)
37
+ - Test failures after refactor → `/quality-debug {scope}`
38
+ - No test suite available → `/quality-auto-test {phase}`
39
+ </execution>
40
+
41
+ <error_codes>
42
+ | Code | Severity | Condition | Recovery |
43
+ |------|----------|-----------|----------|
44
+ | E001 | error | Refactoring scope/description required | Prompt user for module path, feature area, or "all" |
45
+ | E002 | error | Test suite not available for affected area | Suggest creating tests first, or proceed with manual verification |
46
+ | W001 | warning | Partial test coverage for affected area | Note uncovered areas, proceed with extra caution |
47
+ </error_codes>
48
+
49
+ <success_criteria>
50
+ - [ ] Refactoring plan created and confirmed by user
51
+ - [ ] Changes implemented according to plan
52
+ - [ ] All tests pass after refactoring
53
+ - [ ] No regressions introduced
54
+ - [ ] reflection-log.md written with strategy and outcomes
55
+ </success_criteria>
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: quality-retrospective
3
+ description: Phase retrospective with insight routing to specs and lessons
4
+ argument-hint: "[phase|N..M] [--lens technical|process|quality|decision] [--all] [--no-route] [--compare N] [-y]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Post-execution multi-perspective retrospective (复盘) for completed phases. Consumes existing execution artifacts (verification.json, review.json, issues.jsonl, plan.json, .summaries/, uat.md, state.json) and runs four parallel lenses — technical, process, quality, decision — to distill reusable insights. Routes each insight into the appropriate store: spec stub for reusable patterns, memory tip for process notes, issue for recurring gaps. Auto-scans for unreviewed completed phases and reports the backlog. Every insight is also persisted to `.workflow/learning/lessons.jsonl` for cross-phase queryability.
17
+ </purpose>
18
+
19
+ <required_reading>
20
+ @~/.maestro/workflows/retrospective.md
21
+ </required_reading>
22
+
23
+ <deferred_reading>
24
+ - @~/.maestro/workflows/issue.md (issues.jsonl schema for auto-creation)
25
+ - @~/.maestro/workflows/learn.md (tip routing via manage-learn tip)
26
+ - @~/.maestro/workflows/verify.md (verification.json schema for quality lens parsing)
27
+ - @~/.maestro/workflows/review.md (review.json schema for quality lens parsing)
28
+ </deferred_reading>
29
+
30
+ <context>
31
+ Arguments: $ARGUMENTS
32
+
33
+ Modes (scan/single/range/all), flags (--lens, --no-route, --compare, -y), and storage paths defined in workflow retrospective.md Argument Shape and Stages 1-7.
34
+ </context>
35
+
36
+ <execution>
37
+ Follow `~/.maestro/workflows/retrospective.md` Stages 1–8 in order. Key invariants:
38
+
39
+ 1. **Read-only until Stage 6** — Stages 1–5 must not write anything except the in-memory retrospective record.
40
+ 2. **Parallel lens dispatch** — Stage 4 spawns one Agent per active lens in a single message (multiple Agent tool calls). All agents use `subagent_type: "general-purpose"` and `run_in_background: false`.
41
+ 3. **Match canonical issues schema** — Stage 6 issue routing must produce rows that pass `jq` parsing and match the schema in `workflows/issue.md` Step 4 exactly (status `"open"`, full `issue_history` entry, all required fields).
42
+ 4. **Reuse `manage-learn tip` for note routing** — do not duplicate the learning pipeline; invoke via `Skill({ skill: "manage-learn", args: "tip ..." })`.
43
+ 5. **Backward-compat with phase-transition** — append a one-line summary per insight to `.workflow/specs/learnings.md` if and only if that file already exists. Never create it.
44
+ 6. **Stable insight IDs** — `INS-{8 hex}` from `hash(phase_num + lens + title)` so re-runs do not duplicate.
45
+ 7. **Archive before overwrite** — if existing `retrospective.{md,json}` are being replaced, move them to `{artifact_dir}/.history/` with a timestamp suffix first.
46
+ </execution>
47
+
48
+ <error_codes>
49
+ | Code | Severity | Description | Stage |
50
+ |------|----------|-------------|-------|
51
+ | E001 | error | `.workflow/` not initialized — run `/maestro-init` first | parse_input |
52
+ | E002 | error | Unknown `--lens` name (allowed: technical, process, quality, decision) | parse_input |
53
+ | E003 | error | `--compare` requires a single phase argument | parse_input |
54
+ | E004 | error | Phase has not executed yet — no `.task/` or `.summaries/` artifacts | load_artifacts |
55
+ | E005 | error | Phase argument out of range / phase directory not found | scan_unreviewed |
56
+ | W001 | warning | One or more lens agents failed — proceeding with partial coverage | multi_lens_analysis |
57
+ | W002 | warning | Existing retrospective.json found and not `--all` — prompted user to overwrite | scan_unreviewed |
58
+ | W003 | warning | `manage-learn tip` did not return parseable INS id; fell back to direct write | route_outputs |
59
+ | W004 | warning | `--compare` target phase has no retrospective.json; delta omitted | load_artifacts |
60
+ </error_codes>
61
+
62
+ <success_criteria>
63
+ - [ ] Mode correctly resolved (scan / single / range / all)
64
+ - [ ] At least one phase selected and validated (status == "completed", artifacts exist)
65
+ - [ ] All requested lens agents returned valid JSON, or W001 logged for partial coverage
66
+ - [ ] `retrospective.json` written with metrics, findings_by_lens, distilled_insights, routing_recommendations
67
+ - [ ] `retrospective.md` written and human-readable (tweetable, metrics table, per-lens findings, insights, routing table)
68
+ - [ ] Each insight has a stable `INS-{8hex}` id
69
+ - [ ] If routing enabled (default): every recommendation either created an artifact or was explicitly skipped by user
70
+ - [ ] Spec entries (if any) appended as `<spec-entry>` to matching `.workflow/specs/{category-file}.md`
71
+ - [ ] Issue rows (if any) match canonical issues.jsonl schema (status "open", full issue_history, all required fields)
72
+ - [ ] Note tips (if any) created via `Skill({ skill: "manage-learn", args: "tip ..." })`
73
+ - [ ] `lessons.jsonl` appended with one row per insight regardless of routing target
74
+ - [ ] `learning-index.json` updated and parseable
75
+ - [ ] No existing phase artifacts modified (verification.json, review.json, plan.json untouched)
76
+ - [ ] Confirmation banner displays routing counts and next-step suggestions
77
+ - [ ] Next step: `/manage-status` to review state, or `/manage-issue list --source retrospective` to triage created issues, or `/manage-learn list` to browse the lessons library
78
+ </success_criteria>
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: quality-review
3
+ description: Tiered code review with severity classification
4
+ argument-hint: "<phase> [--level quick|standard|deep] [--dimensions security,architecture,...] [--skip-specs]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Run multi-dimensional code review on a completed phase's changed files. Answers the question "is this code good?" -- complementing maestro-verify ("is the goal met?") and quality-test ("does it work for users?"). Three review levels (quick/standard/deep) scale with task depth, auto-detected from file count. Level definitions, dimension lists, deep-dive rules, and issue creation thresholds defined in workflow review.md.
17
+ </purpose>
18
+
19
+ <required_reading>
20
+ @~/.maestro/workflows/review.md
21
+ </required_reading>
22
+
23
+ <deferred_reading>
24
+ - [index.json](~/.maestro/templates/index.json) — read when updating phase index after review
25
+ </deferred_reading>
26
+
27
+ <context>
28
+ Phase: $ARGUMENTS (required — phase number or slug)
29
+
30
+ **Flags:**
31
+ - `--level quick|standard|deep` — Explicit review level (default: auto-detect from file count)
32
+ - `--dimensions <list>` — Comma-separated subset of dimensions to review (overrides level defaults)
33
+ - `--skip-specs` — Skip loading project specs as review context
34
+
35
+ **All context via state.json.artifacts[]:**
36
+
37
+ ```
38
+ related = artifacts.filter(a =>
39
+ a.phase === target_phase && a.milestone === current_milestone
40
+ ).sort_by(completed_at asc)
41
+ ```
42
+
43
+ Each artifact's type determines its outputs at `.workflow/{a.path}/`:
44
+ - **execute** → .summaries/, .task/, verification.json, plan.json (source of files to review)
45
+ - **review** → review.json (prior verdict, findings — for delta comparison)
46
+ - **debug** → understanding.md, evidence.ndjson (confirmed root causes)
47
+ - **test** → uat.md, .tests/ (user-observable gaps)
48
+
49
+ Extract conclusions from related artifacts that may affect this review. Pass as prior quality context to reviewer agents — avoid redundant work, focus on gaps and regressions.
50
+
51
+ ### Pre-load context (before dispatching reviewer agents)
52
+
53
+ 1. **Codebase docs**: If `.workflow/codebase/ARCHITECTURE.md` exists, load component boundaries and layer rules. Pass as `codebase_context` to reviewer agents (especially architecture dimension).
54
+ 2. **Wiki constraints**: Run `maestro wiki search "architecture constraint" --json 2>/dev/null`. If results found, pass as `wiki_context` to reviewer agents for evaluating code against documented decisions.
55
+ 3. Both are optional — proceed without if unavailable.
56
+
57
+ **Output**: `REVIEW_DIR = .workflow/scratch/{YYYYMMDD}-review-P{N}-{slug}/` (P{N} = phase number, enables directory-level identification as state.json fallback)
58
+ </context>
59
+
60
+ <execution>
61
+ Follow '~/.maestro/workflows/review.md' completely.
62
+
63
+ **Output writes to REVIEW_DIR** (not EXEC_DIR):
64
+ - `REVIEW_DIR/review.json` — findings, severity distribution, verdict
65
+
66
+ **Register artifact on completion:**
67
+ ```
68
+ Append to state.json.artifacts[]:
69
+ {
70
+ id: nextArtifactId(artifacts, "review"), // REV-001
71
+ type: "review",
72
+ milestone: current_milestone,
73
+ phase: target_phase,
74
+ scope: "phase",
75
+ path: "scratch/{YYYYMMDD}-review-P{N}-{slug}", // relative to .workflow/
76
+ status: "completed",
77
+ depends_on: exec_art.id, // or prior debug/review if re-review
78
+ harvested: false,
79
+ created_at: start_time,
80
+ completed_at: now()
81
+ }
82
+ ```
83
+
84
+ Report format and next-step routing by verdict defined in workflow review.md Report Format and Next Step Routing sections.
85
+
86
+ **Next-step routing summary:**
87
+ - PASS → `/quality-test {phase}`
88
+ - WARN → `/quality-test {phase}` (proceed with caveats)
89
+ - BLOCK → `/maestro-plan {phase} --gaps` (fix critical findings first)
90
+ </execution>
91
+
92
+ <error_codes>
93
+ | Code | Severity | Condition | Recovery |
94
+ |------|----------|-----------|----------|
95
+ | E001 | error | Phase argument required | Check arguments format, re-run with correct input |
96
+ | E002 | error | Phase directory not found | Check arguments format, re-run with correct input |
97
+ | E003 | error | No execution results found (no task summaries) | Verify execution completed with task summaries |
98
+ | E004 | error | No changed files detected in phase | Verify execution completed with task summaries |
99
+ | W001 | warning | Some dimension agents failed, partial results | Retry failed dimensions or accept partial results |
100
+ | W002 | warning | Deep-dive iteration limit reached with unresolved criticals | Accept current findings or escalate manually |
101
+ </error_codes>
102
+
103
+ <success_criteria>
104
+ - [ ] Phase resolved and changed files collected from task summaries
105
+ - [ ] Review level determined (explicit flag or auto-detected)
106
+ - [ ] Project specs loaded as review context (unless --skip-specs)
107
+ - [ ] Dimension reviews executed (inline for quick, parallel agents for standard/deep)
108
+ - [ ] All dimension results aggregated with severity classification
109
+ - [ ] Deep-dive completed if triggered (standard: auto, deep: forced)
110
+ - [ ] review.json written with complete findings, severity distribution, verdict
111
+ - [ ] Issues auto-created based on level thresholds
112
+ - [ ] index.json updated with review status
113
+ - [ ] Next step routed by verdict (PASS→test, WARN→test with caveats, BLOCK→plan --gaps)
114
+ </success_criteria>
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: quality-sync
3
+ description: Sync codebase docs by tracing git diff impact
4
+ argument-hint: "[--full] [--since <commit|HEAD~N>] [--dry-run]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Synchronize project state after manual code changes or to refresh codebase documentation. Detects changes via git diff, traces impact through doc-index.json (file -> component -> feature -> requirement), updates state.json and index.json, and refreshes affected `.workflow/codebase/` documentation. Use --full flag for a complete resync of all tracked files regardless of git diff.
17
+ </purpose>
18
+
19
+ <required_reading>
20
+ @~/.maestro/workflows/sync.md
21
+ </required_reading>
22
+
23
+ <context>
24
+ $ARGUMENTS -- optional flags:
25
+ - `--full` -- Complete resync of all tracked files (ignores git diff, rebuilds all docs)
26
+ - `--since <commit|HEAD~N>` -- Diff since specific commit (default: last sync timestamp)
27
+ - `--dry-run` -- Show what would be updated without writing changes
28
+ </context>
29
+
30
+ <execution>
31
+ Follow '~/.maestro/workflows/sync.md' completely.
32
+
33
+ **Next-step routing on completion:**
34
+ - Docs refreshed → `/manage-status`
35
+ - Major structural changes detected → `/manage-codebase-rebuild` (full rebuild recommended)
36
+ </execution>
37
+
38
+ <error_codes>
39
+ | Code | Severity | Condition | Recovery |
40
+ |------|----------|-----------|----------|
41
+ | E001 | error | .workflow/ not initialized | Suggest running `/maestro-init` first|
42
+ | W001 | warning | No changes detected since last sync | Report clean state, skip updates |
43
+ </error_codes>
44
+
45
+ <success_criteria>
46
+ - [ ] state.json updated with current sync timestamp
47
+ - [ ] Codebase docs refreshed for all affected components
48
+ - [ ] doc-index.json reflects current file state
49
+ - [ ] Changes tracked and logged
50
+ - [ ] project.md Tech Stack section refreshed if dependency manifests changed
51
+ </success_criteria>