opencode-plugin-flow 4.1.0 → 4.1.2

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
@@ -1,7 +1,1069 @@
1
1
  #!/usr/bin/env node
2
- import{createHash as g}from"node:crypto";import{mkdir as aa,readdir as w,readFile as y,rm as b,writeFile as ta}from"node:fs/promises";import{dirname as ra,join as i,normalize as k,sep as x}from"node:path";var _=".flow-skill-version";function h(){return process.env.HOME??process.env.USERPROFILE??""}function F(e=h()){return i(e,".config","opencode","skills")}function R(e){return g("sha256").update(e).digest("hex")}async function u(e){try{return await y(e,"utf8")}catch(a){if(a.code==="ENOENT")return null;throw a}}function I(e){let a=new Map;if(!e)return a;for(let t of e.split(/\r?\n/)){let o=/^file=(.+) sha256=([a-f0-9]{64})$/.exec(t)??/^file=(.+)=sha256:([a-f0-9]{64})$/.exec(t);if(o?.[1]&&o[2])a.set(o[1],o[2]);let n=/^hash=sha256:([a-f0-9]{64})$/.exec(t);if(n?.[1]&&!a.has("SKILL.md"))a.set("SKILL.md",n[1])}return a}function C(e,a){let t=k(i(e,...a.split("/")));if(t!==e&&t.startsWith(`${e}${x}`))return t;throw Error(`Unsafe skill file path '${a}'.`)}async function p(e=h()){let a=F(e),t=[],o=[],n;try{n=await w(a)}catch(r){if(r.code==="ENOENT")return{removed:t,kept:o};throw r}for(let r of n){if(r!=="flow"&&!r.startsWith("flow-"))continue;let s=i(a,r),c=await u(i(s,_));if(c===null){o.push(s);continue}let f=I(c),l=!1;for(let[m,v]of f){let d=await u(C(s,m));if(d!==null&&R(d)!==v){l=!0;break}}if(l){o.push(s);continue}await b(s,{recursive:!0,force:!0}),t.push(s)}return{removed:t,kept:o}}async function U(e){if(e[2]!=="uninstall"){process.stderr.write(`usage: opencode-plugin-flow uninstall
3
- `),process.exitCode=2;return}let t=await p();for(let o of t.removed)process.stdout.write(`Removed Flow skill: ${o}
4
- `);for(let o of t.kept)process.stdout.write(`Kept non-Flow or user-edited skill: ${o}
2
+ import{createHash as xe}from"node:crypto";import{mkdir as xa,readdir as K,readFile as _e,rm as Re,writeFile as _a}from"node:fs/promises";import{createRequire as Ie}from"node:module";import{dirname as Fa,join as l,normalize as Fe,sep as Ce}from"node:path";var F=`# Flow worker handoff contract
3
+
4
+ Flow managers merge only the worker's final response. Treat that response as the
5
+ worker report of record: it must include the assigned scope, what was actually
6
+ covered, the evidence for each useful claim, and the remaining gaps. End worker
7
+ prompts with "Return only this Flow handoff."
8
+
9
+ ## Evidence, review, validation, or audit worker report
10
+
11
+ Use this for \`flow-evidence-worker\`, \`flow-reviewer\`,
12
+ \`flow-validation-worker\`, and \`flow-audit-worker\`.
13
+
14
+ \`\`\`markdown
15
+ ## Status
16
+ success | partial | blocked
17
+
18
+ ## Scope
19
+ <owned slice: path set, module, command, risk lens, route, data range, or question set>
20
+
21
+ ## Coverage
22
+ - Expected: <files, ranges, questions, commands, or findings assigned>
23
+ - Checked: <actual coverage, for example "12/12 files" or "command not run">
24
+ - Not checked: <items skipped with reason, or "none">
25
+
26
+ ## Findings or facts
27
+ - [high|med|low] <claim>; evidence: <file:line | command summary | screenshot path | URL | metric>; corroboration: <N sources or "single source">
28
+ - [high|med|low] <claim>; evidence: <...>; corroboration: <...>
29
+
30
+ ## Sources
31
+ - <paths read, commands run, docs fetched, data ranges covered, screenshots inspected>
32
+
33
+ ## Confidence and verification
34
+ - Verified: <claims directly re-run, recounted, traced, or cross-checked>
35
+ - Single-source: <claims with exactly one supporting source>
36
+ - Inferred: <claims derived from surrounding evidence rather than directly observed>
37
+ - Unsettled: <claims, sources, or citations that could not be resolved>
38
+ - Falsifier or missing input: <what would overturn or materially change the result>
39
+
40
+ ## Open questions / gaps
41
+ - <ambiguity, missing source, contradiction, skipped item, or out-of-scope dependency>
42
+
43
+ ## Manager follow-ups
44
+ - <concrete next tasks, verifier claims, validation commands, or Flow plan targets>
45
+ \`\`\`
46
+
47
+ Validation workers must include exact command names and raw outcome summaries
48
+ for commands they actually ran. Audit workers must include guards checked for
49
+ any blocking-severity candidate. Review workers must separate blocking findings
50
+ from advisory notes.
51
+
52
+ ## Verifier worker report
53
+
54
+ Use this for \`flow-verifier-worker\`. Give it atomic claims and the cited sources
55
+ or commands. Do not include the generator's reasoning unless that reasoning is
56
+ the thing being verified.
57
+
58
+ \`\`\`markdown
59
+ ## Status
60
+ success | partial | blocked
61
+
62
+ ## Scope
63
+ <claim ids, sources or commands checked, and the acceptance question>
64
+
65
+ ## Verdict per claim
66
+ - <claim id>: verdict=<supported | partly-supported | unsupported | source-not-found>
67
+ - claim: <claim text>
68
+ - evidence: <supporting snippet, path plus line, measured value, command result, or "none">
69
+ - source resolution: <URL, path, or command plus whether it resolved>
70
+ - confidence level: high | med | low
71
+ - recommended action: <keep, narrow, rewrite, or remove>
72
+
73
+ ## Overall
74
+ <accept | revise | reject> because <brief reason>
75
+
76
+ ## Gaps
77
+ - <unavailable source, ambiguous claim wording, missing oracle, or check not run>
78
+
79
+ ## Manager follow-ups
80
+ - <narrow recheck, plan adjustment, review finding, or none>
81
+ \`\`\`
82
+
83
+ ## Candidate implementation worker report
84
+
85
+ Use this only for isolated worktrees or exact non-overlapping path ownership
86
+ authorized by the manager.
87
+
88
+ \`\`\`markdown
89
+ ## Status
90
+ success | partial | blocked
91
+
92
+ ## Scope
93
+ <isolated worktree or exact path-owned slice>
94
+
95
+ ## Changed or proposed patch
96
+ - <path>: <what changed and why>
97
+
98
+ ## Coverage
99
+ - Assigned: <owned files/modules>
100
+ - Touched: <files changed or proposed>
101
+ - Skipped: <anything assigned but not changed and why, or "none">
102
+
103
+ ## Verification
104
+ live-verified | test-verified | type-check-only | not-verified
105
+ - <command, observed outcome, pass/fail counts, or manual check>
106
+
107
+ ## Confidence and risk
108
+ - Checked directly: <behavior, files, or commands verified by the worker>
109
+ - Still open: <tests, review paths, or integration points the manager must cover>
110
+ - Risk: low | medium | high -- <why>
111
+
112
+ ## Merge notes
113
+ - <conflicts, nearby user changes, assumptions, or deviations>
114
+
115
+ ## Manager follow-ups
116
+ - <merge, reject, rerun check, verifier pass, or replan task>
117
+ \`\`\`
118
+
119
+ The manager must inspect and validate any candidate patch before recording Flow
120
+ completion.
121
+ `;var C=`# Parallel orchestration
122
+
123
+ Use fan-out when Flow work is broad enough that independent workers can gather
124
+ evidence faster than one linear pass. The manager still owns the Flow session:
125
+ only the manager calls state-changing Flow tools, approves plans, completes
126
+ features, records reviews, or closes sessions.
127
+
128
+ Read these companion references before a broad wave:
129
+
130
+ - \`handoff-format.md\` for the exact worker response shapes.
131
+ - \`verification-gates.md\` for coverage checks, handoff acceptance, verifier
132
+ triggers, and synthesis rules.
133
+
134
+ ## Manager sequence
135
+
136
+ 1. Call \`flow_status\` if a Flow session may already exist.
137
+ 2. Do a serial orientation pass. Read enough files, schemas, docs, tests,
138
+ commands, or artifacts to identify real slices.
139
+ 3. Define the local manager task. Do not delegate the immediate blocker that
140
+ determines whether fan-out is even valid.
141
+ 4. Build a pre-fan-out coverage gate:
142
+ - total files, modules, routes, commands, findings, rows, or claims in scope.
143
+ - one line per slice with path/range/lens and expected count.
144
+ - partition check showing slices add back to the total when the work is
145
+ countable.
146
+ - overlap/gap check showing no duplicate ownership, empty slices, or missing
147
+ target areas.
148
+ 5. Spawn only named Flow workers. Use exact slices and the required handoff
149
+ shape. Keep each prompt self-contained.
150
+ 6. Continue non-overlapping manager work while workers run.
151
+ 7. Read every handoff. Keep only claims that have evidence, match the assigned
152
+ scope, and carry confidence labels.
153
+ 8. Send important low-confidence, single-source, contested, or citation-heavy
154
+ claims to \`flow-verifier-worker\`.
155
+ 9. Run second waves only for material gaps, conflicts, narrowed scope, or
156
+ verification needs.
157
+ 10. Synthesize one Flow artifact: plan fields, completion evidence, review
158
+ payload, audit report, or candidate patch decision. Do not paste worker
159
+ handoffs as the user-facing result.
160
+
161
+ ## Modes
162
+
163
+ When fanning out Flow work, select the matching hidden Flow agent by name. Do
164
+ not use generic subagents for Flow slices because Flow workers carry the
165
+ permission boundaries for each mode.
166
+
167
+ | Mode | Use agent | Worker output | Write access | Flow tools |
168
+ | --- | --- | --- | --- | --- |
169
+ | \`evidence\` | \`flow-evidence-worker\` | Coverage, facts, files inspected, confidence, gaps, suggested plan targets | No | \`flow_status\` only if needed |
170
+ | \`review\` | \`flow-reviewer\` | Coverage, candidate findings or review slice summary, confidence, gaps | No | \`flow_status\` only if needed |
171
+ | \`validation\` | \`flow-validation-worker\` | Command options or manager-authorized raw output, coverage, confidence, gaps | No code edits; commands only when explicitly allowed | \`flow_status\` only if needed |
172
+ | \`audit\` | \`flow-audit-worker\` | Refuted or surviving finding candidates, guards checked, confidence, gaps | No | \`flow_status\` only if needed |
173
+ | \`verifier\` | \`flow-verifier-worker\` | Per-claim verdicts against cited evidence or commands | No | \`flow_status\` only if needed |
174
+ | \`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 |
175
+
176
+ Do not fan out parallel \`flow_plan_save\`, \`flow_plan_approve\`,
177
+ \`flow_run_start\`, \`flow_feature_complete\`, \`flow_feature_reset\`, or
178
+ \`flow_session_close\` calls. Runtime locking protects files, but Flow accepts only
179
+ one active feature result at a time.
180
+
181
+ ## Worker rules
182
+
183
+ Workers may read files, inspect docs, run authorized read-only commands, and
184
+ summarize evidence. Candidate implementation workers may edit only when the
185
+ manager assigned an isolated worktree or exact path ownership that does not
186
+ overlap sibling workers or manager edits.
187
+
188
+ Workers must not edit \`.flow/**\` and must not call:
189
+
190
+ - \`flow_plan_save\`
191
+ - \`flow_plan_approve\`
192
+ - \`flow_run_start\`
193
+ - \`flow_feature_complete\`
194
+ - \`flow_feature_reset\`
195
+ - \`flow_session_close\`
196
+
197
+ Workers also must not approve work, close sessions, record Flow validation, or
198
+ claim validation they did not run. A worker may report raw validation output it
199
+ actually ran; the manager decides whether it is strong enough to record.
200
+
201
+ ## Prompt contract
202
+
203
+ Every worker prompt includes:
204
+
205
+ \`\`\`text
206
+ Overall goal, context only: <goal>
207
+ Mode: evidence | review | validation | audit | verifier | candidate-implementation
208
+ Your exact slice: <paths, modules, command, claim ids, risk lens, or worktree>
209
+ Expected coverage: <count, paths, range, or complete question set>
210
+ Do: <bounded actions>
211
+ Do not: call Flow state tools, edit .flow/**, own sibling slices, or make the final Flow verdict.
212
+ Return exactly the matching handoff shape from handoff-format.md.
213
+ \`\`\`
214
+
215
+ For research or current-doc slices, require source checks for versioned or
216
+ time-sensitive facts. For implementation candidates, remind workers that other
217
+ work may be active and that they must not revert unrelated changes.
218
+
219
+ ## Where handoffs go
220
+
221
+ - Planning evidence becomes \`requirements\`, \`decisions\`, feature \`targets\`,
222
+ feature \`validation\`, or plan notes in prose fields.
223
+ - Execution evidence informs the active feature, but \`flow_feature_complete\` is
224
+ manager-owned.
225
+ - Validation evidence may become \`validationRun\` only when the command, status,
226
+ and raw outcome are concrete enough to trust.
227
+ - Review evidence informs \`featureReview\` or \`finalReview\`, but the manager owns
228
+ the pass/fail verdict.
229
+ - Audit evidence becomes findings only after refutation and verification rules
230
+ in \`verification-gates.md\`.
231
+ - Candidate patches are inspected, merged, and validated by the manager before
232
+ any Flow completion call.
233
+
234
+ When worker results conflict, inspect the underlying artifact directly and rerun
235
+ the smallest check that can settle the disagreement.
236
+
237
+ ## Second waves
238
+
239
+ Start a follow-up wave when first-wave handoffs reveal:
240
+
241
+ - missing coverage in the original slice map.
242
+ - conflicting findings that matter to the Flow decision.
243
+ - a specialized follow-up that was intentionally out of scope.
244
+ - high-stakes, low-confidence, or single-source claims needing verification.
245
+ - bounded implementation candidates after research converges.
246
+
247
+ Do not recurse by default. If a worker says it needs another worker, the manager
248
+ decides whether that is a second wave and writes the next bounded prompt.
249
+ `;var U='# 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`.\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';var A=`# Verification gates
250
+
251
+ Verification is how Flow keeps parallel work from turning into parallel
252
+ guesswork. Worker handoffs are candidate evidence; the manager decides what can
253
+ enter the plan, validation record, review payload, audit report, or final
254
+ answer.
255
+
256
+ ## Before fan-out
257
+
258
+ Run a pre-fan-out gate after serial orientation and before spawning workers:
259
+
260
+ - Count the total work items when countable: files, modules, routes, commands,
261
+ rows, findings, screenshots, or claims.
262
+ - List every slice with path/range/lens and expected count.
263
+ - Check that countable slices add back to the total.
264
+ - Check for overlapping ownership, missing areas, empty slices, and ambiguous
265
+ shared contracts.
266
+ - Fix the slice map centrally before spawning if the gate does not reconcile.
267
+
268
+ If the scope cannot be counted, state the completeness rule instead, such as
269
+ "all changed files plus callers" or "all public commands plus release docs."
270
+
271
+ ## Every handoff
272
+
273
+ Accept a handoff only after a cheap manager-side pass:
274
+
275
+ - \`Status\` is terminal: \`success\`, \`partial\`, or \`blocked\`.
276
+ - Coverage matches the assigned slice, or skips are explicit.
277
+ - Important claims have concrete evidence and confidence tags.
278
+ - Cited paths, commands, screenshots, URLs, or metrics resolve.
279
+ - The evidence supports the claim, not just the topic.
280
+ - Findings stay inside the worker's slice.
281
+ - Headline counts can be recounted or traced.
282
+ - Contradictions between workers are either resolved or explicitly marked as
283
+ contested.
284
+
285
+ Demote, drop, re-task, or verify claims that fail this pass.
286
+
287
+ ## Verifier triggers
288
+
289
+ Use \`flow-verifier-worker\` when a claim is:
290
+
291
+ - blocking or release-sensitive.
292
+ - high-stakes for user data, security, persistence, permissions, or public API
293
+ behavior.
294
+ - low-confidence, inferred, surprising, or single-sourced.
295
+ - citation-heavy enough that source drift would change the conclusion.
296
+ - contradicted by another worker or by manager inspection.
297
+ - a count, benchmark, command result, or pass/fail claim that a Flow payload will
298
+ rely on.
299
+
300
+ Give the verifier atomic claims, cited sources or commands, and the acceptance
301
+ question. Do not ask it to redesign the work or review the whole feature.
302
+
303
+ ## Flow payload acceptance
304
+
305
+ Planning fields may use worker evidence only when the source and scope are clear.
306
+ Unverified broad findings should become a review-first feature, not a fix plan.
307
+
308
+ \`validationRun\` entries may use worker-reported commands only when the worker
309
+ was explicitly authorized to run the command and reported the exact command,
310
+ status, and raw outcome summary.
311
+
312
+ \`featureReview\` and \`finalReview\` may use worker review slices, but the manager
313
+ owns the pass/fail decision and must resolve blockers, contradictions, and
314
+ coverage gaps before returning the payload.
315
+
316
+ Audit reports may include only findings that survived refutation. Blocking audit
317
+ findings need guards checked, deployment context, and evidence that the current
318
+ code exhibits the behavior.
319
+
320
+ Candidate implementation patches are not Flow evidence until the manager
321
+ inspects, merges or rejects them, and runs suitable validation in the main
322
+ Flow-managed workspace.
323
+
324
+ ## Final synthesis
325
+
326
+ Before presenting or recording the result:
327
+
328
+ - Preserve confidence: verified, single-sourced, inferred, and unresolved claims
329
+ stay distinct when it matters.
330
+ - When workers disagree, inspect the cited artifact or rerun the cited command
331
+ instead of arbitrating from summaries.
332
+ - Run the strongest practical local check for the deliverable.
333
+ - Re-read critical files or docs that will be cited in the final decision.
334
+ - Record gaps honestly instead of converting missing evidence into success
335
+ language.
336
+
337
+ \`Status: success\` only says the worker believes its slice is done. The manager
338
+ still checks coverage and evidence before trusting the result.
339
+ `;var q="---\nname: flow\ndescription: Main Flow loop for skills-first OpenCode work. Use when a user asks for Flow-guided planning, autonomous execution, resumable implementation, session status, or end-to-end delivery with validation and review gates.\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\n## Loop\n\n1. Call `flow_status` first. Trust its active session and next action over conversation memory.\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`. 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.\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 waves. Its `references/handoff-format.md` and `references/verification-gates.md` companions define the worker contracts. The manager owns every `flow_*` state change.\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\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";var T=`# Safe refactor workflow
340
+
341
+ Refactoring is a behavior-preserving sequence of small changes. This workflow keeps cleanup from becoming an unreviewable rewrite.
342
+
343
+ ## Before editing
344
+
345
+ - Define the invariant: what behavior, API, schema, command, state path, or visual output must remain unchanged.
346
+ - Locate callers and tests before changing the target. If there is no test coverage, add or run the narrowest check that proves current behavior.
347
+ - Identify the smallest reversible move: remove dead code, rename, extract, inline, move, consolidate, or split phase.
348
+ - Choose a validation command that can fail for the behavior you might break.
349
+
350
+ ## During editing
351
+
352
+ - Make one structural move at a time, then re-run the relevant check when risk is non-trivial.
353
+ - Prefer deleting or inlining a useless layer before introducing a new one.
354
+ - Keep names domain-specific. Generic names like \`manager\`, \`processor\`, \`utils\`, and \`helper\` are suspect unless the repo already owns that vocabulary.
355
+ - Avoid mixed commits inside a feature: no unrelated formatting, package churn, comment rewrites, or style sweeps.
356
+ - If the refactor uncovers a behavior bug, stop and replan unless the approved feature already includes fixing that bug.
357
+
358
+ ## Validation evidence
359
+
360
+ Good cleanup evidence includes:
361
+
362
+ - focused tests for behavior touched by the refactor.
363
+ - typecheck/lint/build output for mechanical structure changes.
364
+ - before/after references for deleted exports, commands, generated files, and docs when static search is not enough.
365
+ - broad validation when shared abstractions, public APIs, persistence, or cross-feature integration changed.
366
+
367
+ Weak evidence includes:
368
+
369
+ - "No tests needed" for behavior-adjacent refactors.
370
+ - tests that were edited to match the new shape but do not prove the old behavior.
371
+ - scanner metrics without human inspection.
372
+ - green tests after changing unrelated surfaces not covered by those tests.
373
+
374
+ ## Review checklist
375
+
376
+ - Every changed artifact maps to the approved cleanup scope.
377
+ - The new structure has fewer reasons to change, not just fewer lines.
378
+ - Public contracts and compatibility shims remain intact or were explicitly planned.
379
+ - Deleted code is actually unreachable or obsolete.
380
+ - Validation can catch a realistic mistake in the refactor.
381
+ `;var P=`# Deslop smell rubric
382
+
383
+ Use this rubric to turn vague cleanup instincts into reviewable findings.
384
+
385
+ ## Actionable smell classes
386
+
387
+ - **duplication** — repeated logic or conditionals that must change together. Confirm whether small repetition is clearer than abstraction.
388
+ - **bloat** — long function, large class/module, or oversized component whose responsibilities are mixed enough to hide behavior.
389
+ - **speculative generality** — unused extension points, factories, options, interfaces, or configuration added for imagined futures.
390
+ - **dead code** — unreachable branches, unused exports, stale flags, abandoned helpers, obsolete tests, or comments describing code that no longer exists.
391
+ - **primitive obsession** — stringly typed modes, loosely shaped objects, or magic literals that obscure a domain constraint already present elsewhere.
392
+ - **shotgun surgery** — one conceptual change requires scattered edits across unrelated modules.
393
+ - **feature envy / misplaced responsibility** — code repeatedly reaches into another module's internals instead of using the owning boundary.
394
+ - **message chains / excessive delegation** — call chains or wrappers that add no policy and make behavior harder to locate.
395
+ - **agent slop** — verbose scaffolding, duplicate defensive branches, generic helper layers, temporary flags, commented-out code, debug output, or invented patterns that do not match the repo.
396
+ - **test-oracle slop** — tests that assert implementation trivia, snapshots of noisy markup, or mocks that make broken behavior pass.
397
+
398
+ ## Non-smells until proven
399
+
400
+ - Repetition that makes two workflows intentionally independent.
401
+ - Framework-required shape, generated code, migration history, compatibility shims, or public API affordances.
402
+ - Verbose guards protecting data loss, security, lifecycle ordering, or error observability.
403
+ - Logging/metrics that operators or tests rely on.
404
+ - Local style differences already accepted by the repo and not hurting changeability.
405
+
406
+ ## Finding shape
407
+
408
+ Each blocking cleanup finding should carry:
409
+
410
+ \`\`\`text
411
+ class; severity; location; evidence read; refutation checked; why it matters; safe fix shape; validation command
412
+ \`\`\`
413
+
414
+ Rate as blocking only when the smell materially raises defect risk, blocks planned work, hides behavior, or makes the success claim unverifiable. Style-only cleanup is advisory.
415
+ `;var D=`---
416
+ name: flow-deslop
417
+ description: Flow guidance for evidence-backed code smell cleanup, AI-slop removal, overengineering reduction, maintainability refactors, and behavior-preserving cleanup. Use when planning, executing, or reviewing broad cleanup/refactor work, code smell findings, duplicated or bloated code, speculative abstractions, dead code, or agent-introduced mess.
418
+ ---
419
+
420
+ # Flow deslop
421
+
422
+ 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.
423
+
424
+ ## Ground the cleanup
425
+
426
+ - 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.
427
+ - Load \`references/smell-rubric.md\` when classifying findings or deciding what is worth fixing.
428
+ - Load \`references/refactor-workflow.md\` before implementing or reviewing non-trivial cleanup.
429
+ - Treat scanner output, metrics, and model impressions as candidates only. A smell becomes actionable after reading the surrounding code, callers, tests, and relevant contracts.
430
+ - Record cleanup context in existing Flow plan fields: \`requirements\`, \`decisions\`, feature \`targets\`, and feature \`validation\`. Do not invent new Flow payload fields.
431
+
432
+ ## Plan cleanup work
433
+
434
+ - Prefer one feature per validated cleanup theme with a clear validation story. "Clean the whole repo" starts with a review-first feature that produces evidence-backed findings, then fix features for confirmed clusters.
435
+ - Keep refactors small and behavior-preserving. If a cleanup requires behavior change, surface it as product scope and replan.
436
+ - State what will not be cleaned. Broad cleanup without boundaries invites churn and makes review impossible.
437
+ - Choose validation before editing: focused tests for affected behavior, typecheck/lint for mechanical changes, and a broad gate when cleanup spans shared abstractions.
438
+
439
+ ## Execute cleanup safely
440
+
441
+ - Preserve public APIs, persisted data, command names, tool names, and observable behavior unless the approved plan explicitly changes them.
442
+ - Prefer removal, consolidation, naming, and local extraction before new abstractions. New abstractions must reduce real duplication or clarify an existing boundary.
443
+ - Delete dead code only after checking references, exports, generated entrypoints, docs, tests, and runtime/distribution paths that static search may miss.
444
+ - Keep every change tied to a finding or plan target. Opportunistic style edits are out of scope.
445
+
446
+ ## Review cleanup claims
447
+
448
+ For each claimed smell removal, verify:
449
+
450
+ - **location** — the changed code and the original smell were actually read.
451
+ - **impact** — the change reduces duplication, coupling, complexity, or future-change risk in a concrete way.
452
+ - **refutation checked** — apparent smell was not intentional compatibility, performance, generated code, framework convention, or a safety guard.
453
+ - **behavior preserved** — tests or other evidence cover the behavior touched.
454
+ - **blast radius** — public contracts and downstream callers still work.
455
+
456
+ Never approve cleanup because it "looks cleaner" without evidence. Tests passing is necessary but not sufficient when the refactor changes structure across files.
457
+ `;var j=`# Parallel discovery
458
+
459
+ 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.
460
+
461
+ For broad waves, also load \`../../flow/references/parallel-orchestration.md\`.
462
+ Use its pre-fan-out coverage gate and
463
+ \`../../flow/references/handoff-format.md\` response shapes.
464
+
465
+ ## Good slices
466
+
467
+ - Independent modules or packages.
468
+ - Frontend route and backend endpoint pairs.
469
+ - Test, CI, and release surfaces.
470
+ - Risk lenses such as security, persistence, accessibility, migration, or performance.
471
+ - Documentation and operator-contract checks.
472
+
473
+ ## Flow repo default slices
474
+
475
+ For this repository, good first-wave slices are:
476
+
477
+ - Runtime gates: \`src/runtime/schema.ts\`, \`src/runtime/transitions.ts\`,
478
+ \`src/runtime/api.ts\`, and \`tests/runtime-gates.test.ts\`.
479
+ - Workspace persistence: \`src/runtime/workspace.ts\`,
480
+ \`src/runtime/json/strict-object.ts\`, and
481
+ \`tests/workspace-persistence.test.ts\`.
482
+ - OpenCode adapter surface: \`src/adapters/opencode/**\`, \`src/config-shared.ts\`,
483
+ \`src/config.ts\`, \`src/index.ts\`, and surface tests.
484
+ - Distribution and synced skills: \`src/distribution/**\`, \`src/cli.ts\`,
485
+ \`skills/**\`, and distribution tests.
486
+ - CI, package, and release contract: \`.github/workflows/**\`, \`package.json\`,
487
+ \`bun.lock\`, \`README.md\`, and \`CHANGELOG.md\`.
488
+ - Docs and operator contract: \`docs/**\`, \`README.md\`, and skill references.
489
+
490
+ ## Coverage gate
491
+
492
+ Before spawning workers, state the total discovery scope and one line per slice.
493
+ For countable scopes, confirm that slice counts add back to the total and that
494
+ there are no overlaps, gaps, or empty slices. If the scope is not countable,
495
+ state the completeness rule, such as "all changed files plus callers."
496
+
497
+ ## Worker prompt
498
+
499
+ \`\`\`text
500
+ Inspect <slice> for <goal>. Read-only. Do not edit files or call Flow tools.
501
+ Return the evidence/review/validation/audit handoff shape from ../../flow/references/handoff-format.md.
502
+ \`\`\`
503
+
504
+ For validation-oriented discovery:
505
+
506
+ \`\`\`text
507
+ Inspect <slice> for validation risk. Read-only. Do not edit files or call Flow
508
+ tools. You may report commands that should be run, and include raw output only
509
+ for commands you actually ran. Return the evidence/review/validation/audit
510
+ handoff shape from ../../flow/references/handoff-format.md.
511
+ \`\`\`
512
+
513
+ ## Synthesis
514
+
515
+ Convert only evidence-backed work into plan fields:
516
+
517
+ - \`requirements\`: user promises and externally visible acceptance criteria.
518
+ - \`decisions\`: architecture boundaries, rejected approaches, and scope cuts.
519
+ - feature \`targets\`: files, modules, routes, commands, docs, or workflows the feature owns.
520
+ - feature \`validation\`: checks expected to prove the feature.
521
+
522
+ 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.
523
+ `;var W=`# Planning examples
524
+
525
+ ## Rate limiting feature set
526
+
527
+ Human summary:
528
+
529
+ 1. **In-memory rate limit middleware** - add request counting and response headers for one-process deployments.
530
+ 2. **Redis-backed limiter** - add shared store adapter for multi-instance deployments.
531
+ 3. **Operator docs** - document configuration and rollout notes.
532
+
533
+ Payload:
534
+
535
+ \`\`\`json
536
+ {
537
+ "goal": "Add API rate limiting with local and Redis-backed stores",
538
+ "plan": {
539
+ "summary": "Add configurable rate limiting for API routes.",
540
+ "overview": "Implement middleware first, then a Redis store, then document rollout.",
541
+ "requirements": [
542
+ "Preserve existing route behavior except rate-limit responses.",
543
+ "Expose deterministic headers for limit, remaining, and reset time."
544
+ ],
545
+ "decisions": [
546
+ "Start with an in-memory store for single-process deployments.",
547
+ "Keep Redis behind a store interface so tests can use a mock."
548
+ ],
549
+ "finalReviewPolicy": "detailed",
550
+ "features": [
551
+ {
552
+ "id": "rate-limit-middleware",
553
+ "title": "In-memory limiter",
554
+ "summary": "Add middleware, config, and tests for single-process rate limiting.",
555
+ "targets": ["src/middleware/rate-limit.ts", "src/app.ts", "src/config.ts"],
556
+ "validation": ["route tests for limit/reset/header behavior", "typecheck"],
557
+ "dependsOn": []
558
+ },
559
+ {
560
+ "id": "redis-store",
561
+ "title": "Redis store",
562
+ "summary": "Add a Redis-backed rate limit store without changing middleware behavior.",
563
+ "targets": ["src/middleware/stores/redis.ts", "src/middleware/rate-limit.ts"],
564
+ "validation": ["store tests with Redis mock", "manual two-process recipe if practical"],
565
+ "dependsOn": ["rate-limit-middleware"]
566
+ },
567
+ {
568
+ "id": "operator-docs",
569
+ "title": "Operator docs",
570
+ "summary": "Document configuration, headers, and rollout guidance.",
571
+ "targets": ["README.md", "docs/operations.md"],
572
+ "validation": ["lint docs if available", "review examples against implemented config"],
573
+ "dependsOn": ["redis-store"]
574
+ }
575
+ ]
576
+ }
577
+ }
578
+ \`\`\`
579
+
580
+ ## Review-first cleanup
581
+
582
+ Bad plan:
583
+
584
+ \`\`\`text
585
+ 1. Simplify services
586
+ 2. Remove duplication
587
+ 3. Improve tests
588
+ \`\`\`
589
+
590
+ Why it is bad: no evidence names which services are actually tangled, what duplication exists, or which behavior needs test coverage.
591
+
592
+ Better plan:
593
+
594
+ \`\`\`text
595
+ 1. Audit service layer - produce evidence-backed findings with file:line citations, guards checked, and follow-up order.
596
+ 2. Consolidate confirmed config parsing duplication - only if the audit proves the duplication exists and is safe to merge.
597
+ 3. Add behavior-preservation tests for the changed service paths.
598
+ \`\`\`
599
+
600
+ ## Decomposition anti-patterns
601
+
602
+ - Feature per file when behavior crosses files.
603
+ - Feature per implementation step with no user-visible or reviewable outcome.
604
+ - Plan fixes for findings not yet verified.
605
+ - Validation that only says "manual testing".
606
+ - Targets that name the entire repo.
607
+ - Features with hidden dependencies instead of \`dependsOn\`.
608
+ `;var z=`---
609
+ name: flow-plan
610
+ 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.
611
+ ---
612
+
613
+ # Flow Plan
614
+
615
+ Use this skill before implementation. The output is a compact plan the runtime can enforce and future agents can execute without rediscovering the goal.
616
+
617
+ If \`flow_plan_save\` is unavailable, stop and tell the user to check that \`opencode-plugin-flow\` is loaded in OpenCode.
618
+
619
+ ## Inspect first
620
+
621
+ - Read the files, docs, tests, package scripts, and local conventions that determine the work.
622
+ - 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.
623
+ - For cleanup/refactor goals, load \`flow-deslop\`.
624
+ - For UI/frontend goals, load \`flow-ui-quality\`.
625
+ - Do not invent findings. Broad "review and fix" goals start with a review-first feature whose deliverable is evidence-backed findings.
626
+
627
+ ## Plan shape
628
+
629
+ Call \`flow_plan_save\` with:
630
+
631
+ \`\`\`json
632
+ {
633
+ "goal": "user-visible goal",
634
+ "plan": {
635
+ "summary": "one-sentence outcome",
636
+ "overview": "implementation strategy and boundaries",
637
+ "requirements": ["constraints, acceptance criteria, user promises"],
638
+ "decisions": ["architecture or scope decisions already made"],
639
+ "finalReviewPolicy": "detailed",
640
+ "features": [
641
+ {
642
+ "id": "lowercase-kebab-case",
643
+ "title": "Short title",
644
+ "summary": "Outcome this feature delivers",
645
+ "targets": ["files, modules, routes, commands, or docs in scope"],
646
+ "validation": ["focused checks expected before completion"],
647
+ "dependsOn": []
648
+ }
649
+ ]
650
+ }
651
+ }
652
+ \`\`\`
653
+
654
+ Use \`finalReviewPolicy: "broad"\` only for low-risk, narrow work. Use \`"detailed"\` for behavioral changes, cross-module edits, migrations, releases, security-sensitive code, or large refactors.
655
+
656
+ ## Feature sizing
657
+
658
+ - Each feature should have one owner, one coherent outcome, and a validation story.
659
+ - Split by dependency order: foundations before callers, schema before consumers, implementation before docs when docs depend on behavior.
660
+ - Avoid "misc cleanup" features. Tie cleanup to evidence and targets.
661
+ - Keep feature ids stable once the plan is approved.
662
+ - Put scope boundaries in \`targets\` and expected checks in \`validation\`.
663
+
664
+ ## Approval
665
+
666
+ After saving, summarize the plan to the user or proceed if they already authorized implementation. Then call \`flow_plan_approve\`. Approved plans are immutable; changing them later requires reset/closure rather than silent edits.
667
+
668
+ See \`references/planning-examples.md\` for payload examples and decomposition anti-patterns.
669
+ `;var B=`# Review rubric
670
+
671
+ Use this to decide whether a \`featureReview\` or \`finalReview\` payload may pass.
672
+
673
+ ## Finding classes
674
+
675
+ - **correctness**: wrong result, broken state transition, bad edge case, race, data loss, or crash.
676
+ - **contract**: public API, CLI, config, persisted data, or documented behavior changed without plan approval.
677
+ - **security/privacy**: unsafe input handling, secret exposure, permission bypass, or insecure default.
678
+ - **test-coverage**: behavioral change lacks a check strong enough for the risk.
679
+ - **maintainability**: complexity or coupling creates concrete future-change risk.
680
+ - **ui/accessibility**: user cannot complete the workflow, layout breaks, accessibility basics fail, or visual claims lack evidence.
681
+
682
+ ## Severity
683
+
684
+ - **blocking**: must fail the review. Includes incorrect behavior, data loss, security risk, unverifiable completion claims, missing validation for behavioral work, or unresolved scope drift.
685
+ - **advisory**: worth noting but does not block the current goal.
686
+
687
+ If unsure whether a finding is real, read more or downgrade it. Do not promote guesses to blockers.
688
+
689
+ ## Feature review checklist
690
+
691
+ - The work matches the active feature's \`summary\`, \`targets\`, and dependencies.
692
+ - Plan \`requirements\` and \`decisions\` are still honored.
693
+ - Changed files were read, not just summarized.
694
+ - Validation evidence covers the behavior touched.
695
+ - New tests or manual checks would fail or visibly differ without the change where practical.
696
+ - No unrelated scope slipped in.
697
+ - Public contracts and downstream callers still work.
698
+
699
+ ## Final review checklist
700
+
701
+ - Every feature is complete and together they satisfy the original goal.
702
+ - Broad validation ran and passed.
703
+ - The final review depth equals the approved \`finalReviewPolicy\`.
704
+ - Feature-level reviews have no unresolved blocking findings.
705
+ - Docs, commands, package metadata, and release surfaces match the delivered behavior.
706
+ - Remaining gaps are explicit and do not contradict \`kind: "completed"\`.
707
+
708
+ ## Payloads
709
+
710
+ Feature review:
711
+
712
+ \`\`\`json
713
+ {
714
+ "status": "passed",
715
+ "summary": "Reviewed changed runtime files and focused tests; validation covers the new gate.",
716
+ "blockingFindings": []
717
+ }
718
+ \`\`\`
719
+
720
+ Failed feature review:
721
+
722
+ \`\`\`json
723
+ {
724
+ "status": "failed",
725
+ "summary": "Validation does not exercise the changed persistence path.",
726
+ "blockingFindings": [
727
+ {
728
+ "summary": "No test covers archive removal of .flow/session.json after close.",
729
+ "severity": "blocking"
730
+ }
731
+ ]
732
+ }
733
+ \`\`\`
734
+
735
+ Final review:
736
+
737
+ \`\`\`json
738
+ {
739
+ "status": "passed",
740
+ "summary": "Reviewed plan scope, all changed files, broad validation, and release metadata.",
741
+ "blockingFindings": [],
742
+ "reviewDepth": "detailed"
743
+ }
744
+ \`\`\`
745
+
746
+ ## Audit report reviews
747
+
748
+ When reviewing a findings report, verify findings adversarially:
749
+
750
+ - Check the cited file and surrounding code.
751
+ - Trace mitigating paths before accepting blocking severity.
752
+ - Confirm the deployment model used for severity.
753
+ - Dedupe overlapping findings.
754
+ - Downgrade or reject findings that do not survive refutation.
755
+
756
+ Approve only on evidence actually inspected. A review is a claim of coverage, not a courtesy stamp.
757
+ `;var O=`---
758
+ name: flow-review
759
+ 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.
760
+ ---
761
+
762
+ # Flow Review
763
+
764
+ Use this skill for review. The reviewer is usually read-only and does not mutate Flow state. The manager records the returned review payload inside \`flow_feature_complete\`.
765
+
766
+ If Flow tools are unavailable, perform an advisory review and say that no Flow-gated review payload was recorded.
767
+
768
+ ## Start
769
+
770
+ - Call \`flow_status\` when available.
771
+ - Identify whether this is a feature review or final review.
772
+ - Read the approved plan fields relevant to the work: \`requirements\`, \`decisions\`, feature \`targets\`, feature \`validation\`, and dependencies.
773
+ - Inspect the actual diff, changed files, tests, and validation output. Do not review only the completion summary.
774
+ - Load \`references/review-rubric.md\` for severity, depth, and payload shape.
775
+
776
+ ## Depth
777
+
778
+ - **quick**: docs, comments, config-only changes, or mechanical changes fully covered by tooling.
779
+ - **standard**: default feature review. Read every changed file and relevant tests.
780
+ - **detailed**: final review, risky behavior, persistence, security, cross-module refactors, migrations, releases, or weak validation.
781
+
782
+ Claim only the depth actually performed. Missing evidence is a finding, not a nuisance.
783
+
784
+ ## Output
785
+
786
+ For a feature review, return:
787
+
788
+ \`\`\`json
789
+ {
790
+ "status": "passed",
791
+ "summary": "what was reviewed and why it is acceptable",
792
+ "blockingFindings": []
793
+ }
794
+ \`\`\`
795
+
796
+ For a final review, return:
797
+
798
+ \`\`\`json
799
+ {
800
+ "status": "passed",
801
+ "summary": "session-level review summary",
802
+ "blockingFindings": [],
803
+ "reviewDepth": "detailed"
804
+ }
805
+ \`\`\`
806
+
807
+ Use \`status: "failed"\` when any blocking finding remains. Advisory findings may be included in the prose summary, but \`blockingFindings\` contains only blockers.
808
+
809
+ ## Special cases
810
+
811
+ - Cleanup/refactor: load \`flow-deslop\`; verify the smell was real, refutation paths were checked, and behavior was preserved.
812
+ - UI/frontend: load \`flow-ui-quality\`; verify state coverage and visual evidence when a local target was available.
813
+ - Audit reports: use \`flow-run/references/audit-rubric.md\`; findings must survive refutation before they can drive fix features.
814
+ - Large reviews: use \`../flow/references/parallel-orchestration.md\` for
815
+ read-only slices by changed-file group, risk lens, or validation surface.
816
+ Use the named review, audit, evidence, or validation agents from that
817
+ reference instead of generic subagents. Apply its handoff format and
818
+ verification gates; only the manager returns the final \`featureReview\` or
819
+ \`finalReview\` payload.
820
+
821
+ Never approve to unblock completion, fix findings in the review pass, or vouch for validation you did not inspect.
822
+ `;var N=`# Audit findings rubric
823
+
824
+ What counts as a valid finding when the feature's deliverable is a findings report: a codebase audit, a review-first feature, or any report whose findings a later feature will fix. The commands you run are still governed by \`validation-rubric.md\`; this rubric governs the findings themselves.
825
+
826
+ A findings report is a set of claims about code you did not write. Its failure mode is not "missed something" — it is the confident, accurately-cited finding that is wrong because the mitigating code path was never read. Accurate citations are necessary, never sufficient: a citation proves you found the suspicious site, not that the suspicion survives contact with the rest of the codebase.
827
+
828
+ ## Refute before you report
829
+
830
+ Before any finding earns blocking severity (P1/P2 or equivalent), actively try to kill it:
831
+
832
+ - **Trace the mitigating paths.** Read the callers of the suspicious site and the code it delegates to. The question is never "could this line misbehave?" but "does anything between input and this line already prevent that?"
833
+ - **Cross the layer boundary.** In a multi-layer repo, a finding in one layer is unverified until you have read its counterpart in the other. A frontend finding requires reading the backend handler it calls (it may already validate or dedupe); a library-internals finding requires checking what validation real callers pass through; an API finding requires checking what the client can actually send.
834
+ - **Check the surrounding lifecycle.** State that "leaks" or "goes stale" may already be reset by an effect, a guard clause, or an invalidation a few lines away from where you stopped reading.
835
+
836
+ A finding that survives this pass is worth reporting. A finding you did not try to refute is a guess with a citation.
837
+
838
+ ## Parallel audit slices
839
+
840
+ For broad audits, use \`../../flow/references/parallel-orchestration.md\` to split
841
+ read-only slices by module, data flow, or risk lens. Workers surface candidates;
842
+ the audit author owns the report. Apply its handoff format and verification
843
+ gates. Before blocking severity, dedupe, trace guards, fill cross-layer checks,
844
+ verify contested or high-stakes claims, and downgrade missing context.
845
+
846
+ ## Every blocking finding records "guards checked"
847
+
848
+ In addition to evidence, why-it-matters, and fix shape, every blocking finding names the mitigating paths you traced and why they do not cover this case ("\`suggest_mappings()\` enforces one-to-one via \`used_a\`/\`used_b\` — but nothing dedupes after the frontend re-sorts" reads very differently from silence). No guards-checked line means the finding is unverified: downgrade it to advisory and say what you did not trace.
849
+
850
+ ## Observed, not hypothesized
851
+
852
+ - A blocking finding describes behavior the current code exhibits, with the input that triggers it. "If the backend ever returns X" is a hypothesis about code you chose not to read — either read it and confirm, or record the item as a defense-in-depth note (advisory at most).
853
+ - Uncertainty after tracing is honest — state it and rate by the realistic worst case. Uncertainty instead of tracing is padding.
854
+
855
+ ## Severity is rated in deployment context
856
+
857
+ - The report header states the deployment model the product actually has: desktop app, shared server, library consumed by others, CLI, and so on.
858
+ - Rate impact within that model. Unbounded memory in a single-user desktop process whose lifetime is one window is not the severity it would be in a long-running shared service. When a finding only matters under a deployment the product does not have, say so explicitly ("becomes blocking if this ships as a shared service") instead of rating for the imagined deployment.
859
+
860
+ ## Report shape
861
+
862
+ \`\`\`
863
+ header: scope audited; deployment context; validation commands actually run
864
+ findings, strongest first, each with:
865
+ - class and severity
866
+ - evidence — file:line actually read
867
+ - guards checked — mitigating paths traced and why they fall short (blocking findings)
868
+ - why it matters — the concrete failure, with triggering input
869
+ - fix shape — one sentence, not an implementation
870
+ positive findings — what is genuinely solid, so fixes do not regress it
871
+ follow-up order — correctness and persisted/user-input surfaces first
872
+ \`\`\`
873
+
874
+ Never: promote a hypothesis to blocking severity; cite a line you did not read in context; rate severity against a deployment model the product does not have; pad the report to look thorough — six verified findings outrank nine where three die on first contact.
875
+ `;var V=`# Validation evidence rubric
876
+
877
+ Use this before recording \`flow_feature_complete\`.
878
+
879
+ ## Evidence tiers
880
+
881
+ 1. **Behavioral automated test**: a targeted unit/integration/e2e test exercises the changed behavior and fails without the change.
882
+ 2. **Manual reproducible check**: you ran the app, CLI, endpoint, or workflow and recorded exact steps plus observed result.
883
+ 3. **Indirect automated check**: typecheck, lint, build, or compile proves shape but not behavior. Acceptable alone only for docs, comments, renames fully covered by tooling, or purely mechanical changes.
884
+ 4. **Static inspection**: reading code without running anything. This is a gap, not completion evidence for behavioral work.
885
+
886
+ Use the strongest practical tier. For risky work, combine tiers.
887
+
888
+ ## Recording rules
889
+
890
+ - Each \`validationRun\` entry has \`command\`, \`status\`, and \`summary\`.
891
+ - Completion accepts only passing entries. Failed or skipped checks belong in the summary/notes and must be resolved or explained as blockers.
892
+ - Do not claim a command was run unless it was run in this session or directly reported by a trusted worker with raw output.
893
+ - Worker-reported command output must satisfy \`../../flow/references/verification-gates.md\`: exact command, status, raw outcome summary, coverage, and manager acceptance.
894
+ - Include scope in the summary: what behavior, files, routes, or states the check covered.
895
+ - UI work should include browser or screenshot evidence when the app can run locally.
896
+ - Cleanup/refactor work should show behavior preservation, not only formatting success.
897
+
898
+ ## Scope
899
+
900
+ - Use \`validationScope: "targeted"\` for ordinary feature completion.
901
+ - Use \`validationScope: "broad"\` only when the session is on its final feature and the project-level gate was run.
902
+
903
+ Broad validation usually means the repo's full check command, full relevant test suite, build, or equivalent release gate. If the broad gate cannot run, do not mark the final feature complete; report \`needs_input\` or fix the blocker.
904
+
905
+ ## Good payload fragment
906
+
907
+ \`\`\`json
908
+ {
909
+ "validationRun": [
910
+ {
911
+ "command": "bun test tests/runtime-gates.test.ts",
912
+ "status": "passed",
913
+ "summary": "12 pass; covered approval immutability, active feature, and completion gates"
914
+ },
915
+ {
916
+ "command": "bun run typecheck",
917
+ "status": "passed",
918
+ "summary": "TypeScript accepted runtime and adapter changes"
919
+ }
920
+ ],
921
+ "validationScope": "broad"
922
+ }
923
+ \`\`\`
924
+
925
+ ## Blockers and resets
926
+
927
+ - If validation fails due to a code bug, fix it and rerun.
928
+ - If validation reveals a wrong design or interface assumption, call \`flow_feature_reset\` and rerun from the corrected approach.
929
+ - If validation needs external access, missing credentials, or ambiguous user input, record \`status: "needs_input"\` with an honest \`outcome\`.
930
+
931
+ Never trim failing output, relabel a failed command as passed, or use "not run" as completion evidence.
932
+ `;var E="---\nname: flow-run\ndescription: 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.\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- 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- 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- 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\n## Validate\n\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.\nWorkers must use the handoff format and verification gates from that reference.\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 `flow-review`; for read-only subagent reviews, the manager receives the payload and records it.\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 \"featureReview\": { \"status\": \"passed\", \"summary\": \"review summary\", \"blockingFindings\": [] }\n}\n```\n\nIf genuinely blocked, call `flow_feature_complete` with `status: \"needs_input\"` and an `outcome` that explains the blocker and next step. Never fabricate validation or review evidence to force progress.\n";var G=`# UI quality rubric
933
+
934
+ Use this rubric for frontend planning, implementation, and review.
935
+
936
+ ## Product fit
937
+
938
+ - The screen solves the user's actual task, not a generic demo of components.
939
+ - The first viewport shows the product, data, object, or workflow the user came for.
940
+ - The information density matches use: operational tools favor scannable, compact structure; expressive pages need stronger visual identity and media.
941
+ - Navigation and primary actions are obvious without explanatory helper text.
942
+
943
+ ## Visual design
944
+
945
+ - **Typography**: hierarchy is clear; font choices fit the product; body text remains readable; compact surfaces do not use hero-scale type.
946
+ - **Color**: palette has a coherent role system; contrast is sufficient; accent colors guide attention; avoid one-note palettes and generic purple-blue gradients unless the brand requires them.
947
+ - **Composition**: alignment, spacing, and grouping make comparison easy; repeated items are consistent; page sections are not nested decorative cards.
948
+ - **Controls**: use familiar controls for the job: icons for common tools, toggles for binary settings, segmented controls for modes, sliders/inputs for numbers, menus for option sets.
949
+ - **Motion**: animation clarifies state or creates a focused moment; it does not hide latency, distract from work, or ignore reduced-motion needs.
950
+ - **Imagery/media**: when the subject matters, show the actual product/place/object/state rather than atmospheric filler.
951
+
952
+ ## Interaction and states
953
+
954
+ - Loading, empty, error, disabled, hover, focus, selected, and validation states exist for the changed workflow.
955
+ - Long strings, missing data, large numbers, and small screens do not break layout.
956
+ - Destructive actions have appropriate confirmation or undo patterns.
957
+ - Form errors are close to the field and clear enough to fix.
958
+ - Async state cannot double-submit, lose edits, or leave stale UI behind.
959
+
960
+ ## Accessibility baseline
961
+
962
+ - Interactive elements are semantic or have correct roles and labels.
963
+ - Keyboard users can reach and operate controls in a logical order.
964
+ - Focus indicators are visible.
965
+ - Text and essential UI meet contrast expectations.
966
+ - Status, error, and progress messages are not conveyed by color alone.
967
+ - Motion respects reduced-motion preferences when substantial.
968
+
969
+ ## Review finding shape
970
+
971
+ \`\`\`text
972
+ class; severity; location or screenshot area; evidence inspected; user impact; fix shape; visual/validation evidence needed
973
+ \`\`\`
974
+
975
+ Blocking UI findings are issues that prevent task completion, hide required information, break accessibility basics, create incoherent layout at supported sizes, or make the visual success claim unverifiable.
976
+ `;var L=`# Visual verification workflow
977
+
978
+ Use this workflow when UI changes can be run locally. Flow execution may create visual evidence; Flow review usually assesses recorded evidence because the reviewer is read-only.
979
+
980
+ ## Execution lane
981
+
982
+ - Identify the target route, state, viewport sizes, and any required seed data.
983
+ - Start the repo's normal dev server or storybook command from the recorded repo profile.
984
+ - Prefer existing browser or Playwright tooling when available. Do not add heavy visual tooling just to inspect a small change.
985
+ - Capture at least one desktop viewport and one mobile viewport for user-facing layout changes.
986
+ - Exercise the primary interaction changed by the feature.
987
+ - Inspect loading, empty, and error states when they are part of the changed workflow or easy to reach.
988
+ - Check browser console output when the tooling exposes it.
989
+ - For canvas/3D/media-heavy UI, verify rendered pixels are nonblank and the subject is framed.
990
+
991
+ ## Review lane
992
+
993
+ - Inspect the screenshots, browser notes, console output, or visual artifacts recorded by execution.
994
+ - Compare recorded evidence against the plan's design intent, supported viewports, state coverage, and the UI rubric.
995
+ - If the current reviewer has browser/shell tools and permissions, it may perform additional read-only visual checks.
996
+ - If the reviewer is read-only without browser or shell access, do not try to recreate evidence. Treat missing or insufficient visual evidence as a finding or coverage gap.
997
+
998
+ ## What to look for
999
+
1000
+ - Text overlap, clipped labels, unintended wrapping, and controls resizing on hover.
1001
+ - Incoherent spacing, nested cards, generic placeholder visuals, and decorative elements that compete with the task.
1002
+ - Missing focus states, low contrast, unreachable controls, and color-only status.
1003
+ - Broken responsive behavior: horizontal scroll, collapsed controls, hidden primary actions, or unreadable tables.
1004
+ - State bugs: stale loading indicators, duplicate submissions, lost input, or errors that cannot be recovered.
1005
+
1006
+ ## If visual verification is unavailable
1007
+
1008
+ Record the reason and use the strongest available substitute:
1009
+
1010
+ - build/typecheck/lint for changed frontend code.
1011
+ - component or interaction tests.
1012
+ - Storybook/static render output.
1013
+ - code inspection against existing component patterns.
1014
+
1015
+ Do not claim visual polish was verified if no visual artifact was inspected.
1016
+ `;var M=`---
1017
+ name: flow-ui-quality
1018
+ description: Flow guidance for UX/UI design, frontend polish, visual quality review, responsive and accessible interfaces, and avoiding generic AI-generated UI. Use when planning, executing, or reviewing frontend pages, components, dashboards, visual redesigns, interaction states, screenshots, or browser-verified UI work.
1019
+ ---
1020
+
1021
+ # Flow UI quality
1022
+
1023
+ 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.
1024
+
1025
+ ## Establish the interface intent
1026
+
1027
+ - Identify the user, job-to-be-done, primary workflow, density needs, device constraints, and brand/product tone before choosing visuals.
1028
+ - Choose a clear design direction that fits the product context. Distinctive does not mean decorative; utilitarian tools can be excellent through restraint, hierarchy, and speed.
1029
+ - Load \`references/ui-rubric.md\` for design and UX review criteria.
1030
+ - Load \`references/visual-verification.md\` before completing meaningful UI changes to capture visual evidence. During review, use it to assess recorded evidence; only run browser checks yourself if the current agent and tools permit it.
1031
+ - Record design constraints and verification expectations in Flow plan fields: \`requirements\`, \`decisions\`, feature \`targets\`, and feature \`validation\`. Do not add new Flow payload fields.
1032
+
1033
+ ## Build with visual intent
1034
+
1035
+ - Use existing design systems, component libraries, tokens, icons, and layout conventions before inventing new primitives.
1036
+ - Make typography, spacing, color, motion, and hierarchy deliberate. Avoid default-looking AI output: centered everything, purple gradients, generic cards, uniform oversized radii, stock SaaS layouts, and unexamined Inter/system-font sameness.
1037
+ - Match composition to domain: operational apps need scanability, alignment, predictable controls, efficient density, and clear states; marketing or editorial surfaces can carry more expressive imagery and motion.
1038
+ - Include states a real user will hit: loading, empty, error, disabled, hover, focus, selected, validation, and long content.
1039
+ - Protect accessibility: semantic controls, labels, focus order, keyboard reachability, contrast, reduced-motion behavior, and non-color-only status.
1040
+
1041
+ ## Verify visually
1042
+
1043
+ - For meaningful UI changes, run the app and capture screenshots when a local browser target is available.
1044
+ - Check desktop and mobile breakpoints, not only the viewport you developed in.
1045
+ - Verify text does not overlap, truncate unintentionally, or escape controls; long labels and empty/error states must fit.
1046
+ - Compare against provided screenshots, design references, or the stated product intent. List meaningful differences and fix the ones that violate the goal.
1047
+ - If browser verification cannot run, record the gap and the next-best evidence such as component tests, Storybook snapshots, build output, or static inspection.
1048
+
1049
+ ## Review UI work
1050
+
1051
+ Approve only when the interface is both useful and inspectable:
1052
+
1053
+ - The main workflow is visible and efficient.
1054
+ - Visual hierarchy makes the next action obvious.
1055
+ - Responsive behavior is deliberate.
1056
+ - Accessibility basics are covered.
1057
+ - State coverage is present or the gaps are explicit.
1058
+ - Screenshot/browser evidence supports the claim whenever feasible.
1059
+
1060
+ Never approve a UI change based only on code shape. If users will judge it visually, Flow evidence should include visual inspection.
1061
+ `;var x=[{name:"flow",files:[{relativePath:"SKILL.md",content:q},{relativePath:"references/recovery-playbook.md",content:U},{relativePath:"references/parallel-orchestration.md",content:C},{relativePath:"references/handoff-format.md",content:F},{relativePath:"references/verification-gates.md",content:A}]},{name:"flow-plan",files:[{relativePath:"SKILL.md",content:z},{relativePath:"references/planning-examples.md",content:W},{relativePath:"references/parallel-discovery.md",content:j}]},{name:"flow-run",files:[{relativePath:"SKILL.md",content:E},{relativePath:"references/validation-rubric.md",content:V},{relativePath:"references/audit-rubric.md",content:N}]},{name:"flow-review",files:[{relativePath:"SKILL.md",content:O},{relativePath:"references/review-rubric.md",content:B}]},{name:"flow-deslop",files:[{relativePath:"SKILL.md",content:D},{relativePath:"references/smell-rubric.md",content:P},{relativePath:"references/refactor-workflow.md",content:T}]},{name:"flow-ui-quality",files:[{relativePath:"SKILL.md",content:M},{relativePath:"references/ui-rubric.md",content:G},{relativePath:"references/visual-verification.md",content:L}]}];var X=".flow-skill-version";function _(){return process.env.HOME??process.env.USERPROFILE??""}function $(e=_()){return l(e,".config","opencode","skills")}function R(e){return xe("sha256").update(e).digest("hex")}function Ue(e,t){return[`version=${t}`,...e.files.map((a)=>`file=${a.relativePath} sha256=${R(a.content)}`),""].join(`
1062
+ `)}async function p(e){try{return await _e(e,"utf8")}catch(t){if(t.code==="ENOENT")return null;throw t}}function Y(e){let t=new Map;if(!e)return t;for(let a of e.split(/\r?\n/)){let r=/^file=(.+) sha256=([a-f0-9]{64})$/.exec(a)??/^file=(.+)=sha256:([a-f0-9]{64})$/.exec(a);if(r?.[1]&&r[2])t.set(r[1],r[2]);let n=/^hash=sha256:([a-f0-9]{64})$/.exec(a);if(n?.[1]&&!t.has("SKILL.md"))t.set("SKILL.md",n[1])}return t}function Ae(e){if(!e)return null;for(let t of e.split(/\r?\n/)){let a=/^version=(.+)$/.exec(t);if(a?.[1])return a[1]}return null}function J(e,t){let a=Fe(l(e,...t.split("/")));if(a!==e&&a.startsWith(`${e}${Ce}`))return a;throw Error(`Unsafe skill file path '${t}'.`)}function qe(){return x.map((e)=>e.name)}function Te(e){return`npx -y opencode-plugin-flow@${e} doctor`}function Pe(){if(process.env.npm_package_version)return process.env.npm_package_version;try{let e=Ie(import.meta.url);for(let t of["../package.json","../../package.json"])try{let a=e(t);if(a.version)return a.version}catch{}}catch{}return"0.0.0"}async function Z(e=Pe(),t=_()){let a=$(t),r=new Set(qe()),n=await Promise.all(x.map(async(o)=>{let i=l(a,o.name),m=await p(l(i,X)),g=Ae(m),ee=Y(m);if(await p(l(i,"SKILL.md"))===null)return{name:o.name,path:i,status:"missing",markerVersion:g,missingFiles:o.files.map((d)=>d.relativePath),editedFiles:[],outdatedFiles:[]};if(m===null)return{name:o.name,path:i,status:"foreign",markerVersion:g,missingFiles:[],editedFiles:[],outdatedFiles:[]};let w=[],y=[],b=[];for(let d of o.files){let k=await p(J(i,d.relativePath));if(k===null){w.push(d.relativePath);continue}if(k===d.content)continue;let I=ee.get(d.relativePath);if(I&&R(k)!==I){y.push(d.relativePath);continue}b.push(d.relativePath)}let ae=m!==Ue(o,e),te=w.length>0?"incomplete":y.length>0?"edited":ae||b.length>0?"outdated":"ok";return{name:o.name,path:i,status:te,markerVersion:g,missingFiles:w,editedFiles:y,outdatedFiles:b}})),s=[];try{s=await K(a)}catch(o){if(o.code!=="ENOENT")throw o}let c=s.filter((o)=>(o==="flow"||o.startsWith("flow-"))&&!r.has(o)).map((o)=>l(a,o)),u=n.filter((o)=>["missing","incomplete","outdated"].includes(o.status)).map((o)=>o.name),h=n.filter((o)=>["foreign","edited"].includes(o.status)).map((o)=>o.name),f=h.length>0,v=u.length>0;return{status:f?"action_required":v?"sync_required":"ok",version:e,root:a,expectedSkills:[...r],skills:n,syncRequiredSkills:u,actionRequiredSkills:h,unmanagedFlowSkills:c}}function S(e,t,a){if(a.length===0)return;e.push(`- ${t}: ${a.join(", ")}`)}function Q(e){let t=["Flow doctor",`- status: ${e.status}`,`- plugin version: ${e.version}`,`- skills root: ${e.root}`,`- expected skills: ${e.expectedSkills.join(", ")}`];S(t,"startup sync can install/update",e.syncRequiredSkills),S(t,"needs user decision",e.actionRequiredSkills),t.push("","Skills:");for(let a of e.skills){if(t.push(`- ${a.name}: ${a.status} (${a.path})${a.markerVersion?` marker=${a.markerVersion}`:""}`),a.missingFiles.length>0)t.push(` missing: ${a.missingFiles.join(", ")}`);if(a.editedFiles.length>0)t.push(` edited: ${a.editedFiles.join(", ")}`);if(a.outdatedFiles.length>0)t.push(` outdated: ${a.outdatedFiles.join(", ")}`)}if(e.unmanagedFlowSkills.length>0){t.push("","Unmanaged Flow-like skill folders:");for(let a of e.unmanagedFlowSkills)t.push(`- ${a}`)}if(t.push("","Recommendation:"),e.status==="ok")t.push("- Flow skills are present and current.");else if(e.status==="sync_required")t.push("- Start or restart OpenCode with opencode-plugin-flow enabled so startup sync can install or update the listed skills. If Flow then reports restart_required, restart OpenCode once more so the refreshed skill registry is used.");else t.push("- Resolve user-owned or edited managed skill folders, then restart OpenCode. Move a folder aside to let Flow recreate it, or keep it intentionally as a local override.");return t.push(`- Details command: ${Te(e.version)}`),`${t.join(`
1063
+ `)}
1064
+ `}async function H(e=_()){let t=$(e),a=[],r=[],n;try{n=await K(t)}catch(s){if(s.code==="ENOENT")return{removed:a,kept:r};throw s}for(let s of n){if(s!=="flow"&&!s.startsWith("flow-"))continue;let c=l(t,s),u=await p(l(c,X));if(u===null){r.push(c);continue}let h=Y(u),f=!1;for(let[v,o]of h){let i=await p(J(c,v));if(i!==null&&R(i)!==o){f=!0;break}}if(f){r.push(c);continue}await Re(c,{recursive:!0,force:!0}),a.push(c)}return{removed:a,kept:r}}async function De(e){let t=e[2];if(t!=="uninstall"&&t!=="doctor"){process.stderr.write(`usage: opencode-plugin-flow <doctor|uninstall>
1065
+ `),process.exitCode=2;return}if(t==="doctor"){process.stdout.write(Q(await Z()));return}let a=await H();for(let r of a.removed)process.stdout.write(`Removed Flow skill: ${r}
1066
+ `);for(let r of a.kept)process.stdout.write(`Kept non-Flow or user-edited skill: ${r}
5
1067
  `);process.stdout.write(`Remove "opencode-plugin-flow" from opencode.json and restart OpenCode.
6
- `)}U(process.argv).catch((e)=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
1068
+ `)}De(process.argv).catch((e)=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
7
1069
  `),process.exitCode=1});