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,167 +1,167 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: learn-second-opinion
|
|
3
|
-
description:
|
|
4
|
-
argument-hint: "<target> [--mode review|challenge|consult]"
|
|
5
|
-
allowed-tools:
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Bash
|
|
9
|
-
- Glob
|
|
10
|
-
- Grep
|
|
11
|
-
- Agent
|
|
12
|
-
- AskUserQuestion
|
|
13
|
-
---
|
|
14
|
-
<purpose>
|
|
15
|
-
Structured second-opinion workflow for code, decisions, or plans. Three modes inspired by gstack `/codex`:
|
|
16
|
-
|
|
17
|
-
- **review** (default): 3 parallel agents with distinct personas (pragmatist, purist, strategist) independently assess the target
|
|
18
|
-
- **challenge**: single adversarial agent that tries to break the approach, find hidden assumptions, and propose alternatives
|
|
19
|
-
- **consult**: interactive Q&A mode where the agent studies the target and answers your questions
|
|
20
|
-
|
|
21
|
-
Decoupled from the phase/execution lifecycle — can be invoked on any piece of code or knowledge at any time. Findings persist to `lessons.jsonl`.
|
|
22
|
-
</purpose>
|
|
23
|
-
|
|
24
|
-
<context>
|
|
25
|
-
Arguments: $ARGUMENTS
|
|
26
|
-
|
|
27
|
-
**Target resolution (auto-detected):**
|
|
28
|
-
- File path → analyze that file's content
|
|
29
|
-
- Wiki ID (`<type>-<slug>`) → fetch via `maestro wiki get`
|
|
30
|
-
- `HEAD` or `staged` → analyze current git diff (`git diff HEAD` or `git diff --staged`)
|
|
31
|
-
- Phase number (e.g., `3`) → resolve via `state.json.artifacts[]` to find plan in scratch dir
|
|
32
|
-
|
|
33
|
-
**Flags:**
|
|
34
|
-
- `--mode review` — 3-persona parallel review (default)
|
|
35
|
-
- `--mode challenge` — Adversarial single-agent analysis
|
|
36
|
-
- `--mode consult` — Interactive Q&A session
|
|
37
|
-
|
|
38
|
-
**Storage written:**
|
|
39
|
-
- `.workflow/learning/opinion-{slug}-{YYYY-MM-DD}.md` — Opinion report
|
|
40
|
-
- `.workflow/learning/lessons.jsonl` — New insights from analysis (source: "second-opinion")
|
|
41
|
-
- `.workflow/learning/learning-index.json` — Updated index
|
|
42
|
-
|
|
43
|
-
**Storage read:**
|
|
44
|
-
- Target content (file, wiki entry, diff, or plan)
|
|
45
|
-
- `.workflow/specs/` — Project conventions for context
|
|
46
|
-
- `maestro wiki search` — Related knowledge entries
|
|
47
|
-
- `.workflow/learning/lessons.jsonl` — Prior insights about the topic
|
|
48
|
-
</context>
|
|
49
|
-
|
|
50
|
-
<execution>
|
|
51
|
-
|
|
52
|
-
### Stage 1: Resolve Target
|
|
53
|
-
- File path: Read the file
|
|
54
|
-
- Wiki ID: `maestro wiki get <id>`
|
|
55
|
-
- `HEAD`: `git diff HEAD` (unstaged + staged changes)
|
|
56
|
-
- `staged`: `git diff --staged`
|
|
57
|
-
- Phase N: Resolve via `state.json.artifacts.find(a => a.type === 'plan' && a.phase === N)` → read `.workflow/{artifact.path}/plan.json`
|
|
58
|
-
- If unresolvable, AskUserQuestion for clarification
|
|
59
|
-
|
|
60
|
-
### Stage 2: Load Context
|
|
61
|
-
- Read relevant specs: `Skill({ skill: "spec-load" })` silently to get project conventions
|
|
62
|
-
- Search wiki: `maestro wiki search "<target topic>"` for related entries (top 5)
|
|
63
|
-
- Search lessons: grep `lessons.jsonl` for entries related to the target area
|
|
64
|
-
- Build context brief: target content + conventions + related knowledge
|
|
65
|
-
|
|
66
|
-
### Stage 3: Execute Mode
|
|
67
|
-
|
|
68
|
-
#### Mode: review (default)
|
|
69
|
-
Spawn 3 Agents in a single message with distinct personas:
|
|
70
|
-
|
|
71
|
-
**Agent 1 — Pragmatist:**
|
|
72
|
-
- Focus: simplicity, YAGNI, maintenance cost, readability
|
|
73
|
-
- Question: "Is this the simplest thing that could work? What's the maintenance burden?"
|
|
74
|
-
- Evaluates: complexity score, abstraction depth, dependency count
|
|
75
|
-
|
|
76
|
-
**Agent 2 — Purist:**
|
|
77
|
-
- Focus: correctness, type safety, edge cases, error handling
|
|
78
|
-
- Question: "What assumptions can be violated? Where are the edge cases?"
|
|
79
|
-
- Evaluates: error paths covered, type completeness, invariant preservation
|
|
80
|
-
|
|
81
|
-
**Agent 3 — Strategist:**
|
|
82
|
-
- Focus: scalability, extensibility, architecture alignment
|
|
83
|
-
- Question: "Does this support future growth? Does it fit the overall architecture?"
|
|
84
|
-
- Evaluates: coupling, cohesion, architecture constraint compliance
|
|
85
|
-
|
|
86
|
-
Each agent returns:
|
|
87
|
-
```json
|
|
88
|
-
{
|
|
89
|
-
"persona": "pragmatist|purist|strategist",
|
|
90
|
-
"verdict": "approve|concern|reject",
|
|
91
|
-
"confidence": "high|medium|low",
|
|
92
|
-
"findings": [{ "severity": "high|medium|low", "description": "...", "location": "file:line", "suggestion": "..." }],
|
|
93
|
-
"summary": "one paragraph assessment"
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
#### Mode: challenge
|
|
98
|
-
Spawn 1 Agent as an adversarial reviewer:
|
|
99
|
-
|
|
100
|
-
- Try to find the weakest assumption in the approach
|
|
101
|
-
- Propose a concrete scenario that breaks the current implementation
|
|
102
|
-
- Identify the single biggest risk
|
|
103
|
-
- Suggest an alternative approach and argue why it might be better
|
|
104
|
-
- Apply forcing questions:
|
|
105
|
-
- "What assumption would invalidate this entire approach?"
|
|
106
|
-
- "What's the simplest thing that breaks this?"
|
|
107
|
-
- "If you had to rewrite this in 6 months, what would you regret?"
|
|
108
|
-
- "What's the implicit contract that isn't enforced?"
|
|
109
|
-
|
|
110
|
-
#### Mode: consult
|
|
111
|
-
Interactive loop:
|
|
112
|
-
1. Agent studies the target content thoroughly
|
|
113
|
-
2. Display: "Target loaded. What would you like to know?"
|
|
114
|
-
3. AskUserQuestion for the first question
|
|
115
|
-
4. Agent answers with code references and evidence
|
|
116
|
-
5. Loop: AskUserQuestion for follow-up or "done" to exit
|
|
117
|
-
6. On exit, compile all Q&A into the report
|
|
118
|
-
|
|
119
|
-
### Stage 4: Synthesize
|
|
120
|
-
Across all perspectives (or from single agent in challenge/consult):
|
|
121
|
-
- **Points of agreement**: findings all personas share
|
|
122
|
-
- **Points of disagreement**: where personas diverge (with reasoning)
|
|
123
|
-
- **Verdict**: combined assessment with confidence level
|
|
124
|
-
- **Top 3 recommendations**: prioritized by impact
|
|
125
|
-
|
|
126
|
-
### Stage 5: Persist & Report
|
|
127
|
-
1. Write `.workflow/learning/opinion-{slug}-{date}.md`:
|
|
128
|
-
- Target summary
|
|
129
|
-
- Per-persona findings (review) / adversarial analysis (challenge) / Q&A transcript (consult)
|
|
130
|
-
- Synthesis: agreements, disagreements, verdict
|
|
131
|
-
- Recommendations
|
|
132
|
-
2. Append non-trivial findings to `lessons.jsonl`:
|
|
133
|
-
- `source: "second-opinion"`, `category: "pattern"` or `"antipattern"` or `"decision"`
|
|
134
|
-
- Tags: `["second-opinion", "{mode}", "{target-slug}"]`
|
|
135
|
-
3. Update `learning-index.json`
|
|
136
|
-
4. Display summary with verdict and recommendations
|
|
137
|
-
|
|
138
|
-
**Next-step routing:**
|
|
139
|
-
- Create issue for a finding → `/manage-issue create <description>`
|
|
140
|
-
- Decompose patterns found → `/learn-decompose <path>`
|
|
141
|
-
- Follow-along on the code → `/learn-follow <path>`
|
|
142
|
-
</execution>
|
|
143
|
-
|
|
144
|
-
<error_codes>
|
|
145
|
-
| Code | Severity | Condition | Recovery |
|
|
146
|
-
|------|----------|-----------|----------|
|
|
147
|
-
| E001 | error | Target not resolvable (file/wiki/diff/plan not found) | Verify target argument, provide correct path or ID |
|
|
148
|
-
| E002 | error | Unknown --mode value | Use: review, challenge, or consult |
|
|
149
|
-
| W001 | warning | One review agent failed — partial perspectives | Proceed with available agents, note incomplete coverage |
|
|
150
|
-
| W002 | warning | No related wiki entries found for context | Proceed without wiki context |
|
|
151
|
-
| W003 | warning | Git diff empty (no changes) for HEAD/staged target | Nothing to review; suggest using a file path instead |
|
|
152
|
-
</error_codes>
|
|
153
|
-
|
|
154
|
-
<success_criteria>
|
|
155
|
-
- [ ] Target resolved and content loaded
|
|
156
|
-
- [ ] Context gathered (specs, wiki, lessons)
|
|
157
|
-
- [ ] Mode executed correctly:
|
|
158
|
-
- review: 3 agents spawned in parallel, all returned findings
|
|
159
|
-
- challenge: adversarial analysis completed with forcing questions
|
|
160
|
-
- consult: interactive Q&A loop completed
|
|
161
|
-
- [ ] Synthesis produced with agreements, disagreements, verdict
|
|
162
|
-
- [ ] Report written to `opinion-{slug}-{date}.md`
|
|
163
|
-
- [ ] Non-trivial findings appended to `lessons.jsonl`
|
|
164
|
-
- [ ] `learning-index.json` updated
|
|
165
|
-
- [ ] No files modified outside `.workflow/learning/`
|
|
166
|
-
- [ ] Summary displayed with verdict and next-step routing
|
|
167
|
-
</success_criteria>
|
|
1
|
+
---
|
|
2
|
+
name: learn-second-opinion
|
|
3
|
+
description: Get alternative perspectives — review, challenge, or consult
|
|
4
|
+
argument-hint: "<target> [--mode review|challenge|consult]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Agent
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
---
|
|
14
|
+
<purpose>
|
|
15
|
+
Structured second-opinion workflow for code, decisions, or plans. Three modes inspired by gstack `/codex`:
|
|
16
|
+
|
|
17
|
+
- **review** (default): 3 parallel agents with distinct personas (pragmatist, purist, strategist) independently assess the target
|
|
18
|
+
- **challenge**: single adversarial agent that tries to break the approach, find hidden assumptions, and propose alternatives
|
|
19
|
+
- **consult**: interactive Q&A mode where the agent studies the target and answers your questions
|
|
20
|
+
|
|
21
|
+
Decoupled from the phase/execution lifecycle — can be invoked on any piece of code or knowledge at any time. Findings persist to `lessons.jsonl`.
|
|
22
|
+
</purpose>
|
|
23
|
+
|
|
24
|
+
<context>
|
|
25
|
+
Arguments: $ARGUMENTS
|
|
26
|
+
|
|
27
|
+
**Target resolution (auto-detected):**
|
|
28
|
+
- File path → analyze that file's content
|
|
29
|
+
- Wiki ID (`<type>-<slug>`) → fetch via `maestro wiki get`
|
|
30
|
+
- `HEAD` or `staged` → analyze current git diff (`git diff HEAD` or `git diff --staged`)
|
|
31
|
+
- Phase number (e.g., `3`) → resolve via `state.json.artifacts[]` to find plan in scratch dir
|
|
32
|
+
|
|
33
|
+
**Flags:**
|
|
34
|
+
- `--mode review` — 3-persona parallel review (default)
|
|
35
|
+
- `--mode challenge` — Adversarial single-agent analysis
|
|
36
|
+
- `--mode consult` — Interactive Q&A session
|
|
37
|
+
|
|
38
|
+
**Storage written:**
|
|
39
|
+
- `.workflow/learning/opinion-{slug}-{YYYY-MM-DD}.md` — Opinion report
|
|
40
|
+
- `.workflow/learning/lessons.jsonl` — New insights from analysis (source: "second-opinion")
|
|
41
|
+
- `.workflow/learning/learning-index.json` — Updated index
|
|
42
|
+
|
|
43
|
+
**Storage read:**
|
|
44
|
+
- Target content (file, wiki entry, diff, or plan)
|
|
45
|
+
- `.workflow/specs/` — Project conventions for context
|
|
46
|
+
- `maestro wiki search` — Related knowledge entries
|
|
47
|
+
- `.workflow/learning/lessons.jsonl` — Prior insights about the topic
|
|
48
|
+
</context>
|
|
49
|
+
|
|
50
|
+
<execution>
|
|
51
|
+
|
|
52
|
+
### Stage 1: Resolve Target
|
|
53
|
+
- File path: Read the file
|
|
54
|
+
- Wiki ID: `maestro wiki get <id>`
|
|
55
|
+
- `HEAD`: `git diff HEAD` (unstaged + staged changes)
|
|
56
|
+
- `staged`: `git diff --staged`
|
|
57
|
+
- Phase N: Resolve via `state.json.artifacts.find(a => a.type === 'plan' && a.phase === N)` → read `.workflow/{artifact.path}/plan.json`
|
|
58
|
+
- If unresolvable, AskUserQuestion for clarification
|
|
59
|
+
|
|
60
|
+
### Stage 2: Load Context
|
|
61
|
+
- Read relevant specs: `Skill({ skill: "spec-load" })` silently to get project conventions
|
|
62
|
+
- Search wiki: `maestro wiki search "<target topic>"` for related entries (top 5)
|
|
63
|
+
- Search lessons: grep `lessons.jsonl` for entries related to the target area
|
|
64
|
+
- Build context brief: target content + conventions + related knowledge
|
|
65
|
+
|
|
66
|
+
### Stage 3: Execute Mode
|
|
67
|
+
|
|
68
|
+
#### Mode: review (default)
|
|
69
|
+
Spawn 3 Agents in a single message with distinct personas:
|
|
70
|
+
|
|
71
|
+
**Agent 1 — Pragmatist:**
|
|
72
|
+
- Focus: simplicity, YAGNI, maintenance cost, readability
|
|
73
|
+
- Question: "Is this the simplest thing that could work? What's the maintenance burden?"
|
|
74
|
+
- Evaluates: complexity score, abstraction depth, dependency count
|
|
75
|
+
|
|
76
|
+
**Agent 2 — Purist:**
|
|
77
|
+
- Focus: correctness, type safety, edge cases, error handling
|
|
78
|
+
- Question: "What assumptions can be violated? Where are the edge cases?"
|
|
79
|
+
- Evaluates: error paths covered, type completeness, invariant preservation
|
|
80
|
+
|
|
81
|
+
**Agent 3 — Strategist:**
|
|
82
|
+
- Focus: scalability, extensibility, architecture alignment
|
|
83
|
+
- Question: "Does this support future growth? Does it fit the overall architecture?"
|
|
84
|
+
- Evaluates: coupling, cohesion, architecture constraint compliance
|
|
85
|
+
|
|
86
|
+
Each agent returns:
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"persona": "pragmatist|purist|strategist",
|
|
90
|
+
"verdict": "approve|concern|reject",
|
|
91
|
+
"confidence": "high|medium|low",
|
|
92
|
+
"findings": [{ "severity": "high|medium|low", "description": "...", "location": "file:line", "suggestion": "..." }],
|
|
93
|
+
"summary": "one paragraph assessment"
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
#### Mode: challenge
|
|
98
|
+
Spawn 1 Agent as an adversarial reviewer:
|
|
99
|
+
|
|
100
|
+
- Try to find the weakest assumption in the approach
|
|
101
|
+
- Propose a concrete scenario that breaks the current implementation
|
|
102
|
+
- Identify the single biggest risk
|
|
103
|
+
- Suggest an alternative approach and argue why it might be better
|
|
104
|
+
- Apply forcing questions:
|
|
105
|
+
- "What assumption would invalidate this entire approach?"
|
|
106
|
+
- "What's the simplest thing that breaks this?"
|
|
107
|
+
- "If you had to rewrite this in 6 months, what would you regret?"
|
|
108
|
+
- "What's the implicit contract that isn't enforced?"
|
|
109
|
+
|
|
110
|
+
#### Mode: consult
|
|
111
|
+
Interactive loop:
|
|
112
|
+
1. Agent studies the target content thoroughly
|
|
113
|
+
2. Display: "Target loaded. What would you like to know?"
|
|
114
|
+
3. AskUserQuestion for the first question
|
|
115
|
+
4. Agent answers with code references and evidence
|
|
116
|
+
5. Loop: AskUserQuestion for follow-up or "done" to exit
|
|
117
|
+
6. On exit, compile all Q&A into the report
|
|
118
|
+
|
|
119
|
+
### Stage 4: Synthesize
|
|
120
|
+
Across all perspectives (or from single agent in challenge/consult):
|
|
121
|
+
- **Points of agreement**: findings all personas share
|
|
122
|
+
- **Points of disagreement**: where personas diverge (with reasoning)
|
|
123
|
+
- **Verdict**: combined assessment with confidence level
|
|
124
|
+
- **Top 3 recommendations**: prioritized by impact
|
|
125
|
+
|
|
126
|
+
### Stage 5: Persist & Report
|
|
127
|
+
1. Write `.workflow/learning/opinion-{slug}-{date}.md`:
|
|
128
|
+
- Target summary
|
|
129
|
+
- Per-persona findings (review) / adversarial analysis (challenge) / Q&A transcript (consult)
|
|
130
|
+
- Synthesis: agreements, disagreements, verdict
|
|
131
|
+
- Recommendations
|
|
132
|
+
2. Append non-trivial findings to `lessons.jsonl`:
|
|
133
|
+
- `source: "second-opinion"`, `category: "pattern"` or `"antipattern"` or `"decision"`
|
|
134
|
+
- Tags: `["second-opinion", "{mode}", "{target-slug}"]`
|
|
135
|
+
3. Update `learning-index.json`
|
|
136
|
+
4. Display summary with verdict and recommendations
|
|
137
|
+
|
|
138
|
+
**Next-step routing:**
|
|
139
|
+
- Create issue for a finding → `/manage-issue create <description>`
|
|
140
|
+
- Decompose patterns found → `/learn-decompose <path>`
|
|
141
|
+
- Follow-along on the code → `/learn-follow <path>`
|
|
142
|
+
</execution>
|
|
143
|
+
|
|
144
|
+
<error_codes>
|
|
145
|
+
| Code | Severity | Condition | Recovery |
|
|
146
|
+
|------|----------|-----------|----------|
|
|
147
|
+
| E001 | error | Target not resolvable (file/wiki/diff/plan not found) | Verify target argument, provide correct path or ID |
|
|
148
|
+
| E002 | error | Unknown --mode value | Use: review, challenge, or consult |
|
|
149
|
+
| W001 | warning | One review agent failed — partial perspectives | Proceed with available agents, note incomplete coverage |
|
|
150
|
+
| W002 | warning | No related wiki entries found for context | Proceed without wiki context |
|
|
151
|
+
| W003 | warning | Git diff empty (no changes) for HEAD/staged target | Nothing to review; suggest using a file path instead |
|
|
152
|
+
</error_codes>
|
|
153
|
+
|
|
154
|
+
<success_criteria>
|
|
155
|
+
- [ ] Target resolved and content loaded
|
|
156
|
+
- [ ] Context gathered (specs, wiki, lessons)
|
|
157
|
+
- [ ] Mode executed correctly:
|
|
158
|
+
- review: 3 agents spawned in parallel, all returned findings
|
|
159
|
+
- challenge: adversarial analysis completed with forcing questions
|
|
160
|
+
- consult: interactive Q&A loop completed
|
|
161
|
+
- [ ] Synthesis produced with agreements, disagreements, verdict
|
|
162
|
+
- [ ] Report written to `opinion-{slug}-{date}.md`
|
|
163
|
+
- [ ] Non-trivial findings appended to `lessons.jsonl`
|
|
164
|
+
- [ ] `learning-index.json` updated
|
|
165
|
+
- [ ] No files modified outside `.workflow/learning/`
|
|
166
|
+
- [ ] Summary displayed with verdict and next-step routing
|
|
167
|
+
</success_criteria>
|