maestro-flow-one 0.2.23 → 0.2.25

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.
@@ -42,9 +42,10 @@ You are a collaborative planner that works within a pre-allocated task ID range.
42
42
  "type": "feature",
43
43
  "priority": "medium",
44
44
  "effort": "medium",
45
- "action": "Implement",
45
+ "action": "<concrete action with exact values: function signatures, config keys, import paths>",
46
46
  "scope": "<module path>",
47
47
  "focus_paths": [],
48
+ "read_first": ["src/module/existing.ts", "src/types/shared.ts"],
48
49
  "depends_on": [],
49
50
  "parallel_group": null,
50
51
  "convergence": {
@@ -116,6 +117,8 @@ You are a collaborative planner that works within a pre-allocated task ID range.
116
117
  - Task files must use `convergence.criteria` (array of testable strings), not `done_when`
117
118
  - files must use `[{path, action, target, change}]` format, not `["path"]`
118
119
  - Each task must have convergence.criteria with min 2 testable conditions
120
+ - Each task must have `read_first[]` — files the executor MUST read before implementation
121
+ - `action` must contain concrete values (function signatures, config keys, import paths), not just a verb
119
122
  - Task definitions follow the same schema as workflow-planner output
120
123
  - If you discover scope that belongs to another planner's range, note it in plan-note.md
121
124
  - Do not modify other planners' task files
@@ -30,7 +30,9 @@ You validate the quality of execution plans before they proceed to implementatio
30
30
  - Each criterion must reference a concrete artifact, output, or behavior
31
31
  - Criteria should be sufficient to prove the task is complete
32
32
  7. **Check files array** -- Verify each task's `files[]` array is consistent with its description
33
- 8. **Report** -- Write check report with issues or approval
33
+ 8. **Check read_first** -- Verify each task has `read_first[]` containing: the file being modified + source-of-truth files. Missing or empty `read_first` is a critical issue.
34
+ 9. **Check action concreteness** -- Verify each task's `action` contains concrete values (function signatures, config keys, import paths), not vague verbs like "Implement" or references like "align X with Y"
35
+ 10. **Report** -- Write check report with issues or approval
34
36
 
35
37
  ### Revision Loop (max 3 rounds)
36
38
  - If issues found: write report with specific issues and suggested fixes
@@ -72,6 +74,14 @@ Check report written to the output location above:
72
74
  ## Files Array Consistency
73
75
  - TASK-006: description mentions "update config" but files[] does not include any config file
74
76
 
77
+ ## Read First Completeness
78
+ - TASK-001 read_first: Missing — must include src/auth.ts (file being modified) + src/types/auth.ts (type definitions)
79
+ - TASK-003 read_first: Has target file but missing source-of-truth reference
80
+
81
+ ## Action Concreteness
82
+ - TASK-002 action: Too vague ("Implement auth") — should include: "Add verifyToken(token: string): Promise<AuthPayload> to src/auth.ts, import from jsonwebtoken"
83
+ - TASK-005 action: Contains "align with existing pattern" — must specify the exact target state
84
+
75
85
  ## Summary
76
86
  <Overall assessment>
77
87
  ```
@@ -92,9 +92,10 @@ When invoked with `quick` flag:
92
92
  "type": "feature",
93
93
  "priority": "medium",
94
94
  "effort": "medium",
95
- "action": "Implement",
95
+ "action": "<concrete action with exact values: function signatures, config keys, import paths>",
96
96
  "scope": "<module path>",
97
97
  "focus_paths": ["src/tools/"],
98
+ "read_first": ["src/tools/existing-tool.ts", "src/types/tool.ts"],
98
99
  "depends_on": [],
99
100
  "parallel_group": null,
100
101
  "convergence": {
@@ -164,6 +165,8 @@ These rules prevent over-splitting that wastes tokens on unnecessary agent spawn
164
165
  - Each task must be substantial (15-60 min of work); group related changes, avoid file-per-task
165
166
  - Each task must have convergence.criteria (min 2 testable conditions)
166
167
  - convergence.criteria must be specific and testable (not "works correctly")
168
+ - Each task must have `read_first[]` — files the executor MUST read before implementation (the file being modified + source-of-truth files)
169
+ - `action` must contain concrete values (function signatures, config keys, import paths), not just a verb like "Implement"
167
170
  - files must use array format `[{path, action, target, change}]`
168
171
  - Wave ordering must respect dependencies (no task before its dependency)
169
172
  - Task descriptions must be clear enough for the executor to implement without ambiguity
@@ -48,7 +48,7 @@ $ARGUMENTS -- phase number for micro mode, topic text for macro/adhoc mode, no a
48
48
  - `-y` / `--yes`: Auto mode — skip interactive scoping, use recommended defaults, auto-deepen
49
49
  - `-c` / `--continue`: Resume from existing session (auto-detect session folder + discussion.md)
50
50
  - `-q` / `--quick`: Quick mode — skip exploration + scoring, go straight to decision extraction (context.md only)
51
- - `--from <source>`: Load upstream context package (brainstorm:ID, blueprint:BLP-xxx, @file, or path)
51
+ - `--from <source>`: Load upstream context package (grill:ID, brainstorm:ID, blueprint:BLP-xxx, @file, or path)
52
52
  - `--gaps [ISS-ID]`: Issue root cause analysis mode. If ISS-ID provided, analyze single issue. If omitted, analyze all open/registered issues from issues.jsonl.
53
53
 
54
54
  Scope routing, output directory format, artifact registration schema, and output artifact listing are defined in workflow analyze.md (Scope Routing and Output Structure sections).
@@ -68,7 +68,7 @@ Interview the user relentlessly until shared understanding is reached. Active on
68
68
  - Branch jumps allowed: the user may switch freely between mode / role / upstream / sub-pipeline branches; sequence is not enforced, but every decision point must end with a definite answer.
69
69
  - Scope guard: only ask about decisions owned by `brainstorm`. Do not pre-resolve roadmap/plan choices.
70
70
 
71
- Decision points: mode (auto / single-role / review-only) / role selection and `--count` / `--from` upstream source / whether to enable design-research and the DESIGN.md sub-pipeline.
71
+ Decision points: mode (auto / single-role / review-only) / role selection and `--count` / `--from` upstream source (grill:ID, blueprint:ID, @file, path) / whether to enable design-research and the DESIGN.md sub-pipeline.
72
72
 
73
73
  Exit: on consensus or explicit user signal to proceed, finalize session metadata. The §11 table (already populated incrementally) uses this schema:
74
74
  `| # | Decision | Choice | Source (user / code / default) |`
@@ -84,6 +84,7 @@ Auto mode:
84
84
  - Project initialized, need formal spec package → Skill({ skill: "maestro-blueprint", args: "--from brainstorm:{artifact_id}" })
85
85
  - Project initialized, quick roadmap → Skill({ skill: "maestro-roadmap", args: "--from brainstorm:{artifact_id}" })
86
86
  - Need deeper analysis first → Skill({ skill: "maestro-analyze", args: "{topic} --from brainstorm:{artifact_id}" })
87
+ - Need stress-testing first → Skill({ skill: "maestro-grill", args: "{topic}" })
87
88
  - `html-prototypes/` produced with 2+ files and user wants to browse → load `~/.maestro/workflows/brainstorm-visualize.md` and launch visualizer server (optional, user-triggered)
88
89
  - DESIGN.md established during Step 3.5 → suggest: "Run `/maestro-impeccable build <feature-description>` to build with the established design system"
89
90
 
@@ -0,0 +1,531 @@
1
+ ---
2
+ name: maestro-companion
3
+ description: Knowledge companion — load context, record companion doc, capture insights, route to skills
4
+ argument-hint: "[before|note|after|route] [--task <description>] [--type <task_type>] [--category <cat>]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Skill
13
+ - AskUserQuestion
14
+ ---
15
+
16
+ <purpose>
17
+ Task companion command — pairs with any task to provide knowledge context loading,
18
+ structured companion document recording, insight capture, and skill routing.
19
+
20
+ Does not create sessions or modify workflow state. Pure side-car utility.
21
+
22
+ Four modes:
23
+ - **before** — Pre-task: load spec + knowhow index + codebase index, create companion doc
24
+ - **note** — Mid-task: append a structured entry to the active companion doc
25
+ - **after** — Post-task: review companion doc, promote entries to spec/knowhow, suggest next steps
26
+ - **route** — Routing: recommend next skill/command based on intent
27
+
28
+ No arguments → auto-detect: uncommitted changes → `after`, else → `before`.
29
+ </purpose>
30
+
31
+ <context>
32
+ $ARGUMENTS — mode + optional flags.
33
+
34
+ **Mode detection priority:**
35
+ 1. Explicit `before` / `note` / `after` / `route`
36
+ 2. Intent text that is not a mode keyword → `route`
37
+ 3. No arguments → auto-detect (`git status` has changes → `after`, else → `before`)
38
+
39
+ **Flags:**
40
+ - `--task <description>` — Current task description (for targeted knowledge loading and doc title)
41
+ - `--type <task_type>` — Task type for field template selection (see task types below)
42
+ - `--category <cat>` — Spec category filter: coding / arch / test / review / debug / learning / ui
43
+
44
+ **Task types** (determines which recording sections are active):
45
+
46
+ | Type | Description | Key sections |
47
+ |------|-------------|--------------|
48
+ | `implement` | Feature development, code writing | working_files, dependencies, decisions, tests_affected |
49
+ | `debug` | Bug investigation, root cause analysis | symptoms, hypotheses, evidence, root_cause, fix_applied |
50
+ | `analyze` | Code/architecture/performance analysis | scope, findings, risks, recommendations |
51
+ | `design` | Architecture/UI/API design | constraints, alternatives, trade_offs, chosen_approach |
52
+ | `plan` | Task decomposition, roadmap planning | goals, breakdown, estimates, dependencies |
53
+ | `review` | Code review, PR review | files_reviewed, findings, severity_counts, verdict |
54
+ | `test` | Test writing, UAT, coverage expansion | coverage_before, coverage_after, gaps, test_files |
55
+ | `refactor` | Code restructuring, tech debt | affected_modules, before_after, breaking_changes |
56
+ | `learn` | Codebase exploration, knowledge building | questions, answers, mental_model, references |
57
+ | `general` | Default / unclassified | (all universal sections) |
58
+
59
+ Auto-detection: if `--type` not provided, infer from `--task` description keywords.
60
+
61
+ **Companion document:**
62
+ - Path: `.workflow/.scratchpad/companion-{YYYYMMDD-HHmmss}.md`
63
+ - Active doc tracking: `.workflow/.scratchpad/.companion-active` (stores path of current companion doc)
64
+ - Format: YAML frontmatter (rich metadata) + typed sections + timestamped entries
65
+ </context>
66
+
67
+ <state_machine>
68
+
69
+ <states>
70
+ S_PARSE — Parse arguments, detect mode, resolve task type
71
+ S_BEFORE — Load knowledge context, create companion doc with typed template
72
+ S_NOTE — Append structured entry to active companion doc
73
+ S_AFTER — Review companion doc, populate outcome, promote entries, suggest next steps
74
+ S_ROUTE — Skill routing via maestro-next
75
+ </states>
76
+
77
+ <transitions>
78
+
79
+ S_PARSE:
80
+ → S_BEFORE WHEN: mode == "before" OR (no args AND no uncommitted changes)
81
+ → S_NOTE WHEN: mode == "note"
82
+ → S_AFTER WHEN: mode == "after" OR (no args AND has uncommitted changes)
83
+ → S_ROUTE WHEN: mode == "route" OR intent text present
84
+
85
+ </transitions>
86
+
87
+ </state_machine>
88
+
89
+ <execution>
90
+
91
+ ## S_BEFORE — Knowledge Loading + Companion Doc Creation
92
+
93
+ Execute in order, skip unavailable steps:
94
+
95
+ ### 1. Load specs
96
+
97
+ ```bash
98
+ # With --category: load by category
99
+ maestro spec load --category <cat>
100
+
101
+ # With --task: load by keyword extracted from task description
102
+ maestro spec load --keyword <extracted_keyword>
103
+
104
+ # No flags: load coding (most universal)
105
+ maestro spec load --category coding
106
+ ```
107
+
108
+ Display loaded rules summary (entry count + key rule names).
109
+
110
+ ### 2. Browse knowhow index
111
+
112
+ ```bash
113
+ # List recent knowhow entries
114
+ maestro knowhow list --store workflow
115
+
116
+ # With --task: search relevant entries
117
+ maestro knowhow search "<task_keyword>"
118
+ ```
119
+
120
+ Display available knowhow entries (ID + title). Hint: `maestro wiki load <id>` for details.
121
+
122
+ ### 3. Check codebase index
123
+
124
+ ```bash
125
+ ls .workflow/codebase/doc-index.json
126
+ ```
127
+
128
+ - Exists → display "Codebase docs ready, last updated: {timestamp}"
129
+ - Missing → suggest `/manage-codebase-rebuild`
130
+ - Stale (>7 days) → suggest `/manage-codebase-refresh`
131
+
132
+ ### 4. Create companion document
133
+
134
+ Create `.workflow/.scratchpad/` if needed. Resolve task type from `--type` flag or infer from `--task` keywords.
135
+
136
+ Write companion doc with the full field template:
137
+
138
+ ```markdown
139
+ ---
140
+ # === Identity ===
141
+ task: "{task_description or 'Untitled task'}"
142
+ task_type: "{resolved type: implement|debug|analyze|design|plan|review|test|refactor|learn|general}"
143
+ created: "{ISO timestamp}"
144
+ status: active
145
+
146
+ # === Context Loaded ===
147
+ specs_loaded: "{category or 'coding'}"
148
+ specs_count: {N}
149
+ knowhow_searched: "{keyword or 'none'}"
150
+ knowhow_available: {M}
151
+ codebase_index: "{ready|missing|stale}"
152
+ branch: "{current git branch}"
153
+ phase: "{current phase from state.json or 'none'}"
154
+ milestone: "{current milestone from state.json or 'none'}"
155
+
156
+ # === Scope ===
157
+ working_files: []
158
+ dependencies: []
159
+ related_artifacts: []
160
+
161
+ # === Outcome (populated by after mode) ===
162
+ outcome: ""
163
+ files_changed: []
164
+ promoted_specs: 0
165
+ promoted_knowhow: 0
166
+ follow_up: []
167
+ completed: ""
168
+ ---
169
+
170
+ # Companion Doc — {task_description}
171
+
172
+ > `/maestro-companion note "<content>"` — add entries
173
+ > `/maestro-companion after` — review, promote, close
174
+
175
+ ## Context
176
+
177
+ {Type-specific context section — see templates below}
178
+
179
+ ## Entries
180
+
181
+ ## Summary
182
+ ```
183
+
184
+ **Type-specific context templates** (written into `## Context`):
185
+
186
+ **implement:**
187
+ ```markdown
188
+ ### Working Files
189
+ | File | Role | Status |
190
+ |------|------|--------|
191
+
192
+ ### Dependencies
193
+ - (modules, APIs, or services this task depends on)
194
+
195
+ ### Decisions
196
+ | # | Decision | Rationale | Alternatives Considered |
197
+ |---|----------|-----------|------------------------|
198
+
199
+ ### Tests Affected
200
+ - (test files that need creation or update)
201
+ ```
202
+
203
+ **debug:**
204
+ ```markdown
205
+ ### Symptoms
206
+ - (observable behavior vs expected behavior)
207
+
208
+ ### Hypotheses
209
+ | # | Hypothesis | Status | Evidence |
210
+ |---|-----------|--------|----------|
211
+
212
+ ### Evidence Trail
213
+ | Time | Source | Type | Finding |
214
+ |------|--------|------|---------|
215
+
216
+ ### Root Cause
217
+ - (populated when identified)
218
+
219
+ ### Fix Applied
220
+ - (description of fix, files changed)
221
+ ```
222
+
223
+ **analyze:**
224
+ ```markdown
225
+ ### Scope
226
+ - (what is being analyzed and boundaries)
227
+
228
+ ### Findings
229
+ | # | Finding | Severity | Location |
230
+ |---|---------|----------|----------|
231
+
232
+ ### Risks
233
+ - (identified risks or concerns)
234
+
235
+ ### Recommendations
236
+ - (actionable recommendations)
237
+ ```
238
+
239
+ **design:**
240
+ ```markdown
241
+ ### Constraints
242
+ - (hard limits, requirements, compatibility needs)
243
+
244
+ ### Alternatives
245
+ | # | Approach | Pros | Cons |
246
+ |---|----------|------|------|
247
+
248
+ ### Trade-offs
249
+ - (key trade-off decisions and rationale)
250
+
251
+ ### Chosen Approach
252
+ - (selected design with justification)
253
+ ```
254
+
255
+ **plan:**
256
+ ```markdown
257
+ ### Goals
258
+ - (what success looks like)
259
+
260
+ ### Breakdown
261
+ | # | Task | Estimate | Depends On | Status |
262
+ |---|------|----------|------------|--------|
263
+
264
+ ### Dependencies
265
+ - (external dependencies, blockers, prerequisites)
266
+ ```
267
+
268
+ **review:**
269
+ ```markdown
270
+ ### Files Reviewed
271
+ | File | Lines | Findings |
272
+ |------|-------|----------|
273
+
274
+ ### Findings
275
+ | # | Severity | Category | File:Line | Description |
276
+ |---|----------|----------|-----------|-------------|
277
+
278
+ ### Verdict
279
+ - (pass / pass-with-concerns / fail)
280
+ ```
281
+
282
+ **test:**
283
+ ```markdown
284
+ ### Coverage
285
+ - Before: {%}
286
+ - After: {%}
287
+ - Target: {%}
288
+
289
+ ### Test Files
290
+ | File | Type | Tests Added | Status |
291
+ |------|------|------------|--------|
292
+
293
+ ### Gaps
294
+ - (uncovered paths or scenarios)
295
+ ```
296
+
297
+ **refactor:**
298
+ ```markdown
299
+ ### Affected Modules
300
+ - (modules being restructured)
301
+
302
+ ### Before / After
303
+ | Aspect | Before | After |
304
+ |--------|--------|-------|
305
+
306
+ ### Breaking Changes
307
+ - (API or behavior changes that affect consumers)
308
+ ```
309
+
310
+ **learn:**
311
+ ```markdown
312
+ ### Questions
313
+ | # | Question | Answered | Source |
314
+ |---|----------|----------|--------|
315
+
316
+ ### Mental Model
317
+ - (evolving understanding of how it works)
318
+
319
+ ### References
320
+ - (files, docs, wiki entries consulted)
321
+ ```
322
+
323
+ **general:**
324
+ ```markdown
325
+ ### Notes
326
+ - (general working notes)
327
+ ```
328
+
329
+ Write the companion doc path to `.workflow/.scratchpad/.companion-active`.
330
+
331
+ ### 5. Output summary card
332
+
333
+ ```
334
+ Knowledge context loaded
335
+ Spec: {N} rules ({category})
336
+ Knowhow: {M} entries available
337
+ Codebase: {status}
338
+ Doc: {companion_doc_path} [{task_type}]
339
+
340
+ Mid-task commands:
341
+ /maestro-companion note "finding or decision"
342
+ /maestro-companion note --file src/auth.ts "changed token validation"
343
+ /spec-load --keyword <keyword>
344
+ maestro wiki search "<query>"
345
+ ```
346
+
347
+ ---
348
+
349
+ ## S_NOTE — Append Structured Entry to Companion Doc
350
+
351
+ ### 1. Locate active companion doc
352
+
353
+ Read `.workflow/.scratchpad/.companion-active` to get the doc path.
354
+ If missing or file not found → create a new companion doc (same as S_BEFORE step 4, minimal — no spec/knowhow loading).
355
+
356
+ ### 2. Parse entry content and flags
357
+
358
+ Parse $ARGUMENTS after `note` keyword:
359
+ - `--file <path>` — associate entry with a specific file (appended to frontmatter `working_files`)
360
+ - `--severity <level>` — for findings: critical / high / medium / low
361
+ - Remaining text = entry content
362
+
363
+ ### 3. Classify entry type
364
+
365
+ Auto-classify from content signals:
366
+
367
+ | Content signal | Type tag |
368
+ |---------------|----------|
369
+ | "decided/decision/chose/picked/went with" | `decision` |
370
+ | "pattern/convention/rule/always/never/must" | `spec-candidate` |
371
+ | "pitfall/gotcha/careful/warning/trap/beware" | `pitfall` |
372
+ | "learned/realized/discovered/understood/turns out" | `insight` |
373
+ | "hypothesis/suspect/might be/could be" | `hypothesis` |
374
+ | "found bug/root cause/because of/caused by" | `evidence` |
375
+ | "risk/concern/worry/might break" | `risk` |
376
+ | "todo/need to/should also/follow up/remaining" | `todo` |
377
+ | "question/why does/how does/unclear" | `question` |
378
+ | "blocked/stuck/can't/impossible" | `blocker` |
379
+ | Default | `note` |
380
+
381
+ ### 4. Append entry
382
+
383
+ Append to the companion doc under `## Entries`:
384
+
385
+ ```markdown
386
+ ### [{type}] {HH:mm} — {first line of content}
387
+
388
+ {full content}
389
+
390
+ {if --file: **File:** `{path}`}
391
+ {if --severity: **Severity:** {level}}
392
+ ```
393
+
394
+ ### 5. Update frontmatter fields
395
+
396
+ - If `--file` provided and not already in `working_files` → append to `working_files`
397
+ - If type is `decision` → also append row to `### Decisions` table (if implement/design type doc)
398
+ - If type is `hypothesis` → also append row to `### Hypotheses` table (if debug type doc)
399
+ - If type is `evidence` → also append row to `### Evidence Trail` table (if debug type doc)
400
+ - If type is `risk` → also append to `### Risks` list (if analyze/design type doc)
401
+ - If type is `question` → also append row to `### Questions` table (if learn type doc)
402
+
403
+ ### 6. Confirm
404
+
405
+ ```
406
+ [{type}] entry added to companion doc
407
+ /maestro-companion note "..." — add more
408
+ /maestro-companion after — review & promote
409
+ ```
410
+
411
+ ---
412
+
413
+ ## S_AFTER — Review Companion Doc + Populate Outcome + Promote Entries + Route
414
+
415
+ ### 1. Load companion doc
416
+
417
+ Read `.workflow/.scratchpad/.companion-active` → read the companion doc.
418
+ If no active doc or doc is empty → skip to step 4 (accumulation reminder).
419
+
420
+ ### 2. Populate outcome fields
421
+
422
+ Collect task outcome data:
423
+
424
+ ```bash
425
+ # Detect files changed since companion doc creation
426
+ git diff --name-only --since="{companion_created_timestamp}"
427
+ ```
428
+
429
+ Update frontmatter:
430
+ - `files_changed` — from git diff
431
+ - `completed` — current ISO timestamp
432
+ - `status` — `completed`
433
+
434
+ Display entry summary:
435
+ ```
436
+ Companion doc review — {task_type}
437
+ Entries: {total} ({by type breakdown})
438
+ Files: {files_changed count} changed
439
+ Duration: {elapsed since created}
440
+
441
+ Promotable entries:
442
+ {list of decision/spec-candidate/pitfall/insight entries}
443
+ ```
444
+
445
+ ### 3. Promote entries
446
+
447
+ If promotable entries exist, AskUserQuestion:
448
+
449
+ - Option 1: "Promote to spec" — short coding/arch/test constraint
450
+ - Option 2: "Promote to knowhow" — detailed recipe/template/decision/tip
451
+ - Option 3: "Promote both" — spec index entry + knowhow document
452
+ - Option 4: "Skip — nothing to promote"
453
+
454
+ **Routing by selection:**
455
+
456
+ | Selection | Action |
457
+ |-----------|--------|
458
+ | Spec | `Skill("spec-add", args)` — guide user through category + content |
459
+ | Knowhow | `Skill("manage-knowhow-capture", args)` — guide through type + content |
460
+ | Both | `Skill("spec-add")` first, then `Skill("manage-knowhow-capture")` |
461
+ | Skip | Proceed to step 4 |
462
+
463
+ Update frontmatter: `promoted_specs`, `promoted_knowhow` counts.
464
+
465
+ Extract any `todo` entries → write to `follow_up` in frontmatter.
466
+
467
+ Clear `.workflow/.scratchpad/.companion-active`.
468
+
469
+ ### 4. Output accumulation reminder + routing
470
+
471
+ ```
472
+ Knowledge accumulation reminders:
473
+ Reusable pattern found? /spec-add <category> "title" "content"
474
+ Solved a complex problem? /manage-knowhow-capture recipe "description"
475
+ Made an architecture decision? /manage-knowhow-capture decision "description"
476
+ Discovered a useful trick? /manage-knowhow-capture tip "content"
477
+
478
+ Next steps:
479
+ /maestro-next — recommend next command
480
+ /maestro "<intent>" — route intent to full workflow
481
+ /manage-status — view project dashboard
482
+ ```
483
+
484
+ ---
485
+
486
+ ## S_ROUTE — Skill Routing
487
+
488
+ ### 1. Parse intent
489
+
490
+ Extract intent text from $ARGUMENTS after removing the `route` keyword.
491
+
492
+ ### 2. Delegate to maestro-next
493
+
494
+ ```
495
+ Skill("maestro-next", "<intent_text>")
496
+ ```
497
+
498
+ Reuses maestro-next routing table and scoring logic to recommend the best single command.
499
+
500
+ </execution>
501
+
502
+ <error_codes>
503
+ | Code | Severity | Condition | Recovery |
504
+ |------|----------|-----------|----------|
505
+ | W001 | warning | `.workflow/specs/` not initialized | Suggest `/spec-setup` |
506
+ | W002 | warning | `.workflow/knowhow/` is empty | Normal, skip knowhow index |
507
+ | W003 | warning | `.workflow/codebase/` does not exist | Suggest `/manage-codebase-rebuild` |
508
+ | W004 | warning | No active companion doc found (note/after mode) | Create new doc or skip |
509
+ </error_codes>
510
+
511
+ <success_criteria>
512
+ - [ ] Mode correctly detected (before/note/after/route)
513
+ - [ ] Task type resolved from --type flag or inferred from --task keywords
514
+ - [ ] before: spec + knowhow + codebase indexes loaded or hints given
515
+ - [ ] before: companion doc created with full YAML frontmatter (identity + context + scope + outcome placeholders)
516
+ - [ ] before: type-specific context template written (matching task_type)
517
+ - [ ] before: active doc path written to `.companion-active`
518
+ - [ ] before: summary card output with mid-task command hints
519
+ - [ ] note: active companion doc located and entry appended with type tag
520
+ - [ ] note: entry type auto-classified from content signals (11 type tags)
521
+ - [ ] note: --file flag updates working_files in frontmatter
522
+ - [ ] note: typed entries cross-posted to matching context tables (decisions→Decisions, hypothesis→Hypotheses, etc.)
523
+ - [ ] after: companion doc entries reviewed and promotable items identified
524
+ - [ ] after: outcome fields populated (files_changed, completed, status)
525
+ - [ ] after: AskUserQuestion routes to spec-add or manage-knowhow-capture
526
+ - [ ] after: todo entries extracted to follow_up field
527
+ - [ ] after: companion doc marked completed, active pointer cleared
528
+ - [ ] after: accumulation reminder + next-step routing displayed
529
+ - [ ] route: intent correctly forwarded to maestro-next
530
+ - [ ] No session created, no state.json modified
531
+ </success_criteria>