opencode-plugin-flow 4.2.1 → 4.3.0

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/dist/index.js CHANGED
@@ -75,7 +75,7 @@ Example evidence quality:
75
75
 
76
76
  Use this for \`flow-verifier-worker\`. Give it atomic claims and the cited sources
77
77
  or commands. Do not include the generator's reasoning unless that reasoning is
78
- the thing being verified.
78
+ the thing being verified, and do not say which worker produced the claim.
79
79
 
80
80
  \`\`\`markdown
81
81
  ## Status
@@ -104,8 +104,8 @@ success | partial | blocked
104
104
 
105
105
  ## Candidate implementation worker report
106
106
 
107
- Use this only for isolated worktrees or exact non-overlapping path ownership
108
- authorized by the manager.
107
+ Use this only with explicit user authorization, in an isolated worktree or an
108
+ exact non-overlapping path-owned slice assigned by the manager.
109
109
 
110
110
  \`\`\`markdown
111
111
  ## Status
@@ -150,76 +150,60 @@ evidence faster than one linear pass. The manager still owns the Flow session:
150
150
  only the manager calls state-changing Flow tools, approves plans, completes
151
151
  features, records reviews, or closes sessions.
152
152
 
153
- Sections: quick path, operational defaults, manager sequence, modes, permission
154
- contract, worker rules, prompt contract, handoff location, and follow-up passes.
155
-
156
- Read these companion references before a broad parallel pass:
157
-
158
- - \`parallel-pass-patterns.md\` for pass selection, effort defaults, and stop or
159
- follow-up rules.
160
- - \`handoff-format.md\` for the exact worker response shapes.
161
- - \`verification-gates.md\` for the pre-fan-out coverage gate, handoff
162
- acceptance, verifier triggers, and the manager synthesis barrier. Those
163
- definitions are canonical; this file only points at them.
164
- - \`parallel-pass-example.md\` for a concrete end-to-end pass after the rules
165
- below are clear (synced with the \`flow\` skill; not bundled into commands).
166
-
167
- ## Quick path
168
-
169
- 1. Orient serially and keep the immediate blocker local.
170
- 2. Fan out only when two to five non-overlapping slices reduce known
171
- uncertainty.
172
- 3. Write a coverage gate before spawning workers: total scope, exact slices,
173
- expected counts, and overlap/gap check.
174
- 4. Give each worker a named mode, exact slice, expected coverage, and the
175
- required handoff shape.
176
- 5. Accept only scoped, evidenced, confidence-labeled claims; verify important
177
- weak, contested, or single-source claims.
178
- 6. Synthesize one manager-owned artifact. Raw handoffs do not become the answer,
179
- Flow payload, or patch decision.
180
-
181
- ## Operational defaults
182
-
183
- - Prefer serial work when the scope is small, tightly coupled, or blocked by one
184
- decision that must be made before slices are meaningful.
185
- - A normal first pass is two to five workers with independent slices. Use more
186
- only when the coverage gate is countable and the slices remain non-overlapping.
187
- - Run at most one routine follow-up pass. Extra passes need an explicit manager
188
- reason, such as a high-stakes verifier check or a newly discovered bounded
189
- slice.
190
- - Do not fan out just to keep agents busy. Every worker should reduce a known
191
- planning, validation, review, audit, or implementation uncertainty.
192
-
193
- Skip fan-out when:
194
-
195
- - one file, command, or design question determines the next step.
196
- - slices would share the same contracts, fixtures, or edit targets.
197
- - the manager can inspect the full scope faster than writing and checking
153
+ Every parallel pass runs the same loop:
154
+
155
+ **orient → slice → manifest → fan out → account → verify → synthesize →
156
+ extend or stop.**
157
+
158
+ This file is the whole playbook; read it once and run the pass. Two companions
159
+ stay separate:
160
+
161
+ - \`handoff-format.md\` holds the worker response templates. The manager pastes
162
+ the matching template verbatim into every worker prompt.
163
+ - \`parallel-pass-example.md\` walks one concrete end-to-end pass (synced with
164
+ the \`flow\` skill; not bundled into commands).
165
+
166
+ ## Choose a pass
167
+
168
+ | Situation | Flow pass | Output the manager may synthesize |
169
+ | --- | --- | --- |
170
+ | Repo shape is unclear before planning | Discovery pass | Requirements, decisions, targets, validation entries, or a review-first feature |
171
+ | A broad finding set needs refutation | Audit pass | Surviving findings with guards checked and gaps named |
172
+ | Changed files or risk lenses are too broad for one review pass | Review pass | One \`featureReview\` or \`finalReview\` payload owned by the manager |
173
+ | Test strategy or route coverage is unclear | Validation pass | Candidate commands or authorized raw command evidence |
174
+ | A claim is single-source, surprising, high-stakes, or payload-bound | Verification pass | Per-claim keep, narrow, rewrite, or remove decisions |
175
+ | Multiple implementation paths are plausible | Candidate pass | Candidate patches inspected and validated by the manager before use |
176
+
177
+ Pass notes:
178
+
179
+ - **Discovery**: workers read specific modules, routes, docs, commands, or risk
180
+ lenses; only evidenced claims become plan fields.
181
+ - **Audit**: workers actively look for guards, lifecycle resets, deployment
182
+ constraints, and counterexamples before reporting a finding. A finding
183
+ without refutation work stays advisory or becomes a follow-up question.
184
+ - **Review**: workers separate blocking findings from advisory notes; the
185
+ manager resolves conflicts and returns one review payload.
186
+ - **Validation**: workers run only manager-authorized commands and report the
187
+ exact command, status, and raw outcome summary.
188
+ - **Verification**: verifiers judge atomic claims against cited sources or
189
+ commands; do not ask a verifier to redesign the work or review the whole
190
+ feature.
191
+ - **Candidate**: only with explicit user authorization plus isolated worktrees
192
+ or exact non-overlapping path ownership. Patches stay proposals until the
193
+ manager inspects, merges or rejects, and validates.
194
+
195
+ ## When to stay serial
196
+
197
+ - One file, command, or design question determines the next step.
198
+ - Slices would share the same contracts, fixtures, or edit targets.
199
+ - The manager can inspect the full scope faster than writing and checking
198
200
  worker prompts.
199
- - the result would still need the same manual synthesis with no time saved.
200
-
201
- ## Manager sequence
202
-
203
- 1. Call \`flow_status\` if a Flow session may already exist.
204
- 2. Do a serial orientation pass. Read enough files, schemas, docs, tests,
205
- commands, or artifacts to identify real slices.
206
- 3. Define the local manager task. Do not delegate the immediate blocker that
207
- determines whether fan-out is even valid.
208
- 4. Build the pre-fan-out coverage gate defined in \`verification-gates.md\`
209
- ("Before fan-out"): total scope, one line per slice with expected count,
210
- partition check, and overlap/gap check.
211
- 5. Spawn only named Flow workers. Use exact slices and the required handoff
212
- shape. Keep each prompt self-contained.
213
- 6. Continue non-overlapping manager work while workers run.
214
- 7. Read every handoff. Keep only claims that have evidence, match the assigned
215
- scope, and carry confidence labels.
216
- 8. Send important low-confidence, single-source, contested, or citation-heavy
217
- claims to \`flow-verifier-worker\`.
218
- 9. Run follow-up passes only for material gaps, conflicts, narrowed scope, or
219
- verification needs.
220
- 10. Apply the manager synthesis barrier from \`verification-gates.md\`: keep
221
- only distilled, evidence-backed claims and synthesize one Flow artifact.
222
- Do not paste worker handoffs as the user-facing result.
201
+ - The result would still need the same manual synthesis with no time saved.
202
+
203
+ Do not fan out to keep agents busy. Every worker should reduce a named
204
+ planning, validation, review, audit, or implementation uncertainty. A normal
205
+ first pass is two to five workers with independent slices; use more only when
206
+ the manifest stays countable and non-overlapping.
223
207
 
224
208
  ## Modes
225
209
 
@@ -237,20 +221,10 @@ carry the permission boundaries for each mode.
237
221
  | \`verifier\` | \`flow-verifier-worker\` | Per-claim verdicts against cited evidence or commands | No | \`flow_status\` only if needed |
238
222
  | \`candidate-implementation\` | \`flow-candidate-worker\` | Candidate patch summary from an isolated worktree or exact path-owned slice | Only with explicit user authorization plus isolation or exact non-overlapping path ownership | No state-changing Flow tools |
239
223
 
240
- Mode examples:
241
-
242
- - Use \`flow-evidence-worker\` when the repo shape is unclear and the output will
243
- become plan requirements, decisions, targets, or validation entries.
244
- - Use \`flow-reviewer\` when changed files or risk lenses can be reviewed
245
- independently before the manager returns one review payload.
246
- - Use \`flow-validation-worker\` when the manager needs command options or raw
247
- output from an explicitly authorized command.
248
- - Use \`flow-audit-worker\` when candidate findings must be refuted before they
249
- can become a report or follow-up feature.
250
- - Use \`flow-verifier-worker\` for atomic claims that are contested,
251
- single-sourced, high-stakes, or destined for a Flow payload.
252
- - Use \`flow-candidate-worker\` only after explicit user authorization and only
253
- with an isolated worktree or exact non-overlapping path ownership.
224
+ If the runtime exposes per-worker model or effort choices, spend them where
225
+ being wrong is expensive: read-heavy discovery slices tolerate the cheapest
226
+ configured option, while verifier and review slices deserve the strongest.
227
+ Otherwise route by scope: give weaker slices narrower, more countable scope.
254
228
 
255
229
  ## Permission contract
256
230
 
@@ -272,27 +246,56 @@ Do not fan out parallel \`flow_plan_save\`, \`flow_plan_approve\`,
272
246
  \`flow_session_close\` calls. Runtime locking protects files, but Flow accepts only
273
247
  one active feature result at a time.
274
248
 
275
- ## Worker rules
276
-
277
249
  Workers may read files, inspect docs, run authorized read-only commands, and
278
250
  summarize evidence. Candidate implementation workers may edit only when the
279
251
  manager assigned an isolated worktree or exact path ownership that does not
280
- overlap sibling workers or manager edits.
252
+ overlap sibling workers or manager edits. Workers must not edit \`.flow/**\`,
253
+ must not call state-changing Flow tools, and must not approve work, close
254
+ sessions, record Flow validation, or claim validation they did not run. A
255
+ worker may report raw validation output it actually ran; the manager decides
256
+ whether it is strong enough to record.
257
+
258
+ ## Stage 1 — Orient (serial)
259
+
260
+ Call \`flow_status\` if a Flow session may already exist. Read enough files,
261
+ schemas, docs, tests, commands, or artifacts to identify real slices. Keep the
262
+ immediate blocker local: do not delegate the question that determines whether
263
+ fan-out is even valid.
264
+
265
+ ## Stage 2 — Slice
281
266
 
282
- Workers must not edit \`.flow/**\` and must not call:
267
+ Split along whichever axis keeps slices independent: modules or path sets,
268
+ route or endpoint groups, risk lenses, command surfaces, data ranges, or claim
269
+ sets. Each slice needs a one-line scope, expected coverage, and a defined
270
+ output the manager can check.
283
271
 
284
- - \`flow_plan_save\`
285
- - \`flow_plan_approve\`
286
- - \`flow_run_start\`
287
- - \`flow_feature_complete\`
288
- - \`flow_feature_reset\`
289
- - \`flow_session_close\`
272
+ ## Stage 3 — Manifest (the pre-fan-out coverage gate)
273
+
274
+ Before spawning, write a pass manifest: one row per slice, plus a totals check.
275
+
276
+ | # | Slice scope | Expected coverage | Mode | Verification tier |
277
+ | --- | --- | --- | --- | --- |
278
+ | 1 | \`src/core/**\` plus its tests | 14 files | \`evidence\` | accept locally |
279
+ | 2 | release contract: CI workflows, \`package.json\`, changelog | 6 files | \`evidence\` | verify once |
280
+
281
+ - Count the total work items when countable: files, modules, routes, commands,
282
+ rows, findings, screenshots, or claims. Confirm slice counts add back to the
283
+ total, with no overlaps, gaps, empty slices, or ambiguous shared contracts.
284
+ - If the scope cannot be counted, state the completeness rule instead, such as
285
+ "all changed files plus callers" or "all public commands plus release docs."
286
+ - Assign each slice's verification tier now (see Stage 6). Deciding where a
287
+ wrong claim is expensive belongs before handoffs arrive, not after.
288
+ - Fix the slice map centrally before spawning if the gate does not reconcile.
290
289
 
291
- Workers also must not approve work, close sessions, record Flow validation, or
292
- claim validation they did not run. A worker may report raw validation output it
293
- actually ran; the manager decides whether it is strong enough to record.
290
+ The manifest is also the accounting contract for the pass: N rows spawned means
291
+ N handoffs collected and checked in Stage 5 before anything is synthesized.
294
292
 
295
- ## Prompt contract
293
+ Write the manifest where it survives the pass: the conversation is enough for a
294
+ single bounded pass, but when a follow-up pass or a session resume is
295
+ plausible, persist it with the synthesis (Stage 7) so the accounting can be
296
+ reconstructed.
297
+
298
+ ## Stage 4 — Fan out
296
299
 
297
300
  Every worker prompt includes:
298
301
 
@@ -309,43 +312,139 @@ Return only the Flow handoff in this exact shape:
309
312
 
310
313
  Hidden workers cannot load skills or read \`handoff-format.md\` themselves. The
311
314
  manager copies the matching handoff template into every worker prompt; a bare
312
- filename reference is not enough.
315
+ filename reference is not enough. Workers also cannot read the conversation, so
316
+ prompts cite file paths — including any synthesis file from an earlier pass —
317
+ instead of restating chat history.
313
318
 
314
319
  For research or current-doc slices, require source checks for versioned or
315
320
  time-sensitive facts. For implementation candidates, remind workers that other
316
321
  work may be active and that they must not revert unrelated changes.
317
322
 
318
- ## Where handoffs go
323
+ Continue non-overlapping manager work while workers run.
324
+
325
+ ## Stage 5 — Account
326
+
327
+ Check every manifest row off against a returned handoff before synthesis. A
328
+ worker that never returns, errors out, or reports \`partial\` or \`blocked\` is a
329
+ hole in the pass, and synthesizing around it silently drops a slice.
330
+
331
+ Worker failure ladder:
332
+
333
+ 1. Re-spawn once with a narrower slice and a note about what the first attempt
334
+ returned.
335
+ 2. If it fails again, cover the slice directly in the manager session.
336
+ 3. If it stays blocked, carry the slice into the synthesis explicitly as
337
+ not-covered. Never present results as if coverage were complete.
338
+
339
+ ## Stage 6 — Verify
340
+
341
+ \`Status: success\` only says the worker believes its slice is done. Accept a
342
+ handoff only after a cheap manager-side pass:
343
+
344
+ - \`Status\` is present and terminal: \`success\`, \`partial\`, or \`blocked\`.
345
+ - Coverage matches the assigned slice, or skips are explicit.
346
+ - Important claims have concrete evidence and confidence tags.
347
+ - Cited paths, commands, screenshots, URLs, or metrics resolve.
348
+ - The evidence supports the claim, not just the topic.
349
+ - Findings stay inside the worker's slice.
350
+ - Headline counts can be recounted or traced.
351
+ - Contradictions between workers are either resolved or explicitly marked as
352
+ contested.
353
+
354
+ Demote, drop, re-task, or verify claims that fail this pass.
355
+
356
+ ### Verification tiers
357
+
358
+ One taxonomy decides how much verification a claim gets: the manifest assigns
359
+ a default tier per slice, and this stage applies it per claim. Use the cheapest
360
+ check that matches the risk:
361
+
362
+ - **Accept locally**: low-risk claims with direct evidence that the manager can
363
+ cheaply inspect or recount.
364
+ - **Verify once** with \`flow-verifier-worker\`: single-source, surprising,
365
+ inferred, low-confidence, citation-heavy, contested, or Flow-payload-bound
366
+ claims, including any count, benchmark, command result, or pass/fail claim a
367
+ Flow payload will rely on.
368
+ - **Verify strongly**: blocking or release-sensitive claims and claims that
369
+ affect user data, security, persistence, permissions, public API behavior,
370
+ release behavior, or data loss. Use independent verifier checks, manager-run
371
+ commands, or direct artifact inspection strong enough to settle the claim.
372
+ - **Do not accept**: claims without concrete evidence, claims outside the
373
+ assigned slice, claims contradicted by inspected artifacts, or claims where
374
+ the cited evidence supports only the topic rather than the assertion.
375
+
376
+ Verifier prompts use stable claim ids, one atomic assertion per id, the cited
377
+ source or command for each id, and the exact acceptance question. Do not
378
+ include the generator's reasoning unless that reasoning is the thing being
379
+ verified, do not say which worker produced the claim, and do not ask a
380
+ verifier to redesign the work or review the whole feature.
381
+
382
+ ## Stage 7 — Synthesize
383
+
384
+ Apply the manager synthesis barrier before presenting or recording anything:
385
+
386
+ - Preserve confidence: verified, single-sourced, inferred, and unresolved claims
387
+ stay distinct when it matters.
388
+ - When workers disagree, inspect the cited artifact or rerun the cited command
389
+ instead of arbitrating from summaries. Do not average conflicting claims.
390
+ - Run the strongest practical local check for the deliverable.
391
+ - Re-read critical files or docs that will be cited in the final decision.
392
+ - Move only distilled, evidence-backed claims forward; raw handoffs remain
393
+ candidate evidence, not a plan, review, completion payload, or final answer.
394
+ - Record gaps honestly instead of converting missing evidence into success
395
+ language.
396
+
397
+ Where accepted evidence goes:
319
398
 
320
399
  - Planning evidence becomes \`requirements\`, \`decisions\`, feature \`targets\`,
321
- feature \`validation\`, or plan notes in prose fields.
322
- - Execution evidence informs the active feature, but \`flow_feature_complete\` is
323
- manager-owned.
324
- - Validation evidence may become \`validationRun\` only when the command, status,
325
- and raw outcome are concrete enough to trust.
326
- - Review evidence informs \`featureReview\` or \`finalReview\`, but the manager owns
327
- the pass/fail verdict.
328
- - Audit evidence becomes findings only after refutation and verification rules
329
- in \`verification-gates.md\`.
330
- - Candidate patches are inspected, merged, and validated by the manager before
331
- any Flow completion call.
332
-
333
- When worker results conflict, inspect the underlying artifact directly and rerun
334
- the smallest check that can settle the disagreement. The manager synthesis
335
- barrier in \`verification-gates.md\` applies before anything moves forward.
336
-
337
- ## Follow-up passes
338
-
339
- Start a follow-up pass when first-pass handoffs reveal:
340
-
341
- - missing coverage in the original slice map.
342
- - conflicting findings that matter to the Flow decision.
343
- - a specialized follow-up that was intentionally out of scope.
344
- - high-stakes, low-confidence, or single-source claims needing verification.
345
- - bounded implementation candidates after research converges.
346
-
347
- Do not recurse by default. If a worker says it needs another worker, the manager
348
- decides whether that is a follow-up pass and writes the next bounded prompt.
400
+ feature \`validation\`, or plan notes only when the source and scope are
401
+ clear. Unverified broad findings become a review-first feature, not a fix
402
+ plan.
403
+ - Validation evidence may become \`validationRun\` only when the worker was
404
+ explicitly authorized to run the command and reported the exact command,
405
+ status, and raw outcome summary.
406
+ - Review evidence informs \`featureReview\` or \`finalReview\`, but the manager
407
+ owns the pass/fail verdict and must resolve blockers, contradictions, and
408
+ coverage gaps before returning the payload.
409
+ - Audit evidence becomes findings only after refutation; blocking findings need
410
+ guards checked, deployment context, and evidence that the current code
411
+ exhibits the behavior.
412
+ - Candidate patches are not Flow evidence until the manager inspects, merges or
413
+ rejects them, and validates the main Flow-managed workspace.
414
+
415
+ Persist the manifest and the synthesis when another pass may follow or the
416
+ session is long enough to be compacted or resumed: write the distilled result —
417
+ the accounted manifest, accepted claims with evidence and confidence, dropped
418
+ claims with one-line reasons, and open gaps — into plan prose fields or a
419
+ manager-owned scratch file outside both \`.flow/**\` and the repository worktree,
420
+ such as a file in the OS temporary directory. The runtime owns the \`.flow/**\`
421
+ layout, and scratch files left in the worktree end up staged or reviewed as if
422
+ they were project changes. Follow-up worker prompts cite that path; files are
423
+ the only shared memory between passes.
424
+
425
+ ## Stage 8 — Extend or stop
426
+
427
+ Stop after a pass when:
428
+
429
+ - the manifest's coverage rule is satisfied and every row is accounted for.
430
+ - accepted claims are evidenced, scoped, and confidence-labeled.
431
+ - material single-source, contested, high-stakes, or payload-bound claims have
432
+ been verified or downgraded.
433
+ - remaining gaps are explicit and do not block the Flow artifact being produced.
434
+
435
+ Start a bounded follow-up pass only when:
436
+
437
+ - the original slice map missed material scope.
438
+ - workers disagree on a claim that affects the Flow decision.
439
+ - a high-stakes or payload-bound claim needs verification.
440
+ - a first pass exposes a narrower implementation or validation slice worth
441
+ isolating.
442
+
443
+ Run at most one routine follow-up pass. Extra passes need an explicit manager
444
+ reason, such as a high-stakes verifier check or a newly discovered bounded
445
+ slice. Do not recurse by default: if a worker says it needs another worker, the
446
+ manager decides whether that is a follow-up pass and writes the next bounded
447
+ prompt, starting again from the manifest.
349
448
  `;
350
449
 
351
450
  // skills/flow/references/parallel-pass-example.md
@@ -363,11 +462,14 @@ twelve API route modules, one shared error middleware, and an integration test
363
462
  directory. The manager keeps the middleware local because it is one file and
364
463
  anchors every other judgment.
365
464
 
366
- Coverage gate: twelve countable route modules remain after the local check.
465
+ Pass manifest: twelve countable route modules remain after the local check, and
466
+ 4 + 3 + 5 adds back to 12 with no overlaps or gaps.
367
467
 
368
- - Slice A: auth and account routes, expected 4/12.
369
- - Slice B: billing and subscription routes, expected 3/12.
370
- - Slice C: remaining content and admin routes, expected 5/12.
468
+ | # | Slice scope | Expected coverage | Mode | Verification tier |
469
+ | --- | --- | --- | --- | --- |
470
+ | A | auth and account routes | 4/12 modules | \`evidence\` | accept locally |
471
+ | B | billing and subscription routes | 3/12 modules | \`review\` | verify once |
472
+ | C | remaining content and admin routes | 5/12 modules | \`audit\` | verify once |
371
473
 
372
474
  Worker prompts:
373
475
 
@@ -404,6 +506,11 @@ Return only the Flow handoff in this exact shape:
404
506
  <matching handoff template copied verbatim from handoff-format.md>
405
507
  \`\`\`
406
508
 
509
+ Accounting: three manifest rows spawned means three handoffs collected before
510
+ synthesis. If slice B returned \`partial\`, the manager would re-spawn it once
511
+ with a narrower scope, then cover it directly, and as a last resort carry it
512
+ into the synthesis explicitly as not-covered.
513
+
407
514
  Handoff checks: the manager accepts only reports with terminal status, matching
408
515
  coverage counts, concrete file:line evidence, confidence tags, and claims inside
409
516
  the assigned slice. A claim such as \`[high] billing routes bypass the error
@@ -422,222 +529,11 @@ a plan decision, review payload, or docs patch. Raw handoffs and unverified
422
529
  suggestions do not move into the next pass or user-facing answer.
423
530
  `;
424
531
 
425
- // skills/flow/references/parallel-pass-patterns.md
426
- var parallel_pass_patterns_default = `# Parallel pass patterns
427
-
428
- Flow uses parallel workers to reduce uncertainty, not to delegate decisions.
429
- Each pass has a bounded purpose, an explicit coverage rule, and one
430
- manager-owned synthesis result.
431
-
432
- ## Choose a pass
433
-
434
- | Situation | Flow pass | Output the manager may synthesize |
435
- | --- | --- | --- |
436
- | Repo shape is unclear before planning | Discovery pass | Requirements, decisions, targets, validation entries, or a review-first feature |
437
- | A broad finding set needs refutation | Audit pass | Surviving findings with guards checked and gaps named |
438
- | Changed files or risk lenses are too broad for one review pass | Review pass | One \`featureReview\` or \`finalReview\` payload owned by the manager |
439
- | Test strategy or route coverage is unclear | Validation pass | Candidate commands or authorized raw command evidence |
440
- | A claim is single-source, surprising, high-stakes, or payload-bound | Verification pass | Per-claim keep, narrow, rewrite, or remove decisions |
441
- | Multiple implementation paths are plausible | Candidate pass | Candidate patches inspected and validated by the manager before use |
442
-
443
- Prefer serial work when one file, command, or design question determines the
444
- next step. A parallel pass should reduce a named planning, validation, review,
445
- audit, or implementation uncertainty.
446
-
447
- ## Pass Shapes
448
-
449
- ### Discovery pass
450
-
451
- Use before planning when the manager has oriented enough to name disjoint slices
452
- but not enough to write reliable plan fields. Workers read specific modules,
453
- routes, docs, commands, or risk lenses. The manager turns only evidenced claims
454
- into plan fields.
455
-
456
- ### Audit pass
457
-
458
- Use when a report starts from candidate findings. Workers actively look for
459
- guards, lifecycle resets, deployment constraints, and counterexamples before
460
- reporting a finding. A finding that lacks refutation work stays advisory or
461
- becomes a follow-up question.
462
-
463
- ### Review pass
464
-
465
- Use when changed files or risks can be reviewed independently. Review workers
466
- separate blocking findings from advisory notes. The manager resolves conflicts,
467
- checks cited artifacts, and returns one review payload.
468
-
469
- ### Validation pass
470
-
471
- Use when coverage is unclear or command evidence can be gathered independently.
472
- Validation workers may run only manager-authorized commands and must report
473
- exact command, status, raw outcome summary, coverage, confidence, and gaps.
474
-
475
- ### Verification pass
476
-
477
- Use for atomic claims. Give the verifier claim ids, cited sources or commands,
478
- and the acceptance question. Do not ask a verifier to redesign the work or
479
- review the whole feature.
480
-
481
- ### Candidate pass
482
-
483
- Use only with explicit user authorization plus isolated worktrees or exact
484
- non-overlapping path ownership. Candidate patches are proposals until the
485
- manager inspects, merges or rejects them, and validates the main workspace.
486
-
487
- ## Effort Defaults
488
-
489
- - Start with two to five workers. Use more only when the coverage gate is
490
- countable and the manager can verify every handoff.
491
- - Run at most one routine follow-up pass. Extra passes need a stated reason,
492
- such as a high-stakes verification check or a newly discovered bounded slice.
493
- - Spend effort where being wrong costs more: public API, persistence, security,
494
- permissions, release behavior, data loss, and Flow payload claims.
495
- - Do not fan out to keep agents busy. Worker setup and synthesis have real cost.
496
-
497
- ## Stop And Extend
498
-
499
- Stop after a pass when:
500
-
501
- - the coverage rule is satisfied.
502
- - accepted claims are evidenced, scoped, and confidence-labeled.
503
- - material single-source, contested, high-stakes, or payload-bound claims have
504
- been verified or downgraded.
505
- - remaining gaps are explicit and do not block the Flow artifact being produced.
506
-
507
- Start a bounded follow-up pass only when:
508
-
509
- - the original slice map missed material scope.
510
- - workers disagree on a claim that affects the Flow decision.
511
- - a high-stakes or payload-bound claim needs verification.
512
- - a first pass exposes a narrower implementation or validation slice worth
513
- isolating.
514
-
515
- After every pass, the manager synthesis barrier from \`verification-gates.md\`
516
- applies before any handoff content moves forward.
517
- `;
518
-
519
532
  // skills/flow/references/recovery-playbook.md
520
533
  var recovery_playbook_default = '# Recovery playbook\n\nUse this when a Flow tool returns `status: "error"`, a blocker, or a `nextAction` that conflicts with memory.\n\n## First response\n\n1. Re-anchor with `flow_status`.\n2. Read the returned `summary`, `recovery`, `lastError`, and active feature.\n3. Fix the cause, then retry the smallest valid Flow action.\n\n## Common cases\n\n- `missing_session`: start with `flow_plan_save` using the user\'s goal.\n- `missing_goal`: ask for a concrete goal before planning.\n- `Approved plans cannot be changed`: use `flow_feature_reset` when only affected features need another pass; otherwise close and start a new goal.\n- `No feature is currently running`: call `flow_run_start` before completing.\n- `already in progress`: finish, reset, or block the active feature before starting another.\n- `Completion requires recorded validation evidence`: run real validation and include at least one passing `validationRun`.\n- `Completion requires all recorded validation to pass`: fix failures and rerun. Do not relabel failed checks as passed.\n- `Non-final feature completion requires targeted validation`: use `validationScope: "targeted"` for ordinary features.\n- `Final feature completion requires broad validation`: run the project-level gate and use `validationScope: "broad"`.\n- `Completion requires a passing featureReview`: run or request a real review and include a passing `featureReview` only when there are no blocking findings.\n- `Final feature completion requires a finalReview`: perform final review and include `finalReview`.\n- `Final review depth must match the plan policy`: use `reviewDepth` equal to the approved plan\'s `finalReviewPolicy`; valid final-review values are `broad` and `detailed`.\n- `Cannot close ... unfinished features`: complete, reset, defer, or abandon honestly. Do not mark completed while work remains.\n\n## Reset guidance\n\nUse `flow_feature_reset` when the active or completed work was built on the wrong assumption, validation revealed a design issue, dependencies need to be rerun, or dependent features must be invalidated. Resetting a feature also resets its dependents.\n\n## Closure guidance\n\nUse `flow_session_close`:\n\n- `completed`: only after all planned features are complete.\n- `deferred`: the user intentionally postpones unfinished work.\n- `abandoned`: the session should be archived without claiming delivery.\n\nAfter closure, the active `.flow/session.json` is removed and the archived JSON is stored under `.flow/history/`.\n';
521
534
 
522
- // skills/flow/references/verification-gates.md
523
- var verification_gates_default = `# Verification gates
524
-
525
- Verification is how Flow keeps parallel work from turning into parallel
526
- guesswork. Worker handoffs are candidate evidence; the manager decides what can
527
- enter the plan, validation record, review payload, audit report, or final
528
- answer.
529
-
530
- Sections: before fan-out, every handoff, verifier triggers, verification tiers,
531
- Flow payload acceptance, and manager synthesis barrier.
532
-
533
- ## Before fan-out
534
-
535
- Run a pre-fan-out gate after serial orientation and before spawning workers:
536
-
537
- - Count the total work items when countable: files, modules, routes, commands,
538
- rows, findings, screenshots, or claims.
539
- - List every slice with path/range/lens and expected count.
540
- - Check that countable slices add back to the total.
541
- - Check for overlapping ownership, missing areas, empty slices, and ambiguous
542
- shared contracts.
543
- - Fix the slice map centrally before spawning if the gate does not reconcile.
544
-
545
- If the scope cannot be counted, state the completeness rule instead, such as
546
- "all changed files plus callers" or "all public commands plus release docs."
547
-
548
- ## Every handoff
549
-
550
- Accept a handoff only after a cheap manager-side pass:
551
-
552
- - \`Status\` is terminal: \`success\`, \`partial\`, or \`blocked\`.
553
- - Coverage matches the assigned slice, or skips are explicit.
554
- - Important claims have concrete evidence and confidence tags.
555
- - Cited paths, commands, screenshots, URLs, or metrics resolve.
556
- - The evidence supports the claim, not just the topic.
557
- - Findings stay inside the worker's slice.
558
- - Headline counts can be recounted or traced.
559
- - Contradictions between workers are either resolved or explicitly marked as
560
- contested.
561
-
562
- Demote, drop, re-task, or verify claims that fail this pass.
563
-
564
- ## Verifier triggers
565
-
566
- Use \`flow-verifier-worker\` when a claim is:
567
-
568
- - blocking or release-sensitive.
569
- - high-stakes for user data, security, persistence, permissions, or public API
570
- behavior.
571
- - low-confidence, inferred, surprising, or single-sourced.
572
- - citation-heavy enough that source drift would change the conclusion.
573
- - contradicted by another worker or by manager inspection.
574
- - a count, benchmark, command result, or pass/fail claim that a Flow payload will
575
- rely on.
576
-
577
- Give the verifier atomic claims, cited sources or commands, and the acceptance
578
- question. Do not ask it to redesign the work or review the whole feature.
579
-
580
- ## Verification tiers
581
-
582
- Use the cheapest check that matches the risk:
583
-
584
- - **Accept locally**: low-risk claims with direct evidence that the manager can
585
- cheaply inspect or recount.
586
- - **Verify once**: single-source, surprising, inferred, citation-heavy, or
587
- Flow-payload-bound claims.
588
- - **Verify strongly**: claims that affect security, persistence, permissions,
589
- public API behavior, release behavior, data loss, or blocking review outcome.
590
- Use independent verifier checks, manager-run commands, or direct artifact
591
- inspection strong enough to settle the claim.
592
- - **Do not accept**: claims without concrete evidence, claims outside the
593
- assigned slice, claims contradicted by inspected artifacts, or claims where the
594
- cited evidence supports only the topic rather than the assertion.
595
-
596
- Verifier prompts should use stable claim ids, one atomic assertion per id, the
597
- cited source or command for each id, and the exact acceptance question.
598
-
599
- ## Flow payload acceptance
600
-
601
- Planning fields may use worker evidence only when the source and scope are clear.
602
- Unverified broad findings should become a review-first feature, not a fix plan.
603
-
604
- \`validationRun\` entries may use worker-reported commands only when the worker
605
- was explicitly authorized to run the command and reported the exact command,
606
- status, and raw outcome summary.
607
-
608
- \`featureReview\` and \`finalReview\` may use worker review slices, but the manager
609
- owns the pass/fail decision and must resolve blockers, contradictions, and
610
- coverage gaps before returning the payload.
611
-
612
- Audit reports may include only findings that survived refutation. Blocking audit
613
- findings need guards checked, deployment context, and evidence that the current
614
- code exhibits the behavior.
615
-
616
- Candidate implementation patches are not Flow evidence until the manager
617
- inspects, merges or rejects them, and runs suitable validation in the main
618
- Flow-managed workspace.
619
-
620
- ## Manager synthesis barrier
621
-
622
- Before presenting or recording the result:
623
-
624
- - Preserve confidence: verified, single-sourced, inferred, and unresolved claims
625
- stay distinct when it matters.
626
- - When workers disagree, inspect the cited artifact or rerun the cited command
627
- instead of arbitrating from summaries.
628
- - Run the strongest practical local check for the deliverable.
629
- - Re-read critical files or docs that will be cited in the final decision.
630
- - Move only distilled, evidence-backed claims forward; raw handoffs remain
631
- candidate evidence, not a plan, review, completion payload, or final answer.
632
- - Record gaps honestly instead of converting missing evidence into success
633
- language.
634
-
635
- \`Status: success\` only says the worker believes its slice is done. The manager
636
- still checks coverage and evidence before trusting the result.
637
- `;
638
-
639
535
  // skills/flow/SKILL.md
640
- var SKILL_default = "---\nname: flow\ndescription: Manage the end-to-end Flow loop for skills-first OpenCode work. Use when a user asks for Flow-guided delivery from goal to completion, resumable autonomous delivery, or resuming or closing a Flow session. For plan-only work use flow-plan; for executing one approved feature use flow-run.\n---\n\n# Flow\n\nUse Flow as a minimal state ledger, not as a framework. Skills provide judgment; the runtime only records the approved plan, active feature, validation evidence, review evidence, and closure.\n\nRouting: this manager skill owns the whole loop and every state-changing `flow_*` call. Load `flow-plan` alone for plan-only requests and `flow-run` alone when an approved plan needs one feature executed. Answer status-only questions with `flow_status`; no skill load is needed. `flow-test`, `flow-deslop`, and `flow-ui-quality` are optional helpers loaded from inside the loop; `flow-commit` is user-triggered only and never part of the autonomous loop.\n\n## Loop\n\n1. Call `flow_status` first. Trust its active session and next action over conversation memory.\n If the result includes `setup.skills`, follow the Skill Availability rules\n below before loading any Flow skill.\n2. If there is no active session and the user gave a goal, load `flow-plan`, save a plan with `flow_plan_save`, then approve it with `flow_plan_approve` only after explicit user approval or prior authorization for autonomous implementation. If there is no goal, ask for one.\n3. Load `flow-run`, call `flow_run_start`, implement exactly one feature, validate it, and prepare a `flow_feature_complete` payload. For validation-heavy, regression-sensitive, browser QA, route QA, or failure-prone work, use `flow-test` to choose and summarize evidence before completion.\n4. Load `flow-review` for the required feature review. The reviewer reports a `featureReview` payload; the manager records it inside `flow_feature_complete`.\n5. On the final feature, run broad validation and include `finalReview` in the same `flow_feature_complete` call. Its `reviewDepth` must match the plan's `finalReviewPolicy`.\n6. After all features are complete, archive the session with `flow_session_close` using `kind: \"completed\"`.\n\nUse `references/parallel-orchestration.md` for broad read-only discovery, audit, validation, review, verification, or candidate implementation passes. Hidden Flow workers are injected by plugin config; invoke the named worker when it is available. Its `references/parallel-pass-patterns.md`, `references/handoff-format.md`, and `references/verification-gates.md` companions define pass selection, worker contracts, and claim acceptance. The manager owns every `flow_*` state change.\n\nDo not commit, push, amend, rebase, publish, or mutate releases during the\nautonomous Flow loop. Load `flow-commit` only when the user explicitly asks for\ncommit preparation or commit creation.\n\n## Skill Availability\n\nIf `flow_status` returns `setup.skills`, report that setup status and stop\nnative-loading Flow skills in the current OpenCode startup. Missing, incomplete,\nor outdated managed skills require a sync/restart cycle before their native skill\ninstructions can be trusted by the running process. Public command bundles are\nself-contained and may continue when the command prompt already embeds the\nrequired Flow instructions.\n\nIf optional helper skills such as `flow-test`, `flow-deslop`, or\n`flow-ui-quality` are unavailable, continue only with explicit coverage gaps. Do\nnot copy their rubrics into another skill and do not claim their quality checks\nwere completed.\n\n## Runtime Surface\n\n- `flow_status`: read the active session.\n- `flow_plan_save`: create a session and/or save a draft plan.\n- `flow_plan_approve`: lock the draft plan.\n- `flow_run_start`: start one runnable feature.\n- `flow_feature_complete`: record completion or a real blocker with validation and review evidence.\n- `flow_feature_reset`: reset one feature and its dependents.\n- `flow_session_close`: archive the active session as `completed`, `deferred`, or `abandoned`.\n\nThere is no `flow_context`, no separate review-record tool, and no multi-session activation surface. The single active source of truth is `.flow/session.json`; closed sessions are archived under `.flow/history/`.\n\nPlanning and running require loaded Flow tools; do not simulate plan approval or feature completion when the runtime is unavailable. Review may still return advisory output when tools, skills, or references are stale or unavailable, but the manager must not record it as Flow-gated evidence.\n\n## Hard Gates\n\n- Approved plans are immutable. To change direction, reset affected features or close the session and start a new goal.\n- Only one feature can be active at a time.\n- Completion requires at least one passing `validationRun` entry.\n- Non-final completion requires `validationScope: \"targeted\"`.\n- Final completion requires `validationScope: \"broad\"` and a passing `finalReview`.\n- Every completed feature requires a passing `featureReview` with no blocking findings.\n- `flow_session_close` accepts `kind: \"completed\"` only after an approved plan has passed final completion.\n\n## Recovery\n\n- Confused state: call `flow_status` and follow `nextAction`.\n- Wrong assumption or failed implementation path: use `flow_feature_reset` for the feature and dependents, then rerun from the corrected plan.\n- Missing validation or review evidence: gather real evidence, then call `flow_feature_complete`.\n- Approved plan is materially wrong: reset the affected features, save a revised plan if the session is back in planning; otherwise close and start a new goal.\n- Unknown runtime error: read `summary` and `recovery`; see `references/recovery-playbook.md` for common cases.\n\nNever fabricate validation output, backfill review approval you did not perform, or close as `deferred`/`abandoned` merely to avoid an unfinished-work blocker.\n";
536
+ var SKILL_default = "---\nname: flow\ndescription: Manage the end-to-end Flow loop for skills-first OpenCode work. Use when a user asks for Flow-guided delivery from goal to completion, resumable autonomous delivery, or resuming or closing a Flow session. For plan-only work use flow-plan; for executing one approved feature use flow-run.\n---\n\n# Flow\n\nUse Flow as a minimal state ledger, not as a framework. Skills provide judgment; the runtime only records the approved plan, active feature, validation evidence, review evidence, and closure.\n\nRouting: this manager skill owns the whole loop and every state-changing `flow_*` call. Load `flow-plan` alone for plan-only requests and `flow-run` alone when an approved plan needs one feature executed. Answer status-only questions with `flow_status`; no skill load is needed. `flow-test`, `flow-deslop`, and `flow-ui-quality` are optional helpers loaded from inside the loop; `flow-commit` is user-triggered only and never part of the autonomous loop.\n\n## Loop\n\n1. Call `flow_status` first. Trust its active session and next action over conversation memory.\n If the result includes `setup.skills`, follow the Skill Availability rules\n below before loading any Flow skill.\n2. If there is no active session and the user gave a goal, load `flow-plan`, save a plan with `flow_plan_save`, then approve it with `flow_plan_approve` only after explicit user approval or prior authorization for autonomous implementation. If there is no goal, ask for one.\n3. Load `flow-run`, call `flow_run_start`, implement exactly one feature, validate it, and prepare a `flow_feature_complete` payload. For validation-heavy, regression-sensitive, browser QA, route QA, or failure-prone work, use `flow-test` to choose and summarize evidence before completion.\n4. Load `flow-review` for the required feature review. The reviewer reports a `featureReview` payload; the manager records it inside `flow_feature_complete`.\n5. On the final feature, run broad validation and include `finalReview` in the same `flow_feature_complete` call. Its `reviewDepth` must match the plan's `finalReviewPolicy`.\n6. After all features are complete, archive the session with `flow_session_close` using `kind: \"completed\"`.\n\nUse `references/parallel-orchestration.md` for broad read-only discovery, audit, validation, review, verification, or candidate implementation passes. It is the whole pass playbook orient, slice, manifest, fan out, account, verify, synthesize, extend or stop — and its `references/handoff-format.md` companion holds the worker report templates the manager pastes into prompts. Hidden Flow workers are injected by plugin config; invoke the named worker when it is available. The manager owns every `flow_*` state change.\n\nDo not commit, push, amend, rebase, publish, or mutate releases during the\nautonomous Flow loop. Load `flow-commit` only when the user explicitly asks for\ncommit preparation or commit creation.\n\n## Skill Availability\n\nIf `flow_status` returns `setup.skills`, report that setup status and stop\nnative-loading Flow skills in the current OpenCode startup. Missing, incomplete,\nor outdated managed skills require a sync/restart cycle before their native skill\ninstructions can be trusted by the running process. Public command bundles are\nself-contained and may continue when the command prompt already embeds the\nrequired Flow instructions.\n\nIf optional helper skills such as `flow-test`, `flow-deslop`, or\n`flow-ui-quality` are unavailable, continue only with explicit coverage gaps. Do\nnot copy their rubrics into another skill and do not claim their quality checks\nwere completed.\n\n## Runtime Surface\n\n- `flow_status`: read the active session.\n- `flow_plan_save`: create a session and/or save a draft plan.\n- `flow_plan_approve`: lock the draft plan.\n- `flow_run_start`: start one runnable feature.\n- `flow_feature_complete`: record completion or a real blocker with validation and review evidence.\n- `flow_feature_reset`: reset one feature and its dependents.\n- `flow_session_close`: archive the active session as `completed`, `deferred`, or `abandoned`.\n\nThere is no `flow_context`, no separate review-record tool, and no multi-session activation surface. The single active source of truth is `.flow/session.json`; closed sessions are archived under `.flow/history/`.\n\nPlanning and running require loaded Flow tools; do not simulate plan approval or feature completion when the runtime is unavailable. Review may still return advisory output when tools, skills, or references are stale or unavailable, but the manager must not record it as Flow-gated evidence.\n\n## Hard Gates\n\n- Approved plans are immutable. To change direction, reset affected features or close the session and start a new goal.\n- Only one feature can be active at a time.\n- Completion requires at least one passing `validationRun` entry.\n- Non-final completion requires `validationScope: \"targeted\"`.\n- Final completion requires `validationScope: \"broad\"` and a passing `finalReview`.\n- Every completed feature requires a passing `featureReview` with no blocking findings.\n- `flow_session_close` accepts `kind: \"completed\"` only after an approved plan has passed final completion.\n\n## Recovery\n\n- Confused state: call `flow_status` and follow `nextAction`.\n- Wrong assumption or failed implementation path: use `flow_feature_reset` for the feature and dependents, then rerun from the corrected plan.\n- Missing validation or review evidence: gather real evidence, then call `flow_feature_complete`.\n- Approved plan is materially wrong: reset the affected features, save a revised plan if the session is back in planning; otherwise close and start a new goal.\n- Unknown runtime error: read `summary` and `recovery`; see `references/recovery-playbook.md` for common cases.\n\nNever fabricate validation output, backfill review approval you did not perform, or close as `deferred`/`abandoned` merely to avoid an unfinished-work blocker.\n";
641
537
 
642
538
  // skills/flow-commit/SKILL.md
643
539
  var SKILL_default2 = `---
@@ -887,7 +783,7 @@ var parallel_discovery_default = `# Parallel discovery
887
783
  Use this only after a serial orientation pass has identified the repo shape and the likely slices. Workers are read-only evidence gatherers; the planner owns the plan.
888
784
 
889
785
  For broad parallel passes, also load \`../../flow/references/parallel-orchestration.md\`.
890
- Use its pre-fan-out coverage gate and
786
+ Use its pass manifest as the pre-fan-out coverage gate and
891
787
  \`../../flow/references/handoff-format.md\` response shapes.
892
788
 
893
789
  ## Good slices
@@ -908,35 +804,21 @@ config, and docs. Name each slice by the paths it owns, for example "runtime:
908
804
 
909
805
  Treat derived slices as starting points, not a simultaneous coverage map.
910
806
  Before fan-out, choose the relevant entries and de-overlap shared docs,
911
- config, or release surfaces in the coverage gate.
807
+ config, or release surfaces in the pass manifest.
912
808
 
913
- ## Coverage gate
809
+ ## Manifest and prompts
914
810
 
915
- Before spawning workers, state the total discovery scope and one line per slice.
916
- For countable scopes, confirm that slice counts add back to the total and that
917
- there are no overlaps, gaps, or empty slices. If the scope is not countable,
918
- state the completeness rule, such as "all changed files plus callers."
811
+ Write the pass manifest and the worker prompts exactly as Stages 3 and 4 of
812
+ \`../../flow/references/parallel-orchestration.md\` define them: one manifest row
813
+ per slice with expected coverage and a verification tier, and a self-contained
814
+ prompt per worker naming the mode (usually \`evidence\`), the exact slice, and
815
+ the expected coverage. Discovery-specific rules:
919
816
 
920
- ## Worker prompt
921
-
922
- \`\`\`text
923
- Inspect <slice> for <goal>. Read-only. Do not edit files or call
924
- state-changing Flow tools. Return only the Flow handoff in this exact shape:
925
- <matching handoff template copied verbatim from handoff-format.md>
926
- \`\`\`
927
-
928
- For validation-oriented discovery:
929
-
930
- \`\`\`text
931
- Inspect <slice> for validation risk. Read-only. Do not edit files or call
932
- state-changing Flow tools. You may report commands that should be run, and
933
- include raw output only for commands you actually ran. Return only the Flow
934
- handoff in this exact shape:
935
- <matching handoff template copied verbatim from handoff-format.md>
936
- \`\`\`
937
-
938
- Workers cannot read reference files themselves; paste the matching handoff
939
- template from \`../../flow/references/handoff-format.md\` into the prompt.
817
+ - Workers are read-only. For validation-oriented discovery, workers may report
818
+ commands that should be run, and include raw output only for commands they
819
+ actually ran.
820
+ - Workers cannot read reference files themselves; paste the matching handoff
821
+ template from \`../../flow/references/handoff-format.md\` into the prompt.
940
822
 
941
823
  ## Synthesis
942
824
 
@@ -950,8 +832,8 @@ Convert only evidence-backed work into plan fields:
950
832
  If workers disagree, inspect the source artifact yourself. If a candidate finding lacks a concrete citation or refutation pass, make it a review-first deliverable rather than a fix feature.
951
833
 
952
834
  Apply the manager synthesis barrier from
953
- \`../../flow/references/verification-gates.md\`: only distilled, evidence-backed
954
- claims become plan fields.
835
+ \`../../flow/references/parallel-orchestration.md\`: only distilled,
836
+ evidence-backed claims become plan fields.
955
837
  `;
956
838
 
957
839
  // skills/flow-plan/references/planning-examples.md
@@ -1045,7 +927,7 @@ Better plan:
1045
927
  // skills/flow-plan/SKILL.md
1046
928
  var SKILL_default4 = `---
1047
929
  name: flow-plan
1048
- description: "Plan Flow work for the v4 skills-first runtime: inspect the repo, decompose a user goal into right-sized features, save a draft with flow_plan_save, and approve it with flow_plan_approve."
930
+ description: "Use when Flow work needs planning before implementation: a new goal to turn into an approved Flow feature plan, a draft plan to revise, or a decomposition or plan-approval decision in the v4 skills-first runtime. For executing an approved feature use flow-run; for the full goal-to-completion loop use flow."
1049
931
  ---
1050
932
 
1051
933
  # Flow Plan
@@ -1057,7 +939,7 @@ If \`flow_plan_save\` or \`flow_plan_approve\` is unavailable, stop and tell the
1057
939
  ## Inspect first
1058
940
 
1059
941
  - Read the files, docs, tests, package scripts, and local conventions that determine the work.
1060
- - For broad discovery, read \`references/parallel-discovery.md\` after a serial orientation pass. Use \`../flow/references/parallel-orchestration.md\` when discovery needs multiple workers, and apply its coverage gate before fan-out.
942
+ - For broad discovery, read \`references/parallel-discovery.md\` after a serial orientation pass. Use \`../flow/references/parallel-orchestration.md\` when discovery needs multiple workers, and write its pass manifest before fan-out.
1061
943
  - Helper rule: when a named helper skill is unavailable, record a planning gap
1062
944
  and keep the corresponding claims conservative instead of simulating its
1063
945
  checks.
@@ -1067,6 +949,25 @@ If \`flow_plan_save\` or \`flow_plan_approve\` is unavailable, stop and tell the
1067
949
  - For UI/frontend goals, load \`flow-ui-quality\`.
1068
950
  - Do not invent findings. Broad "review and fix" goals start with a review-first feature whose deliverable is evidence-backed findings.
1069
951
 
952
+ ## Reduce uncertainty before decomposing
953
+
954
+ A vague goal does not slice into reliable features yet. Name what is uncertain,
955
+ because the two kinds resolve differently:
956
+
957
+ - **Specification uncertainty** — what the user wants: ambiguous goal, missing
958
+ acceptance criteria, unstated constraints. Resolve by stating an explicit
959
+ assumption in \`decisions\` and proceeding, or by asking only when a wrong
960
+ guess would be expensive to undo.
961
+ - **Environment uncertainty** — facts the repo, docs, commands, or data can
962
+ answer: code shape, schema, API behavior, current conventions. Resolve by
963
+ inspecting or by a discovery pass, never by asking the user.
964
+
965
+ Spend the cheapest probe that removes the most uncertainty first: local reads
966
+ before worker fan-out, fan-out before user questions. Decompose into features
967
+ only once the remaining uncertainty is low enough that \`targets\` and
968
+ \`validation\` can be stated concretely; otherwise the first feature is a
969
+ review-first or discovery deliverable that produces the missing evidence.
970
+
1070
971
  ## Plan shape
1071
972
 
1072
973
  Call \`flow_plan_save\` with:
@@ -1208,7 +1109,7 @@ Approve only on evidence actually inspected. A review is a claim of coverage, no
1208
1109
  // skills/flow-review/SKILL.md
1209
1110
  var SKILL_default5 = `---
1210
1111
  name: flow-review
1211
- description: "Review Flow work in the v4 runtime: inspect feature or final-session changes, classify findings, and return featureReview or finalReview payloads for flow_feature_complete."
1112
+ description: "Use when Flow work needs a review verdict in the v4 runtime: a completed feature awaiting its featureReview, a final session review, or an assigned review slice. Validation evidence gathering stays in flow-test; cleanup judgment stays in flow-deslop."
1212
1113
  ---
1213
1114
 
1214
1115
  # Flow Review
@@ -1287,8 +1188,12 @@ Use \`status: "failed"\` when any blocking finding remains. Advisory findings ma
1287
1188
  \`../flow/references/parallel-orchestration.md\` for read-only slices by
1288
1189
  changed-file group, risk lens, or validation surface. Use the named review,
1289
1190
  audit, evidence, or validation agents from that reference instead of generic
1290
- subagents. Apply its handoff format and verification gates; only the manager
1291
- returns the final \`featureReview\` or \`finalReview\` payload. The hidden
1191
+ subagents. Write its pass manifest before fan-out and apply its Stage 6
1192
+ handoff acceptance and verification tiers; only the manager
1193
+ returns the final \`featureReview\` or \`finalReview\` payload. If that reference
1194
+ is unavailable in the current context (for example in a bundled public Flow
1195
+ command that does not include it), review serially and record the skipped
1196
+ fan-out as a coverage gap instead of improvising worker contracts. The hidden
1292
1197
  reviewer cannot spawn workers; it reviews its assigned scope directly and
1293
1198
  reports coverage gaps for the rest.
1294
1199
 
@@ -1370,7 +1275,7 @@ Use the strongest practical tier. For risky work, combine tiers.
1370
1275
  - Each \`validationRun\` entry has \`command\`, \`status\`, and \`summary\`.
1371
1276
  - Completion accepts only passing entries. Failed or skipped checks belong in the summary/notes and must be resolved or explained as blockers.
1372
1277
  - Do not claim a command was run unless it was run in this session or directly reported by a trusted worker with raw output.
1373
- - Worker-reported command output must satisfy \`../../flow/references/verification-gates.md\`: exact command, status, raw outcome summary, coverage, and manager acceptance.
1278
+ - Worker-reported command output must satisfy the verification stage of \`../../flow/references/parallel-orchestration.md\`: exact command, status, raw outcome summary, coverage, and manager acceptance.
1374
1279
  - Include scope in the summary: what behavior, files, routes, or states the check covered.
1375
1280
  - UI work should include browser or screenshot evidence when the app can run locally.
1376
1281
  - Cleanup/refactor work should show behavior preservation, not only formatting success.
@@ -1414,7 +1319,7 @@ Never trim failing output, relabel a failed command as passed, or use "not run"
1414
1319
  // skills/flow-run/SKILL.md
1415
1320
  var SKILL_default6 = `---
1416
1321
  name: flow-run
1417
- description: "Execute one approved Flow feature in the v4 runtime: start a feature with flow_run_start, make scoped changes, gather real validation evidence, obtain review payloads, and complete with flow_feature_complete."
1322
+ description: "Use when an approved Flow plan has a feature to implement, validate, or complete in the v4 runtime, and the work is scoped to one active feature. For planning a goal first use flow-plan; for the full goal-to-completion loop or resuming a session use flow."
1418
1323
  ---
1419
1324
 
1420
1325
  # Flow Run
@@ -1459,7 +1364,9 @@ If \`flow_run_start\` is unavailable, stop and tell the user to check that \`ope
1459
1364
  For broad validation research, risky changes, or unclear coverage, use
1460
1365
  \`../flow/references/parallel-orchestration.md\` to fan out named Flow workers.
1461
1366
  Use the mode-to-agent mapping in that reference instead of generic subagents.
1462
- Workers must use the handoff format and verification gates from that reference.
1367
+ Write its pass manifest before fan-out, paste the matching handoff template
1368
+ from \`../flow/references/handoff-format.md\` into every worker prompt, and
1369
+ apply its verification tiers to the handoffs that come back.
1463
1370
  They may report command output they actually ran or propose focused checks; the
1464
1371
  manager decides what is strong enough to record.
1465
1372
 
@@ -1785,10 +1692,6 @@ var FLOW_SKILL_DEFINITIONS = [
1785
1692
  relativePath: "references/parallel-orchestration.md",
1786
1693
  content: parallel_orchestration_default
1787
1694
  },
1788
- {
1789
- relativePath: "references/parallel-pass-patterns.md",
1790
- content: parallel_pass_patterns_default
1791
- },
1792
1695
  {
1793
1696
  relativePath: "references/parallel-pass-example.md",
1794
1697
  content: parallel_pass_example_default
@@ -1796,10 +1699,6 @@ var FLOW_SKILL_DEFINITIONS = [
1796
1699
  {
1797
1700
  relativePath: "references/handoff-format.md",
1798
1701
  content: handoff_format_default
1799
- },
1800
- {
1801
- relativePath: "references/verification-gates.md",
1802
- content: verification_gates_default
1803
1702
  }
1804
1703
  ]
1805
1704
  },
@@ -1905,18 +1804,14 @@ var FLOW_PLAN_BUNDLED_INSTRUCTIONS = bundledFlowInstructions([
1905
1804
  ["flow-plan", "references/planning-examples.md"],
1906
1805
  ["flow-plan", "references/parallel-discovery.md"],
1907
1806
  ["flow", "references/parallel-orchestration.md"],
1908
- ["flow", "references/parallel-pass-patterns.md"],
1909
- ["flow", "references/handoff-format.md"],
1910
- ["flow", "references/verification-gates.md"]
1807
+ ["flow", "references/handoff-format.md"]
1911
1808
  ]);
1912
1809
  var FLOW_RUN_BUNDLED_INSTRUCTIONS = bundledFlowInstructions([
1913
1810
  ["flow-run", "SKILL.md"],
1914
1811
  ["flow-run", "references/validation-rubric.md"],
1915
1812
  ["flow-run", "references/audit-rubric.md"],
1916
1813
  ["flow", "references/parallel-orchestration.md"],
1917
- ["flow", "references/parallel-pass-patterns.md"],
1918
1814
  ["flow", "references/handoff-format.md"],
1919
- ["flow", "references/verification-gates.md"],
1920
1815
  ["flow-review", "SKILL.md"],
1921
1816
  ["flow-review", "references/review-rubric.md"]
1922
1817
  ]);
@@ -1924,9 +1819,7 @@ var FLOW_AUTO_BUNDLED_INSTRUCTIONS = bundledFlowInstructions([
1924
1819
  ["flow", "SKILL.md"],
1925
1820
  ["flow", "references/recovery-playbook.md"],
1926
1821
  ["flow", "references/parallel-orchestration.md"],
1927
- ["flow", "references/parallel-pass-patterns.md"],
1928
1822
  ["flow", "references/handoff-format.md"],
1929
- ["flow", "references/verification-gates.md"],
1930
1823
  ["flow-plan", "SKILL.md"],
1931
1824
  ["flow-plan", "references/planning-examples.md"],
1932
1825
  ["flow-plan", "references/parallel-discovery.md"],
@@ -3803,4 +3696,4 @@ export {
3803
3696
  plugin_default as default
3804
3697
  };
3805
3698
 
3806
- //# debugId=EA3C77088C11C2C264756E2164756E21
3699
+ //# debugId=611F19C0C11F22C064756E2164756E21