opencode-plugin-flow 4.3.7 → 4.3.9

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
@@ -44,6 +44,12 @@ success | partial | blocked
44
44
  ## Scope
45
45
  <owned slice: path set, module, command, risk lens, route, data range, or question set>
46
46
 
47
+ ## Pass metadata
48
+ - Pass id: <stable pass id from the manifest>
49
+ - Manifest row id: <row id from the manifest>
50
+ - Depends on: <upstream row ids or "none">
51
+ - Write scope: <none | manager-serial | exact-path | isolated-worktree | mixed>
52
+
47
53
  ## Coverage
48
54
  - Expected: <files, ranges, questions, commands, or findings assigned>
49
55
  - Checked: <actual coverage, for example "12/12 files" or "command not run">
@@ -98,6 +104,11 @@ success | partial | blocked
98
104
  ## Scope
99
105
  <claim ids, sources or commands checked, and the acceptance question>
100
106
 
107
+ ## Pass metadata
108
+ - Pass id: <stable pass id from the manifest>
109
+ - Manifest row id: <row id from the manifest>
110
+ - Depends on: <upstream row ids or "none">
111
+
101
112
  ## Verdict per claim
102
113
  - <claim id>: verdict=<supported | partly-supported | unsupported | source-not-found>
103
114
  - claim: <claim text>
@@ -128,6 +139,12 @@ success | partial | blocked
128
139
  ## Scope
129
140
  <isolated worktree or exact path-owned slice>
130
141
 
142
+ ## Pass metadata
143
+ - Pass id: <stable pass id from the manifest>
144
+ - Manifest row id: <row id from the manifest>
145
+ - Depends on: <upstream row ids or "none">
146
+ - Write scope: <exact-path | isolated-worktree>
147
+
131
148
  ## Changed or proposed patch
132
149
  - <path>: <what changed and why>
133
150
 
@@ -154,6 +171,48 @@ live-verified | test-verified | type-check-only | not-verified
154
171
 
155
172
  The manager must inspect and validate any candidate patch before recording Flow
156
173
  completion.
174
+
175
+ ## Manager pass accounting record
176
+
177
+ The manager, not the worker, may carry compact records into
178
+ \`flow_feature_complete.orchestrationPasses\`. Use one record per material pass or
179
+ implementation decision; keep handoffs and long artifacts outside \`.flow/**\`.
180
+ The candidate accounting rules — which \`candidateEligibility\`,
181
+ \`candidateDecision\`, and \`decision\` combinations validate, and what counts as
182
+ candidate execution evidence — live in
183
+ [parallel-orchestration.md](parallel-orchestration.md) under "Implementation
184
+ pass decision"; note \`decision: "parallel"\` is not valid on
185
+ \`implementation-decision\` records.
186
+
187
+ \`\`\`json
188
+ {
189
+ "id": "stable-pass-id",
190
+ "kind": "discovery | audit | review | validation | verification | candidate | implementation-decision",
191
+ "decision": "serial | parallel | candidate-exact-path | candidate-worktree | tournament | skipped",
192
+ "decisionReason": "why this pass shape was chosen",
193
+ "candidateEligibility": "eligible | not_eligible | unknown",
194
+ "candidateDecision": "used | skipped | serial_required",
195
+ "decisionFactors": [
196
+ "shared_state",
197
+ "overlapping_files",
198
+ "small_slice",
199
+ "needs_manager_judgment",
200
+ "independent_surface",
201
+ "validation_available"
202
+ ],
203
+ "modes": ["evidence"],
204
+ "workerCount": 1,
205
+ "candidateWorkerCount": 0,
206
+ "verifierWorkerCount": 0,
207
+ "sliceIds": ["manifest-row-id"],
208
+ "dependsOn": [],
209
+ "writeScope": "none | manager-serial | exact-path | isolated-worktree | mixed",
210
+ "handoffRefs": ["/tmp/flow-handoff.md"],
211
+ "verificationStatus": "not-needed | pending | passed | failed | mixed | downgraded",
212
+ "outcome": "accepted | modified | rejected | partial | not-covered | superseded",
213
+ "synthesisRef": "/tmp/flow-synthesis.md"
214
+ }
215
+ \`\`\`
157
216
  `;
158
217
 
159
218
  // skills/flow/references/parallel-orchestration.md
@@ -206,6 +265,99 @@ Pass notes:
206
265
  or exact non-overlapping path ownership. Patches stay proposals until the
207
266
  manager inspects, merges or rejects, and validates.
208
267
 
268
+ ## Implementation pass decision
269
+
270
+ Before implementing a broad, risky, or multi-target feature, record one manager
271
+ decision. This is required even when the answer is "stay serial"; the point is
272
+ to make the skipped parallelism visible instead of relying on memory.
273
+
274
+ First classify candidate eligibility:
275
+
276
+ - \`eligible\`: at least one slice is independent enough for a candidate worker.
277
+ - \`not_eligible\`: worker isolation would not make the implementation safer or
278
+ cheaper because the slice shares state, files, tests, or one mental model.
279
+ - \`unknown\`: orientation did not produce enough evidence to classify; use this
280
+ only for non-decision pass rows or legacy low-signal records, not for
281
+ \`implementation-decision\` records and not as a substitute for judgment.
282
+
283
+ Then record the candidate decision:
284
+
285
+ - \`used\`: candidate workers were used or a candidate pass carried the work.
286
+ - \`skipped\`: candidates were eligible, but the manager chose serial anyway.
287
+ This is the underused-parallelism signal counted by Flow status; use it only
288
+ on \`kind: "implementation-decision"\` records.
289
+ - \`serial_required\`: candidates were not eligible, so serial work was the
290
+ correct implementation shape. Use it only on \`kind: "implementation-decision"\`
291
+ records.
292
+
293
+ Use one of these decisions:
294
+
295
+ - \`serial\`: the manager implements directly because slices overlap, the next
296
+ edit depends on one shared contract, or prompt/merge overhead would exceed the
297
+ value. Pair unsafe or not-useful worker cases with
298
+ \`candidateEligibility: "not_eligible"\` and
299
+ \`candidateDecision: "serial_required"\`.
300
+ - \`candidate-exact-path\`: one or more candidate workers may edit exact
301
+ non-overlapping paths or modules named by the manager.
302
+ - \`candidate-worktree\`: one or more candidate workers may edit in isolated
303
+ worktrees, then the manager inspects and merges or rejects.
304
+ - \`tournament\`: several isolated candidate implementations compete for the same
305
+ outcome; the manager filters by tests, review, and source inspection before
306
+ accepting one.
307
+ - Candidate-shaped decisions (\`candidate-exact-path\`, \`candidate-worktree\`,
308
+ \`tournament\`) require candidate execution evidence on the same record:
309
+ \`kind: "candidate"\`, \`modes\` includes \`candidate-implementation\`, or
310
+ \`candidateWorkerCount > 0\`. The same evidence rule applies to
311
+ \`candidateDecision: "used"\`. Non-decision candidate rows (for example
312
+ \`kind: "candidate"\`) may omit \`decision\`; \`implementation-decision\` rows must
313
+ always set one, and when \`candidateDecision\` is \`"used"\` that decision must
314
+ be candidate-shaped — never \`serial\`, \`parallel\`, or \`skipped\`.
315
+ - \`parallel\` describes multi-worker read or audit passes (discovery, audit,
316
+ review); it is not a valid \`implementation-decision\` value. Implementation
317
+ decisions use \`serial\`, \`skipped\`, or a candidate-shaped decision.
318
+ - \`skipped\`: candidate workers were eligible but the manager chose serial
319
+ anyway; pair this with \`candidateEligibility: "eligible"\` and
320
+ \`candidateDecision: "skipped"\`. Do not use \`skipped\` for shared fixtures,
321
+ shared API contracts, unclear ownership, or other unsafe worker cases; use
322
+ \`serial\` plus \`serial_required\` for those.
323
+
324
+ Use structured \`decisionFactors\` alongside prose \`decisionReason\`:
325
+ \`shared_state\`, \`overlapping_files\`, \`small_slice\`,
326
+ \`needs_manager_judgment\`, \`independent_surface\`, and
327
+ \`validation_available\`. Serial-required records usually cite
328
+ \`shared_state\`, \`overlapping_files\`, or \`needs_manager_judgment\`; eligible
329
+ records usually cite \`independent_surface\` and \`validation_available\`, with
330
+ \`small_slice\` explaining an eligible-but-skipped choice.
331
+
332
+ ### Worker decision rubric
333
+
334
+ Default to considering candidate workers when:
335
+
336
+ - the plan has three or more features.
337
+ - features touch separate surfaces such as frontend, core, docs, release
338
+ scripts, tests, or bindings.
339
+ - validation can run per slice.
340
+ - the work is mostly additive or localized.
341
+ - the final manager can review, apply, adapt, or reject the result safely.
342
+
343
+ Prefer serial when:
344
+
345
+ - one tight invariant crosses shared files.
346
+ - migrations, persistence, storage, or lifecycle semantics require one mental
347
+ model.
348
+ - tests require iterative local debugging in one checkout.
349
+ - multiple slices would edit the same files or fixtures.
350
+ - the slice is so small that prompt, handoff, merge, and verification overhead
351
+ costs more than direct work.
352
+
353
+ Record the decision in the pass manifest with a stable pass id,
354
+ \`candidateEligibility\`, \`candidateDecision\`, \`decisionFactors\`,
355
+ \`decisionReason\`, \`writeScope\`, expected verification, and where any handoff or
356
+ synthesis artifact will live. If the feature completes, include the compact
357
+ record in the \`orchestrationPasses\` array of the \`flow_feature_complete\`
358
+ payload. The runtime stores only compact accounting; full worker handoffs stay
359
+ in manager-owned scratch files or the conversation.
360
+
209
361
  ## When to stay serial
210
362
 
211
363
  - One file, command, or design question determines the next step.
@@ -281,6 +433,12 @@ schemas, docs, tests, commands, or artifacts to identify real slices. Keep the
281
433
  immediate blocker local: do not delegate the question that determines whether
282
434
  fan-out is even valid.
283
435
 
436
+ Treat orientation as uncertainty reduction. Resolve environment uncertainty by
437
+ inspecting the repo, running cheap commands, or assigning evidence workers; ask
438
+ the user only when the remaining specification uncertainty would make a wrong
439
+ slice expensive to undo. Do not split a vague goal into workers until the
440
+ candidate slices have concrete targets, dependencies, and verification signals.
441
+
284
442
  ## Stage 2 — Slice
285
443
 
286
444
  Split along whichever axis keeps slices independent: modules or path sets,
@@ -288,14 +446,29 @@ route or endpoint groups, risk lenses, command surfaces, data ranges, or claim
288
446
  sets. Each slice needs a one-line scope, expected coverage, and a defined
289
447
  output the manager can check.
290
448
 
449
+ For implementation slices, also name dependencies and write ownership before
450
+ spawning. A real dependency edge means the later slice waits for a verified
451
+ handoff or manager synthesis from the earlier slice; a shared file, fixture,
452
+ schema, or public contract usually means the work should stay serial unless an
453
+ isolated worktree is used. The manifest owns those edges through \`dependsOn\`
454
+ and \`writeScope\`.
455
+
291
456
  ## Stage 3 — Manifest (the pre-fan-out coverage gate)
292
457
 
293
458
  Before spawning, write a pass manifest: one row per slice, plus a totals check.
459
+ Give the pass a stable id so later handoffs, verifier claims, and completion
460
+ payloads can refer to the same work without replaying chat.
294
461
 
295
- | # | Slice scope | Expected coverage | Mode | Verification tier |
296
- | --- | --- | --- | --- | --- |
297
- | 1 | \`src/core/**\` plus its tests | 14 files | \`evidence\` | accept locally |
298
- | 2 | release contract: CI workflows, \`package.json\`, changelog | 6 files | \`evidence\` | verify once |
462
+ | Row id | Slice scope | Expected coverage | Mode | Depends on | Write scope | Verification tier | Handoff ref | Verification status | Synthesis ref |
463
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
464
+ | \`runtime-read\` | \`src/core/**\` plus its tests | 14 files | \`evidence\` | none | none | accept locally | pending | pending | pending |
465
+ | \`release-read\` | release contract: CI workflows, \`package.json\`, changelog | 6 files | \`evidence\` | none | none | verify once | pending | pending | pending |
466
+
467
+ \`writeScope\` values in runtime accounting are \`none\`, \`manager-serial\`,
468
+ \`exact-path\`, \`isolated-worktree\`, or \`mixed\`. Use \`manager-serial\` for a
469
+ recorded serial implementation decision, \`exact-path\` for disjoint candidate
470
+ edits in one checkout, and \`isolated-worktree\` for candidate work that must be
471
+ merged back by the manager.
299
472
 
300
473
  - Count the total work items when countable: files, modules, routes, commands,
301
474
  rows, findings, screenshots, or claims. Confirm slice counts add back to the
@@ -304,11 +477,30 @@ Before spawning, write a pass manifest: one row per slice, plus a totals check.
304
477
  "all changed files plus callers" or "all public commands plus release docs."
305
478
  - Assign each slice's verification tier now (see Stage 6). Deciding where a
306
479
  wrong claim is expensive belongs before handoffs arrive, not after.
480
+ - Record dependency edges now. A row may be spawned only after every \`depends on\`
481
+ row it names has returned a verified handoff or a manager synthesis that
482
+ explicitly settles the dependency.
307
483
  - Fix the slice map centrally before spawning if the gate does not reconcile.
308
484
 
309
485
  The manifest is also the accounting contract for the pass: N rows spawned means
310
486
  N handoffs collected and checked in Stage 5 before anything is synthesized.
311
487
 
488
+ For implementation decisions, add a manifest row even when no worker is spawned:
489
+ \`kind=implementation-decision\`, \`decision=serial\` or \`decision=skipped\`,
490
+ \`candidateEligibility\`, \`candidateDecision\`, \`decisionFactors\`,
491
+ \`workerCount=0\`, \`writeScope=manager-serial\`, and a concrete \`decisionReason\`.
492
+ Use \`decision=serial\` with \`candidateDecision=serial_required\` for ineligible
493
+ worker cases; reserve \`decision=skipped\` for eligible candidate work that the
494
+ manager chose not to delegate. When an implementation-decision row uses
495
+ \`candidateDecision=used\`, it must also record actual candidate execution
496
+ evidence: either \`modes=candidate-implementation\`, or \`candidateWorkerCount > 0\`
497
+ with \`workerCount\` raised to cover it — a \`workerCount=0\` row cannot carry a
498
+ positive \`candidateWorkerCount\`. Neither subtype count may exceed the total:
499
+ \`candidateWorkerCount <= workerCount\` and \`verifierWorkerCount <= workerCount\`
500
+ (a single worker may fill both roles).
501
+ This is how Flow distinguishes deliberate serial work from forgotten candidate
502
+ or verifier passes.
503
+
312
504
  Write the manifest where it survives the pass: the conversation is enough for a
313
505
  single bounded pass, but when a follow-up pass or a session resume is
314
506
  plausible, persist it with the synthesis (Stage 7) so the accounting can be
@@ -321,8 +513,10 @@ Every worker prompt includes:
321
513
  \`\`\`text
322
514
  Overall goal, context only: <goal>
323
515
  Mode: evidence | review | validation | audit | verifier | candidate-implementation
516
+ Pass id and manifest row id: <stable ids from the manifest>
324
517
  Your exact slice: <paths, modules, command, claim ids, risk lens, or worktree>
325
518
  Expected coverage: <count, paths, range, or complete question set>
519
+ Dependencies and write scope: <verified dependencies, if any; none | manager-serial | exact-path | isolated-worktree>
326
520
  Do: <bounded actions>
327
521
  Do not: call state-changing Flow tools, edit .flow/**, own sibling slices, or make the final Flow verdict.
328
522
  Return only the Flow handoff in this exact shape:
@@ -348,6 +542,21 @@ worker that never returns, errors out, returns empty or unstructured output, or
348
542
  reports \`partial\` or \`blocked\` is a hole in the pass, and synthesizing around it
349
543
  silently drops a slice.
350
544
 
545
+ For each row, fill in:
546
+
547
+ - \`handoffRefs\`: worker ids, handoff file paths, command output artifacts, or
548
+ review packet location that the manager can re-open.
549
+ - \`verificationStatus\`: \`not-needed\`, \`pending\`, \`passed\`, \`failed\`, \`mixed\`,
550
+ or \`downgraded\`.
551
+ - \`outcome\`: \`accepted\`, \`modified\`, \`rejected\`, \`partial\`, \`not-covered\`, or
552
+ \`superseded\`.
553
+ - \`synthesisRef\`: the manager-owned synthesis file or plan field that carries
554
+ the accepted result forward.
555
+
556
+ Rows with no worker, such as serial or skipped implementation decisions, still
557
+ need a row id, decision, reason, and outcome. They are not handoffs, but they
558
+ are accounting.
559
+
351
560
  Worker failure ladder:
352
561
 
353
562
  1. Re-spawn once with a narrower slice and a note about what the first attempt
@@ -369,6 +578,12 @@ handoff only after a cheap manager-side pass:
369
578
  - The evidence supports the claim, not just the topic.
370
579
  - Findings stay inside the worker's slice.
371
580
  - Headline counts can be recounted or traced.
581
+ - Dependency claims cite the verified upstream handoff, synthesis, or source
582
+ artifact they depend on.
583
+ - Candidate implementation claims identify whether they came from exact path
584
+ ownership or an isolated worktree, and whether the manager inspected the
585
+ resulting patch. Record the manager result as \`accepted\`, \`modified\`, or
586
+ \`rejected\` where that is the most precise candidate outcome.
372
587
  - Contradictions between workers are either resolved or explicitly marked as
373
588
  contested.
374
589
 
@@ -409,6 +624,11 @@ Apply the manager synthesis barrier before presenting or recording anything:
409
624
  - When workers disagree, inspect the cited artifact or rerun the cited command
410
625
  instead of arbitrating from summaries. Do not average conflicting claims.
411
626
  - Run the strongest practical local check for the deliverable.
627
+ - For broad implementation sessions, use one verifier worker after manager
628
+ synthesis when the risk is medium or high. Ask it whether every planned
629
+ feature landed, worker validation claims are supported, final code matches
630
+ the audit finding, generated bindings/docs/version metadata stayed
631
+ consistent, and changed files have plausible test coverage.
412
632
  - Re-read critical files or docs that will be cited in the final decision.
413
633
  - Move only distilled, evidence-backed claims forward; raw handoffs remain
414
634
  candidate evidence, not a plan, review, completion payload, or final answer.
@@ -433,6 +653,56 @@ Where accepted evidence goes:
433
653
  - Candidate patches are not Flow evidence until the manager inspects, merges or
434
654
  rejects them, and validates the main Flow-managed workspace.
435
655
 
656
+ When completing a feature, include compact pass accounting in
657
+ \`flow_feature_complete.orchestrationPasses\` for any pass or implementation
658
+ decision that materially affected the feature:
659
+
660
+ \`\`\`json
661
+ {
662
+ "id": "feature-id-implementation-decision",
663
+ "kind": "implementation-decision",
664
+ "decision": "serial",
665
+ "decisionReason": "Shared schema and tests made exact path ownership unsafe.",
666
+ "candidateEligibility": "not_eligible",
667
+ "candidateDecision": "serial_required",
668
+ "decisionFactors": ["shared_state", "overlapping_files"],
669
+ "modes": [],
670
+ "workerCount": 0,
671
+ "candidateWorkerCount": 0,
672
+ "verifierWorkerCount": 0,
673
+ "sliceIds": ["manager-implementation"],
674
+ "dependsOn": [],
675
+ "writeScope": "manager-serial",
676
+ "handoffRefs": [],
677
+ "verificationStatus": "not-needed",
678
+ "outcome": "accepted",
679
+ "synthesisRef": "/tmp/flow-pass-synthesis.md"
680
+ }
681
+ \`\`\`
682
+
683
+ For candidate and verifier passes, use \`kind: "candidate"\` or
684
+ \`kind: "verification"\`, list the worker modes used, worker counts, slice ids,
685
+ handoff refs, dependency ids, verification status, and whether the manager
686
+ accepted, rejected, downgraded, or superseded the pass. The runtime aggregates
687
+ these compact records into \`session.budget.orchestration\` and stores them on
688
+ the feature history entry. Do not store full handoffs, long logs, or scratch
689
+ tables in \`.flow/session.json\`.
690
+
691
+ Status accounting distinguishes three cases: \`candidateDecision: "used"\` means
692
+ candidate execution evidence was recorded, \`candidateDecision:
693
+ "serial_required"\` means workers were not safe or useful, and
694
+ \`candidateEligibility: "eligible"\` plus \`candidateDecision: "skipped"\`
695
+ increments \`skippedCandidateDecisionCount\`. These candidate decision counters
696
+ come from \`kind: "implementation-decision"\` records; \`skipped\` and
697
+ \`serial_required\` are not valid on discovery, audit, review, validation,
698
+ verification, or candidate pass rows. \`candidatePassCount\`
699
+ counts actual candidate pass or worker evidence (\`kind: "candidate"\`,
700
+ \`modes\` includes \`candidate-implementation\`, or \`candidateWorkerCount > 0\`) —
701
+ a candidate-shaped decision label without that evidence is rejected, so decision
702
+ labels alone never count. \`verifierPassCount\` similarly counts
703
+ actual verifier pass or worker evidence (\`kind: "verification"\`, \`modes\`
704
+ includes \`verifier\`, or \`verifierWorkerCount > 0\`).
705
+
436
706
  Persist the manifest and the synthesis when another pass may follow or the
437
707
  session is long enough to be compacted or resumed: write the distilled result —
438
708
  the accounted manifest, accepted claims with evidence and confidence, dropped
@@ -451,6 +721,11 @@ Stop after a pass when:
451
721
  - accepted claims are evidenced, scoped, and confidence-labeled.
452
722
  - material single-source, contested, high-stakes, or payload-bound claims have
453
723
  been verified or downgraded.
724
+ - every dependency edge named in the manifest has either a verified upstream
725
+ result or an explicit not-covered outcome.
726
+ - implementation pass decisions are recorded, including skipped candidate
727
+ workers, candidate eligibility, candidate decision, structured factors, and
728
+ the reason eligible workers were skipped.
454
729
  - remaining gaps are explicit and do not block the Flow artifact being produced.
455
730
 
456
731
  Start a bounded follow-up pass only when:
@@ -458,6 +733,9 @@ Start a bounded follow-up pass only when:
458
733
  - the original slice map missed material scope.
459
734
  - workers disagree on a claim that affects the Flow decision.
460
735
  - a high-stakes or payload-bound claim needs verification.
736
+ - a dependency has just become verified and now unlocks a dependent slice.
737
+ - a candidate patch was rejected and an isolated alternative is still cheaper
738
+ than serial repair.
461
739
  - a first pass exposes a narrower implementation or validation slice worth
462
740
  isolating.
463
741
 
@@ -466,6 +744,20 @@ reason, such as a high-stakes verifier check or a newly discovered bounded
466
744
  slice. Do not recurse by default: if a worker says it needs another worker, the
467
745
  manager decides whether that is a follow-up pass and writes the next bounded
468
746
  prompt, starting again from the manifest.
747
+
748
+ ## Worker count defaults
749
+
750
+ Use caps, not a fixed feature limit:
751
+
752
+ - small implementation: zero or one worker.
753
+ - medium independent implementation: two workers.
754
+ - broad audit: three to five workers.
755
+ - broad implementation: two to four candidate workers, only for
756
+ non-overlapping slices.
757
+ - final verifier: one worker when risk is medium or high.
758
+
759
+ The target is not "more workers." The target is explicit accounting: Flow must
760
+ justify not using workers when the work was eligible.
469
761
  `;
470
762
 
471
763
  // skills/flow/references/parallel-pass-example.md
@@ -484,21 +776,24 @@ directory. The manager keeps the middleware local because it is one file and
484
776
  anchors every other judgment.
485
777
 
486
778
  Pass manifest: twelve countable route modules remain after the local check, and
487
- 4 + 3 + 5 adds back to 12 with no overlaps or gaps.
779
+ 4 + 3 + 5 adds back to 12 with no overlaps or gaps. The pass id is
780
+ \`api-error-handling-read\`.
488
781
 
489
- | # | Slice scope | Expected coverage | Mode | Verification tier |
490
- | --- | --- | --- | --- | --- |
491
- | A | auth and account routes | 4/12 modules | \`evidence\` | accept locally |
492
- | B | billing and subscription routes | 3/12 modules | \`review\` | verify once |
493
- | C | remaining content and admin routes | 5/12 modules | \`audit\` | verify once |
782
+ | Row id | Slice scope | Expected coverage | Mode | Depends on | Write scope | Verification tier | Handoff ref | Verification status | Synthesis ref |
783
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
784
+ | \`routes-auth\` | auth and account routes | 4/12 modules | \`evidence\` | none | none | accept locally | pending | pending | pending |
785
+ | \`routes-billing\` | billing and subscription routes | 3/12 modules | \`review\` | none | none | verify once | pending | pending | pending |
786
+ | \`routes-admin\` | remaining content and admin routes | 5/12 modules | \`audit\` | none | none | verify once | pending | pending | pending |
494
787
 
495
788
  Worker prompts:
496
789
 
497
790
  \`\`\`text
498
791
  Overall goal, context only: confirm API error handling is consistent.
499
792
  Mode: evidence
793
+ Pass id and manifest row id: api-error-handling-read / routes-auth
500
794
  Your exact slice: the four auth and account route modules under src/routes/.
501
795
  Expected coverage: 4/4 modules.
796
+ Dependencies and write scope: none; none.
502
797
  Do: report each route's error paths, status codes, and middleware usage with file:line evidence.
503
798
  Do not: call state-changing Flow tools, edit .flow/**, own sibling slices, or make the final Flow verdict.
504
799
  Return only the Flow handoff in this exact shape:
@@ -508,8 +803,10 @@ Return only the Flow handoff in this exact shape:
508
803
  \`\`\`text
509
804
  Overall goal, context only: confirm API error handling is consistent.
510
805
  Mode: review
806
+ Pass id and manifest row id: api-error-handling-read / routes-billing
511
807
  Your exact slice: the three billing and subscription route modules under src/routes/.
512
808
  Expected coverage: 3/3 modules.
809
+ Dependencies and write scope: none; none.
513
810
  Do: separate blocking findings from advisory notes and cite file:line evidence.
514
811
  Do not: call state-changing Flow tools, edit .flow/**, own sibling slices, or make the final Flow verdict.
515
812
  Return only the Flow handoff in this exact shape:
@@ -519,8 +816,10 @@ Return only the Flow handoff in this exact shape:
519
816
  \`\`\`text
520
817
  Overall goal, context only: confirm API error handling is consistent.
521
818
  Mode: audit
819
+ Pass id and manifest row id: api-error-handling-read / routes-admin
522
820
  Your exact slice: the five content and admin route modules under src/routes/.
523
821
  Expected coverage: 5/5 modules.
822
+ Dependencies and write scope: none; none.
524
823
  Do: check each claimed error path against the shared middleware contract and report divergences with evidence.
525
824
  Do not: call state-changing Flow tools, edit .flow/**, own sibling slices, or make the final Flow verdict.
526
825
  Return only the Flow handoff in this exact shape:
@@ -531,6 +830,9 @@ Accounting: three manifest rows spawned means three handoffs collected before
531
830
  synthesis. If slice B returned \`partial\`, the manager would re-spawn it once
532
831
  with a narrower scope, then cover it directly, and as a last resort carry it
533
832
  into the synthesis explicitly as not-covered.
833
+ The manager fills \`handoffRefs\`, \`verificationStatus\`, \`outcome\`, and
834
+ \`synthesisRef\` for each row before any claim becomes a plan decision or review
835
+ payload.
534
836
 
535
837
  Handoff checks: the manager accepts only reports with terminal status, matching
536
838
  coverage counts, concrete file:line evidence, confidence tags, and claims inside
@@ -548,6 +850,12 @@ Final synthesis: the manager re-reads the relevant route and middleware lines,
548
850
  keeps only verified or clearly labeled claims, and records one artifact such as
549
851
  a plan decision, review payload, or docs patch. Raw handoffs and unverified
550
852
  suggestions do not move into the next pass or user-facing answer.
853
+
854
+ If the pass shaped feature execution, the manager records compact accounting in
855
+ \`flow_feature_complete.orchestrationPasses\`, such as pass id
856
+ \`api-error-handling-read\`, kind \`review\`, worker count \`3\`, slice ids
857
+ \`routes-auth\`, \`routes-billing\`, and \`routes-admin\`, verification status
858
+ \`mixed\` or \`passed\`, and a synthesis ref pointing to the manager-owned summary.
551
859
  `;
552
860
 
553
861
  // skills/flow/references/recovery-playbook.md
@@ -831,15 +1139,19 @@ config, or release surfaces in the pass manifest.
831
1139
 
832
1140
  Write the pass manifest and the worker prompts exactly as Stages 3 and 4 of
833
1141
  \`../../flow/references/parallel-orchestration.md\` define them: one manifest row
834
- per slice with expected coverage and a verification tier, and a self-contained
835
- prompt per worker naming the mode (usually \`evidence\`), the exact slice, and
836
- the expected coverage. Discovery-specific rules:
1142
+ per slice with expected coverage, dependencies, write scope, and a verification
1143
+ tier, and a self-contained prompt per worker naming the mode (usually
1144
+ \`evidence\`), the exact slice, and the expected coverage. Discovery-specific
1145
+ rules:
837
1146
 
838
1147
  - Workers are read-only. For validation-oriented discovery, workers may report
839
1148
  commands that should be run, and include raw output only for commands they
840
1149
  actually ran.
841
1150
  - Workers cannot read reference files themselves; paste the matching handoff
842
1151
  template from \`../../flow/references/handoff-format.md\` into the prompt.
1152
+ - If discovery finds later features with disjoint path ownership, preserve that
1153
+ fact in feature \`targets\` and \`dependsOn\` so execution can make an explicit
1154
+ serial or candidate-pass decision instead of rediscovering ownership.
843
1155
 
844
1156
  ## Synthesis
845
1157
 
@@ -1258,6 +1570,11 @@ to execute.
1258
1570
  validation entry should name the expected test level, such as targeted unit,
1259
1571
  integration, browser/e2e, package/build, docs/static, cleanup preservation, or
1260
1572
  broad project gate.
1573
+ - When a feature may benefit from parallel implementation, make \`targets\`
1574
+ precise enough for later ownership decisions: name exact modules, docs,
1575
+ commands, or route groups, and use \`dependsOn\` to preserve prerequisite order.
1576
+ Broad shared-contract work should stay in one feature or an earlier foundation
1577
+ feature so later candidate passes can own disjoint paths safely.
1261
1578
  - Assign \`reviewDepth\` from risk. Use \`detailed\` for persistence, migration,
1262
1579
  concurrency, security, final-delivery-adjacent, or cross-module slices; use
1263
1580
  \`standard\` for normal code changes; reserve \`quick\` for low-risk non-behavioral
@@ -1623,7 +1940,7 @@ Never trim failing output, relabel a failed command as passed, or use "not run"
1623
1940
  `;
1624
1941
 
1625
1942
  // skills/flow-run/SKILL.md
1626
- var SKILL_default6 = '---\nname: flow-run\ndescription: "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."\n---\n\n# Flow Run\n\nUse this skill for implementation after a Flow plan is approved. Work one feature at a time.\n\nIf `flow_run_start` is unavailable, stop and tell the user to check that `opencode-plugin-flow` is loaded in OpenCode.\n\n## Start\n\n- Call `flow_status`.\n- If `flow_status` returns a `session.resumePacket` or\n `session.budget.phaseBoundary`, stop the current autonomous loop and report\n the resume instructions. Only call `flow_run_start` with\n `phaseBoundaryAck: true` at the start of a fresh user invocation that is\n explicitly resuming the Flow session; do not acknowledge a boundary inside\n the same uninterrupted loop that created it.\n- Call `flow_run_start` with no `featureId` unless the user or plan requires a specific runnable feature.\n- Treat the returned feature as the sole scope until it is completed, blocked, or reset.\n- Helper rule: when a named helper skill is unavailable, record the gap and\n keep the corresponding claims conservative instead of simulating its checks.\n- Load `flow-deslop` for cleanup/refactor features.\n- Load `flow-ui-quality` for frontend, UX, responsive, accessibility, or visual work.\n\n## Implement\n\n- Read the feature `targets`, `summary`, `validation`, dependencies, and plan `requirements`/`decisions`.\n- Treat the feature\'s `reviewDepth` as the minimum feature-review depth that\n must be recorded in `flow_feature_complete`.\n- Keep edits scoped to the active feature. If new scope appears, stop and replan or defer it to another feature.\n- Preserve unrelated user changes in the worktree.\n- When a wrong assumption invalidates the feature, use `flow_feature_reset`; do not pile patches onto a bad path.\n- Do not stage, commit, push, amend, rebase, publish, or mutate releases as part\n of feature execution. If the user explicitly asks for commit preparation, load\n `flow-commit` only after `flow_feature_complete` has been recorded, unless the\n user explicitly asks for a WIP commit path. Keep Git boundaries separate from\n Flow state recording.\n\n## Validate\n\n- For complex validation, regression-sensitive changes, browser QA, route QA,\n failure-prone checks, unclear coverage, exploratory QA, or\n `validationRun` summarization, load `flow-test` (helper rule applies).\n- Read `references/validation-rubric.md` before completing.\n- Run the strongest practical checks for the changed behavior.\n- Record concrete command names, status, and observed results. "Tests pass" is not evidence.\n- Non-final features complete with `validationScope: "targeted"`.\n- The final feature must run a broad project-level gate and use `validationScope: "broad"`.\n\nFor broad validation research, risky changes, or unclear coverage, use\n`../flow/references/parallel-orchestration.md` to fan out named Flow workers.\nUse the mode-to-agent mapping in that reference instead of generic subagents.\nWrite its pass manifest before fan-out, paste the matching handoff template\nfrom `../flow/references/handoff-format.md` into every worker prompt, and\napply its verification tiers to the handoffs that come back.\nThey may report command output they actually ran or propose focused checks; the\nmanager decides what is strong enough to record.\n\nFor independent implementation attempts, use candidate workers only with\nexplicit user authorization plus isolated worktrees or exact non-overlapping\npath ownership. Treat their output as candidate patches. The manager inspects,\nmerges, validates, and records Flow state serially.\n\n## Review and complete\n\nBefore `flow_feature_complete`, obtain a `featureReview` payload. Load\n`flow-review`; for read-only subagent reviews, the manager receives the review\npacket and records both `featureReviewDepth` and `featureReview`.\n\nSend reviewers a compact review packet. Do not rely on the accumulated parent\nconversation. Include only:\n\n- active feature id, title, summary, `reviewDepth`, targets, validation, and dependencies\n- relevant plan requirements, decisions, and final review policy\n- changed files and a short diff summary\n- validation evidence with exact commands, status, and observed result\n- targeted paths or risk lenses the reviewer must inspect\n\nIf the review returns `status: "failed"`, do not fix inside the review pass.\nRecord the failed attempt by calling `flow_feature_complete` with the otherwise\nprepared completion payload, the failed `featureReview`, and the attempted\n`featureReviewDepth`; the runtime will reject completion and update the retry\nbudget. Default to stopping and reporting the blocker. When the user already\nauthorized autonomous implementation, make at most one repair and run one retry\nreview. If the retry fails or the runtime reports review retry budget\nexhausted, stop with the blocker.\n\nIf `flow_status` reports `setup.skills` or `flow-review` cannot be loaded, do\nnot record a Flow-gated `featureReview` or `finalReview`. You may perform an\nadvisory review using available context or the bundled review fallback provided\nby plugin config, then complete with `status: "needs_input"` if review evidence\nis required to proceed.\n\nFor the final feature, also obtain a `finalReview` payload whose `reviewDepth` equals the approved plan\'s `finalReviewPolicy`.\n\nComplete with:\n\n```json\n{\n "status": "ok",\n "featureId": "active-feature-id",\n "summary": "what changed",\n "artifactsChanged": [{ "path": "src/file.ts" }],\n "validationRun": [\n { "command": "bun test tests/foo.test.ts", "status": "passed", "summary": "3 pass, exercised foo behavior" }\n ],\n "validationScope": "targeted",\n "featureReviewDepth": "standard",\n "featureReview": { "status": "passed", "summary": "review summary", "blockingFindings": [] }\n}\n```\n\nIf `flow_feature_complete` returns a `session.resumePacket` or\n`session.budget.phaseBoundary`, stop after reporting the compact handoff. If\ngenuinely blocked, call `flow_feature_complete` with `status: "needs_input"` and\nan `outcome` that explains the blocker and next step. Never fabricate validation\nor review evidence to force progress.\n';
1943
+ var SKILL_default6 = '---\nname: flow-run\ndescription: "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."\n---\n\n# Flow Run\n\nUse this skill for implementation after a Flow plan is approved. Work one feature at a time.\n\nIf `flow_run_start` is unavailable, stop and tell the user to check that `opencode-plugin-flow` is loaded in OpenCode.\n\n## Start\n\n- Call `flow_status`.\n- If `flow_status` returns a `session.resumePacket` or\n `session.budget.phaseBoundary`, stop the current autonomous loop and report\n the resume instructions. Only call `flow_run_start` with\n `phaseBoundaryAck: true` at the start of a fresh user invocation that is\n explicitly resuming the Flow session; do not acknowledge a boundary inside\n the same uninterrupted loop that created it.\n- Call `flow_run_start` with no `featureId` unless the user or plan requires a specific runnable feature.\n- Treat the returned feature as the sole scope until it is completed, blocked, or reset.\n- Helper rule: when a named helper skill is unavailable, record the gap and\n keep the corresponding claims conservative instead of simulating its checks.\n- Load `flow-deslop` for cleanup/refactor features.\n- Load `flow-ui-quality` for frontend, UX, responsive, accessibility, or visual work.\n\n## Implement\n\n- Read the feature `targets`, `summary`, `validation`, dependencies, and plan `requirements`/`decisions`.\n- Treat the feature\'s `reviewDepth` as the minimum feature-review depth that\n must be recorded in `flow_feature_complete`.\n- For broad, risky, or multi-target work, record an implementation pass\n decision before editing: `serial`, `candidate-exact-path`,\n `candidate-worktree`, `tournament`, or `skipped`. Use\n `../flow/references/parallel-orchestration.md` for the decision rules,\n manifest fields, and compact `orchestrationPasses` record.\n- Classify `candidateEligibility` (`eligible`, `not_eligible`, or `unknown`)\n and `candidateDecision` (`used`, `skipped`, or `serial_required`) separately;\n implementation decisions must use `eligible` or `not_eligible` and always set\n an explicit `decision`. The valid pairings and the candidate execution\n evidence rules are in `../flow/references/parallel-orchestration.md` under\n "Implementation pass decision" — follow that reference when composing the\n record.\n- Record structured `decisionFactors`: `shared_state`, `overlapping_files`,\n `small_slice`, `needs_manager_judgment`, `independent_surface`, and\n `validation_available`.\n- Keep edits scoped to the active feature. If new scope appears, stop and replan or defer it to another feature.\n- Preserve unrelated user changes in the worktree.\n- When a wrong assumption invalidates the feature, use `flow_feature_reset`; do not pile patches onto a bad path.\n- Do not stage, commit, push, amend, rebase, publish, or mutate releases as part\n of feature execution. If the user explicitly asks for commit preparation, load\n `flow-commit` only after `flow_feature_complete` has been recorded, unless the\n user explicitly asks for a WIP commit path. Keep Git boundaries separate from\n Flow state recording.\n\n## Validate\n\n- For complex validation, regression-sensitive changes, browser QA, route QA,\n failure-prone checks, unclear coverage, exploratory QA, or\n `validationRun` summarization, load `flow-test` (helper rule applies).\n- Read `references/validation-rubric.md` before completing.\n- Run the strongest practical checks for the changed behavior.\n- Record concrete command names, status, and observed results. "Tests pass" is not evidence.\n- Non-final features complete with `validationScope: "targeted"`.\n- The final feature must run a broad project-level gate and use `validationScope: "broad"`.\n\nFor broad validation research, risky changes, or unclear coverage, use\n`../flow/references/parallel-orchestration.md` to fan out named Flow workers.\nUse the mode-to-agent mapping in that reference instead of generic subagents.\nWrite its pass manifest before fan-out, paste the matching handoff template\nfrom `../flow/references/handoff-format.md` into every worker prompt, and\napply its verification tiers to the handoffs that come back.\nThey may report command output they actually ran or propose focused checks; the\nmanager decides what is strong enough to record.\n\nFor independent implementation attempts, use candidate workers only with\nexplicit user authorization plus isolated worktrees or exact non-overlapping\npath ownership. Treat their output as candidate patches. The manager inspects,\nmerges or rejects, validates, and records Flow state serially. Record whether a\ncandidate was `accepted`, `modified`, or `rejected`.\nWhen a candidate pass or serial/skipped implementation decision materially\nshaped the feature, include its compact record in\n`flow_feature_complete.orchestrationPasses`. Do not paste full worker handoffs\nor long logs into the runtime payload.\n\n## Review and complete\n\nBefore `flow_feature_complete`, obtain a `featureReview` payload. Load\n`flow-review`; for read-only subagent reviews, the manager receives the review\npacket and records both `featureReviewDepth` and `featureReview`.\n\nSend reviewers a compact review packet. Do not rely on the accumulated parent\nconversation. Include only:\n\n- active feature id, title, summary, `reviewDepth`, targets, validation, and dependencies\n- relevant plan requirements, decisions, and final review policy\n- changed files and a short diff summary\n- validation evidence with exact commands, status, and observed result\n- targeted paths or risk lenses the reviewer must inspect\n\nIf the review returns `status: "failed"`, do not fix inside the review pass.\nRecord the failed attempt by calling `flow_feature_complete` with the otherwise\nprepared completion payload, the failed `featureReview`, and the attempted\n`featureReviewDepth`; the runtime will reject completion and update the retry\nbudget. Default to stopping and reporting the blocker. When the user already\nauthorized autonomous implementation, make at most one repair and run one retry\nreview. If the retry fails or the runtime reports review retry budget\nexhausted, stop with the blocker.\n\nIf `flow_status` reports `setup.skills` or `flow-review` cannot be loaded, do\nnot record a Flow-gated `featureReview` or `finalReview`. You may perform an\nadvisory review using available context or the bundled review fallback provided\nby plugin config, then complete with `status: "needs_input"` if review evidence\nis required to proceed.\n\nFor the final feature, also obtain a `finalReview` payload whose `reviewDepth` equals the approved plan\'s `finalReviewPolicy`.\n\nComplete with:\n\n```json\n{\n "status": "ok",\n "featureId": "active-feature-id",\n "summary": "what changed",\n "artifactsChanged": [{ "path": "src/file.ts" }],\n "validationRun": [\n { "command": "bun test tests/foo.test.ts", "status": "passed", "summary": "3 pass, exercised foo behavior" }\n ],\n "validationScope": "targeted",\n "featureReviewDepth": "standard",\n "featureReview": { "status": "passed", "summary": "review summary", "blockingFindings": [] },\n "orchestrationPasses": [\n {\n "id": "active-feature-id-implementation-decision",\n "kind": "implementation-decision",\n "decision": "serial",\n "decisionReason": "Shared contract edits made worker ownership unsafe.",\n "candidateEligibility": "not_eligible",\n "candidateDecision": "serial_required",\n "decisionFactors": ["shared_state", "overlapping_files"],\n "writeScope": "manager-serial",\n "verificationStatus": "not-needed",\n "outcome": "accepted"\n }\n ]\n}\n```\n\nIf `flow_feature_complete` returns a `session.resumePacket` or\n`session.budget.phaseBoundary`, stop after reporting the compact handoff. If\ngenuinely blocked, call `flow_feature_complete` with `status: "needs_input"` and\nan `outcome` that explains the blocker and next step. Never fabricate validation\nor review evidence to force progress.\n';
1627
1944
 
1628
1945
  // skills/flow-test/SKILL.md
1629
1946
  var SKILL_default7 = `---
@@ -2547,4 +2864,4 @@ main(process.argv).catch((error) => {
2547
2864
  process.exitCode = 1;
2548
2865
  });
2549
2866
 
2550
- //# debugId=70ED7108866181D964756E2164756E21
2867
+ //# debugId=6088D1387043CD7A64756E2164756E21