maestro-flow-one 0.2.30 → 0.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/maestro-flow/commands/learn/follow.md +1 -1
- package/maestro-flow/commands/learn/investigate.md +2 -2
- package/maestro-flow/commands/learn/second-opinion.md +1 -1
- package/maestro-flow/commands/lifecycle/analyze.md +53 -2
- package/maestro-flow/commands/lifecycle/blueprint.md +36 -1
- package/maestro-flow/commands/lifecycle/brainstorm.md +40 -1
- package/maestro-flow/commands/lifecycle/collab.md +1 -1
- package/maestro-flow/commands/lifecycle/companion.md +4 -4
- package/maestro-flow/commands/lifecycle/composer.md +1 -1
- package/maestro-flow/commands/lifecycle/execute.md +29 -6
- package/maestro-flow/commands/lifecycle/fork.md +24 -0
- package/maestro-flow/commands/lifecycle/grill.md +38 -1
- package/maestro-flow/commands/lifecycle/impeccable.md +13 -0
- package/maestro-flow/commands/lifecycle/init.md +11 -0
- package/maestro-flow/commands/lifecycle/merge.md +17 -1
- package/maestro-flow/commands/lifecycle/next.md +8 -9
- package/maestro-flow/commands/lifecycle/overlay.md +3 -3
- package/maestro-flow/commands/lifecycle/plan.md +21 -3
- package/maestro-flow/commands/lifecycle/quick.md +13 -1
- package/maestro-flow/commands/lifecycle/roadmap.md +28 -2
- package/maestro-flow/commands/lifecycle/swarm-workflow.md +2 -2
- package/maestro-flow/commands/lifecycle/tools-register.md +2 -2
- package/maestro-flow/commands/lifecycle/ui-codify.md +20 -0
- package/maestro-flow/commands/lifecycle/update.md +59 -116
- package/maestro-flow/commands/manage/codebase-rebuild.md +3 -3
- package/maestro-flow/commands/manage/harvest.md +1 -1
- package/maestro-flow/commands/manage/knowhow-capture.md +7 -4
- package/maestro-flow/commands/manage/knowhow.md +3 -1
- package/maestro-flow/commands/manage/wiki.md +17 -8
- package/maestro-flow/commands/milestone/audit.md +34 -2
- package/maestro-flow/commands/milestone/complete.md +19 -1
- package/maestro-flow/commands/milestone/release.md +18 -0
- package/maestro-flow/commands/quality/auto-test.md +3 -3
- package/maestro-flow/commands/quality/debug.md +4 -4
- package/maestro-flow/commands/quality/refactor.md +2 -2
- package/maestro-flow/commands/quality/retrospective.md +5 -5
- package/maestro-flow/commands/quality/review.md +4 -4
- package/maestro-flow/commands/quality/sync.md +1 -0
- package/maestro-flow/commands/quality/test.md +4 -4
- package/maestro-flow/commands/spec/add.md +6 -4
- package/maestro-flow/commands/spec/setup.md +1 -1
- package/package.json +1 -1
- package/maestro-flow/commands/learn/retro.md +0 -157
- package/maestro-flow/commands/lifecycle/learn.md +0 -140
- package/maestro-flow/commands/lifecycle/verify.md +0 -144
- package/maestro-flow/commands/manage/codebase-refresh.md +0 -60
- package/maestro-flow/commands/manage/learn.md +0 -65
- package/maestro-flow/commands/wiki/connect.md +0 -62
- package/maestro-flow/commands/wiki/digest.md +0 -68
|
@@ -55,7 +55,7 @@ Flags, artifact context resolution, and output formats defined in workflow auto-
|
|
|
55
55
|
1. **Test specs + tools**: Run `maestro spec load --category test` to load test conventions (framework, patterns, naming). Apply to all generated tests.
|
|
56
56
|
2. **Coding specs**: Run `maestro spec load --category coding` to understand coding patterns for accurate test targeting.
|
|
57
57
|
3. **Role Knowledge**:
|
|
58
|
-
- Browse: `maestro
|
|
58
|
+
- Browse: `maestro search --category test`
|
|
59
59
|
- Load task-relevant entries: `maestro wiki load <id1> [id2...]`
|
|
60
60
|
4. All are optional — proceed without if unavailable.
|
|
61
61
|
</context>
|
|
@@ -91,13 +91,13 @@ Append to state.json.artifacts[]:
|
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
**Next-step routing on completion:**
|
|
94
|
-
- Converged (>=95%) → `/
|
|
94
|
+
- Converged (>=95%) → `/quality-review {phase}`
|
|
95
95
|
- All requirements verified (spec source) → `/maestro-milestone-audit`
|
|
96
96
|
- Bugs discovered → `/quality-debug --from-uat {phase}`
|
|
97
97
|
- Max iter, >80% → `/quality-test {phase}` for manual UAT
|
|
98
98
|
- Max iter, <80% → `/quality-debug {phase}`
|
|
99
99
|
- Coverage still low → `/quality-auto-test {phase} --layer {missing}`
|
|
100
|
-
- Re-run all pass → `/
|
|
100
|
+
- Re-run all pass → `/quality-review {phase}`
|
|
101
101
|
- Single pass, all pass → `/quality-test {phase}`
|
|
102
102
|
</execution>
|
|
103
103
|
|
|
@@ -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
|
|
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
|
|
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-
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
|
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: /
|
|
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
|
|
45
|
-
- Role knowledge: `maestro
|
|
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-
|
|
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-
|
|
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
|
-
#
|
|
38
|
-
/spec-add coding "
|
|
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
|
-
#
|
|
41
|
-
/spec-add coding "
|
|
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
|
|
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.
|
|
3
|
+
"version": "0.2.32",
|
|
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>
|