maestro-flow-one 0.2.30 → 0.2.31

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 (49) hide show
  1. package/maestro-flow/commands/learn/follow.md +1 -1
  2. package/maestro-flow/commands/learn/investigate.md +2 -2
  3. package/maestro-flow/commands/learn/second-opinion.md +1 -1
  4. package/maestro-flow/commands/lifecycle/analyze.md +53 -2
  5. package/maestro-flow/commands/lifecycle/blueprint.md +36 -1
  6. package/maestro-flow/commands/lifecycle/brainstorm.md +40 -1
  7. package/maestro-flow/commands/lifecycle/collab.md +1 -1
  8. package/maestro-flow/commands/lifecycle/companion.md +4 -4
  9. package/maestro-flow/commands/lifecycle/composer.md +1 -1
  10. package/maestro-flow/commands/lifecycle/execute.md +29 -6
  11. package/maestro-flow/commands/lifecycle/fork.md +24 -0
  12. package/maestro-flow/commands/lifecycle/grill.md +38 -1
  13. package/maestro-flow/commands/lifecycle/impeccable.md +13 -0
  14. package/maestro-flow/commands/lifecycle/init.md +11 -0
  15. package/maestro-flow/commands/lifecycle/merge.md +17 -1
  16. package/maestro-flow/commands/lifecycle/next.md +8 -9
  17. package/maestro-flow/commands/lifecycle/overlay.md +3 -3
  18. package/maestro-flow/commands/lifecycle/plan.md +21 -3
  19. package/maestro-flow/commands/lifecycle/quick.md +13 -1
  20. package/maestro-flow/commands/lifecycle/roadmap.md +28 -2
  21. package/maestro-flow/commands/lifecycle/swarm-workflow.md +2 -2
  22. package/maestro-flow/commands/lifecycle/tools-register.md +2 -2
  23. package/maestro-flow/commands/lifecycle/ui-codify.md +20 -0
  24. package/maestro-flow/commands/lifecycle/update.md +59 -116
  25. package/maestro-flow/commands/manage/codebase-rebuild.md +3 -3
  26. package/maestro-flow/commands/manage/harvest.md +1 -1
  27. package/maestro-flow/commands/manage/knowhow-capture.md +3 -2
  28. package/maestro-flow/commands/manage/knowhow.md +3 -1
  29. package/maestro-flow/commands/manage/wiki.md +17 -8
  30. package/maestro-flow/commands/milestone/audit.md +34 -2
  31. package/maestro-flow/commands/milestone/complete.md +19 -1
  32. package/maestro-flow/commands/milestone/release.md +18 -0
  33. package/maestro-flow/commands/quality/auto-test.md +3 -3
  34. package/maestro-flow/commands/quality/debug.md +4 -4
  35. package/maestro-flow/commands/quality/refactor.md +2 -2
  36. package/maestro-flow/commands/quality/retrospective.md +5 -5
  37. package/maestro-flow/commands/quality/review.md +4 -4
  38. package/maestro-flow/commands/quality/sync.md +1 -0
  39. package/maestro-flow/commands/quality/test.md +4 -4
  40. package/maestro-flow/commands/spec/add.md +6 -4
  41. package/maestro-flow/commands/spec/setup.md +1 -1
  42. package/package.json +1 -1
  43. package/maestro-flow/commands/learn/retro.md +0 -157
  44. package/maestro-flow/commands/lifecycle/learn.md +0 -140
  45. package/maestro-flow/commands/lifecycle/verify.md +0 -144
  46. package/maestro-flow/commands/manage/codebase-refresh.md +0 -60
  47. package/maestro-flow/commands/manage/learn.md +0 -65
  48. package/maestro-flow/commands/wiki/connect.md +0 -62
  49. package/maestro-flow/commands/wiki/digest.md +0 -68
@@ -45,9 +45,9 @@ Extract conclusions from related artifacts that may affect this debug session
45
45
 
46
46
  ### Pre-load (optional, proceed without)
47
47
  - Codebase docs: `.workflow/codebase/ARCHITECTURE.md` → module boundaries
48
- - Wiki: `maestro wiki search "<symptom keywords>" --json` → prior investigations
48
+ - Wiki: `maestro search "<symptom keywords>" --json` → prior investigations
49
49
  - Specs: `maestro spec load --category debug --keyword "<symptom>"` → known issues/workarounds
50
- - Role knowledge: `maestro wiki list --category debug` → select relevant → `maestro wiki load`
50
+ - Role knowledge: `maestro search --category debug` → select relevant → `maestro wiki load`
51
51
 
52
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
53
  </context>
@@ -81,13 +81,13 @@ Append to state.json.artifacts[]:
81
81
  | Non-obvious fix / workaround | "Record as learning?" | spec-add learning |
82
82
  | Root cause = architectural boundary violation | "Update architecture-constraints.md?" | spec-add arch |
83
83
 
84
- On confirm → `Skill("spec-add", "<category> <content>")`.
84
+ On confirm → `Skill("spec-add", "<category> <content> --description \"<summary>\"")`.
85
85
 
86
86
  **Next-step routing on completion:**
87
87
  - Root cause found, fix needed → `/maestro-plan {phase} --gaps`
88
88
  - Root cause found (from UAT), auto-fix → `/quality-test {phase} --auto-fix`
89
89
  - Inconclusive, need more info → `/quality-debug {issue} -c` (resume session)
90
- - Standalone fix already applied → `/maestro-verify {phase}`
90
+ - Standalone fix already applied → `/maestro-execute {phase}`
91
91
  </execution>
92
92
 
93
93
  <error_codes>
@@ -33,7 +33,7 @@ If not provided, prompt user for scope.
33
33
  1. **Coding specs**: Run `maestro spec load --category coding` to load coding conventions. Apply conventions to all refactored code.
34
34
  2. **Review specs**: Run `maestro spec load --category review` to load review standards. Use as quality gate for refactored code.
35
35
  3. **Role Knowledge**:
36
- - Browse: `maestro wiki list --category coding`
36
+ - Browse: `maestro search --category coding`
37
37
  - Identify task-relevant entries, then load: `maestro wiki load <id1> [id2...]`
38
38
  4. All are optional — proceed without if unavailable.
39
39
  </context>
@@ -42,7 +42,7 @@ If not provided, prompt user for scope.
42
42
  Follow '~/.maestro/workflows/refactor.md' completely.
43
43
 
44
44
  **Knowledge inquiry on completion:**
45
- After successful refactoring, ask user once: "Record refactoring pattern as coding convention?" If yes, persist via `Skill("spec-add", "coding \"<title>\" \"<pattern>\" --keywords <kw1>,<kw2>")`.
45
+ After successful refactoring, ask user once: "Record refactoring pattern as coding convention?" If yes, persist via `Skill("spec-add", "coding \"<title>\" \"<pattern>\" --keywords <kw1>,<kw2> --description \"<summary>\"")`.
46
46
 
47
47
  **Next-step routing on completion:**
48
48
  - All tests pass → `/quality-sync` (update codebase docs)
@@ -22,7 +22,7 @@ Post-execution multi-perspective retrospective (复盘) for completed phases. Co
22
22
 
23
23
  <deferred_reading>
24
24
  - @~/.maestro/workflows/issue.md (issues.jsonl schema for auto-creation)
25
- - @~/.maestro/workflows/learn.md (tip routing via manage-learn tip)
25
+ - @~/.maestro/workflows/learn.md (tip routing via manage-knowhow-capture tip)
26
26
  - @~/.maestro/workflows/verify.md (verification.json schema for quality lens parsing)
27
27
  - @~/.maestro/workflows/review.md (review.json schema for quality lens parsing)
28
28
  </deferred_reading>
@@ -39,7 +39,7 @@ Follow `~/.maestro/workflows/retrospective.md` Stages 1–8 in order. Key invari
39
39
  1. **Read-only until Stage 6** — Stages 1–5 must not write anything except the in-memory retrospective record.
40
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
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 ..." })`.
42
+ 4. **Reuse `manage-knowhow-capture tip` for note routing** — do not duplicate the learning pipeline; invoke via `Skill({ skill: "manage-knowhow-capture", args: "tip ..." })`.
43
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
44
  6. **Stable insight IDs** — `INS-{8 hex}` from `hash(phase_num + lens + title)` so re-runs do not duplicate.
45
45
  7. **Archive before overwrite** — if existing `retrospective.{md,json}` are being replaced, move them to `{artifact_dir}/.history/` with a timestamp suffix first.
@@ -55,7 +55,7 @@ Follow `~/.maestro/workflows/retrospective.md` Stages 1–8 in order. Key invari
55
55
  | E005 | error | Phase argument out of range / phase directory not found | scan_unreviewed |
56
56
  | W001 | warning | One or more lens agents failed — proceeding with partial coverage | multi_lens_analysis |
57
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 |
58
+ | W003 | warning | `manage-knowhow-capture tip` did not return parseable INS id; fell back to direct write | route_outputs |
59
59
  | W004 | warning | `--compare` target phase has no retrospective.json; delta omitted | load_artifacts |
60
60
  </error_codes>
61
61
 
@@ -69,9 +69,9 @@ Follow `~/.maestro/workflows/retrospective.md` Stages 1–8 in order. Key invari
69
69
  - [ ] If routing enabled (default): every recommendation either created an artifact or was explicitly skipped by user
70
70
  - [ ] Spec entries (if any) appended as `<spec-entry>` to matching `.workflow/specs/{category-file}.md`
71
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 ..." })`
72
+ - [ ] Note tips (if any) created via `Skill({ skill: "manage-knowhow-capture", args: "tip ..." })`
73
73
  - [ ] `.workflow/specs/learnings.md` appended with one `<spec-entry>` per insight regardless of routing target
74
74
  - [ ] No existing phase artifacts modified (verification.json, review.json, plan.json untouched)
75
75
  - [ ] Confirmation banner displays routing counts and next-step suggestions
76
- - [ ] Next step: `/manage-status` to review state, or `/manage-issue list --source retrospective` to triage created issues, or `/manage-learn list` to browse the knowhow library
76
+ - [ ] Next step: `/manage-status` to review state, or `/manage-issue list --source retrospective` to triage created issues, or `/manage-knowhow list` to browse the knowhow library
77
77
  </success_criteria>
@@ -13,7 +13,7 @@ allowed-tools:
13
13
  - AskUserQuestion
14
14
  ---
15
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.
16
+ Run multi-dimensional code review on a completed phase's changed files. Answers the question "is this code good?" -- complementing maestro-execute's built-in verification ("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
17
  </purpose>
18
18
 
19
19
  <required_reading>
@@ -50,9 +50,9 @@ Extract conclusions from related artifacts that may affect this review. Pass as
50
50
 
51
51
  ### Pre-load (optional, proceed without)
52
52
  - Codebase docs: `.workflow/codebase/ARCHITECTURE.md` → component boundaries, layer rules
53
- - Wiki constraints: `maestro wiki search "architecture constraint" --json` → documented decisions
53
+ - Wiki constraints: `maestro search "architecture constraint" --json` → documented decisions
54
54
  - Specs: `maestro spec load --category review` → review standards, checklists, knowhow tools
55
- - Role knowledge: `maestro wiki list --category review` → select relevant → `maestro wiki load`
55
+ - Role knowledge: `maestro search --category review` → select relevant → `maestro wiki load`
56
56
 
57
57
  **Output**: `REVIEW_DIR = .workflow/scratch/{YYYYMMDD}-review-P{N}-{slug}/` (P{N} = phase number, enables directory-level identification as state.json fallback)
58
58
  </context>
@@ -99,7 +99,7 @@ NEXT: /quality-refactor
99
99
 
100
100
  Status mapping:
101
101
  - **DONE** — PASS verdict, no critical findings → NEXT: /quality-refactor
102
- - **DONE_WITH_CONCERNS** — WARN verdict, issues found but non-blocking → NEXT: /maestro-verify
102
+ - **DONE_WITH_CONCERNS** — WARN verdict, issues found but non-blocking → NEXT: /quality-test
103
103
  - **NEEDS_RETRY** — BLOCK verdict, critical findings require fix first
104
104
  </execution>
105
105
 
@@ -33,6 +33,7 @@ Follow '~/.maestro/workflows/sync.md' completely.
33
33
  **Next-step routing on completion:**
34
34
  - Docs refreshed → `/manage-status`
35
35
  - Major structural changes detected → `/manage-codebase-rebuild` (full rebuild recommended)
36
+ - Incremental refresh (replaces former `/manage-codebase-refresh`) → use `--since` flag
36
37
  </execution>
37
38
 
38
39
  <error_codes>
@@ -41,8 +41,8 @@ Follow '~/.maestro/workflows/test.md' completely.
41
41
  **Command-specific extensions (not in workflow):**
42
42
 
43
43
  **Knowledge context loading** (before test design):
44
- - Wiki search: `maestro wiki search "<phase/feature keywords>" --json` → prior test strategies, recipes, decisions
45
- - Role knowledge: `maestro wiki list --category test` → select relevant → `maestro wiki load <id>`
44
+ - Wiki search: `maestro search "<phase/feature keywords>" --json` → prior test strategies, recipes, decisions
45
+ - Role knowledge: `maestro search --category test` → select relevant → `maestro wiki load <id>`
46
46
  - Specs + tools: `maestro spec load --category test` → test conventions + discoverable knowhow tools
47
47
 
48
48
  **Test tool discovery** (knowhow tools as scenario source):
@@ -77,7 +77,7 @@ Append to state.json.artifacts[]:
77
77
 
78
78
  **Next-step routing on completion:**
79
79
  - All tests pass → `/maestro-milestone-audit`
80
- - Issues found, --auto-fix ran and succeeded → `/maestro-verify {phase}`
80
+ - Issues found, --auto-fix ran and succeeded → `/maestro-execute {phase}`
81
81
  - Issues found, --auto-fix ran but gaps remain → `/quality-debug --from-uat {phase}`
82
82
  - Issues found, manual fix needed → `/quality-debug --from-uat {phase}`
83
83
  - Coverage below threshold → `/quality-auto-test {phase}`
@@ -88,7 +88,7 @@ Append to state.json.artifacts[]:
88
88
  | Code | Severity | Condition | Recovery |
89
89
  |------|----------|-----------|----------|
90
90
  | E001 | error | Phase or task target required (no active sessions) | Prompt user for phase number |
91
- | E002 | error | Phase not verified yet (no verification.json) | Suggest `/maestro-verify` first |
91
+ | E002 | error | Phase not verified yet (no verification.json) | Suggest `/maestro-execute` first (verification is built-in) |
92
92
  | E003 | error | Smoke test failed (app won't start) | Suggest `/quality-debug` |
93
93
  | W001 | warning | One or more test scenarios failed | Auto-diagnose, suggest fix options |
94
94
  | W002 | warning | Coverage below threshold | Suggest `/quality-auto-test` |
@@ -24,6 +24,7 @@ Entries use `category` attribute to declare which category they belong to.
24
24
  $ARGUMENTS -- expects `[--scope <scope>] [--uid <uid>] <category> <content>`
25
25
 
26
26
  **Options:**
27
+ - `--description <desc>` — One-line description for search results (falls back to content[:240])
27
28
  - `--ref <path>` — Create as index entry referencing a knowhow document. If the path exists, only creates the spec index entry. If path doesn't exist, also creates the knowhow file.
28
29
  - `--knowhow-type <type>` — Knowhow document type when creating with --ref (asset, blueprint, document, template, recipe, reference, decision)
29
30
 
@@ -34,12 +35,13 @@ Scope-to-directory mapping, category-to-file mapping, and entry format defined i
34
35
  # English content → English keywords
35
36
  /spec-add coding "Named exports" "Always use named exports" --keywords "exports,naming"
36
37
 
37
- # Chinese content Chinese keywords (匹配中文 prompt)
38
- /spec-add coding "命名导出规范" "始终使用命名导出" --keywords "导出,命名,模块"
38
+ # With description for search results
39
+ /spec-add coding "OAuth PKCE Flow" "完整 PKCE 集成流程" --keywords "oauth,pkce" --description "OAuth 2.0 PKCE 认证流程规范"
39
40
 
40
- # Mixedbilingual keywords
41
- /spec-add coding "OAuth PKCE Flow" "完整 PKCE 集成流程" --ref knowhow/RCP-oauth-pkce.md --keywords "oauth,pkce,认证,授权"
41
+ # Chinese content Chinese keywords
42
+ /spec-add coding "命名导出规范" "始终使用命名导出" --keywords "导出,命名,模块"
42
43
 
44
+ # Ref mode
43
45
  /spec-add arch "OAuth PKCE 集成" "完整流程设计" --ref knowhow/AST-oauth-flow.md
44
46
  ```
45
47
  </context>
@@ -12,7 +12,7 @@ allowed-tools:
12
12
  <purpose>
13
13
  Initialize the project-level specs directory by scanning the codebase for conventions, patterns, and tech stack.
14
14
  Core files (coding, arch, learnings) are always created. Optional spec files (quality, test, ui) are created only when relevant signals are detected.
15
- Additionally, generates recipe-type knowhow docs in `.workflow/knowhow/` for detected operational workflows (test / debug / build / dev / lint) — capturing "how to do X in this project" so future agents can find them via `maestro wiki search`.
15
+ Additionally, generates recipe-type knowhow docs in `.workflow/knowhow/` for detected operational workflows (test / debug / build / dev / lint) — capturing "how to do X in this project" so future agents can find them via `maestro search`.
16
16
  Spec output lands in `.workflow/specs/`; recipe output lands in `.workflow/knowhow/`.
17
17
  </purpose>
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maestro-flow-one",
3
- "version": "0.2.30",
3
+ "version": "0.2.31",
4
4
  "description": "All Maestro workflow commands as a single Claude Code skill — intent routing, decision gates, minimal closed-loop chains",
5
5
  "bin": {
6
6
  "maestro-flow": "bin/maestro-flow.js"
@@ -1,157 +0,0 @@
1
- ---
2
- name: learn-retro
3
- description: Retrospective of git activity and decision quality
4
- argument-hint: "[--lens git|decision|all] [--days N] [--author <name>] [--area <path>] [--phase N] [--tag <tag>] [--id <id>] [--compare]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Bash
9
- - Glob
10
- - Grep
11
- - Agent
12
- - AskUserQuestion
13
- ---
14
- <purpose>
15
- Unified retrospective combining git activity analysis and decision quality evaluation. Works on raw git history and wiki/spec data. Two lenses (git, decision), usable independently or together.
16
-
17
- All insights persist to `.workflow/specs/learnings.md` as `<spec-entry>` blocks.
18
- </purpose>
19
-
20
- <context>
21
- $ARGUMENTS — lens selection and scope flags.
22
-
23
- **Lens**: `--lens git` | `--lens decision` | `--lens all` (default: all)
24
-
25
- **Git lens flags**: `--days N` (default: 7), `--author <name>`, `--area <path>`, `--compare` (vs prior retro)
26
- **Decision lens flags**: `--phase N`, `--tag <tag>`, `--id <id>` (single decision by wiki/INS id)
27
-
28
- **Storage write**:
29
- - `.workflow/knowhow/KNW-retro-{date}.md` — unified report
30
- - `.workflow/knowhow/KNW-retro-{date}.json` — structured metrics
31
- - `.workflow/specs/learnings.md` — appended `<spec-entry>` blocks (source: retro-git / retro-decision)
32
-
33
- **Storage read**: git history, `.workflow/state.json`, prior `KNW-retro-*.json`, `.workflow/specs/learnings.md`, wiki specs, `architecture-constraints.md`, phase context files
34
- </context>
35
-
36
- <state_machine>
37
-
38
- <states>
39
- S_PARSE — 解析 lens + flags PERSIST: —
40
- S_GIT — git 活动分析(lens=git/all 时) PERSIST: metrics
41
- S_DECISION — 决策质量评估(lens=decision/all 时) PERSIST: evaluations
42
- S_REPORT — 生成统一报告 PERSIST: .md + .json
43
- S_PERSIST — 写 spec-entry 块 PERSIST: .workflow/specs/learnings.md
44
- </states>
45
-
46
- <transitions>
47
-
48
- S_PARSE:
49
- → S_GIT WHEN: lens == git OR all DO: ensure .workflow/knowhow/ exists (mkdir -p)
50
- → S_DECISION WHEN: lens == decision DO: ensure .workflow/knowhow/ exists (mkdir -p)
51
-
52
- S_GIT:
53
- → S_DECISION WHEN: lens == all DO: A_GIT_ANALYSIS
54
- → S_REPORT WHEN: lens == git DO: A_GIT_ANALYSIS
55
-
56
- S_DECISION:
57
- → S_REPORT DO: A_DECISION_ANALYSIS
58
-
59
- S_REPORT:
60
- → S_PERSIST DO: write KNW-retro-{date}.md + .json
61
-
62
- S_PERSIST:
63
- → END DO: append insights to .workflow/specs/learnings.md via `maestro spec add learning`
64
- RULE: INS-id = hash(lens + metric_or_decision_id + date) for cross-session stability
65
-
66
- </transitions>
67
-
68
- <actions>
69
-
70
- ### A_GIT_ANALYSIS
71
-
72
- **Parallel git commands**:
73
- ```bash
74
- git log --since="{start}" --format="%H|%aN|%ae|%ai|%s" --shortstat
75
- git log --since="{start}" --format="COMMIT:%H|%aN" --numstat
76
- git log --since="{start}" --format="%at|%aN|%ai|%s" | sort -n
77
- git log --since="{start}" --format="" --name-only | grep -v '^$' | sort | uniq -c | sort -rn | head -20
78
- git shortlog --since="{start}" -sn --no-merges
79
- ```
80
- Apply --author and --area filters.
81
-
82
- **Compute metrics**:
83
-
84
- | Metric | Formula |
85
- |--------|---------|
86
- | Test ratio | test_insertions / total_insertions * 100% |
87
- | Churn rate | files changed >2x / total unique files |
88
- | Sessions | Cluster commits by >2hr gaps in timestamps |
89
- | LOC/session-hour | net_loc / total_session_hours |
90
-
91
- **Per-author breakdown**: commits, LOC, top 3 areas, test ratio, session count.
92
-
93
- **Trend** (if --compare or prior KNW-retro-*.json exists): compute deltas, flag >20% changes.
94
-
95
- **Distill insights**: high churn files (instability), low test ratio areas (<20%), session patterns, area drift vs roadmap.
96
-
97
- ### A_DECISION_ANALYSIS
98
-
99
- **Collect** (parallel):
100
- ```bash
101
- maestro wiki search "decision" --json
102
- maestro wiki list --type spec --json
103
- git log --oneline --all --grep="decision\|chose\|decided" -20
104
- ```
105
- Plus: architecture-constraints.md, phase context Locked/Deferred sections, .workflow/specs/learnings.md.
106
- Apply --phase/--tag/--id filters.
107
-
108
- **Build registry** per decision: id, title, source, date, rationale, alternatives, phase, implementation_evidence [file paths].
109
-
110
- **Evaluate** — spawn 3 Agents in single message:
111
-
112
- | Agent | Dimension | Grades |
113
- |-------|-----------|--------|
114
- | Technical Soundness | Implementation matches intent? Context changed? | sound / degraded / violated |
115
- | Cost Assessment | Complexity added? Coupling/debt? | low-cost / acceptable / expensive / debt-creating |
116
- | Alternative Hindsight | Right call with current knowledge? Reversible? | confirmed / questionable / should-revisit |
117
-
118
- **Classify lifecycle**:
119
-
120
- | Status | Criteria |
121
- |--------|---------|
122
- | Validated | sound + low/acceptable + confirmed |
123
- | Aging | sound + expensive + confirmed |
124
- | Questionable | degraded/violated + questionable |
125
- | Stale | any + should-revisit |
126
- | Reversed | code contradicts decision |
127
-
128
- **Recommend**: Aging → tech debt review, Questionable → create issue, Stale → refresh, Reversed → document reversal.
129
-
130
- </actions>
131
-
132
- </state_machine>
133
-
134
- <error_codes>
135
- | Code | Condition | Recovery |
136
- |------|-----------|----------|
137
- | E001 | Not in git repo (git lens) | Navigate to git repo |
138
- | E002 | No commits in window (git lens) | Increase --days |
139
- | E003 | No decisions found (decision lens) | Check wiki/specs or provide --id |
140
- | E004 | --id not found in wiki or knowhow | Verify the decision ID exists |
141
- | W002 | No prior retro for comparison | Skip trend; first retro = baseline |
142
- | W003 | One perspective agent failed | Proceed with available perspectives |
143
- </error_codes>
144
-
145
- <success_criteria>
146
- - [ ] Git lens: metrics computed (commits, LOC, test ratio, churn, sessions), insights distilled
147
- - [ ] Decision lens: decisions collected, 3 agents evaluated in parallel, lifecycle classified
148
- - [ ] Unified report + structured JSON written
149
- - [ ] .workflow/specs/learnings.md appended with stable INS-ids
150
- </success_criteria>
151
-
152
- <next_step_routing>
153
- - Browse insights → `/manage-learn list --tag retro`
154
- - Deep dive churn → `/learn-follow <path>`
155
- - Fix test gaps → `/quality-auto-test <area>`
156
- - Investigate stale decision → `/learn-investigate <question>`
157
- </next_step_routing>
@@ -1,140 +0,0 @@
1
- ---
2
- name: maestro-learn
3
- description: Route learning intent to learn-* commands
4
- argument-hint: "<intent> [-y] [--dry-run] [--chain <name>]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Bash
9
- - Glob
10
- - Grep
11
- - Agent
12
- - AskUserQuestion
13
- ---
14
- <purpose>
15
- Route learning requests to the optimal learn command or multi-step chain. Supports direct chain selection via `--chain` or intent-based routing via keyword matching.
16
-
17
- Executes commands sequentially via Skill() with session tracking.
18
- </purpose>
19
-
20
- <context>
21
- $ARGUMENTS — user learning intent text, or flags.
22
-
23
- **Flags:**
24
- - `-y` / `--yes` — Auto mode: skip confirmation
25
- - `--dry-run` — Show planned chain without executing
26
- - `--chain <name>` — Force a specific chain (bypass intent detection)
27
-
28
- **Available learn commands:**
29
- | Command | Purpose |
30
- |---------|---------|
31
- | `learn-follow` | Guided reading with forcing questions, pattern extraction |
32
- | `learn-investigate` | Hypothesis-driven question investigation |
33
- | `learn-decompose` | 4-dimension parallel pattern extraction |
34
- | `learn-second-opinion` | Multi-perspective review/challenge/consult |
35
- | `learn-retro` | Unified retrospective (git metrics + decision evaluation) |
36
-
37
- **Available chains:**
38
- | Chain | Steps | Use when |
39
- |-------|-------|----------|
40
- | `follow` | learn-follow | Read/understand code or docs |
41
- | `investigate` | learn-investigate | Answer a "how/why" question |
42
- | `decompose` | learn-decompose | Catalog patterns in a module |
43
- | `second-opinion` | learn-second-opinion | Get review/challenge on code |
44
- | `retro` | learn-retro --lens all | Full retrospective (git + decisions) |
45
- | `deep-understand` | follow → decompose → second-opinion | Thorough module analysis |
46
- | `pattern-catalog` | decompose --save-spec --save-wiki → second-opinion --mode review | Full pattern extraction + review |
47
-
48
- **Storage:**
49
- - `.workflow/knowhow/.maestro-learn/{session_id}/status.json` — Session tracking
50
- - All learn command outputs go to `.workflow/knowhow/`
51
- </context>
52
-
53
- <execution>
54
-
55
- ### Step 1: Parse & Route
56
-
57
- Parse flags (`-y`, `--dry-run`, `--chain`). Extract intent text.
58
-
59
- **If `--chain` specified:** validate against known chains, jump to Step 2.
60
-
61
- **Intent routing table** (match first token or keywords):
62
-
63
- | Keywords | Route |
64
- |----------|-------|
65
- | File path (contains `/` or `\`) | `follow` |
66
- | Wiki ID (`type-slug` pattern) | `follow` |
67
- | read, follow, walk through, understand, 阅读, 跟读 | `follow` |
68
- | why, how, what if, investigate, 为什么, 怎么 | `investigate` |
69
- | pattern, decompose, catalog, 分解, 模式 | `decompose` |
70
- | opinion, review, challenge, consult, 评审, 挑战 | `second-opinion` |
71
- | retro, git, commit, decision, 回顾 | `retro` |
72
- | thorough, deep, 全面, 深入 | `deep-understand` |
73
-
74
- **If no match:** present menu via AskUserQuestion:
75
- ```
76
- What would you like to do?
77
- 1. Read through code/docs → follow
78
- 2. Investigate a question → investigate
79
- 3. Find patterns in code → decompose
80
- 4. Get a second opinion → second-opinion
81
- 5. Retrospective → retro
82
- ```
83
-
84
- Max 1 clarification round. If still unclear: error.
85
-
86
- ### Step 2: Resolve Target & Build Args
87
-
88
- - File path → pass directly
89
- - Wiki ID → pass directly
90
- - Topic string → pass as quoted argument
91
- - Extract any flags (--depth, --days, --lens, --mode, --scope, etc.)
92
-
93
- **Chain → command mapping:**
94
- ```
95
- follow → Skill("learn-follow", "{target} {flags}")
96
- investigate → Skill("learn-investigate", "\"{target}\" {flags}")
97
- decompose → Skill("learn-decompose", "{target} {flags}")
98
- second-opinion → Skill("learn-second-opinion", "{target} {flags}")
99
- retro → Skill("learn-retro", "{flags}")
100
- deep-understand → [learn-follow --depth deep, learn-decompose --save-spec, learn-second-opinion --mode challenge]
101
- pattern-catalog → [learn-decompose --save-spec --save-wiki, learn-second-opinion --mode review]
102
- ```
103
-
104
- ### Step 3: Confirm & Execute
105
-
106
- **If `--dry-run`:** display chain plan and exit.
107
-
108
- **If not `-y`:** show plan, ask for confirmation.
109
-
110
- **Execute:**
111
- 1. Create session dir: `.workflow/knowhow/.maestro-learn/learn-{timestamp}/`
112
- 2. Write `status.json` with chain steps
113
- 3. Execute each step via `Skill()`:
114
- - On success: mark completed, continue
115
- - On failure (interactive): ask retry/skip/abort
116
- - On failure (auto): skip and continue
117
- 4. Display session summary with artifact list and next-step suggestion
118
-
119
- </execution>
120
-
121
- <error_codes>
122
- | Code | Severity | Description | Recovery |
123
- |------|----------|-------------|----------|
124
- | E001 | error | No intent provided | Provide a learning goal or use --chain |
125
- | E002 | error | Cannot determine intent after clarification | Rephrase or use --chain directly |
126
- | E003 | error | Chain step failed + user chose abort | Partial progress saved in status.json |
127
- | E005 | error | Invalid --chain name | Show valid chains |
128
- | W001 | warning | Intent ambiguous between commands | Present options |
129
- | W002 | warning | Chain step completed with warnings | Log and continue |
130
- </error_codes>
131
-
132
- <success_criteria>
133
- - [ ] Intent routed to correct chain (or --chain validated)
134
- - [ ] Target resolved and arguments assembled
135
- - [ ] Session directory created with status.json
136
- - [ ] All chain steps executed via Skill()
137
- - [ ] Error handling: retry/skip/abort per step
138
- - [ ] Session summary displayed with next-step routing
139
- - [ ] No files modified outside `.workflow/knowhow/`
140
- </success_criteria>
@@ -1,144 +0,0 @@
1
- ---
2
- name: maestro-verify
3
- description: Use after execution to verify goals are actually achieved with evidence-based structural checks
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/{YYYYMMDD}-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
41
-
42
- | Flag | Effect | Default |
43
- |------|--------|---------|
44
- | `--skip-tests` | Skip Nyquist test coverage validation (V2), only run Goal-Backward verification | false |
45
- | `--skip-antipattern` | Skip anti-pattern scan step | false |
46
- | `--dir <path>` | Verify a single plan directory instead of milestone-wide | — (milestone mode) |
47
-
48
- **Scope routing:**
49
- | Input | Scope | Resolution |
50
- |-------|-------|------------|
51
- | `--dir scratch/{dir}` | single plan | Verify one plan, write verification.json into plan dir |
52
- | numeric arg | phase | Verify all execute artifacts for that phase |
53
- | no args | milestone | Aggregate all execute artifacts for current milestone |
54
-
55
- Output paths and VRF artifact registration schema are defined in workflow `verify.md`.
56
-
57
- ### Pre-load context (before verification)
58
-
59
- 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.
60
- 2. **Review specs**: Run `maestro spec load --category review` to load review standards. Use as quality baseline for anti-pattern scan and constraint checks.
61
- 3. **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.
62
- 4. **Role Knowledge**:
63
- - Browse: `maestro wiki list --category review`
64
- - Load task-relevant entries: `maestro wiki load <id1> [id2...]`
65
- 5. All are optional — proceed without if unavailable.
66
- </context>
67
-
68
- <execution>
69
- Follow '~/.maestro/workflows/verify.md' completely.
70
-
71
- ### Post-verify Knowledge Inquiry
72
-
73
- | Condition | Ask | Route |
74
- |-----------|-----|-------|
75
- | Anti-pattern blockers found (TODO/FIXME/stubs) | "Update quality-rules.md?" | spec-add quality |
76
- | Architecture constraint violations | "Update architecture-constraints.md?" | spec-add arch |
77
- | Recurring test coverage gap (same module across tasks) | "Add to test-conventions.md?" | spec-add test |
78
-
79
- On confirm → `Skill("spec-add", "<category> <content>")`.
80
-
81
- </execution>
82
-
83
- <completion>
84
- ### Standalone report
85
-
86
- ```
87
- === VERIFY COMPLETE ===
88
- STATUS: DONE|DONE_WITH_CONCERNS|NEEDS_RETRY
89
- CONCERNS: {description if applicable}
90
- NEXT: /quality-review
91
- === END VERIFY ===
92
- ```
93
-
94
- Status mapping:
95
- - **DONE** — All checks pass, no gaps → NEXT: /quality-review
96
- - **DONE_WITH_CONCERNS** — Gaps found (must-have failures or anti-pattern blockers) → NEXT: /maestro-execute (after /maestro-plan --gaps)
97
- - **NEEDS_RETRY** — Verification could not complete (missing artifacts, corrupt data)
98
-
99
- ### Ralph-invoked completion
100
-
101
- End the step by calling the CLI (no text block output):
102
- ```
103
- maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
104
- ```
105
-
106
- Status verdicts:
107
- - **DONE** — Normal completion
108
- - **DONE_WITH_CONCERNS** — Completed with caveats; pass `--concerns`
109
- - **NEEDS_RETRY** — Tooling error / transient issue; ralph will retry
110
- - **BLOCKED** — External hard blocker; pass `--reason`
111
-
112
- ### Next-step routing
113
-
114
- | Condition | Suggestion |
115
- |-----------|-----------|
116
- | All checks pass, no gaps | `/quality-review` |
117
- | Gaps found (must-have failures or anti-pattern blockers) | `/maestro-plan --gaps` |
118
- | Low test coverage (Nyquist gaps) | `/quality-auto-test` |
119
-
120
- **Gap-fix closure loop:**
121
- Gaps found → maestro-plan --gaps → maestro-execute → maestro-verify (re-run)
122
- </completion>
123
-
124
- <error_codes>
125
- | Code | Severity | Condition | Recovery |
126
- |------|----------|-----------|----------|
127
- | E001 | error | No executed plans found for verification | Run maestro-execute first |
128
- | E002 | error | Plan directory not found | Check --dir path |
129
- | E003 | error | No execution results found (missing summaries) | Run maestro-execute first |
130
- | W001 | warning | Test coverage below configured threshold | Review coverage gaps |
131
- | W002 | warning | Anti-pattern blockers found in modified files | Fix blockers before proceeding |
132
- </error_codes>
133
-
134
- <success_criteria>
135
- - [ ] Must-haves established (from convergence.criteria in tasks)
136
- - [ ] All truths verified with status and evidence (Layer 1)
137
- - [ ] All artifacts checked at L1 (exists), L2 (substantive), L3 (wired) (Layer 2)
138
- - [ ] All key links verified with evidence (Layer 3)
139
- - [ ] Anti-patterns scanned and categorized (unless skipped)
140
- - [ ] Nyquist test coverage assessed (unless skipped)
141
- - [ ] Fix plans generated for identified gaps
142
- - [ ] verification.json written to plan dir (single plan) or milestone verify dir
143
- - [ ] VRF artifact registered in state.json
144
- </success_criteria>