maestro-flow 0.3.38 → 0.3.39
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/.claude/agents/workflow-analyzer.md +2 -0
- package/.claude/agents/workflow-debugger.md +2 -0
- package/.claude/agents/workflow-executor.md +2 -0
- package/.claude/agents/workflow-integration-checker.md +1 -0
- package/.claude/agents/workflow-nyquist-auditor.md +1 -0
- package/.claude/agents/workflow-planner.md +2 -0
- package/.claude/agents/workflow-reviewer.md +2 -0
- package/.claude/agents/workflow-verifier.md +2 -0
- package/.claude/commands/learn-decompose.md +176 -176
- package/.claude/commands/learn-follow.md +167 -167
- package/.claude/commands/learn-investigate.md +221 -221
- package/.claude/commands/learn-retro.md +303 -303
- package/.claude/commands/learn-second-opinion.md +167 -167
- package/.claude/commands/maestro-amend.md +300 -300
- package/.claude/commands/maestro-analyze.md +126 -126
- package/.claude/commands/maestro-brainstorm.md +100 -100
- package/.claude/commands/maestro-composer.md +354 -354
- package/.claude/commands/maestro-execute.md +120 -114
- package/.claude/commands/maestro-fork.md +86 -86
- package/.claude/commands/maestro-init.md +78 -78
- package/.claude/commands/maestro-learn.md +140 -140
- package/.claude/commands/maestro-link-coordinate.md +1 -1
- package/.claude/commands/maestro-merge.md +61 -61
- package/.claude/commands/maestro-milestone-release.md +96 -96
- package/.claude/commands/maestro-overlay.md +178 -178
- package/.claude/commands/maestro-plan.md +150 -138
- package/.claude/commands/maestro-player.md +404 -404
- package/.claude/commands/maestro-quick.md +56 -56
- package/.claude/commands/maestro-ralph-execute.md +7 -18
- package/.claude/commands/maestro-ralph.md +9 -3
- package/.claude/commands/maestro-roadmap.md +1 -1
- package/.claude/commands/maestro-ui-design.md +93 -93
- package/.claude/commands/maestro-update.md +176 -176
- package/.claude/commands/maestro-verify.md +96 -90
- package/.claude/commands/maestro.md +121 -121
- package/.claude/commands/manage-codebase-rebuild.md +75 -75
- package/.claude/commands/manage-codebase-refresh.md +57 -57
- package/.claude/commands/manage-harvest.md +94 -94
- package/.claude/commands/manage-issue-discover.md +77 -77
- package/.claude/commands/manage-issue.md +73 -73
- package/.claude/commands/manage-knowhow-capture.md +193 -193
- package/.claude/commands/manage-knowhow.md +77 -77
- package/.claude/commands/manage-learn.md +67 -67
- package/.claude/commands/manage-status.md +51 -51
- package/.claude/commands/manage-wiki.md +62 -62
- package/.claude/commands/quality-auto-test.md +1 -1
- package/.claude/commands/quality-debug.md +121 -115
- package/.claude/commands/quality-refactor.md +55 -55
- package/.claude/commands/quality-retrospective.md +78 -78
- package/.claude/commands/quality-review.md +114 -108
- package/.claude/commands/quality-sync.md +51 -51
- package/.claude/commands/quality-test.md +103 -103
- package/.claude/commands/spec-add.md +49 -49
- package/.claude/commands/spec-load.md +51 -51
- package/.claude/commands/spec-remove.md +51 -51
- package/.claude/commands/spec-setup.md +51 -51
- package/.claude/commands/wiki-connect.md +62 -62
- package/.claude/commands/wiki-digest.md +69 -69
- package/.codex/skills/learn-decompose/SKILL.md +113 -113
- package/.codex/skills/learn-follow/SKILL.md +1 -1
- package/.codex/skills/learn-investigate/SKILL.md +83 -83
- package/.codex/skills/learn-retro/SKILL.md +83 -83
- package/.codex/skills/learn-second-opinion/SKILL.md +86 -86
- package/.codex/skills/maestro/SKILL.md +304 -304
- package/.codex/skills/maestro-analyze/SKILL.md +4 -3
- package/.codex/skills/maestro-brainstorm/SKILL.md +442 -397
- package/.codex/skills/maestro-composer/SKILL.md +213 -213
- package/.codex/skills/maestro-execute/SKILL.md +346 -318
- package/.codex/skills/maestro-fork/SKILL.md +56 -2
- package/.codex/skills/maestro-init/SKILL.md +40 -16
- package/.codex/skills/maestro-learn/SKILL.md +80 -80
- package/.codex/skills/maestro-link-coordinate/SKILL.md +257 -257
- package/.codex/skills/maestro-merge/SKILL.md +1 -1
- package/.codex/skills/maestro-milestone-audit/SKILL.md +1 -1
- package/.codex/skills/maestro-milestone-complete/SKILL.md +40 -9
- package/.codex/skills/maestro-milestone-release/SKILL.md +70 -70
- package/.codex/skills/maestro-overlay/SKILL.md +1 -1
- package/.codex/skills/maestro-plan/SKILL.md +19 -4
- package/.codex/skills/maestro-player/SKILL.md +323 -323
- package/.codex/skills/maestro-quick/SKILL.md +1 -1
- package/.codex/skills/maestro-ralph/SKILL.md +681 -578
- package/.codex/skills/maestro-roadmap/SKILL.md +518 -468
- package/.codex/skills/maestro-ui-design/SKILL.md +109 -12
- package/.codex/skills/maestro-verify/SKILL.md +27 -9
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +3 -2
- package/.codex/skills/manage-codebase-refresh/SKILL.md +1 -1
- package/.codex/skills/manage-harvest/SKILL.md +91 -91
- package/.codex/skills/manage-issue/SKILL.md +19 -6
- package/.codex/skills/manage-issue-discover/SKILL.md +1 -1
- package/.codex/skills/manage-knowhow/SKILL.md +95 -95
- package/.codex/skills/manage-knowhow-capture/SKILL.md +110 -110
- package/.codex/skills/manage-learn/SKILL.md +1 -1
- package/.codex/skills/manage-status/SKILL.md +1 -1
- package/.codex/skills/manage-wiki/SKILL.md +55 -55
- package/.codex/skills/quality-auto-test/SKILL.md +547 -547
- package/.codex/skills/quality-debug/SKILL.md +339 -334
- package/.codex/skills/quality-refactor/SKILL.md +1 -1
- package/.codex/skills/quality-retrospective/SKILL.md +292 -292
- package/.codex/skills/quality-review/SKILL.md +365 -364
- package/.codex/skills/quality-sync/SKILL.md +1 -1
- package/.codex/skills/quality-test/SKILL.md +498 -498
- package/.codex/skills/spec-add/SKILL.md +101 -101
- package/.codex/skills/spec-load/SKILL.md +77 -77
- package/.codex/skills/spec-map/SKILL.md +1 -1
- package/.codex/skills/spec-remove/SKILL.md +69 -69
- package/.codex/skills/spec-setup/SKILL.md +1 -1
- package/.codex/skills/team-coordinate/SKILL.md +2 -1
- package/.codex/skills/team-executor/SKILL.md +116 -115
- package/.codex/skills/team-lifecycle-v4/SKILL.md +2 -1
- package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +14 -6
- package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +16 -4
- package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +7 -1
- package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +16 -4
- package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +8 -2
- package/.codex/skills/team-quality-assurance/SKILL.md +2 -1
- package/.codex/skills/team-quality-assurance/roles/scout/role.md +9 -2
- package/.codex/skills/team-review/SKILL.md +2 -1
- package/.codex/skills/team-review/roles/reviewer/role.md +10 -1
- package/.codex/skills/team-review/roles/scanner/role.md +10 -1
- package/.codex/skills/team-tech-debt/SKILL.md +144 -143
- package/.codex/skills/team-tech-debt/roles/executor/role.md +9 -5
- package/.codex/skills/team-tech-debt/roles/scanner/role.md +10 -0
- package/.codex/skills/team-tech-debt/roles/validator/role.md +8 -2
- package/.codex/skills/team-testing/SKILL.md +2 -1
- package/.codex/skills/team-testing/roles/executor/role.md +8 -2
- package/.codex/skills/team-testing/roles/generator/role.md +8 -2
- package/.codex/skills/wiki-connect/SKILL.md +73 -73
- package/.codex/skills/wiki-digest/SKILL.md +87 -87
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +4 -0
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +6 -0
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
- package/dashboard/dist-server/shared/agent-types.d.ts +2 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.d.ts +2 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.js +4 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
- package/dashboard/dist-server/src/commands/delegate.d.ts +2 -0
- package/dashboard/dist-server/src/commands/delegate.js +18 -0
- package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
- package/dashboard/dist-server/src/config/cli-tools-config.d.ts +6 -0
- package/dashboard/dist-server/src/config/cli-tools-config.js +2 -0
- package/dashboard/dist-server/src/config/cli-tools-config.js.map +1 -1
- package/dist/shared/agent-types.d.ts +2 -0
- package/dist/shared/agent-types.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.d.ts +2 -0
- package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.js +4 -0
- package/dist/src/agents/cli-agent-runner.js.map +1 -1
- package/dist/src/commands/config.d.ts.map +1 -1
- package/dist/src/commands/config.js +29 -1
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/delegate.d.ts +2 -0
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +18 -0
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/commands/launcher.d.ts.map +1 -1
- package/dist/src/commands/launcher.js +27 -4
- package/dist/src/commands/launcher.js.map +1 -1
- package/dist/src/config/cli-tools-config.d.ts +6 -0
- package/dist/src/config/cli-tools-config.d.ts.map +1 -1
- package/dist/src/config/cli-tools-config.js +2 -0
- package/dist/src/config/cli-tools-config.js.map +1 -1
- package/dist/src/core/overlay/applier.d.ts.map +1 -1
- package/dist/src/core/overlay/applier.js +65 -5
- package/dist/src/core/overlay/applier.js.map +1 -1
- package/dist/src/core/overlay/loader.d.ts.map +1 -1
- package/dist/src/core/overlay/loader.js +9 -4
- package/dist/src/core/overlay/loader.js.map +1 -1
- package/dist/src/core/overlay/types.d.ts +2 -0
- package/dist/src/core/overlay/types.d.ts.map +1 -1
- package/dist/src/core/overlay/types.js +2 -0
- package/dist/src/core/overlay/types.js.map +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.js +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -1
- package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ToolsOverview.js +51 -4
- package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -1
- package/package.json +1 -1
- package/shared/agent-types.ts +2 -0
- package/workflows/delegate-protocol.codex.md +65 -0
|
@@ -1,303 +1,303 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: learn-retro
|
|
3
|
-
description:
|
|
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 that combines git activity analysis and decision quality evaluation into a single command with lens-based selection. Works on raw git history and wiki/spec data — does not require completed phase artifacts (unlike `quality-retrospective`).
|
|
16
|
-
|
|
17
|
-
Two lenses, usable independently or together:
|
|
18
|
-
- **git**: Commit metrics, session detection, per-author breakdown, file hotspots, trend tracking
|
|
19
|
-
- **decision**: Decision tracing across wiki/specs/git, multi-perspective evaluation, lifecycle classification
|
|
20
|
-
|
|
21
|
-
All insights persist to `.workflow/learning/lessons.jsonl` for cross-session queryability via `manage-learn`.
|
|
22
|
-
</purpose>
|
|
23
|
-
|
|
24
|
-
<context>
|
|
25
|
-
Arguments: $ARGUMENTS
|
|
26
|
-
|
|
27
|
-
**Lens selection:**
|
|
28
|
-
- `--lens git` — Git activity retrospective only
|
|
29
|
-
- `--lens decision` — Decision evaluation only
|
|
30
|
-
- `--lens all` — Both lenses (default)
|
|
31
|
-
|
|
32
|
-
**Git lens flags:**
|
|
33
|
-
- `--days N` — Time window in days (default: 7)
|
|
34
|
-
- `--author <name>` — Filter commits by author name (substring match)
|
|
35
|
-
- `--area <path>` — Scope to files under a specific directory
|
|
36
|
-
- `--compare` — Compare against the previous retro report if one exists
|
|
37
|
-
|
|
38
|
-
**Decision lens flags:**
|
|
39
|
-
- `--phase N` — Decisions from phase N's context and related specs
|
|
40
|
-
- `--tag <tag>` — Decisions tagged with specific tag in wiki/specs
|
|
41
|
-
- `--id <id>` — Single decision by wiki ID or lessons.jsonl INS-id
|
|
42
|
-
|
|
43
|
-
**Storage written:**
|
|
44
|
-
- `.workflow/learning/retro-{YYYY-MM-DD}.md` — Unified human-readable report
|
|
45
|
-
- `.workflow/learning/retro-{YYYY-MM-DD}.json` — Structured metrics (machine-readable)
|
|
46
|
-
- `.workflow/learning/lessons.jsonl` — Appended insights (source: "retro-git" or "retro-decision")
|
|
47
|
-
- `.workflow/learning/learning-index.json` — Updated index
|
|
48
|
-
|
|
49
|
-
**Storage read:**
|
|
50
|
-
- `.workflow/state.json` — Current phase context (optional)
|
|
51
|
-
- `.workflow/learning/retro-*.json` — Prior retro for trend comparison
|
|
52
|
-
- `.workflow/learning/lessons.jsonl` — Existing insights for dedup
|
|
53
|
-
- `maestro wiki list --type spec --json` — Spec entries (decision lens)
|
|
54
|
-
- `.workflow/specs/architecture-constraints.md` — Documented architectural decisions (decision lens)
|
|
55
|
-
- Phase context with Locked/Free/Deferred decisions (decision lens) — resolve via `state.json.artifacts[]` scratch paths
|
|
56
|
-
</context>
|
|
57
|
-
|
|
58
|
-
<execution>
|
|
59
|
-
|
|
60
|
-
### Stage 1: Parse Arguments & Select Lenses
|
|
61
|
-
- Parse `--lens` flag: `git`, `decision`, or `all` (default: `all`)
|
|
62
|
-
- Extract lens-specific flags
|
|
63
|
-
- Check `.workflow/learning/` exists; bootstrap if missing
|
|
64
|
-
|
|
65
|
-
Display banner:
|
|
66
|
-
```
|
|
67
|
-
============================================================
|
|
68
|
-
LEARN RETRO
|
|
69
|
-
============================================================
|
|
70
|
-
Lens: {git | decision | all}
|
|
71
|
-
Scope: {days/author/area for git} {phase/tag/id for decision}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
### Stage 2: Git Lens (skip if --lens decision)
|
|
77
|
-
|
|
78
|
-
#### 2a: Gather Raw Data (parallel git commands)
|
|
79
|
-
Run ALL these git commands in parallel:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
# Commit stats with author, timestamp, subject, files changed
|
|
83
|
-
git log --since="<start-date>T00:00:00" --format="%H|%aN|%ae|%ai|%s" --shortstat
|
|
84
|
-
|
|
85
|
-
# Per-commit numstat for test vs production LOC split
|
|
86
|
-
git log --since="<start-date>T00:00:00" --format="COMMIT:%H|%aN" --numstat
|
|
87
|
-
|
|
88
|
-
# Timestamps for session detection (sorted)
|
|
89
|
-
git log --since="<start-date>T00:00:00" --format="%at|%aN|%ai|%s" | sort -n
|
|
90
|
-
|
|
91
|
-
# File hotspots (most frequently changed files)
|
|
92
|
-
git log --since="<start-date>T00:00:00" --format="" --name-only | grep -v '^$' | sort | uniq -c | sort -rn | head -20
|
|
93
|
-
|
|
94
|
-
# Per-author commit counts
|
|
95
|
-
git shortlog --since="<start-date>T00:00:00" -sn --no-merges
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Apply `--author` and `--area` filters if provided.
|
|
99
|
-
|
|
100
|
-
#### 2b: Compute Metrics
|
|
101
|
-
| Metric | Computation |
|
|
102
|
-
|--------|-------------|
|
|
103
|
-
| Commits | Count of non-merge commits |
|
|
104
|
-
| Contributors | Unique author count |
|
|
105
|
-
| Total insertions / deletions | Sum from shortstat |
|
|
106
|
-
| Net LOC | insertions - deletions |
|
|
107
|
-
| Test LOC (insertions) | Sum insertions for test files from numstat |
|
|
108
|
-
| Test ratio | test_insertions / total_insertions x 100% |
|
|
109
|
-
| Churn rate | Files changed >2 times / total unique files |
|
|
110
|
-
| Active days | Distinct dates with commits |
|
|
111
|
-
|
|
112
|
-
#### 2c: Detect Work Sessions
|
|
113
|
-
Cluster commits by >2hr gaps in timestamps:
|
|
114
|
-
- Per session: start time, end time, duration, commit count, primary focus area
|
|
115
|
-
- Compute: total sessions, avg session duration, avg LOC/session-hour
|
|
116
|
-
|
|
117
|
-
#### 2d: Per-Author Breakdown
|
|
118
|
-
For each author:
|
|
119
|
-
- Commit count, LOC added/removed, top 3 file areas
|
|
120
|
-
- Test ratio (their test LOC / their total LOC)
|
|
121
|
-
- Session count and patterns
|
|
122
|
-
|
|
123
|
-
#### 2e: Trend Comparison (if --compare or prior report exists)
|
|
124
|
-
- Find most recent `.workflow/learning/retro-*.json`
|
|
125
|
-
- Compute deltas: commits, LOC, test ratio, churn rate, session count
|
|
126
|
-
- Flag significant changes (>20% delta) as trend highlights
|
|
127
|
-
|
|
128
|
-
#### 2f: Distill Git Insights
|
|
129
|
-
- **High churn files** (changed >3 times): instability signal
|
|
130
|
-
- **Low test ratio areas** (<20%): testing gap
|
|
131
|
-
- **Session patterns**: scattered vs deep sessions
|
|
132
|
-
- **Area drift**: commits not aligned with current roadmap phase
|
|
133
|
-
|
|
134
|
-
Each insight: title, description, category (pattern/antipattern/technique), tags, confidence.
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
### Stage 3: Decision Lens (skip if --lens git)
|
|
139
|
-
|
|
140
|
-
#### 3a: Collect Decisions (parallel)
|
|
141
|
-
```bash
|
|
142
|
-
maestro wiki search "decision" --json
|
|
143
|
-
maestro wiki list --type spec --json
|
|
144
|
-
git log --oneline --all --grep="decision\|chose\|decided\|architecture" -20
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Also read:
|
|
148
|
-
- `.workflow/specs/architecture-constraints.md` — grep for `<spec-entry category="arch"` blocks
|
|
149
|
-
- Phase context files — resolve via `state.json.artifacts[]` scratch paths — scan for "Locked:", "Deferred:" sections
|
|
150
|
-
- `.workflow/learning/lessons.jsonl` — filter `category == "decision"`
|
|
151
|
-
|
|
152
|
-
Apply scope filter (--phase, --tag, --id).
|
|
153
|
-
|
|
154
|
-
#### 3b: Build Decision Registry
|
|
155
|
-
Per decision:
|
|
156
|
-
```json
|
|
157
|
-
{
|
|
158
|
-
"id": "source id",
|
|
159
|
-
"title": "what was decided",
|
|
160
|
-
"source": "wiki|spec|phase-context|lesson|git",
|
|
161
|
-
"date": "when decided",
|
|
162
|
-
"rationale": "why",
|
|
163
|
-
"alternatives": "what was considered",
|
|
164
|
-
"phase": "which phase",
|
|
165
|
-
"implementation_evidence": ["file paths from git"]
|
|
166
|
-
}
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
#### 3c: Multi-Perspective Evaluation
|
|
170
|
-
Spawn 3 Agents in a single message:
|
|
171
|
-
|
|
172
|
-
**Agent 1 — Technical Soundness:**
|
|
173
|
-
- Does implementation match stated intent?
|
|
174
|
-
- Has technical context changed since decision was made?
|
|
175
|
-
- Grade: sound / degraded / violated
|
|
176
|
-
|
|
177
|
-
**Agent 2 — Cost Assessment:**
|
|
178
|
-
- What complexity did this decision add?
|
|
179
|
-
- Is it creating coupling or tech debt?
|
|
180
|
-
- Grade: low-cost / acceptable / expensive / debt-creating
|
|
181
|
-
|
|
182
|
-
**Agent 3 — Alternative Hindsight:**
|
|
183
|
-
- With what we know now, was this the right call?
|
|
184
|
-
- Would reversing be feasible?
|
|
185
|
-
- Grade: confirmed / questionable / should-revisit
|
|
186
|
-
|
|
187
|
-
#### 3d: Classify Decision Lifecycle
|
|
188
|
-
| Status | Criteria |
|
|
189
|
-
|--------|---------|
|
|
190
|
-
| **Validated** | Sound + Low/Acceptable cost + Confirmed |
|
|
191
|
-
| **Aging** | Sound but Expensive + Confirmed |
|
|
192
|
-
| **Questionable** | Degraded or Violated + Questionable |
|
|
193
|
-
| **Stale** | Any + Should-revisit |
|
|
194
|
-
| **Reversed** | Code contradicts the decision |
|
|
195
|
-
|
|
196
|
-
#### 3e: Generate Recommendations
|
|
197
|
-
- **Aging**: flag for tech debt review
|
|
198
|
-
- **Questionable**: create issue for investigation
|
|
199
|
-
- **Stale**: suggest decision refresh
|
|
200
|
-
- **Reversed**: suggest documenting the reversal
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
### Stage 4: Unified Report
|
|
205
|
-
|
|
206
|
-
Write `.workflow/learning/retro-{date}.md`:
|
|
207
|
-
|
|
208
|
-
```markdown
|
|
209
|
-
# Retrospective: {date}
|
|
210
|
-
**Lenses:** {active lenses} | **Period:** {days}d
|
|
211
|
-
|
|
212
|
-
## Git Activity (if git lens active)
|
|
213
|
-
### Metrics
|
|
214
|
-
| Metric | Value | Trend |
|
|
215
|
-
|--------|-------|-------|
|
|
216
|
-
| Commits | N | +/-% |
|
|
217
|
-
| ...
|
|
218
|
-
|
|
219
|
-
### Work Sessions
|
|
220
|
-
{session timeline}
|
|
221
|
-
|
|
222
|
-
### File Hotspots
|
|
223
|
-
{top 10 most-changed files}
|
|
224
|
-
|
|
225
|
-
### Per-Author
|
|
226
|
-
{author breakdown table}
|
|
227
|
-
|
|
228
|
-
## Decision Health (if decision lens active)
|
|
229
|
-
### Dashboard
|
|
230
|
-
| Status | Count | Decisions |
|
|
231
|
-
|--------|-------|-----------|
|
|
232
|
-
| Validated | N | {list} |
|
|
233
|
-
| Aging | N | {list} |
|
|
234
|
-
| ...
|
|
235
|
-
|
|
236
|
-
### Per-Decision Evaluation
|
|
237
|
-
{detailed evaluations}
|
|
238
|
-
|
|
239
|
-
## Combined Insights
|
|
240
|
-
{merged insights from both lenses, deduplicated}
|
|
241
|
-
|
|
242
|
-
## Recommended Actions
|
|
243
|
-
1. {action}: {reason}
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
Write `.workflow/learning/retro-{date}.json` with structured data.
|
|
247
|
-
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
### Stage 5: Persist
|
|
251
|
-
1. Write report files
|
|
252
|
-
2. Append insights to `lessons.jsonl`:
|
|
253
|
-
- Git insights: `source: "retro-git"`, `category` per insight type
|
|
254
|
-
- Decision insights: `source: "retro-decision"`, `category: "decision"`
|
|
255
|
-
- Stable INS-id from `hash(lens + metric_or_decision + date)`
|
|
256
|
-
3. Update `learning-index.json`
|
|
257
|
-
4. Display summary
|
|
258
|
-
|
|
259
|
-
**Next-step routing:**
|
|
260
|
-
- Browse insights → `/manage-learn list --tag retro`
|
|
261
|
-
- Deep dive on high-churn file → `/learn-follow <path>`
|
|
262
|
-
- Fix test gaps → `/quality-auto-test <area>`
|
|
263
|
-
- Create issue for questionable decision → `/manage-issue create ...`
|
|
264
|
-
- Investigate stale decision → `/learn-investigate <question>`
|
|
265
|
-
- Full phase retrospective → `/quality-retrospective`
|
|
266
|
-
</execution>
|
|
267
|
-
|
|
268
|
-
<error_codes>
|
|
269
|
-
| Code | Severity | Condition | Recovery |
|
|
270
|
-
|------|----------|-----------|----------|
|
|
271
|
-
| E001 | error | Not inside a git repository (git lens) | Navigate to a git repo directory |
|
|
272
|
-
| E002 | error | No commits found in time window (git lens) | Increase --days or check filters |
|
|
273
|
-
| E003 | error | No decisions found in any source (decision lens) | Check wiki/specs content, or provide --id |
|
|
274
|
-
| E004 | error | --id not found in wiki or lessons (decision lens) | Verify the decision ID exists |
|
|
275
|
-
| W001 | warning | `.workflow/learning/` not found, bootstrapping | Auto-created; proceed normally |
|
|
276
|
-
| W002 | warning | No prior retro report for comparison | Skip trend section; first retro establishes baseline |
|
|
277
|
-
| W003 | warning | One perspective agent failed — partial evaluation (decision lens) | Proceed with available perspectives |
|
|
278
|
-
| W004 | warning | No git implementation evidence for a decision | Evaluation is theoretical only |
|
|
279
|
-
| W005 | warning | Phase context files not found (decision lens) | Skip phase-context decisions |
|
|
280
|
-
</error_codes>
|
|
281
|
-
|
|
282
|
-
<success_criteria>
|
|
283
|
-
- [ ] Lens selection parsed correctly (git / decision / all)
|
|
284
|
-
- [ ] Git lens (if active):
|
|
285
|
-
- [ ] All git commands executed successfully
|
|
286
|
-
- [ ] Metrics computed: commits, LOC, test ratio, churn rate, sessions
|
|
287
|
-
- [ ] Sessions detected with >2hr gap clustering
|
|
288
|
-
- [ ] Per-author breakdown generated
|
|
289
|
-
- [ ] Trend comparison computed if prior report exists
|
|
290
|
-
- [ ] At least 1 actionable insight distilled
|
|
291
|
-
- [ ] Decision lens (if active):
|
|
292
|
-
- [ ] Decisions collected from available sources
|
|
293
|
-
- [ ] Scope filter applied correctly
|
|
294
|
-
- [ ] 3 perspective agents spawned in parallel
|
|
295
|
-
- [ ] Each decision classified by lifecycle status
|
|
296
|
-
- [ ] Recommendations generated for non-Validated decisions
|
|
297
|
-
- [ ] Unified report written to `retro-{date}.md`
|
|
298
|
-
- [ ] Structured data written to `retro-{date}.json`
|
|
299
|
-
- [ ] `lessons.jsonl` appended with insights (stable INS-ids)
|
|
300
|
-
- [ ] `learning-index.json` updated
|
|
301
|
-
- [ ] No files modified outside `.workflow/learning/`
|
|
302
|
-
- [ ] Summary displayed with next-step routing
|
|
303
|
-
</success_criteria>
|
|
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 that combines git activity analysis and decision quality evaluation into a single command with lens-based selection. Works on raw git history and wiki/spec data — does not require completed phase artifacts (unlike `quality-retrospective`).
|
|
16
|
+
|
|
17
|
+
Two lenses, usable independently or together:
|
|
18
|
+
- **git**: Commit metrics, session detection, per-author breakdown, file hotspots, trend tracking
|
|
19
|
+
- **decision**: Decision tracing across wiki/specs/git, multi-perspective evaluation, lifecycle classification
|
|
20
|
+
|
|
21
|
+
All insights persist to `.workflow/learning/lessons.jsonl` for cross-session queryability via `manage-learn`.
|
|
22
|
+
</purpose>
|
|
23
|
+
|
|
24
|
+
<context>
|
|
25
|
+
Arguments: $ARGUMENTS
|
|
26
|
+
|
|
27
|
+
**Lens selection:**
|
|
28
|
+
- `--lens git` — Git activity retrospective only
|
|
29
|
+
- `--lens decision` — Decision evaluation only
|
|
30
|
+
- `--lens all` — Both lenses (default)
|
|
31
|
+
|
|
32
|
+
**Git lens flags:**
|
|
33
|
+
- `--days N` — Time window in days (default: 7)
|
|
34
|
+
- `--author <name>` — Filter commits by author name (substring match)
|
|
35
|
+
- `--area <path>` — Scope to files under a specific directory
|
|
36
|
+
- `--compare` — Compare against the previous retro report if one exists
|
|
37
|
+
|
|
38
|
+
**Decision lens flags:**
|
|
39
|
+
- `--phase N` — Decisions from phase N's context and related specs
|
|
40
|
+
- `--tag <tag>` — Decisions tagged with specific tag in wiki/specs
|
|
41
|
+
- `--id <id>` — Single decision by wiki ID or lessons.jsonl INS-id
|
|
42
|
+
|
|
43
|
+
**Storage written:**
|
|
44
|
+
- `.workflow/learning/retro-{YYYY-MM-DD}.md` — Unified human-readable report
|
|
45
|
+
- `.workflow/learning/retro-{YYYY-MM-DD}.json` — Structured metrics (machine-readable)
|
|
46
|
+
- `.workflow/learning/lessons.jsonl` — Appended insights (source: "retro-git" or "retro-decision")
|
|
47
|
+
- `.workflow/learning/learning-index.json` — Updated index
|
|
48
|
+
|
|
49
|
+
**Storage read:**
|
|
50
|
+
- `.workflow/state.json` — Current phase context (optional)
|
|
51
|
+
- `.workflow/learning/retro-*.json` — Prior retro for trend comparison
|
|
52
|
+
- `.workflow/learning/lessons.jsonl` — Existing insights for dedup
|
|
53
|
+
- `maestro wiki list --type spec --json` — Spec entries (decision lens)
|
|
54
|
+
- `.workflow/specs/architecture-constraints.md` — Documented architectural decisions (decision lens)
|
|
55
|
+
- Phase context with Locked/Free/Deferred decisions (decision lens) — resolve via `state.json.artifacts[]` scratch paths
|
|
56
|
+
</context>
|
|
57
|
+
|
|
58
|
+
<execution>
|
|
59
|
+
|
|
60
|
+
### Stage 1: Parse Arguments & Select Lenses
|
|
61
|
+
- Parse `--lens` flag: `git`, `decision`, or `all` (default: `all`)
|
|
62
|
+
- Extract lens-specific flags
|
|
63
|
+
- Check `.workflow/learning/` exists; bootstrap if missing
|
|
64
|
+
|
|
65
|
+
Display banner:
|
|
66
|
+
```
|
|
67
|
+
============================================================
|
|
68
|
+
LEARN RETRO
|
|
69
|
+
============================================================
|
|
70
|
+
Lens: {git | decision | all}
|
|
71
|
+
Scope: {days/author/area for git} {phase/tag/id for decision}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### Stage 2: Git Lens (skip if --lens decision)
|
|
77
|
+
|
|
78
|
+
#### 2a: Gather Raw Data (parallel git commands)
|
|
79
|
+
Run ALL these git commands in parallel:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Commit stats with author, timestamp, subject, files changed
|
|
83
|
+
git log --since="<start-date>T00:00:00" --format="%H|%aN|%ae|%ai|%s" --shortstat
|
|
84
|
+
|
|
85
|
+
# Per-commit numstat for test vs production LOC split
|
|
86
|
+
git log --since="<start-date>T00:00:00" --format="COMMIT:%H|%aN" --numstat
|
|
87
|
+
|
|
88
|
+
# Timestamps for session detection (sorted)
|
|
89
|
+
git log --since="<start-date>T00:00:00" --format="%at|%aN|%ai|%s" | sort -n
|
|
90
|
+
|
|
91
|
+
# File hotspots (most frequently changed files)
|
|
92
|
+
git log --since="<start-date>T00:00:00" --format="" --name-only | grep -v '^$' | sort | uniq -c | sort -rn | head -20
|
|
93
|
+
|
|
94
|
+
# Per-author commit counts
|
|
95
|
+
git shortlog --since="<start-date>T00:00:00" -sn --no-merges
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Apply `--author` and `--area` filters if provided.
|
|
99
|
+
|
|
100
|
+
#### 2b: Compute Metrics
|
|
101
|
+
| Metric | Computation |
|
|
102
|
+
|--------|-------------|
|
|
103
|
+
| Commits | Count of non-merge commits |
|
|
104
|
+
| Contributors | Unique author count |
|
|
105
|
+
| Total insertions / deletions | Sum from shortstat |
|
|
106
|
+
| Net LOC | insertions - deletions |
|
|
107
|
+
| Test LOC (insertions) | Sum insertions for test files from numstat |
|
|
108
|
+
| Test ratio | test_insertions / total_insertions x 100% |
|
|
109
|
+
| Churn rate | Files changed >2 times / total unique files |
|
|
110
|
+
| Active days | Distinct dates with commits |
|
|
111
|
+
|
|
112
|
+
#### 2c: Detect Work Sessions
|
|
113
|
+
Cluster commits by >2hr gaps in timestamps:
|
|
114
|
+
- Per session: start time, end time, duration, commit count, primary focus area
|
|
115
|
+
- Compute: total sessions, avg session duration, avg LOC/session-hour
|
|
116
|
+
|
|
117
|
+
#### 2d: Per-Author Breakdown
|
|
118
|
+
For each author:
|
|
119
|
+
- Commit count, LOC added/removed, top 3 file areas
|
|
120
|
+
- Test ratio (their test LOC / their total LOC)
|
|
121
|
+
- Session count and patterns
|
|
122
|
+
|
|
123
|
+
#### 2e: Trend Comparison (if --compare or prior report exists)
|
|
124
|
+
- Find most recent `.workflow/learning/retro-*.json`
|
|
125
|
+
- Compute deltas: commits, LOC, test ratio, churn rate, session count
|
|
126
|
+
- Flag significant changes (>20% delta) as trend highlights
|
|
127
|
+
|
|
128
|
+
#### 2f: Distill Git Insights
|
|
129
|
+
- **High churn files** (changed >3 times): instability signal
|
|
130
|
+
- **Low test ratio areas** (<20%): testing gap
|
|
131
|
+
- **Session patterns**: scattered vs deep sessions
|
|
132
|
+
- **Area drift**: commits not aligned with current roadmap phase
|
|
133
|
+
|
|
134
|
+
Each insight: title, description, category (pattern/antipattern/technique), tags, confidence.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### Stage 3: Decision Lens (skip if --lens git)
|
|
139
|
+
|
|
140
|
+
#### 3a: Collect Decisions (parallel)
|
|
141
|
+
```bash
|
|
142
|
+
maestro wiki search "decision" --json
|
|
143
|
+
maestro wiki list --type spec --json
|
|
144
|
+
git log --oneline --all --grep="decision\|chose\|decided\|architecture" -20
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Also read:
|
|
148
|
+
- `.workflow/specs/architecture-constraints.md` — grep for `<spec-entry category="arch"` blocks
|
|
149
|
+
- Phase context files — resolve via `state.json.artifacts[]` scratch paths — scan for "Locked:", "Deferred:" sections
|
|
150
|
+
- `.workflow/learning/lessons.jsonl` — filter `category == "decision"`
|
|
151
|
+
|
|
152
|
+
Apply scope filter (--phase, --tag, --id).
|
|
153
|
+
|
|
154
|
+
#### 3b: Build Decision Registry
|
|
155
|
+
Per decision:
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"id": "source id",
|
|
159
|
+
"title": "what was decided",
|
|
160
|
+
"source": "wiki|spec|phase-context|lesson|git",
|
|
161
|
+
"date": "when decided",
|
|
162
|
+
"rationale": "why",
|
|
163
|
+
"alternatives": "what was considered",
|
|
164
|
+
"phase": "which phase",
|
|
165
|
+
"implementation_evidence": ["file paths from git"]
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
#### 3c: Multi-Perspective Evaluation
|
|
170
|
+
Spawn 3 Agents in a single message:
|
|
171
|
+
|
|
172
|
+
**Agent 1 — Technical Soundness:**
|
|
173
|
+
- Does implementation match stated intent?
|
|
174
|
+
- Has technical context changed since decision was made?
|
|
175
|
+
- Grade: sound / degraded / violated
|
|
176
|
+
|
|
177
|
+
**Agent 2 — Cost Assessment:**
|
|
178
|
+
- What complexity did this decision add?
|
|
179
|
+
- Is it creating coupling or tech debt?
|
|
180
|
+
- Grade: low-cost / acceptable / expensive / debt-creating
|
|
181
|
+
|
|
182
|
+
**Agent 3 — Alternative Hindsight:**
|
|
183
|
+
- With what we know now, was this the right call?
|
|
184
|
+
- Would reversing be feasible?
|
|
185
|
+
- Grade: confirmed / questionable / should-revisit
|
|
186
|
+
|
|
187
|
+
#### 3d: Classify Decision Lifecycle
|
|
188
|
+
| Status | Criteria |
|
|
189
|
+
|--------|---------|
|
|
190
|
+
| **Validated** | Sound + Low/Acceptable cost + Confirmed |
|
|
191
|
+
| **Aging** | Sound but Expensive + Confirmed |
|
|
192
|
+
| **Questionable** | Degraded or Violated + Questionable |
|
|
193
|
+
| **Stale** | Any + Should-revisit |
|
|
194
|
+
| **Reversed** | Code contradicts the decision |
|
|
195
|
+
|
|
196
|
+
#### 3e: Generate Recommendations
|
|
197
|
+
- **Aging**: flag for tech debt review
|
|
198
|
+
- **Questionable**: create issue for investigation
|
|
199
|
+
- **Stale**: suggest decision refresh
|
|
200
|
+
- **Reversed**: suggest documenting the reversal
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
### Stage 4: Unified Report
|
|
205
|
+
|
|
206
|
+
Write `.workflow/learning/retro-{date}.md`:
|
|
207
|
+
|
|
208
|
+
```markdown
|
|
209
|
+
# Retrospective: {date}
|
|
210
|
+
**Lenses:** {active lenses} | **Period:** {days}d
|
|
211
|
+
|
|
212
|
+
## Git Activity (if git lens active)
|
|
213
|
+
### Metrics
|
|
214
|
+
| Metric | Value | Trend |
|
|
215
|
+
|--------|-------|-------|
|
|
216
|
+
| Commits | N | +/-% |
|
|
217
|
+
| ...
|
|
218
|
+
|
|
219
|
+
### Work Sessions
|
|
220
|
+
{session timeline}
|
|
221
|
+
|
|
222
|
+
### File Hotspots
|
|
223
|
+
{top 10 most-changed files}
|
|
224
|
+
|
|
225
|
+
### Per-Author
|
|
226
|
+
{author breakdown table}
|
|
227
|
+
|
|
228
|
+
## Decision Health (if decision lens active)
|
|
229
|
+
### Dashboard
|
|
230
|
+
| Status | Count | Decisions |
|
|
231
|
+
|--------|-------|-----------|
|
|
232
|
+
| Validated | N | {list} |
|
|
233
|
+
| Aging | N | {list} |
|
|
234
|
+
| ...
|
|
235
|
+
|
|
236
|
+
### Per-Decision Evaluation
|
|
237
|
+
{detailed evaluations}
|
|
238
|
+
|
|
239
|
+
## Combined Insights
|
|
240
|
+
{merged insights from both lenses, deduplicated}
|
|
241
|
+
|
|
242
|
+
## Recommended Actions
|
|
243
|
+
1. {action}: {reason}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Write `.workflow/learning/retro-{date}.json` with structured data.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
### Stage 5: Persist
|
|
251
|
+
1. Write report files
|
|
252
|
+
2. Append insights to `lessons.jsonl`:
|
|
253
|
+
- Git insights: `source: "retro-git"`, `category` per insight type
|
|
254
|
+
- Decision insights: `source: "retro-decision"`, `category: "decision"`
|
|
255
|
+
- Stable INS-id from `hash(lens + metric_or_decision + date)`
|
|
256
|
+
3. Update `learning-index.json`
|
|
257
|
+
4. Display summary
|
|
258
|
+
|
|
259
|
+
**Next-step routing:**
|
|
260
|
+
- Browse insights → `/manage-learn list --tag retro`
|
|
261
|
+
- Deep dive on high-churn file → `/learn-follow <path>`
|
|
262
|
+
- Fix test gaps → `/quality-auto-test <area>`
|
|
263
|
+
- Create issue for questionable decision → `/manage-issue create ...`
|
|
264
|
+
- Investigate stale decision → `/learn-investigate <question>`
|
|
265
|
+
- Full phase retrospective → `/quality-retrospective`
|
|
266
|
+
</execution>
|
|
267
|
+
|
|
268
|
+
<error_codes>
|
|
269
|
+
| Code | Severity | Condition | Recovery |
|
|
270
|
+
|------|----------|-----------|----------|
|
|
271
|
+
| E001 | error | Not inside a git repository (git lens) | Navigate to a git repo directory |
|
|
272
|
+
| E002 | error | No commits found in time window (git lens) | Increase --days or check filters |
|
|
273
|
+
| E003 | error | No decisions found in any source (decision lens) | Check wiki/specs content, or provide --id |
|
|
274
|
+
| E004 | error | --id not found in wiki or lessons (decision lens) | Verify the decision ID exists |
|
|
275
|
+
| W001 | warning | `.workflow/learning/` not found, bootstrapping | Auto-created; proceed normally |
|
|
276
|
+
| W002 | warning | No prior retro report for comparison | Skip trend section; first retro establishes baseline |
|
|
277
|
+
| W003 | warning | One perspective agent failed — partial evaluation (decision lens) | Proceed with available perspectives |
|
|
278
|
+
| W004 | warning | No git implementation evidence for a decision | Evaluation is theoretical only |
|
|
279
|
+
| W005 | warning | Phase context files not found (decision lens) | Skip phase-context decisions |
|
|
280
|
+
</error_codes>
|
|
281
|
+
|
|
282
|
+
<success_criteria>
|
|
283
|
+
- [ ] Lens selection parsed correctly (git / decision / all)
|
|
284
|
+
- [ ] Git lens (if active):
|
|
285
|
+
- [ ] All git commands executed successfully
|
|
286
|
+
- [ ] Metrics computed: commits, LOC, test ratio, churn rate, sessions
|
|
287
|
+
- [ ] Sessions detected with >2hr gap clustering
|
|
288
|
+
- [ ] Per-author breakdown generated
|
|
289
|
+
- [ ] Trend comparison computed if prior report exists
|
|
290
|
+
- [ ] At least 1 actionable insight distilled
|
|
291
|
+
- [ ] Decision lens (if active):
|
|
292
|
+
- [ ] Decisions collected from available sources
|
|
293
|
+
- [ ] Scope filter applied correctly
|
|
294
|
+
- [ ] 3 perspective agents spawned in parallel
|
|
295
|
+
- [ ] Each decision classified by lifecycle status
|
|
296
|
+
- [ ] Recommendations generated for non-Validated decisions
|
|
297
|
+
- [ ] Unified report written to `retro-{date}.md`
|
|
298
|
+
- [ ] Structured data written to `retro-{date}.json`
|
|
299
|
+
- [ ] `lessons.jsonl` appended with insights (stable INS-ids)
|
|
300
|
+
- [ ] `learning-index.json` updated
|
|
301
|
+
- [ ] No files modified outside `.workflow/learning/`
|
|
302
|
+
- [ ] Summary displayed with next-step routing
|
|
303
|
+
</success_criteria>
|