opencode-plugin-flow 4.2.0 → 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/cli.js CHANGED
@@ -84,7 +84,7 @@ Example evidence quality:
84
84
 
85
85
  Use this for \`flow-verifier-worker\`. Give it atomic claims and the cited sources
86
86
  or commands. Do not include the generator's reasoning unless that reasoning is
87
- the thing being verified.
87
+ the thing being verified, and do not say which worker produced the claim.
88
88
 
89
89
  \`\`\`markdown
90
90
  ## Status
@@ -113,8 +113,8 @@ success | partial | blocked
113
113
 
114
114
  ## Candidate implementation worker report
115
115
 
116
- Use this only for isolated worktrees or exact non-overlapping path ownership
117
- authorized by the manager.
116
+ Use this only with explicit user authorization, in an isolated worktree or an
117
+ exact non-overlapping path-owned slice assigned by the manager.
118
118
 
119
119
  \`\`\`markdown
120
120
  ## Status
@@ -159,76 +159,60 @@ evidence faster than one linear pass. The manager still owns the Flow session:
159
159
  only the manager calls state-changing Flow tools, approves plans, completes
160
160
  features, records reviews, or closes sessions.
161
161
 
162
- Sections: quick path, operational defaults, manager sequence, modes, permission
163
- contract, worker rules, prompt contract, handoff location, and follow-up passes.
164
-
165
- Read these companion references before a broad parallel pass:
166
-
167
- - \`parallel-pass-patterns.md\` for pass selection, effort defaults, and stop or
168
- follow-up rules.
169
- - \`handoff-format.md\` for the exact worker response shapes.
170
- - \`verification-gates.md\` for the pre-fan-out coverage gate, handoff
171
- acceptance, verifier triggers, and the manager synthesis barrier. Those
172
- definitions are canonical; this file only points at them.
173
- - \`parallel-pass-example.md\` for a concrete end-to-end pass after the rules
174
- below are clear (synced with the \`flow\` skill; not bundled into commands).
175
-
176
- ## Quick path
177
-
178
- 1. Orient serially and keep the immediate blocker local.
179
- 2. Fan out only when two to five non-overlapping slices reduce known
180
- uncertainty.
181
- 3. Write a coverage gate before spawning workers: total scope, exact slices,
182
- expected counts, and overlap/gap check.
183
- 4. Give each worker a named mode, exact slice, expected coverage, and the
184
- required handoff shape.
185
- 5. Accept only scoped, evidenced, confidence-labeled claims; verify important
186
- weak, contested, or single-source claims.
187
- 6. Synthesize one manager-owned artifact. Raw handoffs do not become the answer,
188
- Flow payload, or patch decision.
189
-
190
- ## Operational defaults
191
-
192
- - Prefer serial work when the scope is small, tightly coupled, or blocked by one
193
- decision that must be made before slices are meaningful.
194
- - A normal first pass is two to five workers with independent slices. Use more
195
- only when the coverage gate is countable and the slices remain non-overlapping.
196
- - Run at most one routine follow-up pass. Extra passes need an explicit manager
197
- reason, such as a high-stakes verifier check or a newly discovered bounded
198
- slice.
199
- - Do not fan out just to keep agents busy. Every worker should reduce a known
200
- planning, validation, review, audit, or implementation uncertainty.
201
-
202
- Skip fan-out when:
203
-
204
- - one file, command, or design question determines the next step.
205
- - slices would share the same contracts, fixtures, or edit targets.
206
- - the manager can inspect the full scope faster than writing and checking
162
+ Every parallel pass runs the same loop:
163
+
164
+ **orient → slice → manifest → fan out → account → verify → synthesize →
165
+ extend or stop.**
166
+
167
+ This file is the whole playbook; read it once and run the pass. Two companions
168
+ stay separate:
169
+
170
+ - \`handoff-format.md\` holds the worker response templates. The manager pastes
171
+ the matching template verbatim into every worker prompt.
172
+ - \`parallel-pass-example.md\` walks one concrete end-to-end pass (synced with
173
+ the \`flow\` skill; not bundled into commands).
174
+
175
+ ## Choose a pass
176
+
177
+ | Situation | Flow pass | Output the manager may synthesize |
178
+ | --- | --- | --- |
179
+ | Repo shape is unclear before planning | Discovery pass | Requirements, decisions, targets, validation entries, or a review-first feature |
180
+ | A broad finding set needs refutation | Audit pass | Surviving findings with guards checked and gaps named |
181
+ | Changed files or risk lenses are too broad for one review pass | Review pass | One \`featureReview\` or \`finalReview\` payload owned by the manager |
182
+ | Test strategy or route coverage is unclear | Validation pass | Candidate commands or authorized raw command evidence |
183
+ | A claim is single-source, surprising, high-stakes, or payload-bound | Verification pass | Per-claim keep, narrow, rewrite, or remove decisions |
184
+ | Multiple implementation paths are plausible | Candidate pass | Candidate patches inspected and validated by the manager before use |
185
+
186
+ Pass notes:
187
+
188
+ - **Discovery**: workers read specific modules, routes, docs, commands, or risk
189
+ lenses; only evidenced claims become plan fields.
190
+ - **Audit**: workers actively look for guards, lifecycle resets, deployment
191
+ constraints, and counterexamples before reporting a finding. A finding
192
+ without refutation work stays advisory or becomes a follow-up question.
193
+ - **Review**: workers separate blocking findings from advisory notes; the
194
+ manager resolves conflicts and returns one review payload.
195
+ - **Validation**: workers run only manager-authorized commands and report the
196
+ exact command, status, and raw outcome summary.
197
+ - **Verification**: verifiers judge atomic claims against cited sources or
198
+ commands; do not ask a verifier to redesign the work or review the whole
199
+ feature.
200
+ - **Candidate**: only with explicit user authorization plus isolated worktrees
201
+ or exact non-overlapping path ownership. Patches stay proposals until the
202
+ manager inspects, merges or rejects, and validates.
203
+
204
+ ## When to stay serial
205
+
206
+ - One file, command, or design question determines the next step.
207
+ - Slices would share the same contracts, fixtures, or edit targets.
208
+ - The manager can inspect the full scope faster than writing and checking
207
209
  worker prompts.
208
- - the result would still need the same manual synthesis with no time saved.
209
-
210
- ## Manager sequence
211
-
212
- 1. Call \`flow_status\` if a Flow session may already exist.
213
- 2. Do a serial orientation pass. Read enough files, schemas, docs, tests,
214
- commands, or artifacts to identify real slices.
215
- 3. Define the local manager task. Do not delegate the immediate blocker that
216
- determines whether fan-out is even valid.
217
- 4. Build the pre-fan-out coverage gate defined in \`verification-gates.md\`
218
- ("Before fan-out"): total scope, one line per slice with expected count,
219
- partition check, and overlap/gap check.
220
- 5. Spawn only named Flow workers. Use exact slices and the required handoff
221
- shape. Keep each prompt self-contained.
222
- 6. Continue non-overlapping manager work while workers run.
223
- 7. Read every handoff. Keep only claims that have evidence, match the assigned
224
- scope, and carry confidence labels.
225
- 8. Send important low-confidence, single-source, contested, or citation-heavy
226
- claims to \`flow-verifier-worker\`.
227
- 9. Run follow-up passes only for material gaps, conflicts, narrowed scope, or
228
- verification needs.
229
- 10. Apply the manager synthesis barrier from \`verification-gates.md\`: keep
230
- only distilled, evidence-backed claims and synthesize one Flow artifact.
231
- Do not paste worker handoffs as the user-facing result.
210
+ - The result would still need the same manual synthesis with no time saved.
211
+
212
+ Do not fan out to keep agents busy. Every worker should reduce a named
213
+ planning, validation, review, audit, or implementation uncertainty. A normal
214
+ first pass is two to five workers with independent slices; use more only when
215
+ the manifest stays countable and non-overlapping.
232
216
 
233
217
  ## Modes
234
218
 
@@ -246,20 +230,10 @@ carry the permission boundaries for each mode.
246
230
  | \`verifier\` | \`flow-verifier-worker\` | Per-claim verdicts against cited evidence or commands | No | \`flow_status\` only if needed |
247
231
  | \`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 |
248
232
 
249
- Mode examples:
250
-
251
- - Use \`flow-evidence-worker\` when the repo shape is unclear and the output will
252
- become plan requirements, decisions, targets, or validation entries.
253
- - Use \`flow-reviewer\` when changed files or risk lenses can be reviewed
254
- independently before the manager returns one review payload.
255
- - Use \`flow-validation-worker\` when the manager needs command options or raw
256
- output from an explicitly authorized command.
257
- - Use \`flow-audit-worker\` when candidate findings must be refuted before they
258
- can become a report or follow-up feature.
259
- - Use \`flow-verifier-worker\` for atomic claims that are contested,
260
- single-sourced, high-stakes, or destined for a Flow payload.
261
- - Use \`flow-candidate-worker\` only after explicit user authorization and only
262
- with an isolated worktree or exact non-overlapping path ownership.
233
+ If the runtime exposes per-worker model or effort choices, spend them where
234
+ being wrong is expensive: read-heavy discovery slices tolerate the cheapest
235
+ configured option, while verifier and review slices deserve the strongest.
236
+ Otherwise route by scope: give weaker slices narrower, more countable scope.
263
237
 
264
238
  ## Permission contract
265
239
 
@@ -281,27 +255,56 @@ Do not fan out parallel \`flow_plan_save\`, \`flow_plan_approve\`,
281
255
  \`flow_session_close\` calls. Runtime locking protects files, but Flow accepts only
282
256
  one active feature result at a time.
283
257
 
284
- ## Worker rules
285
-
286
258
  Workers may read files, inspect docs, run authorized read-only commands, and
287
259
  summarize evidence. Candidate implementation workers may edit only when the
288
260
  manager assigned an isolated worktree or exact path ownership that does not
289
- overlap sibling workers or manager edits.
261
+ overlap sibling workers or manager edits. Workers must not edit \`.flow/**\`,
262
+ must not call state-changing Flow tools, and must not approve work, close
263
+ sessions, record Flow validation, or claim validation they did not run. A
264
+ worker may report raw validation output it actually ran; the manager decides
265
+ whether it is strong enough to record.
266
+
267
+ ## Stage 1 — Orient (serial)
268
+
269
+ Call \`flow_status\` if a Flow session may already exist. Read enough files,
270
+ schemas, docs, tests, commands, or artifacts to identify real slices. Keep the
271
+ immediate blocker local: do not delegate the question that determines whether
272
+ fan-out is even valid.
273
+
274
+ ## Stage 2 — Slice
275
+
276
+ Split along whichever axis keeps slices independent: modules or path sets,
277
+ route or endpoint groups, risk lenses, command surfaces, data ranges, or claim
278
+ sets. Each slice needs a one-line scope, expected coverage, and a defined
279
+ output the manager can check.
290
280
 
291
- Workers must not edit \`.flow/**\` and must not call:
281
+ ## Stage 3 Manifest (the pre-fan-out coverage gate)
292
282
 
293
- - \`flow_plan_save\`
294
- - \`flow_plan_approve\`
295
- - \`flow_run_start\`
296
- - \`flow_feature_complete\`
297
- - \`flow_feature_reset\`
298
- - \`flow_session_close\`
283
+ Before spawning, write a pass manifest: one row per slice, plus a totals check.
299
284
 
300
- Workers also must not approve work, close sessions, record Flow validation, or
301
- claim validation they did not run. A worker may report raw validation output it
302
- actually ran; the manager decides whether it is strong enough to record.
285
+ | # | Slice scope | Expected coverage | Mode | Verification tier |
286
+ | --- | --- | --- | --- | --- |
287
+ | 1 | \`src/core/**\` plus its tests | 14 files | \`evidence\` | accept locally |
288
+ | 2 | release contract: CI workflows, \`package.json\`, changelog | 6 files | \`evidence\` | verify once |
289
+
290
+ - Count the total work items when countable: files, modules, routes, commands,
291
+ rows, findings, screenshots, or claims. Confirm slice counts add back to the
292
+ total, with no overlaps, gaps, empty slices, or ambiguous shared contracts.
293
+ - If the scope cannot be counted, state the completeness rule instead, such as
294
+ "all changed files plus callers" or "all public commands plus release docs."
295
+ - Assign each slice's verification tier now (see Stage 6). Deciding where a
296
+ wrong claim is expensive belongs before handoffs arrive, not after.
297
+ - Fix the slice map centrally before spawning if the gate does not reconcile.
303
298
 
304
- ## Prompt contract
299
+ The manifest is also the accounting contract for the pass: N rows spawned means
300
+ N handoffs collected and checked in Stage 5 before anything is synthesized.
301
+
302
+ Write the manifest where it survives the pass: the conversation is enough for a
303
+ single bounded pass, but when a follow-up pass or a session resume is
304
+ plausible, persist it with the synthesis (Stage 7) so the accounting can be
305
+ reconstructed.
306
+
307
+ ## Stage 4 — Fan out
305
308
 
306
309
  Every worker prompt includes:
307
310
 
@@ -318,43 +321,139 @@ Return only the Flow handoff in this exact shape:
318
321
 
319
322
  Hidden workers cannot load skills or read \`handoff-format.md\` themselves. The
320
323
  manager copies the matching handoff template into every worker prompt; a bare
321
- filename reference is not enough.
324
+ filename reference is not enough. Workers also cannot read the conversation, so
325
+ prompts cite file paths — including any synthesis file from an earlier pass —
326
+ instead of restating chat history.
322
327
 
323
328
  For research or current-doc slices, require source checks for versioned or
324
329
  time-sensitive facts. For implementation candidates, remind workers that other
325
330
  work may be active and that they must not revert unrelated changes.
326
331
 
327
- ## Where handoffs go
332
+ Continue non-overlapping manager work while workers run.
333
+
334
+ ## Stage 5 — Account
335
+
336
+ Check every manifest row off against a returned handoff before synthesis. A
337
+ worker that never returns, errors out, or reports \`partial\` or \`blocked\` is a
338
+ hole in the pass, and synthesizing around it silently drops a slice.
339
+
340
+ Worker failure ladder:
341
+
342
+ 1. Re-spawn once with a narrower slice and a note about what the first attempt
343
+ returned.
344
+ 2. If it fails again, cover the slice directly in the manager session.
345
+ 3. If it stays blocked, carry the slice into the synthesis explicitly as
346
+ not-covered. Never present results as if coverage were complete.
347
+
348
+ ## Stage 6 — Verify
349
+
350
+ \`Status: success\` only says the worker believes its slice is done. Accept a
351
+ handoff only after a cheap manager-side pass:
352
+
353
+ - \`Status\` is present and terminal: \`success\`, \`partial\`, or \`blocked\`.
354
+ - Coverage matches the assigned slice, or skips are explicit.
355
+ - Important claims have concrete evidence and confidence tags.
356
+ - Cited paths, commands, screenshots, URLs, or metrics resolve.
357
+ - The evidence supports the claim, not just the topic.
358
+ - Findings stay inside the worker's slice.
359
+ - Headline counts can be recounted or traced.
360
+ - Contradictions between workers are either resolved or explicitly marked as
361
+ contested.
362
+
363
+ Demote, drop, re-task, or verify claims that fail this pass.
364
+
365
+ ### Verification tiers
366
+
367
+ One taxonomy decides how much verification a claim gets: the manifest assigns
368
+ a default tier per slice, and this stage applies it per claim. Use the cheapest
369
+ check that matches the risk:
370
+
371
+ - **Accept locally**: low-risk claims with direct evidence that the manager can
372
+ cheaply inspect or recount.
373
+ - **Verify once** with \`flow-verifier-worker\`: single-source, surprising,
374
+ inferred, low-confidence, citation-heavy, contested, or Flow-payload-bound
375
+ claims, including any count, benchmark, command result, or pass/fail claim a
376
+ Flow payload will rely on.
377
+ - **Verify strongly**: blocking or release-sensitive claims and claims that
378
+ affect user data, security, persistence, permissions, public API behavior,
379
+ release behavior, or data loss. Use independent verifier checks, manager-run
380
+ commands, or direct artifact inspection strong enough to settle the claim.
381
+ - **Do not accept**: claims without concrete evidence, claims outside the
382
+ assigned slice, claims contradicted by inspected artifacts, or claims where
383
+ the cited evidence supports only the topic rather than the assertion.
384
+
385
+ Verifier prompts use stable claim ids, one atomic assertion per id, the cited
386
+ source or command for each id, and the exact acceptance question. Do not
387
+ include the generator's reasoning unless that reasoning is the thing being
388
+ verified, do not say which worker produced the claim, and do not ask a
389
+ verifier to redesign the work or review the whole feature.
390
+
391
+ ## Stage 7 — Synthesize
392
+
393
+ Apply the manager synthesis barrier before presenting or recording anything:
394
+
395
+ - Preserve confidence: verified, single-sourced, inferred, and unresolved claims
396
+ stay distinct when it matters.
397
+ - When workers disagree, inspect the cited artifact or rerun the cited command
398
+ instead of arbitrating from summaries. Do not average conflicting claims.
399
+ - Run the strongest practical local check for the deliverable.
400
+ - Re-read critical files or docs that will be cited in the final decision.
401
+ - Move only distilled, evidence-backed claims forward; raw handoffs remain
402
+ candidate evidence, not a plan, review, completion payload, or final answer.
403
+ - Record gaps honestly instead of converting missing evidence into success
404
+ language.
405
+
406
+ Where accepted evidence goes:
328
407
 
329
408
  - Planning evidence becomes \`requirements\`, \`decisions\`, feature \`targets\`,
330
- feature \`validation\`, or plan notes in prose fields.
331
- - Execution evidence informs the active feature, but \`flow_feature_complete\` is
332
- manager-owned.
333
- - Validation evidence may become \`validationRun\` only when the command, status,
334
- and raw outcome are concrete enough to trust.
335
- - Review evidence informs \`featureReview\` or \`finalReview\`, but the manager owns
336
- the pass/fail verdict.
337
- - Audit evidence becomes findings only after refutation and verification rules
338
- in \`verification-gates.md\`.
339
- - Candidate patches are inspected, merged, and validated by the manager before
340
- any Flow completion call.
341
-
342
- When worker results conflict, inspect the underlying artifact directly and rerun
343
- the smallest check that can settle the disagreement. The manager synthesis
344
- barrier in \`verification-gates.md\` applies before anything moves forward.
345
-
346
- ## Follow-up passes
347
-
348
- Start a follow-up pass when first-pass handoffs reveal:
349
-
350
- - missing coverage in the original slice map.
351
- - conflicting findings that matter to the Flow decision.
352
- - a specialized follow-up that was intentionally out of scope.
353
- - high-stakes, low-confidence, or single-source claims needing verification.
354
- - bounded implementation candidates after research converges.
355
-
356
- Do not recurse by default. If a worker says it needs another worker, the manager
357
- decides whether that is a follow-up pass and writes the next bounded prompt.
409
+ feature \`validation\`, or plan notes only when the source and scope are
410
+ clear. Unverified broad findings become a review-first feature, not a fix
411
+ plan.
412
+ - Validation evidence may become \`validationRun\` only when the worker was
413
+ explicitly authorized to run the command and reported the exact command,
414
+ status, and raw outcome summary.
415
+ - Review evidence informs \`featureReview\` or \`finalReview\`, but the manager
416
+ owns the pass/fail verdict and must resolve blockers, contradictions, and
417
+ coverage gaps before returning the payload.
418
+ - Audit evidence becomes findings only after refutation; blocking findings need
419
+ guards checked, deployment context, and evidence that the current code
420
+ exhibits the behavior.
421
+ - Candidate patches are not Flow evidence until the manager inspects, merges or
422
+ rejects them, and validates the main Flow-managed workspace.
423
+
424
+ Persist the manifest and the synthesis when another pass may follow or the
425
+ session is long enough to be compacted or resumed: write the distilled result —
426
+ the accounted manifest, accepted claims with evidence and confidence, dropped
427
+ claims with one-line reasons, and open gaps — into plan prose fields or a
428
+ manager-owned scratch file outside both \`.flow/**\` and the repository worktree,
429
+ such as a file in the OS temporary directory. The runtime owns the \`.flow/**\`
430
+ layout, and scratch files left in the worktree end up staged or reviewed as if
431
+ they were project changes. Follow-up worker prompts cite that path; files are
432
+ the only shared memory between passes.
433
+
434
+ ## Stage 8 — Extend or stop
435
+
436
+ Stop after a pass when:
437
+
438
+ - the manifest's coverage rule is satisfied and every row is accounted for.
439
+ - accepted claims are evidenced, scoped, and confidence-labeled.
440
+ - material single-source, contested, high-stakes, or payload-bound claims have
441
+ been verified or downgraded.
442
+ - remaining gaps are explicit and do not block the Flow artifact being produced.
443
+
444
+ Start a bounded follow-up pass only when:
445
+
446
+ - the original slice map missed material scope.
447
+ - workers disagree on a claim that affects the Flow decision.
448
+ - a high-stakes or payload-bound claim needs verification.
449
+ - a first pass exposes a narrower implementation or validation slice worth
450
+ isolating.
451
+
452
+ Run at most one routine follow-up pass. Extra passes need an explicit manager
453
+ reason, such as a high-stakes verifier check or a newly discovered bounded
454
+ slice. Do not recurse by default: if a worker says it needs another worker, the
455
+ manager decides whether that is a follow-up pass and writes the next bounded
456
+ prompt, starting again from the manifest.
358
457
  `;
359
458
 
360
459
  // skills/flow/references/parallel-pass-example.md
@@ -372,11 +471,14 @@ twelve API route modules, one shared error middleware, and an integration test
372
471
  directory. The manager keeps the middleware local because it is one file and
373
472
  anchors every other judgment.
374
473
 
375
- Coverage gate: twelve countable route modules remain after the local check.
474
+ Pass manifest: twelve countable route modules remain after the local check, and
475
+ 4 + 3 + 5 adds back to 12 with no overlaps or gaps.
376
476
 
377
- - Slice A: auth and account routes, expected 4/12.
378
- - Slice B: billing and subscription routes, expected 3/12.
379
- - Slice C: remaining content and admin routes, expected 5/12.
477
+ | # | Slice scope | Expected coverage | Mode | Verification tier |
478
+ | --- | --- | --- | --- | --- |
479
+ | A | auth and account routes | 4/12 modules | \`evidence\` | accept locally |
480
+ | B | billing and subscription routes | 3/12 modules | \`review\` | verify once |
481
+ | C | remaining content and admin routes | 5/12 modules | \`audit\` | verify once |
380
482
 
381
483
  Worker prompts:
382
484
 
@@ -413,6 +515,11 @@ Return only the Flow handoff in this exact shape:
413
515
  <matching handoff template copied verbatim from handoff-format.md>
414
516
  \`\`\`
415
517
 
518
+ Accounting: three manifest rows spawned means three handoffs collected before
519
+ synthesis. If slice B returned \`partial\`, the manager would re-spawn it once
520
+ with a narrower scope, then cover it directly, and as a last resort carry it
521
+ into the synthesis explicitly as not-covered.
522
+
416
523
  Handoff checks: the manager accepts only reports with terminal status, matching
417
524
  coverage counts, concrete file:line evidence, confidence tags, and claims inside
418
525
  the assigned slice. A claim such as \`[high] billing routes bypass the error
@@ -431,295 +538,11 @@ a plan decision, review payload, or docs patch. Raw handoffs and unverified
431
538
  suggestions do not move into the next pass or user-facing answer.
432
539
  `;
433
540
 
434
- // skills/flow/references/parallel-pass-patterns.md
435
- var parallel_pass_patterns_default = `# Parallel pass patterns
436
-
437
- Flow uses parallel workers to reduce uncertainty, not to delegate decisions.
438
- Each pass has a bounded purpose, an explicit coverage rule, and one
439
- manager-owned synthesis result.
440
-
441
- ## Choose a pass
442
-
443
- | Situation | Flow pass | Output the manager may synthesize |
444
- | --- | --- | --- |
445
- | Repo shape is unclear before planning | Discovery pass | Requirements, decisions, targets, validation entries, or a review-first feature |
446
- | A broad finding set needs refutation | Audit pass | Surviving findings with guards checked and gaps named |
447
- | Changed files or risk lenses are too broad for one review pass | Review pass | One \`featureReview\` or \`finalReview\` payload owned by the manager |
448
- | Test strategy or route coverage is unclear | Validation pass | Candidate commands or authorized raw command evidence |
449
- | A claim is single-source, surprising, high-stakes, or payload-bound | Verification pass | Per-claim keep, narrow, rewrite, or remove decisions |
450
- | Multiple implementation paths are plausible | Candidate pass | Candidate patches inspected and validated by the manager before use |
451
-
452
- Prefer serial work when one file, command, or design question determines the
453
- next step. A parallel pass should reduce a named planning, validation, review,
454
- audit, or implementation uncertainty.
455
-
456
- ## Pass Shapes
457
-
458
- ### Discovery pass
459
-
460
- Use before planning when the manager has oriented enough to name disjoint slices
461
- but not enough to write reliable plan fields. Workers read specific modules,
462
- routes, docs, commands, or risk lenses. The manager turns only evidenced claims
463
- into plan fields.
464
-
465
- ### Audit pass
466
-
467
- Use when a report starts from candidate findings. Workers actively look for
468
- guards, lifecycle resets, deployment constraints, and counterexamples before
469
- reporting a finding. A finding that lacks refutation work stays advisory or
470
- becomes a follow-up question.
471
-
472
- ### Review pass
473
-
474
- Use when changed files or risks can be reviewed independently. Review workers
475
- separate blocking findings from advisory notes. The manager resolves conflicts,
476
- checks cited artifacts, and returns one review payload.
477
-
478
- ### Validation pass
479
-
480
- Use when coverage is unclear or command evidence can be gathered independently.
481
- Validation workers may run only manager-authorized commands and must report
482
- exact command, status, raw outcome summary, coverage, confidence, and gaps.
483
-
484
- ### Verification pass
485
-
486
- Use for atomic claims. Give the verifier claim ids, cited sources or commands,
487
- and the acceptance question. Do not ask a verifier to redesign the work or
488
- review the whole feature.
489
-
490
- ### Candidate pass
491
-
492
- Use only with explicit user authorization plus isolated worktrees or exact
493
- non-overlapping path ownership. Candidate patches are proposals until the
494
- manager inspects, merges or rejects them, and validates the main workspace.
495
-
496
- ## Effort Defaults
497
-
498
- - Start with two to five workers. Use more only when the coverage gate is
499
- countable and the manager can verify every handoff.
500
- - Run at most one routine follow-up pass. Extra passes need a stated reason,
501
- such as a high-stakes verification check or a newly discovered bounded slice.
502
- - Spend effort where being wrong costs more: public API, persistence, security,
503
- permissions, release behavior, data loss, and Flow payload claims.
504
- - Do not fan out to keep agents busy. Worker setup and synthesis have real cost.
505
-
506
- ## Stop And Extend
507
-
508
- Stop after a pass when:
509
-
510
- - the coverage rule is satisfied.
511
- - accepted claims are evidenced, scoped, and confidence-labeled.
512
- - material single-source, contested, high-stakes, or payload-bound claims have
513
- been verified or downgraded.
514
- - remaining gaps are explicit and do not block the Flow artifact being produced.
515
-
516
- Start a bounded follow-up pass only when:
517
-
518
- - the original slice map missed material scope.
519
- - workers disagree on a claim that affects the Flow decision.
520
- - a high-stakes or payload-bound claim needs verification.
521
- - a first pass exposes a narrower implementation or validation slice worth
522
- isolating.
523
-
524
- After every pass, the manager synthesis barrier from \`verification-gates.md\`
525
- applies before any handoff content moves forward.
526
- `;
527
-
528
541
  // skills/flow/references/recovery-playbook.md
529
542
  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';
530
543
 
531
- // skills/flow/references/verification-gates.md
532
- var verification_gates_default = `# Verification gates
533
-
534
- Verification is how Flow keeps parallel work from turning into parallel
535
- guesswork. Worker handoffs are candidate evidence; the manager decides what can
536
- enter the plan, validation record, review payload, audit report, or final
537
- answer.
538
-
539
- Sections: before fan-out, every handoff, verifier triggers, verification tiers,
540
- Flow payload acceptance, and manager synthesis barrier.
541
-
542
- ## Before fan-out
543
-
544
- Run a pre-fan-out gate after serial orientation and before spawning workers:
545
-
546
- - Count the total work items when countable: files, modules, routes, commands,
547
- rows, findings, screenshots, or claims.
548
- - List every slice with path/range/lens and expected count.
549
- - Check that countable slices add back to the total.
550
- - Check for overlapping ownership, missing areas, empty slices, and ambiguous
551
- shared contracts.
552
- - Fix the slice map centrally before spawning if the gate does not reconcile.
553
-
554
- If the scope cannot be counted, state the completeness rule instead, such as
555
- "all changed files plus callers" or "all public commands plus release docs."
556
-
557
- ## Every handoff
558
-
559
- Accept a handoff only after a cheap manager-side pass:
560
-
561
- - \`Status\` is terminal: \`success\`, \`partial\`, or \`blocked\`.
562
- - Coverage matches the assigned slice, or skips are explicit.
563
- - Important claims have concrete evidence and confidence tags.
564
- - Cited paths, commands, screenshots, URLs, or metrics resolve.
565
- - The evidence supports the claim, not just the topic.
566
- - Findings stay inside the worker's slice.
567
- - Headline counts can be recounted or traced.
568
- - Contradictions between workers are either resolved or explicitly marked as
569
- contested.
570
-
571
- Demote, drop, re-task, or verify claims that fail this pass.
572
-
573
- ## Verifier triggers
574
-
575
- Use \`flow-verifier-worker\` when a claim is:
576
-
577
- - blocking or release-sensitive.
578
- - high-stakes for user data, security, persistence, permissions, or public API
579
- behavior.
580
- - low-confidence, inferred, surprising, or single-sourced.
581
- - citation-heavy enough that source drift would change the conclusion.
582
- - contradicted by another worker or by manager inspection.
583
- - a count, benchmark, command result, or pass/fail claim that a Flow payload will
584
- rely on.
585
-
586
- Give the verifier atomic claims, cited sources or commands, and the acceptance
587
- question. Do not ask it to redesign the work or review the whole feature.
588
-
589
- ## Verification tiers
590
-
591
- Use the cheapest check that matches the risk:
592
-
593
- - **Accept locally**: low-risk claims with direct evidence that the manager can
594
- cheaply inspect or recount.
595
- - **Verify once**: single-source, surprising, inferred, citation-heavy, or
596
- Flow-payload-bound claims.
597
- - **Verify strongly**: claims that affect security, persistence, permissions,
598
- public API behavior, release behavior, data loss, or blocking review outcome.
599
- Use independent verifier checks, manager-run commands, or direct artifact
600
- inspection strong enough to settle the claim.
601
- - **Do not accept**: claims without concrete evidence, claims outside the
602
- assigned slice, claims contradicted by inspected artifacts, or claims where the
603
- cited evidence supports only the topic rather than the assertion.
604
-
605
- Verifier prompts should use stable claim ids, one atomic assertion per id, the
606
- cited source or command for each id, and the exact acceptance question.
607
-
608
- ## Flow payload acceptance
609
-
610
- Planning fields may use worker evidence only when the source and scope are clear.
611
- Unverified broad findings should become a review-first feature, not a fix plan.
612
-
613
- \`validationRun\` entries may use worker-reported commands only when the worker
614
- was explicitly authorized to run the command and reported the exact command,
615
- status, and raw outcome summary.
616
-
617
- \`featureReview\` and \`finalReview\` may use worker review slices, but the manager
618
- owns the pass/fail decision and must resolve blockers, contradictions, and
619
- coverage gaps before returning the payload.
620
-
621
- Audit reports may include only findings that survived refutation. Blocking audit
622
- findings need guards checked, deployment context, and evidence that the current
623
- code exhibits the behavior.
624
-
625
- Candidate implementation patches are not Flow evidence until the manager
626
- inspects, merges or rejects them, and runs suitable validation in the main
627
- Flow-managed workspace.
628
-
629
- ## Manager synthesis barrier
630
-
631
- Before presenting or recording the result:
632
-
633
- - Preserve confidence: verified, single-sourced, inferred, and unresolved claims
634
- stay distinct when it matters.
635
- - When workers disagree, inspect the cited artifact or rerun the cited command
636
- instead of arbitrating from summaries.
637
- - Run the strongest practical local check for the deliverable.
638
- - Re-read critical files or docs that will be cited in the final decision.
639
- - Move only distilled, evidence-backed claims forward; raw handoffs remain
640
- candidate evidence, not a plan, review, completion payload, or final answer.
641
- - Record gaps honestly instead of converting missing evidence into success
642
- language.
643
-
644
- \`Status: success\` only says the worker believes its slice is done. The manager
645
- still checks coverage and evidence before trusting the result.
646
- `;
647
-
648
544
  // skills/flow/SKILL.md
649
- var SKILL_default = `---
650
- name: flow
651
- description: Run the end-to-end Flow loop for skills-first OpenCode work. Use when a user asks for Flow-guided planning through implementation, resumable autonomous delivery, session status, or completion with validation and review gates.
652
- ---
653
-
654
- # Flow
655
-
656
- Use 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.
657
-
658
- ## Loop
659
-
660
- 1. Call \`flow_status\` first. Trust its active session and next action over conversation memory.
661
- If the result includes \`setup.skills\`, follow the Skill Availability rules
662
- below before loading any Flow skill.
663
- 2. 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.
664
- 3. 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.
665
- 4. Load \`flow-review\` for the required feature review. The reviewer reports a \`featureReview\` payload; the manager records it inside \`flow_feature_complete\`.
666
- 5. 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\`.
667
- 6. After all features are complete, archive the session with \`flow_session_close\` using \`kind: "completed"\`.
668
-
669
- Use \`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.
670
-
671
- Do not commit, push, amend, rebase, publish, or mutate releases during the
672
- autonomous Flow loop. Load \`flow-commit\` only when the user explicitly asks for
673
- commit preparation or commit creation.
674
-
675
- ## Skill Availability
676
-
677
- If \`flow_status\` returns \`setup.skills\`, report that setup status and stop
678
- native-loading Flow skills in the current OpenCode startup. Missing, incomplete,
679
- or outdated managed skills require a sync/restart cycle before their native skill
680
- instructions can be trusted by the running process. Public command bundles are
681
- self-contained and may continue when the command prompt already embeds the
682
- required Flow instructions.
683
-
684
- If optional helper skills such as \`flow-test\`, \`flow-deslop\`, or
685
- \`flow-ui-quality\` are unavailable, continue only with explicit coverage gaps. Do
686
- not copy their rubrics into another skill and do not claim their quality checks
687
- were completed.
688
-
689
- ## Runtime Surface
690
-
691
- - \`flow_status\`: read the active session.
692
- - \`flow_plan_save\`: create a session and/or save a draft plan.
693
- - \`flow_plan_approve\`: lock the draft plan.
694
- - \`flow_run_start\`: start one runnable feature.
695
- - \`flow_feature_complete\`: record completion or a real blocker with validation and review evidence.
696
- - \`flow_feature_reset\`: reset one feature and its dependents.
697
- - \`flow_session_close\`: archive the active session as \`completed\`, \`deferred\`, or \`abandoned\`.
698
-
699
- There 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/\`.
700
-
701
- Planning 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.
702
-
703
- ## Hard Gates
704
-
705
- - Approved plans are immutable. To change direction, reset affected features or close the session and start a new goal.
706
- - Only one feature can be active at a time.
707
- - Completion requires at least one passing \`validationRun\` entry.
708
- - Non-final completion requires \`validationScope: "targeted"\`.
709
- - Final completion requires \`validationScope: "broad"\` and a passing \`finalReview\`.
710
- - Every completed feature requires a passing \`featureReview\` with no blocking findings.
711
- - \`flow_session_close\` accepts \`kind: "completed"\` only after an approved plan has passed final completion.
712
-
713
- ## Recovery
714
-
715
- - Confused state: call \`flow_status\` and follow \`nextAction\`.
716
- - Wrong assumption or failed implementation path: use \`flow_feature_reset\` for the feature and dependents, then rerun from the corrected plan.
717
- - Missing validation or review evidence: gather real evidence, then call \`flow_feature_complete\`.
718
- - 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.
719
- - Unknown runtime error: read \`summary\` and \`recovery\`; see \`references/recovery-playbook.md\` for common cases.
720
-
721
- Never fabricate validation output, backfill review approval you did not perform, or close as \`deferred\`/\`abandoned\` merely to avoid an unfinished-work blocker.
722
- `;
545
+ 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";
723
546
 
724
547
  // skills/flow-commit/SKILL.md
725
548
  var SKILL_default2 = `---
@@ -919,13 +742,15 @@ Rate as blocking only when the smell materially raises defect risk, blocks plann
919
742
  // skills/flow-deslop/SKILL.md
920
743
  var SKILL_default3 = `---
921
744
  name: flow-deslop
922
- description: Clean up and refactor code with evidence-backed code-smell analysis. Use for AI-slop removal, overengineering reduction, maintainability refactors, behavior-preserving cleanup, duplicated or bloated code, speculative abstractions, dead code, or broad cleanup/refactor review.
745
+ description: Clean up and refactor code with evidence-backed code-smell analysis. Use for AI-slop removal, overengineering reduction, maintainability refactors, behavior-preserving cleanup, duplicated or bloated code, speculative abstractions, and dead code. Review verdicts on cleanup work stay in flow-review, which loads this skill to judge cleanup claims.
923
746
  ---
924
747
 
925
748
  # Flow deslop
926
749
 
927
750
  Use this skill when the Flow work is about improving code quality rather than adding a new user-visible feature. The job is to make the code easier to change without changing behavior unless the approved plan explicitly says behavior changes.
928
751
 
752
+ This is a helper skill: it produces cleanup findings and evidence only. The manager owns every state-changing \`flow_*\` call, and cleanup review verdicts are returned through \`flow-review\`.
753
+
929
754
  ## Ground the cleanup
930
755
 
931
756
  - Start from concrete evidence: duplicated code, unnecessary abstraction, long or tangled functions, dead branches, confusing ownership, repeated conditionals, excessive coupling, or validation gaps that hide maintainability risk.
@@ -967,7 +792,7 @@ var parallel_discovery_default = `# Parallel discovery
967
792
  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.
968
793
 
969
794
  For broad parallel passes, also load \`../../flow/references/parallel-orchestration.md\`.
970
- Use its pre-fan-out coverage gate and
795
+ Use its pass manifest as the pre-fan-out coverage gate and
971
796
  \`../../flow/references/handoff-format.md\` response shapes.
972
797
 
973
798
  ## Good slices
@@ -988,35 +813,21 @@ config, and docs. Name each slice by the paths it owns, for example "runtime:
988
813
 
989
814
  Treat derived slices as starting points, not a simultaneous coverage map.
990
815
  Before fan-out, choose the relevant entries and de-overlap shared docs,
991
- config, or release surfaces in the coverage gate.
816
+ config, or release surfaces in the pass manifest.
992
817
 
993
- ## Coverage gate
818
+ ## Manifest and prompts
994
819
 
995
- Before spawning workers, state the total discovery scope and one line per slice.
996
- For countable scopes, confirm that slice counts add back to the total and that
997
- there are no overlaps, gaps, or empty slices. If the scope is not countable,
998
- state the completeness rule, such as "all changed files plus callers."
820
+ Write the pass manifest and the worker prompts exactly as Stages 3 and 4 of
821
+ \`../../flow/references/parallel-orchestration.md\` define them: one manifest row
822
+ per slice with expected coverage and a verification tier, and a self-contained
823
+ prompt per worker naming the mode (usually \`evidence\`), the exact slice, and
824
+ the expected coverage. Discovery-specific rules:
999
825
 
1000
- ## Worker prompt
1001
-
1002
- \`\`\`text
1003
- Inspect <slice> for <goal>. Read-only. Do not edit files or call
1004
- state-changing Flow tools. Return only the Flow handoff in this exact shape:
1005
- <matching handoff template copied verbatim from handoff-format.md>
1006
- \`\`\`
1007
-
1008
- For validation-oriented discovery:
1009
-
1010
- \`\`\`text
1011
- Inspect <slice> for validation risk. Read-only. Do not edit files or call
1012
- state-changing Flow tools. You may report commands that should be run, and
1013
- include raw output only for commands you actually ran. Return only the Flow
1014
- handoff in this exact shape:
1015
- <matching handoff template copied verbatim from handoff-format.md>
1016
- \`\`\`
1017
-
1018
- Workers cannot read reference files themselves; paste the matching handoff
1019
- template from \`../../flow/references/handoff-format.md\` into the prompt.
826
+ - Workers are read-only. For validation-oriented discovery, workers may report
827
+ commands that should be run, and include raw output only for commands they
828
+ actually ran.
829
+ - Workers cannot read reference files themselves; paste the matching handoff
830
+ template from \`../../flow/references/handoff-format.md\` into the prompt.
1020
831
 
1021
832
  ## Synthesis
1022
833
 
@@ -1030,8 +841,8 @@ Convert only evidence-backed work into plan fields:
1030
841
  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.
1031
842
 
1032
843
  Apply the manager synthesis barrier from
1033
- \`../../flow/references/verification-gates.md\`: only distilled, evidence-backed
1034
- claims become plan fields.
844
+ \`../../flow/references/parallel-orchestration.md\`: only distilled,
845
+ evidence-backed claims become plan fields.
1035
846
  `;
1036
847
 
1037
848
  // skills/flow-plan/references/planning-examples.md
@@ -1125,7 +936,7 @@ Better plan:
1125
936
  // skills/flow-plan/SKILL.md
1126
937
  var SKILL_default4 = `---
1127
938
  name: flow-plan
1128
- 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."
939
+ 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."
1129
940
  ---
1130
941
 
1131
942
  # Flow Plan
@@ -1137,7 +948,7 @@ If \`flow_plan_save\` or \`flow_plan_approve\` is unavailable, stop and tell the
1137
948
  ## Inspect first
1138
949
 
1139
950
  - Read the files, docs, tests, package scripts, and local conventions that determine the work.
1140
- - 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.
951
+ - 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.
1141
952
  - Helper rule: when a named helper skill is unavailable, record a planning gap
1142
953
  and keep the corresponding claims conservative instead of simulating its
1143
954
  checks.
@@ -1147,6 +958,25 @@ If \`flow_plan_save\` or \`flow_plan_approve\` is unavailable, stop and tell the
1147
958
  - For UI/frontend goals, load \`flow-ui-quality\`.
1148
959
  - Do not invent findings. Broad "review and fix" goals start with a review-first feature whose deliverable is evidence-backed findings.
1149
960
 
961
+ ## Reduce uncertainty before decomposing
962
+
963
+ A vague goal does not slice into reliable features yet. Name what is uncertain,
964
+ because the two kinds resolve differently:
965
+
966
+ - **Specification uncertainty** — what the user wants: ambiguous goal, missing
967
+ acceptance criteria, unstated constraints. Resolve by stating an explicit
968
+ assumption in \`decisions\` and proceeding, or by asking only when a wrong
969
+ guess would be expensive to undo.
970
+ - **Environment uncertainty** — facts the repo, docs, commands, or data can
971
+ answer: code shape, schema, API behavior, current conventions. Resolve by
972
+ inspecting or by a discovery pass, never by asking the user.
973
+
974
+ Spend the cheapest probe that removes the most uncertainty first: local reads
975
+ before worker fan-out, fan-out before user questions. Decompose into features
976
+ only once the remaining uncertainty is low enough that \`targets\` and
977
+ \`validation\` can be stated concretely; otherwise the first feature is a
978
+ review-first or discovery deliverable that produces the missing evidence.
979
+
1150
980
  ## Plan shape
1151
981
 
1152
982
  Call \`flow_plan_save\` with:
@@ -1288,7 +1118,7 @@ Approve only on evidence actually inspected. A review is a claim of coverage, no
1288
1118
  // skills/flow-review/SKILL.md
1289
1119
  var SKILL_default5 = `---
1290
1120
  name: flow-review
1291
- 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."
1121
+ 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."
1292
1122
  ---
1293
1123
 
1294
1124
  # Flow Review
@@ -1303,9 +1133,9 @@ recorded.
1303
1133
 
1304
1134
  These instructions run in two contexts, and only one of them can load helpers:
1305
1135
 
1306
- - **Manager context**: the manager reviews inside \`flow-run\` or \`flow-auto\`
1307
- before recording evidence. The manager may load helper skills and fan out
1308
- read-only workers.
1136
+ - **Manager context**: the manager reviews inside the Flow loop (the \`flow\` or
1137
+ \`flow-run\` skills, or a bundled public Flow command) before recording
1138
+ evidence. The manager may load helper skills and fan out read-only workers.
1309
1139
  - **Hidden reviewer context**: \`/flow-review\` runs as the \`flow-reviewer\`
1310
1140
  subagent, whose permissions deny skill loading, shell commands, and
1311
1141
  subagents. In this context, skip every "load" and "fan out" instruction
@@ -1367,8 +1197,12 @@ Use \`status: "failed"\` when any blocking finding remains. Advisory findings ma
1367
1197
  \`../flow/references/parallel-orchestration.md\` for read-only slices by
1368
1198
  changed-file group, risk lens, or validation surface. Use the named review,
1369
1199
  audit, evidence, or validation agents from that reference instead of generic
1370
- subagents. Apply its handoff format and verification gates; only the manager
1371
- returns the final \`featureReview\` or \`finalReview\` payload. The hidden
1200
+ subagents. Write its pass manifest before fan-out and apply its Stage 6
1201
+ handoff acceptance and verification tiers; only the manager
1202
+ returns the final \`featureReview\` or \`finalReview\` payload. If that reference
1203
+ is unavailable in the current context (for example in a bundled public Flow
1204
+ command that does not include it), review serially and record the skipped
1205
+ fan-out as a coverage gap instead of improvising worker contracts. The hidden
1372
1206
  reviewer cannot spawn workers; it reviews its assigned scope directly and
1373
1207
  reports coverage gaps for the rest.
1374
1208
 
@@ -1450,7 +1284,7 @@ Use the strongest practical tier. For risky work, combine tiers.
1450
1284
  - Each \`validationRun\` entry has \`command\`, \`status\`, and \`summary\`.
1451
1285
  - Completion accepts only passing entries. Failed or skipped checks belong in the summary/notes and must be resolved or explained as blockers.
1452
1286
  - Do not claim a command was run unless it was run in this session or directly reported by a trusted worker with raw output.
1453
- - Worker-reported command output must satisfy \`../../flow/references/verification-gates.md\`: exact command, status, raw outcome summary, coverage, and manager acceptance.
1287
+ - 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.
1454
1288
  - Include scope in the summary: what behavior, files, routes, or states the check covered.
1455
1289
  - UI work should include browser or screenshot evidence when the app can run locally.
1456
1290
  - Cleanup/refactor work should show behavior preservation, not only formatting success.
@@ -1494,7 +1328,7 @@ Never trim failing output, relabel a failed command as passed, or use "not run"
1494
1328
  // skills/flow-run/SKILL.md
1495
1329
  var SKILL_default6 = `---
1496
1330
  name: flow-run
1497
- 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."
1331
+ 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."
1498
1332
  ---
1499
1333
 
1500
1334
  # Flow Run
@@ -1539,7 +1373,9 @@ If \`flow_run_start\` is unavailable, stop and tell the user to check that \`ope
1539
1373
  For broad validation research, risky changes, or unclear coverage, use
1540
1374
  \`../flow/references/parallel-orchestration.md\` to fan out named Flow workers.
1541
1375
  Use the mode-to-agent mapping in that reference instead of generic subagents.
1542
- Workers must use the handoff format and verification gates from that reference.
1376
+ Write its pass manifest before fan-out, paste the matching handoff template
1377
+ from \`../flow/references/handoff-format.md\` into every worker prompt, and
1378
+ apply its verification tiers to the handoffs that come back.
1543
1379
  They may report command output they actually ran or propose focused checks; the
1544
1380
  manager decides what is strong enough to record.
1545
1381
 
@@ -1584,7 +1420,7 @@ If genuinely blocked, call \`flow_feature_complete\` with \`status: "needs_input
1584
1420
  // skills/flow-test/SKILL.md
1585
1421
  var SKILL_default7 = `---
1586
1422
  name: flow-test
1587
- description: Test, validate, make test plans, triage failures, and gather Flow validation evidence. Use when selecting checks, running tests, running browser QA for UI changes, classifying failures, or preparing validationRun evidence for flow_feature_complete.
1423
+ description: Choose, run, and summarize validation checks for Flow features. Use when selecting validation coverage, running tests or browser/e2e QA, classifying test failures, or preparing validationRun evidence for flow_feature_complete. Visual design judgment stays in flow-ui-quality and review verdicts stay in flow-review.
1588
1424
  ---
1589
1425
 
1590
1426
  # Flow Test
@@ -1801,13 +1637,15 @@ Do not claim visual polish was verified if no visual artifact was inspected.
1801
1637
  // skills/flow-ui-quality/SKILL.md
1802
1638
  var SKILL_default8 = `---
1803
1639
  name: flow-ui-quality
1804
- description: Review and improve frontend UI quality for Flow work. Use for UX/UI design, frontend polish, visual quality review, responsive and accessible interfaces, interaction states, screenshots, browser-verified UI work, and avoiding generic AI-generated UI.
1640
+ description: Review and improve frontend UI quality for Flow work. Use for UX/UI design, frontend polish, visual quality review, responsive and accessible interfaces, interaction states, screenshot assessment, and avoiding generic AI-generated UI. Browser-run mechanics and validationRun summaries stay in flow-test.
1805
1641
  ---
1806
1642
 
1807
1643
  # Flow UI quality
1808
1644
 
1809
1645
  Use this skill when Flow work changes what a user sees or how they interact with an interface. The goal is production UI quality: useful, coherent, accessible, responsive, and visually intentional.
1810
1646
 
1647
+ This is a helper skill: it contributes UI judgment and visual evidence only. The manager owns every state-changing \`flow_*\` call.
1648
+
1811
1649
  ## Establish the interface intent
1812
1650
 
1813
1651
  - Identify the user, job-to-be-done, primary workflow, density needs, device constraints, and brand/product tone before choosing visuals.
@@ -1863,10 +1701,6 @@ var FLOW_SKILL_DEFINITIONS = [
1863
1701
  relativePath: "references/parallel-orchestration.md",
1864
1702
  content: parallel_orchestration_default
1865
1703
  },
1866
- {
1867
- relativePath: "references/parallel-pass-patterns.md",
1868
- content: parallel_pass_patterns_default
1869
- },
1870
1704
  {
1871
1705
  relativePath: "references/parallel-pass-example.md",
1872
1706
  content: parallel_pass_example_default
@@ -1874,10 +1708,6 @@ var FLOW_SKILL_DEFINITIONS = [
1874
1708
  {
1875
1709
  relativePath: "references/handoff-format.md",
1876
1710
  content: handoff_format_default
1877
- },
1878
- {
1879
- relativePath: "references/verification-gates.md",
1880
- content: verification_gates_default
1881
1711
  }
1882
1712
  ]
1883
1713
  },
@@ -2423,4 +2253,4 @@ main(process.argv).catch((error) => {
2423
2253
  process.exitCode = 1;
2424
2254
  });
2425
2255
 
2426
- //# debugId=8ECEECE32879216C64756E2164756E21
2256
+ //# debugId=A231A45541CC089364756E2164756E21