[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E6EJN74W98HNT9KNGSCYAF":3,"skill-same:01M7E6EJN74W98HNT9KNGSCYAF":85},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7E6EJN74W98HNT9KNGSCYAF","scala-stream-resource-scoping",null,"Use when a Scala stream or effectful factory change moves where a resource, state or execution lane is acquired, owned, used or released - FS2 scope propagation across channels\u002Fprefetch\u002FparEvalMap, FS2 foreign callback (Reactive Streams, Dispatcher, accept-loop) lanes and ownership, FS2 sink emission cardinality under drain\u002Fappend\u002FflatMap, and http4s stateful middleware factories (nonce, throttle) whose state must live at the acquisition boundary. Covers lifetime and ownership topology, not cancellation-outcome\u002Ffinalizer semantics, HTTP protocol semantics or binary-compatibility law.","w0rxbend\u002Fdot-agents","w0rxbend","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F8176996?v=4","01M7E4XY3Y871Z2NFBXF3H3T8F","Oleksandr B.","01M7E4XY51E6NSG05FXR36H9RV",0,"MIT","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: scala-stream-resource-scoping\ndescription: Use when a Scala stream or effectful factory change moves where a resource, state or execution lane is acquired, owned, used or released - FS2 scope propagation across channels\u002Fprefetch\u002FparEvalMap, FS2 foreign callback (Reactive Streams, Dispatcher, accept-loop) lanes and ownership, FS2 sink emission cardinality under drain\u002Fappend\u002FflatMap, and http4s stateful middleware factories (nonce, throttle) whose state must live at the acquisition boundary. Covers lifetime and ownership topology, not cancellation-outcome\u002Ffinalizer semantics, HTTP protocol semantics or binary-compatibility law.\nlicense: MIT\n---\n\n# Stream and factory resource scoping\n\nFour historical FS2 and http4s cases (2018-2024) share one question: **between which two events does this thing live,\nwho owns it, and what observable signal proves that?**\n\n## When to Use\n\n- Combinator detaches production from consumption (channel, buffer, prefetch, `parEvalMap`) yet claims resource-backed\n  elements stay alive; or scope wrapper changes interruption inheritance.\n- Foreign callbacks (Reactive Streams `request`\u002F`cancel`, Dispatcher, socket accept, JS duplex lanes) bridged into\n  FS2\u002FCats Effect; Dispatcher\u002Fserver-socket lifetime migrated.\n- Sink result type or emission changes (`.drain`, `Unit` -> `Nothing`, `evalMap` \u003C-> `foreach`); post-write\n  continuation rewritten between `flatMap`, `>>` and `++`.\n- Stateful middleware\u002Fclient factory suspended into `F`\u002F`Resource`; its state moved; effectful entrypoint added beside\n  legacy one; tests written to prove shared state or timed transitions.\n- Same shapes elsewhere (ZIO streams, Pekko\u002FAkka Streams bridges, custom pools): apply transferable checks; mark\n  library-specific ones not carried over.\n\n## When Not to Use\n\n- Pure `map`\u002Fvalue transformations: unchanged cardinality, no acquisition, handoff or interruption change.\n- Cancellation outcomes, finalizer error provenance, canceler evaluation: `scala-effect-cancellation-finalization`.\n- HTTP framing, routing, middleware execution order, error disclosure: `scala-http-server-semantics`.\n- MiMa\u002Fbinary\u002Fsource compatibility as policy question, or law-backed instances: `scala-library-compatibility-laws`.\n- General public-API contracts: `scala-library-contracts`; type-level encoding: `scala-type-system`; pure FP style:\n  `scala-functional-patterns`. Whole-library reviews start at router `scala-oss-library-review`.\n- Never a reason to migrate existing Cats Effect\u002FFS2 code to ZIO, Ox or direct style (`direct-style-scala` covers\n  code already in that style). Not a Digest auth security certification.\n\n## Prerequisites\n\n1. Versions from actual build (`build.sbt`, `project\u002Fbuild.properties`, plugin pins), not PR or calendar year; see\n   Version Fences.\n2. Target branch's real source for each lifetime primitive a change names: FS2 `Stream`, `Pull`, `internal\u002FScope`,\n   Dispatcher constructors, `NotNothing`; http4s factory, state allocator, time source, tests.\n3. Platform: JVM, Native, JS differ (FS2 socket accept is JVM\u002FNative; JS duplex lanes separate).\n4. Repository's effect model. Preserve it.\n\n## Shared Model\n\nCB = foreign callback lanes, SC = per-element scope propagation, CA = sink emission cardinality, FA = stateful factory\nacquisition.\n\n**I1. Three moments, not one.** Describing effect, executing acquisition, each use: distinct events. Lifetimes attach\nto acquisition, not description or use.\n- FA: `new NonceKeeper` inside request Kleisli fixed eagerness but made state per request (#6077); #6138 allocates\n  in `F`, maps into reusable Kleisli. Reusing an `F` description is not memoizing its result.\n- CB: #3107's `subscribeStream` is effect whose lifetime encloses `StreamSubscription.apply(...).use(_.run)`;\n  per-subscription control dispatcher lives inside that run.\n\n**I2. Every live thing has exactly one owner whose release is reachable.** Dispatcher, task, socket, keeper, pool.\n- CB: never discard `Resource` release and rely on GC (#3000 GC reply tentative; #3107 TCK fixture's `allocated._1`\n  test-only). Outer `Resource` owns listening socket, not restartable inner accept stream (#3063).\n- FA: Java builders may already own executors\u002Fpools (#1851); classify before calling anything \"pure configuration\".\n- SC: moved finalizer must not create cycle (foreground shutdown waits on producer waits on foreground).\n\n**I3. Lifetime transfer must cover acquisitions that do not exist yet.** Snapshot of current resources is not\nsubscription to future ones.\n- SC: #3512's `Scope.lease` enumerates currently reachable resources (can miss ones already finalizing); later\n  bracket-per-element resources close early. Author withdrew after six-element counterexample.\n- CB analogue: synchronous handoff bounds pending elements only if producers respect backpressure; repeatedly\n  dispatched blocked sends still pile up (#3341 discussion).\n\n**I4. Ordering and progress need separate lanes.** Short ordered control work and long-running data work cannot share\none sequential lane if data waits on control.\n- CB: stream waits for demand; demand task waits behind stream (#3000\u002F#3107). One sequential start lane for concurrent\n  long-lived subscriptions prevents progress. Terminal-state checks go inside ordered effect.\n\n**I5. Inherited context is part of the lifetime contract.** Wrapper that \"enables\" something is not a neutral reset.\n- SC: explicit interruptibility in #2843 passed local assertion but did not restore parent's inherited mode.\n- CB: cancellation stops work without inventing completion; terminal state set before subscriber notification.\n\n**I6. Emission count is observable contract, including `Unit` emissions.** Zero outputs, one completion output, one\noutput per input: three different APIs.\n- CA: `flatMap`\u002F`>>` continue once per output; `take(n)` counts emissions; `++` runs once after successful exhaustion,\n  is not a finalizer. `Queue.enqueue` per-element units bound consumption (#1913 kept them).\n- FA analogue: one acquisition vs one per request is same count question, for state.\n\n**I7. The oracle must observe the property itself.** Compilation, exit status, test names, elapsed timestamps, Boolean\nmapped to `Unit`, `TestControl.executeEmbed`: not oracles.\n- CA: precise-`Nothing` witness vs widened `Stream[F, Unit]` runtime probe; continuation counters and round-trip bytes.\n- SC: per-element Deferred\u002Fuse-before-release records, not global finalized flag.\n- FA: unavailable-before\u002Favailable-after on same bucket (#6469); historical TimeoutSuite discarded its cancel flag.\n- CB: CancellationSpec waits for subscription resources to close.\n\n## Routing\n\n| Change touches | Load |\n|---|---|\n| FS2 `reactive-streams` (`StreamSubscription`, `StreamUnicastPublisher`, `subscribeStream`), Dispatcher sequential\u002Fparallel choice, `request`\u002F`cancel` ordering, `unsafeRunSync` in callbacks | [references\u002Ffs2-foreign-callback-lanes.md](references\u002Ffs2-foreign-callback-lanes.md) |\n| FS2 `io\u002Fnet` server socket accept stream, `Resource[F, Stream[F, Socket]]`, inner-consumer restart, `async_` migration, JS read\u002Fwrite\u002Ferror lanes, callback-driven `Channel.send` backpressure | [references\u002Ffs2-foreign-callback-lanes.md](references\u002Ffs2-foreign-callback-lanes.md) |\n| FS2 `Pull.extendScopeTo`, `Scope.lease`, `parEvalMap`, prefetch\u002Fchannel handoff of bracketed elements, tracing\u002F`IOLocal` scope wrappers, interruption-mode inheritance | [references\u002Ffs2-per-element-scope-propagation.md](references\u002Ffs2-per-element-scope-propagation.md) |\n| FS2 sink\u002Fpipe output type (`Unit` vs `Nothing`), `.drain`, `foreach` vs `evalMap`, `NotNothing`, `flatMap`\u002F`>>`\u002F`++` after a write, Queue\u002FTopic enqueue emissions, `take` after a sink | [references\u002Ffs2-sink-emission-cardinality.md](references\u002Ffs2-sink-emission-cardinality.md) |\n| http4s middleware\u002Fclient factories with mutable state (DigestAuth `NonceKeeper(F)`, Throttle token bucket, OkHttp builder), `apply` vs `applyF`, deprecated entrypoints, `TestControl`\u002FClock-based middleware tests | [references\u002Fhttp4s-stateful-factory-acquisition.md](references\u002Fhttp4s-stateful-factory-acquisition.md) |\n| Analogous code elsewhere | This file's Workflow and transferable checks; then closest case file for probes |\n\nRaw pinned evidence (SHAs, review permalinks, claims with applicability and counterexamples):\n[callback lanes](references\u002Fevidence\u002Fscala-fs2-foreign-callback-lanes.json),\n[scope propagation](references\u002Fevidence\u002Fscala-fs2-per-element-scope-propagation.json),\n[emission cardinality](references\u002Fevidence\u002Fscala-fs2-sink-emission-cardinality.json),\n[factory acquisition](references\u002Fevidence\u002Fscala-http4s-stateful-factory-acquisition.json).\n\n## Workflow\n\n1. **Pin versions and platform** from build. Load routed case file(s). Note which historical anchor (if any) matches\n   target version; rest are only analogies.\n2. **Draw the lifetime timeline.** Per resource\u002Fstate\u002Flane: describe -> acquire -> each use -> release, plus owner and\n   release-triggering hook. Include acquisitions that happen only after first pull or first request (I1, I3).\n3. **Classify each allocation**: pure configuration, acquisition-local state, request\u002Felement-local state, explicitly\n   shared application service, or foreign-owned. Verify \"pure\" claims against source (I2).\n4. **Build the lane table** for callbacks or workers: submission order, can-wait-on-whom, owner. Find any lane waiting\n   on work queued behind itself (I4).\n5. **Write the emission\u002Fcontinuation table** when stream result or continuation changes: empty \u002F one \u002F many inputs,\n   per-element vs per-chunk, consumers (`flatMap`, `>>`, `++`, `take`) (I6).\n6. **Write the oracle before moving code**, one per invariant; name mutation each rejects (allocation moved into\n   callback; lease missing later elements; merged lanes; widened empty bind; permanently unavailable tokens;\n   removed finalizer) (I7).\n7. **Exercise outcomes**: normal exhaustion, downstream early termination, upstream failure, cancellation with pending\n   handoff, shutdown races, second independent acquisition, inherited noninterruptible parent (I5).\n8. **Decide**: accept, request specific test, or reject with counterexample. Rejecting superficially passing fix needs\n   no invented replacement. Do not propose historically rejected APIs (`extendScopeThrough`, `noInterruptScope`) or\n   copy historical exemplars as verified repairs.\n\n## Review and Refactoring Checks\n\nTransferable (any Scala effect\u002Fstream library):\n- [ ] Construction allocates nothing; one acquisition yields one state shared by its uses; separate acquisitions are\n      independent unless sharing is deliberate (I1).\n- [ ] Every dispatcher\u002Ffiber\u002Fsocket\u002Fpool\u002Fkeeper has owner and reachable release; no \"GC will clean it up\" (I2).\n- [ ] `acquire(i) \u003C use(i) \u003C release(i)` for each element actually used, including later acquisitions; unused\n      acquisitions may be released on cancellation; exactly-once release; bounded shutdown; no retain-everything fix (I3).\n- [ ] Ordered control work never queues behind data work it unblocks; terminal checks inside ordered effect; no\n      blocking `unsafeRunSync` just to order submissions (I4).\n- [ ] Inherited interruption\u002Fmasking context preserved across new wrappers; compare wrapped vs unwrapped (I5).\n- [ ] Output counts, continuation counts, bounded-consumption behavior unchanged unless intentionally migrated, with\n      stated binary\u002Fsource\u002Fruntime compatibility policy (I6).\n- [ ] Backpressure checked at submitting callback, not only buffer capacity; coalescing only where duplicates are\n      protocol-redundant (I3\u002FI4).\n- [ ] Every test asserts property, not proxy; deterministic barriers preferred; timeouts only bound hangs (I7).\n\nLibrary\u002Fversion-specific (do not carry over without re-reading target source):\n- [ ] FS2 `Scope.lease` semantics at target SHA; `Pull.extendScopeTo` path (SC).\n- [ ] FS2 Dispatcher sequential vs parallel constructors; shutdown exception suppressed only at its boundary (CB).\n- [ ] FS2 `NotNothing` (or successor) presence on `flatMap`\u002F`>>` (CA).\n- [ ] http4s `applyF`-style distinct factory name vs constraint-only overloads with defaults (FA, CE2 maintenance).\n- [ ] CE3 `TestControl`\u002F`Temporal` vs CE2 `Timer`\u002F`Clock`\u002F`ContextShift`\u002F`Blocker` (FA).\n- [ ] JVM vs Native vs JS socket\u002Flane implementations (CB).\n\n## Consolidated False Positives\n\n- Short ordered control work on sequential dispatcher is correct; application-owned parallel dispatcher is not\n  inherently a leak (but does not prove per-subscription cleanup). (CB)\n- Released handle returned on purpose as failed-publisher test fixture is not a production pattern. (CB)\n- Single fixed outer resource needs only one lifetime extension; pure transformed value may no longer borrow its\n  source. Require actual borrowing\u002Fuse path. (SC)\n- FS2 stream interruption context is not universal Cats Effect masking; choosing not to alter inherited mode is not a\n  missing cancellation feature. (SC)\n- `evalMap(_ => action)` then `take(n)` uses units as progress signals; terminal writer that never promised per-byte\n  emissions need not invent them; #1913 does not authorize changing current Queue\u002FTopic APIs. (CA)\n- Sharing immutable configuration is fine; request-local scratch state is not a lifetime defect; intentional\n  application-scoped sharing of dedicated blocking service is acceptable; `val` holding a clock effect is not a cached\n  timestamp; virtual time does not control foreign sockets or blocking executors. (FA)\n- Narrow fix leaving documented unrelated follow-up (e.g. nonce expiry) did not introduce it; report gap separately.\n  (FA)\n- Pure queue consumer with no foreign callbacks, or pure integer stream with no acquisition or handoff, does not\n  trigger this skill.\n\n## Version Fences\n\n| Case | Anchor | Versions | Status |\n|---|---|---|---|\n| CB | fs2 #3000 | CE 3.4.0-RC1, two sequential dispatchers | discussion + code |\n| CB | fs2 #3107 | CE 3.4.4, Jan 2023, Reactive Streams JVM adapter | merged |\n| CB | fs2 #3063 | CE `3.5-4b87497` snapshot `async_` semantics; JVM\u002FNative sockets | source-inspected |\n| CB | fs2 #2300, #3341 | contextual discussion only | head diffs excluded |\n| SC | fs2 #2843 | CE 3.3.6 (2022) | closed unmerged |\n| SC | fs2 #3512 | CE 3.5.7, Scala 2.12.20\u002F2.13.15\u002F3.3.4, sbt 1.10.5 (Dec 2024) | closed unmerged |\n| CA | fs2 #1754, #1913 | target FS2 3.0; branch on CE 2.2.0-RC3, Scala 2.13.2\u002F2.12.10, Dotty 0.26.0-RC1 | narrowed revision adopted |\n| FA | http4s #1851 | Scala 2.12.6, CE 0.10.1, FS2 0.10.4 | closed\u002Fsuperseded |\n| FA | http4s #6077 \u002F #6138 | Scala 2.12.15\u002F2.13.8\u002F3.0.2, CE 2.5.4, FS2 2.5.10 (for #6138) | #6077 superseded, #6138 adopted |\n| FA | http4s #6469 | Scala 2.12.16\u002F2.13.8\u002F3.1.2, CE 3.3.12, FS2 3.2.8 | adopted |\n\nMethod visible in an unmerged diff is not available in a release. `IOLocal` observations are IO-specific.\n\n## Validation\n\nNo upstream build or test ran during research. Commands below are source-derived; run only after authorization, in\nisolated checkout.\n\n1. Discover real targets first: read `build.sbt`, `project\u002Fbuild.properties`, plugins, platform requirements; run\n   `sbt projects` and `sbt 'show \u003Cproject> \u002F Test \u002F definedTests'`. Do not assume project names (`io`, `server`,\n   `coreJVM`, `serverJVM`) survive across branches; do not invoke release-bearing CI aliases.\n2. Run case's historical selectors (in each case file) only at matching SHA. Require nonzero test discovery and\n   assertions, not exit status.\n3. Add regression probes from Workflow step 6: per-element Deferred brackets with delayed `parEvalMap(2)` use;\n   cancel\u002Frestart of inner accept stream under retained outer resource; shutdown\u002Fcallback races with multiple\n   subscriptions; empty\u002Fnonempty emission and continuation counts, precise-`Nothing` compile failure (specific expected\n   error) plus widened empty runtime bind; no-eager-allocation, two-acquisition and concurrent replay tests;\n   before\u002Fafter threshold state under virtual time.\n4. Run binary gates (`mimaReportBinaryIssues`) when public factory or sink signature changes, and compile concrete `IO`\n   plus effect-polymorphic call sites with defaults.\n5. Keep platform evidence separate: JVM test is not evidence for Native or Node; virtual time is not evidence for real\n   sockets or blocking pools; TCK and repeated race runs are not proofs over all schedules.\n\n## Examples\n\n### Good\n\n`parEvalMap` refactor reviewed with per-element timeline (I3), six-element Deferred-bracket regression with delayed\nconsumer, and check under noninterruptible parent (I5). Separately, nonce middleware factory allocates keeper in `F`,\nmaps it into request Kleisli. One acquisition serves challenge and follow-up; second acquisition is independent;\nconcurrent replay yields exactly one Ok (I1, I7).\n\n### Broken and Correction\n\nBridge \"simplifies\": runs subscription stream and its demand callbacks on one sequential dispatcher, and swaps global\ndispatcher for allocated publisher with discarded release. Two violations: I4 (deadlock: stream waits for demand queued\nbehind it) and I2 (unowned release). Correction: per-subscription ordered control lane inside lifetime-enclosing\nsubscription effect, parallel start lane, real release hook, test proving progress and cleanup. Likewise,\n`drainedWrite ++ readBack` rewritten to `drainedWrite.flatMap(_ => readBack)` silently skips the read (I6); restore\n`++` and assert continuation counter.\n\n### Negative\n\nTwo services share immutable timeout config while each acquires own state and pools; bridge already has verified\nper-subscription control lanes; integer stream changes its arithmetic. None needs a finding: do not demand\neffect-wrapped config copies, uniform global dispatcher, leases, or interruption matrix.\n\n## Output Contract\n\nPer finding: `file:line`, severity, case (CB\u002FSC\u002FCA\u002FFA or \"analogous\"), invariant (I1-I7), version\u002Fplatform, evidence ID or\nURL, concrete interleaving or timeline, relevant table (lane\u002Fowner, emission\u002Fcontinuation, or\nconstruction\u002Facquisition\u002Frequest), proposed bounded correction, discriminating test naming mutation it rejects. State\nrelease hook closing each owner, compatibility policy if signatures change, evidence stage per claim: observed code,\nreviewer proposal, author report, merged decision, or model inference. Say whether any repair was only proposed,\ncompiled, or executed, and which outcomes remain unexercised.\n\n## Limitations\n\n- Derived from model-based review of pinned historical source and maintainer discussion. Several anchors are\n  closed\u002Funmerged (#2843, #3512, #1851, #6077); they teach review probes, not repairs.\n- Invariants I1-I7 are cross-case synthesis (inference); each case file states what its evidence actually shows.\n- Historical exemplars carry caveats (unused Blocker, `lastNc + 1`, discarded TimeoutSuite cancel flag, inconsistent\n  #1913 printing docs, #3107 TCK fixture); not present-day vulnerability claims.\n- #3107 does not prove every Play\u002FAkka integration migrated correctly. Reviewer formal maintainer roles not\n  established. No security, timing or performance effectiveness experimentally established.\n","# Stream and factory resource scoping\n\nFour historical FS2 and http4s cases (2018-2024) share one question: **between which two events does this thing live,\nwho owns it, and what observable signal proves that?**\n\n## When to Use\n\n- Combinator detaches production from consumption (channel, buffer, prefetch, `parEvalMap`) yet claims resource-backed\n  elements stay alive; or scope wrapper changes interruption inheritance.\n- Foreign callbacks (Reactive Streams `request`\u002F`cancel`, Dispatcher, socket accept, JS duplex lanes) bridged into\n  FS2\u002FCats Effect; Dispatcher\u002Fserver-socket lifetime migrated.\n- Sink result type or emission changes (`.drain`, `Unit` -> `Nothing`, `evalMap` \u003C-> `foreach`); post-write\n  continuation rewritten between `flatMap`, `>>` and `++`.\n- Stateful middleware\u002Fclient factory suspended into `F`\u002F`Resource`; its state moved; effectful entrypoint added beside\n  legacy one; tests written to prove shared state or timed transitions.\n- Same shapes elsewhere (ZIO streams, Pekko\u002FAkka Streams bridges, custom pools): apply transferable checks; mark\n  library-specific ones not carried over.\n\n## When Not to Use\n\n- Pure `map`\u002Fvalue transformations: unchanged cardinality, no acquisition, handoff or interruption change.\n- Cancellation outcomes, finalizer error provenance, canceler evaluation: `scala-effect-cancellation-finalization`.\n- HTTP framing, routing, middleware execution order, error disclosure: `scala-http-server-semantics`.\n- MiMa\u002Fbinary\u002Fsource compatibility as policy question, or law-backed instances: `scala-library-compatibility-laws`.\n- General public-API contracts: `scala-library-contracts`; type-level encoding: `scala-type-system`; pure FP style:\n  `scala-functional-patterns`. Whole-library reviews start at router `scala-oss-library-review`.\n- Never a reason to migrate existing Cats Effect\u002FFS2 code to ZIO, Ox or direct style (`direct-style-scala` covers\n  code already in that style). Not a Digest auth security certification.\n\n## Prerequisites\n\n1. Versions from actual build (`build.sbt`, `project\u002Fbuild.properties`, plugin pins), not PR or calendar year; see\n   Version Fences.\n2. Target branch's real source for each lifetime primitive a change names: FS2 `Stream`, `Pull`, `internal\u002FScope`,\n   Dispatcher constructors, `NotNothing`; http4s factory, state allocator, time source, tests.\n3. Platform: JVM, Native, JS differ (FS2 socket accept is JVM\u002FNative; JS duplex lanes separate).\n4. Repository's effect model. Preserve it.\n\n## Shared Model\n\nCB = foreign callback lanes, SC = per-element scope propagation, CA = sink emission cardinality, FA = stateful factory\nacquisition.\n\n**I1. Three moments, not one.** Describing effect, executing acquisition, each use: distinct events. Lifetimes attach\nto acquisition, not description or use.\n- FA: `new NonceKeeper` inside request Kleisli fixed eagerness but made state per request (#6077); #6138 allocates\n  in `F`, maps into reusable Kleisli. Reusing an `F` description is not memoizing its result.\n- CB: #3107's `subscribeStream` is effect whose lifetime encloses `StreamSubscription.apply(...).use(_.run)`;\n  per-subscription control dispatcher lives inside that run.\n\n**I2. Every live thing has exactly one owner whose release is reachable.** Dispatcher, task, socket, keeper, pool.\n- CB: never discard `Resource` release and rely on GC (#3000 GC reply tentative; #3107 TCK fixture's `allocated._1`\n  test-only). Outer `Resource` owns listening socket, not restartable inner accept stream (#3063).\n- FA: Java builders may already own executors\u002Fpools (#1851); classify before calling anything \"pure configuration\".\n- SC: moved finalizer must not create cycle (foreground shutdown waits on producer waits on foreground).\n\n**I3. Lifetime transfer must cover acquisitions that do not exist yet.** Snapshot of current resources is not\nsubscription to future ones.\n- SC: #3512's `Scope.lease` enumerates currently reachable resources (can miss ones already finalizing); later\n  bracket-per-element resources close early. Author withdrew after six-element counterexample.\n- CB analogue: synchronous handoff bounds pending elements only if producers respect backpressure; repeatedly\n  dispatched blocked sends still pile up (#3341 discussion).\n\n**I4. Ordering and progress need separate lanes.** Short ordered control work and long-running data work cannot share\none sequential lane if data waits on control.\n- CB: stream waits for demand; demand task waits behind stream (#3000\u002F#3107). One sequential start lane for concurrent\n  long-lived subscriptions prevents progress. Terminal-state checks go inside ordered effect.\n\n**I5. Inherited context is part of the lifetime contract.** Wrapper that \"enables\" something is not a neutral reset.\n- SC: explicit interruptibility in #2843 passed local assertion but did not restore parent's inherited mode.\n- CB: cancellation stops work without inventing completion; terminal state set before subscriber notification.\n\n**I6. Emission count is observable contract, including `Unit` emissions.** Zero outputs, one completion output, one\noutput per input: three different APIs.\n- CA: `flatMap`\u002F`>>` continue once per output; `take(n)` counts emissions; `++` runs once after successful exhaustion,\n  is not a finalizer. `Queue.enqueue` per-element units bound consumption (#1913 kept them).\n- FA analogue: one acquisition vs one per request is same count question, for state.\n\n**I7. The oracle must observe the property itself.** Compilation, exit status, test names, elapsed timestamps, Boolean\nmapped to `Unit`, `TestControl.executeEmbed`: not oracles.\n- CA: precise-`Nothing` witness vs widened `Stream[F, Unit]` runtime probe; continuation counters and round-trip bytes.\n- SC: per-element Deferred\u002Fuse-before-release records, not global finalized flag.\n- FA: unavailable-before\u002Favailable-after on same bucket (#6469); historical TimeoutSuite discarded its cancel flag.\n- CB: CancellationSpec waits for subscription resources to close.\n\n## Routing\n\n| Change touches | Load |\n|---|---|\n| FS2 `reactive-streams` (`StreamSubscription`, `StreamUnicastPublisher`, `subscribeStream`), Dispatcher sequential\u002Fparallel choice, `request`\u002F`cancel` ordering, `unsafeRunSync` in callbacks | [references\u002Ffs2-foreign-callback-lanes.md](references\u002Ffs2-foreign-callback-lanes.md) |\n| FS2 `io\u002Fnet` server socket accept stream, `Resource[F, Stream[F, Socket]]`, inner-consumer restart, `async_` migration, JS read\u002Fwrite\u002Ferror lanes, callback-driven `Channel.send` backpressure | [references\u002Ffs2-foreign-callback-lanes.md](references\u002Ffs2-foreign-callback-lanes.md) |\n| FS2 `Pull.extendScopeTo`, `Scope.lease`, `parEvalMap`, prefetch\u002Fchannel handoff of bracketed elements, tracing\u002F`IOLocal` scope wrappers, interruption-mode inheritance | [references\u002Ffs2-per-element-scope-propagation.md](references\u002Ffs2-per-element-scope-propagation.md) |\n| FS2 sink\u002Fpipe output type (`Unit` vs `Nothing`), `.drain`, `foreach` vs `evalMap`, `NotNothing`, `flatMap`\u002F`>>`\u002F`++` after a write, Queue\u002FTopic enqueue emissions, `take` after a sink | [references\u002Ffs2-sink-emission-cardinality.md](references\u002Ffs2-sink-emission-cardinality.md) |\n| http4s middleware\u002Fclient factories with mutable state (DigestAuth `NonceKeeper(F)`, Throttle token bucket, OkHttp builder), `apply` vs `applyF`, deprecated entrypoints, `TestControl`\u002FClock-based middleware tests | [references\u002Fhttp4s-stateful-factory-acquisition.md](references\u002Fhttp4s-stateful-factory-acquisition.md) |\n| Analogous code elsewhere | This file's Workflow and transferable checks; then closest case file for probes |\n\nRaw pinned evidence (SHAs, review permalinks, claims with applicability and counterexamples):\n[callback lanes](references\u002Fevidence\u002Fscala-fs2-foreign-callback-lanes.json),\n[scope propagation](references\u002Fevidence\u002Fscala-fs2-per-element-scope-propagation.json),\n[emission cardinality](references\u002Fevidence\u002Fscala-fs2-sink-emission-cardinality.json),\n[factory acquisition](references\u002Fevidence\u002Fscala-http4s-stateful-factory-acquisition.json).\n\n## Workflow\n\n1. **Pin versions and platform** from build. Load routed case file(s). Note which historical anchor (if any) matches\n   target version; rest are only analogies.\n2. **Draw the lifetime timeline.** Per resource\u002Fstate\u002Flane: describe -> acquire -> each use -> release, plus owner and\n   release-triggering hook. Include acquisitions that happen only after first pull or first request (I1, I3).\n3. **Classify each allocation**: pure configuration, acquisition-local state, request\u002Felement-local state, explicitly\n   shared application service, or foreign-owned. Verify \"pure\" claims against source (I2).\n4. **Build the lane table** for callbacks or workers: submission order, can-wait-on-whom, owner. Find any lane waiting\n   on work queued behind itself (I4).\n5. **Write the emission\u002Fcontinuation table** when stream result or continuation changes: empty \u002F one \u002F many inputs,\n   per-element vs per-chunk, consumers (`flatMap`, `>>`, `++`, `take`) (I6).\n6. **Write the oracle before moving code**, one per invariant; name mutation each rejects (allocation moved into\n   callback; lease missing later elements; merged lanes; widened empty bind; permanently unavailable tokens;\n   removed finalizer) (I7).\n7. **Exercise outcomes**: normal exhaustion, downstream early termination, upstream failure, cancellation with pending\n   handoff, shutdown races, second independent acquisition, inherited noninterruptible parent (I5).\n8. **Decide**: accept, request specific test, or reject with counterexample. Rejecting superficially passing fix needs\n   no invented replacement. Do not propose historically rejected APIs (`extendScopeThrough`, `noInterruptScope`) or\n   copy historical exemplars as verified repairs.\n\n## Review and Refactoring Checks\n\nTransferable (any Scala effect\u002Fstream library):\n- [ ] Construction allocates nothing; one acquisition yields one state shared by its uses; separate acquisitions are\n      independent unless sharing is deliberate (I1).\n- [ ] Every dispatcher\u002Ffiber\u002Fsocket\u002Fpool\u002Fkeeper has owner and reachable release; no \"GC will clean it up\" (I2).\n- [ ] `acquire(i) \u003C use(i) \u003C release(i)` for each element actually used, including later acquisitions; unused\n      acquisitions may be released on cancellation; exactly-once release; bounded shutdown; no retain-everything fix (I3).\n- [ ] Ordered control work never queues behind data work it unblocks; terminal checks inside ordered effect; no\n      blocking `unsafeRunSync` just to order submissions (I4).\n- [ ] Inherited interruption\u002Fmasking context preserved across new wrappers; compare wrapped vs unwrapped (I5).\n- [ ] Output counts, continuation counts, bounded-consumption behavior unchanged unless intentionally migrated, with\n      stated binary\u002Fsource\u002Fruntime compatibility policy (I6).\n- [ ] Backpressure checked at submitting callback, not only buffer capacity; coalescing only where duplicates are\n      protocol-redundant (I3\u002FI4).\n- [ ] Every test asserts property, not proxy; deterministic barriers preferred; timeouts only bound hangs (I7).\n\nLibrary\u002Fversion-specific (do not carry over without re-reading target source):\n- [ ] FS2 `Scope.lease` semantics at target SHA; `Pull.extendScopeTo` path (SC).\n- [ ] FS2 Dispatcher sequential vs parallel constructors; shutdown exception suppressed only at its boundary (CB).\n- [ ] FS2 `NotNothing` (or successor) presence on `flatMap`\u002F`>>` (CA).\n- [ ] http4s `applyF`-style distinct factory name vs constraint-only overloads with defaults (FA, CE2 maintenance).\n- [ ] CE3 `TestControl`\u002F`Temporal` vs CE2 `Timer`\u002F`Clock`\u002F`ContextShift`\u002F`Blocker` (FA).\n- [ ] JVM vs Native vs JS socket\u002Flane implementations (CB).\n\n## Consolidated False Positives\n\n- Short ordered control work on sequential dispatcher is correct; application-owned parallel dispatcher is not\n  inherently a leak (but does not prove per-subscription cleanup). (CB)\n- Released handle returned on purpose as failed-publisher test fixture is not a production pattern. (CB)\n- Single fixed outer resource needs only one lifetime extension; pure transformed value may no longer borrow its\n  source. Require actual borrowing\u002Fuse path. (SC)\n- FS2 stream interruption context is not universal Cats Effect masking; choosing not to alter inherited mode is not a\n  missing cancellation feature. (SC)\n- `evalMap(_ => action)` then `take(n)` uses units as progress signals; terminal writer that never promised per-byte\n  emissions need not invent them; #1913 does not authorize changing current Queue\u002FTopic APIs. (CA)\n- Sharing immutable configuration is fine; request-local scratch state is not a lifetime defect; intentional\n  application-scoped sharing of dedicated blocking service is acceptable; `val` holding a clock effect is not a cached\n  timestamp; virtual time does not control foreign sockets or blocking executors. (FA)\n- Narrow fix leaving documented unrelated follow-up (e.g. nonce expiry) did not introduce it; report gap separately.\n  (FA)\n- Pure queue consumer with no foreign callbacks, or pure integer stream with no acquisition or handoff, does not\n  trigger this skill.\n\n## Version Fences\n\n| Case | Anchor | Versions | Status |\n|---|---|---|---|\n| CB | fs2 #3000 | CE 3.4.0-RC1, two sequential dispatchers | discussion + code |\n| CB | fs2 #3107 | CE 3.4.4, Jan 2023, Reactive Streams JVM adapter | merged |\n| CB | fs2 #3063 | CE `3.5-4b87497` snapshot `async_` semantics; JVM\u002FNative sockets | source-inspected |\n| CB | fs2 #2300, #3341 | contextual discussion only | head diffs excluded |\n| SC | fs2 #2843 | CE 3.3.6 (2022) | closed unmerged |\n| SC | fs2 #3512 | CE 3.5.7, Scala 2.12.20\u002F2.13.15\u002F3.3.4, sbt 1.10.5 (Dec 2024) | closed unmerged |\n| CA | fs2 #1754, #1913 | target FS2 3.0; branch on CE 2.2.0-RC3, Scala 2.13.2\u002F2.12.10, Dotty 0.26.0-RC1 | narrowed revision adopted |\n| FA | http4s #1851 | Scala 2.12.6, CE 0.10.1, FS2 0.10.4 | closed\u002Fsuperseded |\n| FA | http4s #6077 \u002F #6138 | Scala 2.12.15\u002F2.13.8\u002F3.0.2, CE 2.5.4, FS2 2.5.10 (for #6138) | #6077 superseded, #6138 adopted |\n| FA | http4s #6469 | Scala 2.12.16\u002F2.13.8\u002F3.1.2, CE 3.3.12, FS2 3.2.8 | adopted |\n\nMethod visible in an unmerged diff is not available in a release. `IOLocal` observations are IO-specific.\n\n## Validation\n\nNo upstream build or test ran during research. Commands below are source-derived; run only after authorization, in\nisolated checkout.\n\n1. Discover real targets first: read `build.sbt`, `project\u002Fbuild.properties`, plugins, platform requirements; run\n   `sbt projects` and `sbt 'show \u003Cproject> \u002F Test \u002F definedTests'`. Do not assume project names (`io`, `server`,\n   `coreJVM`, `serverJVM`) survive across branches; do not invoke release-bearing CI aliases.\n2. Run case's historical selectors (in each case file) only at matching SHA. Require nonzero test discovery and\n   assertions, not exit status.\n3. Add regression probes from Workflow step 6: per-element Deferred brackets with delayed `parEvalMap(2)` use;\n   cancel\u002Frestart of inner accept stream under retained outer resource; shutdown\u002Fcallback races with multiple\n   subscriptions; empty\u002Fnonempty emission and continuation counts, precise-`Nothing` compile failure (specific expected\n   error) plus widened empty runtime bind; no-eager-allocation, two-acquisition and concurrent replay tests;\n   before\u002Fafter threshold state under virtual time.\n4. Run binary gates (`mimaReportBinaryIssues`) when public factory or sink signature changes, and compile concrete `IO`\n   plus effect-polymorphic call sites with defaults.\n5. Keep platform evidence separate: JVM test is not evidence for Native or Node; virtual time is not evidence for real\n   sockets or blocking pools; TCK and repeated race runs are not proofs over all schedules.\n\n## Examples\n\n### Good\n\n`parEvalMap` refactor reviewed with per-element timeline (I3), six-element Deferred-bracket regression with delayed\nconsumer, and check under noninterruptible parent (I5). Separately, nonce middleware factory allocates keeper in `F`,\nmaps it into request Kleisli. One acquisition serves challenge and follow-up; second acquisition is independent;\nconcurrent replay yields exactly one Ok (I1, I7).\n\n### Broken and Correction\n\nBridge \"simplifies\": runs subscription stream and its demand callbacks on one sequential dispatcher, and swaps global\ndispatcher for allocated publisher with discarded release. Two violations: I4 (deadlock: stream waits for demand queued\nbehind it) and I2 (unowned release). Correction: per-subscription ordered control lane inside lifetime-enclosing\nsubscription effect, parallel start lane, real release hook, test proving progress and cleanup. Likewise,\n`drainedWrite ++ readBack` rewritten to `drainedWrite.flatMap(_ => readBack)` silently skips the read (I6); restore\n`++` and assert continuation counter.\n\n### Negative\n\nTwo services share immutable timeout config while each acquires own state and pools; bridge already has verified\nper-subscription control lanes; integer stream changes its arithmetic. None needs a finding: do not demand\neffect-wrapped config copies, uniform global dispatcher, leases, or interruption matrix.\n\n## Output Contract\n\nPer finding: `file:line`, severity, case (CB\u002FSC\u002FCA\u002FFA or \"analogous\"), invariant (I1-I7), version\u002Fplatform, evidence ID or\nURL, concrete interleaving or timeline, relevant table (lane\u002Fowner, emission\u002Fcontinuation, or\nconstruction\u002Facquisition\u002Frequest), proposed bounded correction, discriminating test naming mutation it rejects. State\nrelease hook closing each owner, compatibility policy if signatures change, evidence stage per claim: observed code,\nreviewer proposal, author report, merged decision, or model inference. Say whether any repair was only proposed,\ncompiled, or executed, and which outcomes remain unexercised.\n\n## Limitations\n\n- Derived from model-based review of pinned historical source and maintainer discussion. Several anchors are\n  closed\u002Funmerged (#2843, #3512, #1851, #6077); they teach review probes, not repairs.\n- Invariants I1-I7 are cross-case synthesis (inference); each case file states what its evidence actually shows.\n- Historical exemplars carry caveats (unused Blocker, `lastNc + 1`, discarded TimeoutSuite cancel flag, inconsistent\n  #1913 printing docs, #3107 TCK fixture); not present-day vulnerability claims.\n- #3107 does not prove every Play\u002FAkka integration migrated correctly. Reviewer formal maintainer roles not\n  established. No security, timing or performance effectiveness experimentally established.\n",{"name":5,"license":15,"description":7},"main","101d0f67250256ca5d80dc3f95767cad7b541457","skills\u002Fscala\u002Fscala-stream-resource-scoping","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents","https:\u002F\u002Fgithub.com\u002Fw0rxbend","https:\u002F\u002Freadme.worxbend.com\u002F","Fluent in Backend-ese (microservices, distributed systems, you know the drill)\r\nFunctional Programming Fanatic...","2026-11-14 14:44:12",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add w0rxbend\u002Fdot-agents --skill scala-stream-resource-scoping",{"tool":39,"command":40},"bunx","bunx skills add w0rxbend\u002Fdot-agents --skill scala-stream-resource-scoping",{"tool":42,"command":43},"pnpm","pnpm dlx skills add w0rxbend\u002Fdot-agents --skill scala-stream-resource-scoping","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002FSKILL.md",true,[47,51,57,61,65,69,73,77,81],{"path":48,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":16},"LICENSE","许可证",1280,{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fevidence\u002Fscala-fs2-foreign-callback-lanes.json","REFERENCE","参考文档",19710,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002Freferences\u002Fevidence\u002Fscala-fs2-foreign-callback-lanes.json",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fevidence\u002Fscala-fs2-per-element-scope-propagation.json",9886,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002Freferences\u002Fevidence\u002Fscala-fs2-per-element-scope-propagation.json",{"path":62,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fevidence\u002Fscala-fs2-sink-emission-cardinality.json",10371,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002Freferences\u002Fevidence\u002Fscala-fs2-sink-emission-cardinality.json",{"path":66,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fevidence\u002Fscala-http4s-stateful-factory-acquisition.json",30870,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002Freferences\u002Fevidence\u002Fscala-http4s-stateful-factory-acquisition.json",{"path":70,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Ffs2-foreign-callback-lanes.md",9349,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002Freferences\u002Ffs2-foreign-callback-lanes.md",{"path":74,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Ffs2-per-element-scope-propagation.md",7579,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002Freferences\u002Ffs2-per-element-scope-propagation.md",{"path":78,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Ffs2-sink-emission-cardinality.md",7189,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002Freferences\u002Ffs2-sink-emission-cardinality.md",{"path":82,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fhttp4s-stateful-factory-acquisition.md",9763,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fscala\u002Fscala-stream-resource-scoping\u002Freferences\u002Fhttp4s-stateful-factory-acquisition.md",[86,93,100,108,115,122],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":20},"01M7E6TS1SW1ZSXN748N0RBGHT","wiki-builder","Create and maintain a local Markdown research wiki (sources with provenance, compiled concept\u002Fsource pages, index, maintenance log) driven by a per-wiki config. Use when the user wants to start a wiki or knowledge base, ingest sources into one, or query and update it; use wiki-page-writer for a single code deep-dive page.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fwiki-builder\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M7E6S8ARS0VQR85H4FEC390B","refactoring-guru","Diagnose a named code smell and apply the smallest behavior-preserving refactoring, with verification before and after and an explicit stop condition. Use for structural refactors (extract, move, consolidate, change ownership), not for feature or bug work; for readability cleanup of recent changes use code-simplification.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Frefactoring-guru\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":20},"01M7E6RRXCYGSHA0ZBFX3YZP7Y","legacy-seams","When changing untested legacy code, pin the observed results with characterization tests and open the smallest seam that substitutes only the blocking dependency, separate from any later logic change. Use when a clock, random source, I\u002FO, global, or hidden constructor blocks a test or a safe edit. Use test-driven-development for a new behavior or a bug, refactoring-guru for one named structural refactor after the seam exists, and code-refactoring-tech-debt to choose which legacy to replace.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Flegacy-seams\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Flegacy-seams\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":20},"01M7E6QZ11XWSNHCBGYK8HH97C","idea-refine","Refine a raw idea into a one-page brief (problem statement, recommended direction, assumptions to validate, MVP scope, not-doing list) through divergent then convergent thinking. Use when an idea is still vague or you want options and a stress test before committing; use interview-me when the goal itself is unclear and spec-driven-development once the direction is chosen.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fidea-refine\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":20},"01M7E6N2N7BYW7BA5XGM0QD3B4","code-review-and-quality","Review rubric and approval standard for any change before merge, including code written by you, another agent, or a human: five axes (correctness, readability, architecture, security, performance), change sizing, structural remedies, severity labels, and feedback technique. Use to judge whether a change is fit to merge; use code-review to run a PR or diff review end to end.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcode-review-and-quality\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":126,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":20},"01M7E6MNCZPTRD77Z419X755HQ","code-perfection","Smell and style gate for code you write or change. Bans known code smells (long method, large class, primitive obsession, long parameter list, data clumps, duplicate code, dead code, feature envy, shotgun surgery, flag arguments, message chains) and enforces behavior-preserving structure. On Scala files, enforces worxbend style. Use while implementing, reviewing a diff for smells, or when a smell or style violation is suspected. Routine construction stays with code-complete. SOLID and DRY stay with clean-code-guard. One named structural refactor stays with refactoring-guru.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcode-perfection\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcode-perfection\u002FSKILL.md",[],[]]