[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M780JZ3KBX976K9ECKJ2GCK8":3,"skill-same:01M780JZ3KBX976K9ECKJ2GCK8":103},{"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":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M780JZ3KBX976K9ECKJ2GCK8","effect-v4-testing",null,"Use when writing, reviewing, or fixing tests for Effect v4 code with @effect\u002Fvitest — it.effect + Effect.gen as the default runner, asserting typed errors via Effect.flip or Effect.result (Exit + Cause for defects), providing test\u002Fmock layers with layer(...) for any service in R (owned or consumed), fault-injecting one method of a real layer, property tests with it.effect.prop over a Schema, TestClock for time-dependent logic, converting a plain-Vitest repo, and the mutate-the-edges discipline for proving a suite can actually fail — the discriminating input wrong in exactly one way, per-clause and per-path mutation, and the positive control a \"nothing found\" result needs before it's believed.","spencerbeggs\u002Feffected","spencerbeggs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F109114?v=4","01M77ZTHB70K5Y2VVTRCFY50A5","C. Spencer Beggs","01M77ZTHCC41NXBT3X906K6QM1",8,"MIT","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: effect-v4-testing\ndescription: Use when writing, reviewing, or fixing tests for Effect v4 code with @effect\u002Fvitest — it.effect + Effect.gen as the default runner, asserting typed errors via Effect.flip or Effect.result (Exit + Cause for defects), providing test\u002Fmock layers with layer(...) for any service in R (owned or consumed), fault-injecting one method of a real layer, property tests with it.effect.prop over a Schema, TestClock for time-dependent logic, converting a plain-Vitest repo, and the mutate-the-edges discipline for proving a suite can actually fail — the discriminating input wrong in exactly one way, per-clause and per-path mutation, and the positive control a \"nothing found\" result needs before it's believed.\nwhen_to_use: >-\n  it.scoped removed, Arbitrary size clamp\u002F-0\u002Fexhaustion\u002Fdropped-regex traps, Path.layer + @effected\u002Fmemfs need no platform package, vi.mock must import vi from vitest, layer() memoizing while Effect.provide does not, TestConsole swallowing Effect.log* through ConsoleRef, a small real delay hanging the virtual clock, Tests: 0\u002F0 passed lying while the exit code is honest, a project-filtered run from inside a package not loading the root config, TestClock starting at the epoch (1970), an eagerly-recording layerNoop stub, a narrowing if with no else branch, structural checks over source text (import walkers, export assertions, comment strippers), the two-latch rule for concurrency-leak tests, unhandledErrors and a stray process.exitCode making a green suite lie\ntargets:\n  copilot:\n    description: >-\n      Use when writing, reviewing, or fixing tests for Effect v4 code with @effect\u002Fvitest — it.effect + Effect.gen\n      as the default runner, asserting typed errors via Effect.flip or Effect.result (Exit + Cause for defects),\n      providing test\u002Fmock layers with layer(...) for any service in R (owned or consumed), fault-injecting one\n      method of a real layer, property tests with it.effect.prop over a Schema, TestClock for time-dependent logic,\n      converting a plain-Vitest repo, and the mutate-the-edges discipline for proving a suite can actually fail —\n      the discriminating input wrong in exactly one way, per-clause and per-path mutation, and the positive control\n      a \"nothing found\" result needs before it's believed. Also triggers on: Tests: 0\u002F0 passed lying while the exit\n      code is honest, TestClock at the epoch (1970), layer() memoizing while Effect.provide does not, TestConsole\n      swallowing Effect.log* through ConsoleRef, vi.mock must import vi from vitest, structural checks over source\n      text.\n---\n\n# Effect v4 testing with `@effect\u002Fvitest`\n\n`@effect\u002Fvitest` re-exports Vitest, so it is the single entrypoint for test\nAPIs — with one exception (`vi.mock`, below). Effect programs run through\n`it.effect`, never through a bare `it()` that calls `Effect.runSync`\u002F\n`runPromise`. Our house test files (`packages\u002Fjsonc\u002F__test__\u002FJsonc.test.ts`,\n`packages\u002Fyaml\u002F__test__\u002FYaml.test.ts`) are the canonical shapes. (The\n`effect\u002Ftesting\u002F*` modules — TestClock, TestConsole, TestSchema — and the\nproperty engine `Arbitrary` are indexed in\n`effect-v4-module-index`; this skill owns how to use them. There is no\n`FastCheck` module.)\n\n**Migrating a plain-Vitest Effect repo? Adopt `@effect\u002Fvitest`.** A repo whose\ntests are plain Vitest is not \"nothing to migrate on the testing axis\": add\n`@effect\u002Fvitest` and route Effect-returning tests through `it.effect`. The\nconversion has its own traps →\n**[references\u002Fmigrating-a-repo.md](.\u002Freferences\u002Fmigrating-a-repo.md)**.\n\n**Testing a specific front end or a repo-shape check routes elsewhere first.**\nThis skill owns the general `@effect\u002Fvitest` mechanics; a front end's own\ntesting subpath owns the rest: testing a CLI bin → `effect-v4-cli` (`CliTest`); an Ink screen, a wizard or a live view → `effect-v4-cli` (`CliUiTest`: its `session` transcript, and its snapshot serializer registered through Vitest's `snapshotSerializers` config, snapshots being the one place a test needs `expect`);\ntesting an MCP server → `effect-v4-mcp` (`McpHarness`, `McpProbe`); a\nmonorepo's own repo-shape checks (layering, source boundaries, packed\ninstalls) → `@effected\u002Fworkspaces\u002Ftesting` (see `effected-packages`).\n\n**Install it from the same catalog as `effect`, so it resolves to the same version** — never bare and never from a dist-tag. Effect releases `effect` and every `@effect\u002F*` package together at one shared version, so `@effect\u002Fvitest` must resolve to exactly the version `effect` does. A dist-tag (`latest`, `beta`, `rc`, `snapshot`) is a moving pointer that can resolve to a version other than the one `effect` resolves to.\n\nThe failure of a mismatch names neither package: a v3 `@effect\u002Fvitest` installed beside v4 `effect` loads with only a one-line `Issues with peer dependencies found` warning; `pnpm peers check` then lists unmet `effect ^3` and `vitest ^3` peers, and the test file fails to load with `Cannot find module '…\u002Feffect\u002Fdist\u002FArbitrary.js'`, because the v3 package imports a module the v4 `effect` does not ship. It reads as a broken install rather than a version mismatch. Run `pnpm peers check` and compare `@effect\u002Fvitest`'s resolved version with `effect`'s in the lockfile before believing any resolution. With `@effected\u002Fpnpm-plugin-effected` the dependency comes from `catalog:effected`, which carries both at the same range.\n\n**`vi.mock` is the one import that must NOT come from `@effect\u002Fvitest`.** Vitest\nhoists it above all imports, so a `vi` bound through the re-export is not yet\ninitialized and the file dies at load with `Cannot access '__vi_import_1__'\nbefore initialization` — naming neither `vi` nor `@effect\u002Fvitest`. Write\n`import { vi } from \"vitest\"` in any file calling `vi.mock`; `vi.fn` \u002F\n`vi.spyOn` work fine through the re-export (measured across 24 files).\n\n**A spy restored in `try`\u002F`finally` inside `Effect.gen` LEAKS.** A failing\nassertion leaves through the *error channel*, so the `finally` does not run the\nway the shape suggests, and a `vi.spyOn` on a process global that outlives its\ntest poisons its neighbours — false reds first, false greens later. Acquire and\nrelease spies with `Effect.acquireUseRelease` instead →\n[references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md).\n\n**A repo without `@effect\u002Fvitest` can still test Effect code**: a plain Vitest\n`it` calling a small `Effect.runPromise` helper. What it loses is what\n`it.effect` installs: a per-test `Scope` and the virtual `TestClock` and\n`TestConsole` (`Effect.scoped` and `TestClock.layer()` add the scope and the clock back\nby hand), plus `layer(...)` sharing and `it.effect.prop`. The skill's `it.effect`\nexamples assume the package is installed.\n\n## The default runner: `it.effect` + `Effect.gen`\n\n```ts\nimport { assert, describe, it } from \"@effect\u002Fvitest\";\nimport { Jsonc } from \"@effected\u002Fjsonc\";\nimport { Effect } from \"effect\";\n\ndescribe(\"Jsonc\", () => {\n  it.effect(\"parses objects, arrays and scalars\", () =>\n    Effect.gen(function* () {\n      const value = yield* Jsonc.parse('{ \"a\": 1 }');\n      assert.deepStrictEqual(value, { a: 1 });\n    }),\n  );\n});\n```\n\n- **`it.effect` runs the returned Effect** and provides the default test\n  environment — `TestEnv = Layer.mergeAll(TestConsole.layer, TestClock.layer())`\n  (`packages\u002Fvitest\u002Fsrc\u002Finternal\u002Finternal.ts:68`), piped through\n  `flow(Effect.scoped, Effect.provide(TestEnv))` (`internal.ts:490`). Its type is\n  `Tester\u003CR | Scope.Scope>`, so scoped effects (`Effect.acquireRelease`, scoped\n  layers) run **directly** under `it.effect`.\n- **There is no `it.scoped`** (zero `scoped` matches in\n  `packages\u002Fvitest\u002Fsrc\u002Findex.ts`; the v3→v4 migration guide\n  spells the replacement out — `it.scoped(...)` becomes `it.effect(...)`,\n  `it.scopedLive(...)` becomes `it.live(...)`). The Tester surface is\n  `skip`\u002F`skipIf`\u002F`runIf`\u002F`only`\u002F`each`\u002F`fails`\u002F`prop` — **`it.effect.skipIf`\n  and `it.effect.runIf` exist and are well-typed** (`packages\u002Fvitest\u002Fsrc\u002Findex.ts:82-83`);\n  reach for them instead of hand-rolling a conditional `describe`.\n- **`it.live`** (`Tester\u003CScope.Scope | R>`) opts into the real `Clock` and live\n  runtime services. Use only when a test genuinely needs wall-clock behavior.\n- **`it.effect` takes a Vitest timeout as its third argument** —\n  `it.effect(name, self, timeout?: number | TestOptions)`. Any real-time elapsed\n  assertion above Vitest's 5000ms default is dead code without it (see\n  [references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md)).\n- **Never** `it(\"...\", () => Effect.runPromise(program))`. Plain `it()` is fine\n  only for genuinely non-Effect pure code (`Jsonc.stripComments`, `Yaml.equals`).\n- **The rule is UNCONDITIONAL. \"But the layer is fully synchronous\" is not a\n  carve-out.** The tempting shape is a `describe` block with a local\n  `const validate = (doc) => Effect.runSync(Effect.provide(program, Svc.layer))`\n  helper, justified because the service's implementation happens to be\n  synchronous (a `Layer.succeed` over a sync engine such as ajv). It shipped in\n  `packages\u002Fschemastore\u002F__test__\u002Fschema-validator.test.ts`, alongside four\n  sibling blocks in the same file that use `layer(...)` + `it.effect`\n  correctly. Synchrony is a property of **today's implementation**, never of\n  the **contract**: the member's type is `Effect\u003CA, E>`, which permits async,\n  and nothing in the type system tells you when that changes. The two costs:\n  - Swap one member for an async implementation and every test in the block\n    dies at *runtime* with `AsyncFiberError: An asynchronous Effect was\n    executed with Effect.runSync` — no type error, no warning, and the blast\n    radius is the whole `describe`.\n  - A typed failure escapes `runSync` as a **throw** (in v4 the error instance\n    itself, `_tag` intact — not a wrapper), so it lands in Vitest's generic\n    exception path instead of `Effect.flip` \u002F `Effect.result`, and the test\n    asserts on a stack trace instead of the error channel.\n\n  The correct shape costs one line: `layer(Svc.layer)(\"the shipped engine\",\n  (it) => { it.effect(…, () => Effect.gen(…)) })` — and it gets you\n  `TestClock`\u002F`TestConsole` and layer memoization for free.\n- **Never** `it(\"...\", () => Effect.gen(...))` either — the inverse mistake, and\n  the worse one. Returning an Effect without running it hands Vitest a\n  non-promise it does nothing with: the test reports **green having evaluated\n  zero assertions**. The two shapes are inverses and only the first one looks\n  wrong:\n\n  | shape | runs? | symptom |\n  | --- | --- | --- |\n  | `it(..., () => Effect.runPromise(p))` | yes | correct result, execution laundered |\n  | `it(..., () => p)` | **no** | always green, no assertion ever evaluated |\n\n  The fix in both directions is `it.effect`. This shipped in\n  `@effected\u002Fschemastore` and was caught\n  only in review — and the vacuous test was the one cited as proof to a\n  downstream consumer who had reported the very finding it failed to pin. A\n  false green does not merely miss a regression; it gets used as evidence. The\n  shape is greppable, so it belongs in a structural check (see\n  [references\u002Fstructural-checks.md](.\u002Freferences\u002Fstructural-checks.md)).\n- **Never launder an Effect into a fixture with `Effect.runSync`.** If a test\n  input comes from an Effect (a parse, a decode), the test *is* an `it.effect`\n  and you `yield*` it; if you only need a domain value, build it with `X.make`.\n- **`yield* import(...)` breaks** — it throws `(intermediate value) is not\n  iterable`, naming neither the import nor the yield. A dynamic import inside\n  `Effect.gen` is `yield* Effect.promise(() => import(\".\u002Fthing.js\"))`; a bulk\n  `await` → `yield*` rewrite produces the broken form mechanically.\n\n## Asserting on typed errors\n\nA test for the failure channel must not let the error escape as a defect.\n**`Effect.flip`** — swaps channels so the typed error becomes the success value\n— is our house pattern:\n\n```ts\nimport { assert, it } from \"@effect\u002Fvitest\";\nimport { Jsonc } from \"@effected\u002Fjsonc\";\nimport { Effect } from \"effect\";\n\nit.effect(\"fails with an aggregate JsoncParseError\", () =>\n  Effect.gen(function* () {\n    const error = yield* Effect.flip(Jsonc.parse(\"{ bad }\"));\n    assert.strictEqual(error._tag, \"JsoncParseError\");\n    assert.isAbove(error.errors.length, 0);\n  }),\n);\n```\n\n**`Effect.result`** — never fails; returns a `Result` you narrow with\n`Result.isSuccess`\u002F`isFailure` (the v4 replacement for the removed `Either`).\nReach for it when one program must assert on *both* channels. **`Effect.exit`**\n— the full `Exit` (defects and interrupts included) when you must inspect a\n`Cause`. Signatures (verified): `flip: Effect\u003CA,E,R> => Effect\u003CE,A,R>`,\n`result: … => Effect\u003CResult\u003CA,E>,never,R>`, `exit: … => Effect\u003CExit\u003CA,E>,never,R>`.\n\n**`Effect.flip` is WRONG for a defect.** It swaps only the *typed* channel, so a\ndefect escapes it and the test errors instead of asserting. Defects go through\n`Effect.exit`, **with an explicit throw\u002Ffail on the non-failure branch**:\n\n```ts\nimport { assert, it } from \"@effect\u002Fvitest\";\nimport { Cause, Effect, Exit } from \"effect\";\n\nconst subject = Effect.die(new Error(\"the expected message\"))\n\nit.effect(\"the subject dies with the expected message\", () =>\n  Effect.gen(function* () {\n    const exit = yield* Effect.exit(subject);\n    if (Exit.isFailure(exit)) {\n      assert.include(Cause.pretty(exit.cause), \"the expected message\");\n    } else {\n      assert.fail(\"expected a defect, but the effect succeeded\");\n    }\n  }),\n);\n```\n\n**A narrowing `if` with no `else` asserts nothing on the other path.** A bare\n`if (Exit.isFailure(exit)) { …assert… }` passes silently on success — found six\nseparate times in one package's suite. It is its own anti-pattern, not an\nExit-specific one.\n\n**Genuine defects must NOT be swallowed into the typed channel** — the half a\nflip-based test cannot prove. Assert `Effect.exit`, that the cause holds no\n`Fail` reason (the discriminating line), and that the `Die` defect is the\nORIGINAL error. **Assert helpers are never type predicates** — narrow with a\nreal `if`; and `assert.deepStrictEqual` against literal-typed encodes needs an\nexplicit `\u003Cunknown>` type argument. Worked example and both traps →\n**[references\u002Fasserting-errors.md](.\u002Freferences\u002Fasserting-errors.md)**.\n\n## Providing test \u002F mock layers\n\n`layer(...)` applies to **any service in a test's `R` — owned or consumed**. Its\nsignature takes any `Layer.Layer\u003CR, E>`; nothing requires the package under test\nto declare the service. A package that owns no services but *consumes*\n`Path.Path` or `FileSystem.FileSystem` needs suite-boundary layers most.\n\n```ts\nimport { assert, describe, layer } from \"@effect\u002Fvitest\";\nimport { Context, Effect, Layer } from \"effect\";\n\nclass Foo extends Context.Service\u003CFoo, string>()(\"Foo\") {\n  static readonly layer = Layer.succeed(Foo, \"foo\");\n}\n\ndescribe(\"foo\", () => {\n  layer(Foo.layer)((it) => {\n    it.effect(\"gets foo\", () =>\n      Effect.gen(function* () { assert.strictEqual(yield* Foo, \"foo\"); }));\n  });\n});\n```\n\n### `layer()` memoizes; plain `Effect.provide` does NOT. That asymmetry is the whole decision\n\nThe top-level `layer` builds once per group and keeps the scope open until\n`afterAll`; a per-test `.pipe(Effect.provide(L))` rebuilds per test. Nested\nprovides inside one running effect memoize constituent consts by reference, so\na fault-injected variant can silently fall back to the REAL services already\nbuilt outside.\n\n**Per-test provide is the SAFE default; collapsing a suite onto a\nsuite-boundary `layer()` is the RISKY move.** Build-once means every stateful\nresource is cumulative across the group — `TestClock.adjust`, in-memory\nstores, TTL expiry, `TestConsole.logLines` — so a clock-driving test must NOT\nlive inside a `layer()` block. Pre-flight before collapsing, the nested-layer\nand `excludeTestServices` forms, and why `MethodsNonLive` has no `.live` →\n**[references\u002Fproviding-layers.md](.\u002Freferences\u002Fproviding-layers.md)**; worked\nfailures in [references\u002Fmigrating-a-repo.md](.\u002Freferences\u002Fmigrating-a-repo.md).\nA mock service is a `Context.Service` with a test `Layer`, swapped `Live` →\n`Test` at this boundary, never inside test bodies.\n\n**Testing a boundary-tier package that does real IO needs no platform package.**\n`Path.layer` comes from `effect` core (`Path.ts:931`) and is the POSIX `Path`\nonly (`\u002F` separator, POSIX semantics): provide it in tests, never in code under\n`src\u002F`, where it would give Windows users POSIX paths. The filesystem double\nis `@effected\u002Fmemfs`, a pure package with no `node:*` import — core ships\n**no** `FileSystem.layer`, only the deny-by-default `layerNoop` (`FileSystem.ts:848`),\nwhich is not a double\n([references\u002Fproviding-layers.md](.\u002Freferences\u002Fproviding-layers.md)). So `@effected\u002Fwalker` tests filesystem behavior\nwith zero `@effect\u002Fplatform-node` devDependency:\n\n```ts\nimport { MemoryFileSystem } from \"@effected\u002Fmemfs\";\nimport { assert, layer } from \"@effect\u002Fvitest\";\nimport { Effect, FileSystem, Layer, Path } from \"effect\";\n\nlayer(Path.layer)(\"path ops\", (it) => {\n  it.effect(\"Path is in R, no Effect.provide in the body\", () =>\n    Effect.gen(function* () {\n      const path = yield* Path.Path;\n      assert.strictEqual(path.dirname(\"\u002Fa\u002Fb\"), \"\u002Fa\");\n    }));\n});\n\nconst Volume = Layer.merge(Path.layer, MemoryFileSystem.layerWith({ \"\u002Fa\u002F.rc\": \"\" }));\n\nlayer(Volume)(\"seeded filesystem\", (it) => {\n  it.effect(\"fs.exists consults the volume\", () =>\n    Effect.gen(function* () {\n      const fs = yield* FileSystem.FileSystem;\n      assert.isTrue(yield* fs.exists(\"\u002Fa\u002F.rc\"));\n      assert.isFalse(yield* fs.exists(\"\u002Fa\u002Fother\"));\n    }));\n});\n```\n\n**`layerNoop`'s unstubbed members answer in THREE different ways**\n(`makeNoop` (`FileSystem.ts:712`) splits them) — typed `NotFound`, silent success (`exists` → `false`, `remove` → `Effect.void`), and\n`Effect.die` (`makeDirectory`, `makeTemp*`), which `Effect.catch` cannot\nabsorb. **None of this is a reason to stub `layerNoop` better — it is the\nargument for `@effected\u002Fmemfs`.** This repo's rule: a `FileSystem` double is\n`@effected\u002Fmemfs`, never a `layerNoop` stub and never a hand-rolled `node:fs`\nport stub. The one exception is an **oracle test that runs a third-party\nengine** (the tool your code mirrors, such as `@changesets\u002Fapply-release-plan`\nor a package manager) on the same input as your code: the engine reads\n`node:fs` and real git itself, where no volume can reach it. Copy the fixture\ninto a temporary directory, run both sides there over `@effect\u002Fplatform-node`,\nand keep every other test on memfs. **Every `Effect.provide` of a memfs layer re-seeds a fresh\nvolume**, so assert inside the one provide or provide a pinned\n`handle.layer`. The table, the BOM trap, the seed forms and the\none-`layer(...)`-block-per-fixture shape →\n**[references\u002Fproviding-layers.md](.\u002Freferences\u002Fproviding-layers.md)**;\npicking the memfs form, seeds, faults, case-insensitive volumes and traps →\n**[references\u002Fmemfs.md](.\u002Freferences\u002Fmemfs.md)**.\n\n**A service built on `@effected\u002Fstore` is tested over its REAL implementation, never a hand-written double**: share one implementation effect written against `Store` between `layer(filename)` (production, `Store.layerSqlite`) and a `layerMemory()` FACTORY over `Store.layerTest({ migrations })`, which opens a fresh migrated `:memory:` database per build. A factory, not a const, so two consumers in one composed graph never share a database by reference memoization. Pair it with `@effected\u002Fmemfs` for a fully hermetic pipeline. An application wired through `@effected\u002Fapp` tests over `AppTest.layer(options)` from `@effected\u002Fapp\u002Ftesting` — fixed XDG paths, `:memory:` `Store`\u002F`Cache` and a memfs volume, `R = never`; `@effected\u002Fmemfs` is that subpath's optional peer, so add it as a devDependency.\n\n**Every stub effect goes through `Effect.suspend`.** A recorder that pushes\neagerly logs calls that never executed. Worked probe →\n[references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md).\n\n### Faulting ONE method of a real layer\n\nFor \"behaves like the real service except this one method fails on demand\",\n`layerNoop` is the wrong tool. The house recipe is `Layer.effect` + spread the\nbase + `Layer.provide(base)`, with `Layer.updateService` as the shorter form\nand `Layer.mock` for partial stubs that die loudly. Full scaffold, the source\nanchors and the three ways to get the spread wrong →\n**[references\u002Ffault-injection.md](.\u002Freferences\u002Ffault-injection.md)**.\n\n### The env seam: swap `ConfigProvider`, never `process.env`\n\nCode reading its environment through `Config.*` already has a test seam, and\nit is not in `R`: `ConfigProvider.ConfigProvider` is a `Context.Reference`, so\na test replaces it with `Effect.provide(ConfigProvider.layer(ConfigProvider.fromEnv({ env: record })))`.\nAn empty record is the \"variable unset\" case; the default provider would\nanswer from whatever the developer's shell exports. Never mutate\n`process.env` in `beforeEach`. Worked example →\n**[references\u002Fenv-seam.md](.\u002Freferences\u002Fenv-seam.md)**.\n\n## Property testing with `it.effect.prop` and `it.prop`\n\nFeed a Schema (or class) directly as an arbitrary. The engine is core's native\n**`Arbitrary`**, not fast-check — there is no `FastCheck` module, and **no\n`fastCheck: { numRuns }` option**: the bag is `arbitrary: { runs, size, … }`.\nThe traps a probe settled, each with its fix in\n**[references\u002Fproperty-testing.md](.\u002Freferences\u002Fproperty-testing.md)**:\n\n- The `size` clamp (default **10**) silently shrinks a domain — pass\n  `size: \u003Ccap>` for long-input properties.\n- A brand whose check is a bare `makeFilter` EXHAUSTS instead of hanging.\n- The generator emits `-0`; round-trip properties over serialized numbers\n  exclude it.\n- A partial dictionary is a Struct of `optionalKey`, not a `Record`.\n- `isPattern` regexes must be lookaround-free, free of `i`\u002F`m`\u002F`v`, and carry\n  `u`; otherwise the pattern is silently dropped.\n- A custom-alphabet string is `Arbitrary.array` over a `Schema.Literals`\n  of characters, mapped through `join(\"\")`; `Arbitrary.array` is under the\n  same `size` clamp.\n- Reading a failure: the agent reporter compacts it to one line; the full\n  shrunk input and replay token are in the `--reporter=json` output file. Pin\n  the counterexample as an ordinary regression test.\n\n## Time-dependent logic: `TestClock`\n\n**`it.effect` ALWAYS installs a virtual `TestClock`. This is not opt-in.**\n\n- **A small REAL delay anywhere under the test — usually in `src` — hangs to\n  the vitest timeout** with no message pointing at the clock. Any\n  `Effect.sleep`, retry schedule, timeout or polling interval needs a driven\n  clock or `it.live`; grep the implementation, not only the test. A test that\n  hangs for exactly five seconds: suspect wall-clock time first.\n- **It starts at the EPOCH**, so clock *reads* return 1970 — set the clock\n  with `TestClock.setTime(...)` whenever the code under test reads time.\n- **Real async I\u002FO interleaved with sleeps desyncs the drain loop** — use\n  `it.live` for exactly those tests, outside the `layer()` block.\n- **Do not manually provide `TestClock.layer()` under `it.effect`**, and never\n  call `TestClock.adjust` under `it.live`.\n- **Stage an interleaving with latches, not sleeps**, and a *leak* test needs\n  **two** latches.\n\nThe grep pattern, the driving example, the clock-free interrupt restructure\nand the source-visible reasoning →\n**[references\u002Ftestclock.md](.\u002Freferences\u002Ftestclock.md)**; the two-latch probe →\n[references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md).\n\n## `it.effect` also intercepts CONSOLE output — including `Effect.log*`\n\n`TestEnv` installs `TestConsole` alongside the clock, so a spy on the real\n`console.log` captures **nothing** — and auditing for `Console.*` call sites\nis insufficient, because Effect's default logger writes through the same ref.\n**A test whose only assertions are negative is the vacuous-pass shape**; a\npositive sibling is the cheap proof the sink is live. Source identity and the\nimmune cases → **[references\u002Ftest-console.md](.\u002Freferences\u002Ftest-console.md)**;\n`TestConsole.logLines` accumulation →\n[references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md).\n\n## A test that cannot fail is worse than no test — mutate the edges\n\nA green suite proves nothing about the properties no test can observe. The\ndiscipline: **capture a baseline** (`git status --porcelain > \u002Ftmp\u002Fbaseline`),\nbreak the implementation in the way the property forbids (with the editor —\nnever `git checkout`\u002F`git stash`, other work lives in the tree), watch that\nexact test go red, revert, and confirm the status matches the **baseline**.\n\n- **The assertion must DISCRIMINATE** — fail for the right reason.\n- **The failure to look for is a rule with no input that could falsify it.**\n  Ask of every rule: *what input would make this fire alone, and does it\n  exist?* Mutate **per clause and per path**; **two code paths implementing\n  one rule are two things to pin, not one**.\n- **`as const satisfies ReadonlyArray\u003CUnion>` enforces NOTHING about\n  exhaustiveness** — use a residue-must-be-empty type or a total\n  `Record\u003CUnion, …>`.\n- **One assertion, one rule.** A passing test is evidence about the path it\n  takes, not about the rule it appears to test.\n- **Before acting on \"nothing found\", run a control that FIRES**, with a\n  non-zero expected answer, against a KNOWN-GOOD input.\n- **Read the failure TEXT; never infer a catch from a missing pass line.**\n  Empty output is a failed experiment.\n- **Never verify a change by grepping for the text you just wrote.** Only a\n  mutation finds the emit site.\n- **A semantics-preserving perf fix cannot be pinned** — report it as\n  fixed-but-unpinned.\n- **A surviving mutant is a question about the CODE**; deleting the code is a\n  legitimate answer. When sweeping, assert the on-disk state every run, and\n  settle disagreeing reads against `git show HEAD:\u003Cpath>`.\n\nFull discipline, the checklist, the `satisfies` spellings that do fire and the\nworked failures →\n**[references\u002Fmutation-testing.md](.\u002Freferences\u002Fmutation-testing.md)**.\n\n### Structural checks over source text\n\nAn invariant a type cannot express — \"this module does not reach that\ndependency\", \"the entrypoint exports this by name\" — gets pinned by asserting\nover source text, and those assertions fail silently where ordinary ones shout.\n**Raw source is SAFE for a `notInclude` check (a comment mention is a spurious\nalarm) and DANGEROUS for an `include` one (a comment mention passes).** Strip\ncomments — LINE comments **before** block comments — remove module specifiers,\nmatch on a word boundary, and give the stripper its own discriminating test once\nit is load-bearing → **[references\u002Fstructural-checks.md](.\u002Freferences\u002Fstructural-checks.md)**.\n\n## Other false greens, in one place\n\n`Tests: 0\u002F0 passed` is a FAILED run whose **summary line** says passed (a\nfilter that matched no test file; the separate `ERR_LOAD_URL` a repo suffers\nwhile its config declares a cwd-relative `globalSetup` path is a config defect\nto fix, not a cwd rule to obey); `TestConsole.logLines` accumulation; the eager\n`layerNoop` recorder; `PubSub.takeAll` hanging on an empty subscription; a\ndrain test whose subscriber took every message inside `publish`, so nothing\nwas ever queued; `PubSub.shutdown` dropping the tail it was meant to drain; a\nstream over an ended subscription repeating `PubSub.end`'s sticky final\nmessage forever; a race that only shows below the default\n`Scheduler.MaxOpsBeforeYield` budget; timing\ngates lying under coverage, and a timing guard that cannot catch a loop\nthat never returns (its control runs in a subprocess with a hard timeout);\na green suite that fails the vitest **process**\nbecause a test left `process.exitCode` set; a big green count for a surface the\nsuite never calls; a helper used on **both sides** of every comparison, which\nagrees with itself however broken it is; an `Effect.timeout` guard that never\nfires — under `it.effect` any guard is inert until `TestClock.adjust` passes\nit, and under a real clock a guard of 5 seconds or more loses to vitest's own\ndefault; a forked fiber's failure that is never observed anywhere unless the\nfiber is joined. Each with its probe →\n**[references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md)**.\n\n**Zero collected tests is never a pass — read BOTH the Tests line and the exit\ncode.** A filter that matches no test file prints `Tests: 0\u002F0 passed` and exits\n**1**: the Tests line is the liar and the exit code is honest. Treat any\ndisagreement between the two signals as the alarm, and read `unhandledErrors`\nalongside both. **Run vitest from the repo root** — from inside a package it\ndoes not load the root config — and never `--passWithNoTests`. In a kit\nmonorepo a workspace link resolves to a sibling's `src\u002F`, so no sibling needs\nbuilding first; only a test that reads its own `dist` does, and a `globalSetup` build through `AgentPlugin.runScript` is\nnot a guarantee against it: the script is skipped while its done-marker is\nyounger than `VITEST_AGENT_RUNSCRIPT_BUILT_RECENTLY_MS` (30 s by default),\nso pin that to `1` in the setup or a run inside the window reads the\nprevious build. The `ERR_LOAD_URL` setup-file case and the rest →\n**[references\u002Frunning-the-suite.md](.\u002Freferences\u002Frunning-the-suite.md)**.\n\n## Test the sync facade over the same fixture as the Effect form\n\nWhen an external consumer calls a synchronous facade (a `*Sync` function, or a\n`parseResult`\u002F`Result` form beside an `Effect` one), the facade is a separate\ncode path and a green Effect-form suite proves nothing about it. Run the facade\nover the **same fixture** the Effect form reads and assert the same answer. The\nfacade can fail where the service passes: a layout only the Effect suite had a\nfixture for (a yarn repository's `package.json#workspaces`, say) discovers\nmembers through the service while the sync facade the consuming tool calls\nreturns none.\n\n**Piping vitest into `tail` (or `head`, `grep`) hides its exit code.** The pipe\nreports the last command's status, so a failing run looks green. Under zsh or\nbash use `set -o pipefail` before the pipeline (or read `${PIPESTATUS[0]}` \u002F\n`$pipestatus[1]`), or redirect to a file and read the code of the vitest\ncommand itself.\n\n## House conventions\n\n- Tests live in each package's `__test__\u002F` directory (`*.test.ts`), never\n  co-located in `src\u002F`.\n- **A probe writes no file.** A probe left under `__test__\u002F` is collected by\n  the ordinary suite and inflates the `Tests:` count. Run it as a script that\n  never touches disk, from inside the package:\n  `cd packages\u002F\u003Cname> && node --input-type=module -e '\u003Cscript>'` →\n  [references\u002Frunning-the-suite.md](.\u002Freferences\u002Frunning-the-suite.md).\n- Construct domain values via the schema's `X.make`, never `new`.\n- **In this monorepo, assert with `assert.*` from `@effect\u002Fvitest`, never\n  `expect`** — the root `CLAUDE.md` mandates it and every test file here obeys.\n  `toEqual` → `assert.deepStrictEqual`; `toBe` → `assert.strictEqual`;\n  `toBeInstanceOf` → `assert.instanceOf`; `toBe(true)` → `assert.isTrue`;\n  `toHaveLength` → `assert.lengthOf`. **This is house convention, not a\n  technical constraint** — `expect` works unchanged inside `it.effect`, so in a\n  repo whose house style is `expect`, do **not** sweep it. Follow the host repo.\n- Keep the boundary honest: assert that the package's own error escapes\n  (`error._tag === \"JsoncParseError\"`), and that the schema path surfaces a\n  `SchemaError` — the two must not drift.\n- **A test that cannot fail is worse than no test.** Two cases beyond the walker\n  eight: a prototype-pollution guard whose payload could never mutate the\n  asserted object, and a `@ts-expect-error` in a tsconfig-excluded file.\n","# Effect v4 testing with `@effect\u002Fvitest`\n\n`@effect\u002Fvitest` re-exports Vitest, so it is the single entrypoint for test\nAPIs — with one exception (`vi.mock`, below). Effect programs run through\n`it.effect`, never through a bare `it()` that calls `Effect.runSync`\u002F\n`runPromise`. Our house test files (`packages\u002Fjsonc\u002F__test__\u002FJsonc.test.ts`,\n`packages\u002Fyaml\u002F__test__\u002FYaml.test.ts`) are the canonical shapes. (The\n`effect\u002Ftesting\u002F*` modules — TestClock, TestConsole, TestSchema — and the\nproperty engine `Arbitrary` are indexed in\n`effect-v4-module-index`; this skill owns how to use them. There is no\n`FastCheck` module.)\n\n**Migrating a plain-Vitest Effect repo? Adopt `@effect\u002Fvitest`.** A repo whose\ntests are plain Vitest is not \"nothing to migrate on the testing axis\": add\n`@effect\u002Fvitest` and route Effect-returning tests through `it.effect`. The\nconversion has its own traps →\n**[references\u002Fmigrating-a-repo.md](.\u002Freferences\u002Fmigrating-a-repo.md)**.\n\n**Testing a specific front end or a repo-shape check routes elsewhere first.**\nThis skill owns the general `@effect\u002Fvitest` mechanics; a front end's own\ntesting subpath owns the rest: testing a CLI bin → `effect-v4-cli` (`CliTest`); an Ink screen, a wizard or a live view → `effect-v4-cli` (`CliUiTest`: its `session` transcript, and its snapshot serializer registered through Vitest's `snapshotSerializers` config, snapshots being the one place a test needs `expect`);\ntesting an MCP server → `effect-v4-mcp` (`McpHarness`, `McpProbe`); a\nmonorepo's own repo-shape checks (layering, source boundaries, packed\ninstalls) → `@effected\u002Fworkspaces\u002Ftesting` (see `effected-packages`).\n\n**Install it from the same catalog as `effect`, so it resolves to the same version** — never bare and never from a dist-tag. Effect releases `effect` and every `@effect\u002F*` package together at one shared version, so `@effect\u002Fvitest` must resolve to exactly the version `effect` does. A dist-tag (`latest`, `beta`, `rc`, `snapshot`) is a moving pointer that can resolve to a version other than the one `effect` resolves to.\n\nThe failure of a mismatch names neither package: a v3 `@effect\u002Fvitest` installed beside v4 `effect` loads with only a one-line `Issues with peer dependencies found` warning; `pnpm peers check` then lists unmet `effect ^3` and `vitest ^3` peers, and the test file fails to load with `Cannot find module '…\u002Feffect\u002Fdist\u002FArbitrary.js'`, because the v3 package imports a module the v4 `effect` does not ship. It reads as a broken install rather than a version mismatch. Run `pnpm peers check` and compare `@effect\u002Fvitest`'s resolved version with `effect`'s in the lockfile before believing any resolution. With `@effected\u002Fpnpm-plugin-effected` the dependency comes from `catalog:effected`, which carries both at the same range.\n\n**`vi.mock` is the one import that must NOT come from `@effect\u002Fvitest`.** Vitest\nhoists it above all imports, so a `vi` bound through the re-export is not yet\ninitialized and the file dies at load with `Cannot access '__vi_import_1__'\nbefore initialization` — naming neither `vi` nor `@effect\u002Fvitest`. Write\n`import { vi } from \"vitest\"` in any file calling `vi.mock`; `vi.fn` \u002F\n`vi.spyOn` work fine through the re-export (measured across 24 files).\n\n**A spy restored in `try`\u002F`finally` inside `Effect.gen` LEAKS.** A failing\nassertion leaves through the *error channel*, so the `finally` does not run the\nway the shape suggests, and a `vi.spyOn` on a process global that outlives its\ntest poisons its neighbours — false reds first, false greens later. Acquire and\nrelease spies with `Effect.acquireUseRelease` instead →\n[references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md).\n\n**A repo without `@effect\u002Fvitest` can still test Effect code**: a plain Vitest\n`it` calling a small `Effect.runPromise` helper. What it loses is what\n`it.effect` installs: a per-test `Scope` and the virtual `TestClock` and\n`TestConsole` (`Effect.scoped` and `TestClock.layer()` add the scope and the clock back\nby hand), plus `layer(...)` sharing and `it.effect.prop`. The skill's `it.effect`\nexamples assume the package is installed.\n\n## The default runner: `it.effect` + `Effect.gen`\n\n```ts\nimport { assert, describe, it } from \"@effect\u002Fvitest\";\nimport { Jsonc } from \"@effected\u002Fjsonc\";\nimport { Effect } from \"effect\";\n\ndescribe(\"Jsonc\", () => {\n  it.effect(\"parses objects, arrays and scalars\", () =>\n    Effect.gen(function* () {\n      const value = yield* Jsonc.parse('{ \"a\": 1 }');\n      assert.deepStrictEqual(value, { a: 1 });\n    }),\n  );\n});\n```\n\n- **`it.effect` runs the returned Effect** and provides the default test\n  environment — `TestEnv = Layer.mergeAll(TestConsole.layer, TestClock.layer())`\n  (`packages\u002Fvitest\u002Fsrc\u002Finternal\u002Finternal.ts:68`), piped through\n  `flow(Effect.scoped, Effect.provide(TestEnv))` (`internal.ts:490`). Its type is\n  `Tester\u003CR | Scope.Scope>`, so scoped effects (`Effect.acquireRelease`, scoped\n  layers) run **directly** under `it.effect`.\n- **There is no `it.scoped`** (zero `scoped` matches in\n  `packages\u002Fvitest\u002Fsrc\u002Findex.ts`; the v3→v4 migration guide\n  spells the replacement out — `it.scoped(...)` becomes `it.effect(...)`,\n  `it.scopedLive(...)` becomes `it.live(...)`). The Tester surface is\n  `skip`\u002F`skipIf`\u002F`runIf`\u002F`only`\u002F`each`\u002F`fails`\u002F`prop` — **`it.effect.skipIf`\n  and `it.effect.runIf` exist and are well-typed** (`packages\u002Fvitest\u002Fsrc\u002Findex.ts:82-83`);\n  reach for them instead of hand-rolling a conditional `describe`.\n- **`it.live`** (`Tester\u003CScope.Scope | R>`) opts into the real `Clock` and live\n  runtime services. Use only when a test genuinely needs wall-clock behavior.\n- **`it.effect` takes a Vitest timeout as its third argument** —\n  `it.effect(name, self, timeout?: number | TestOptions)`. Any real-time elapsed\n  assertion above Vitest's 5000ms default is dead code without it (see\n  [references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md)).\n- **Never** `it(\"...\", () => Effect.runPromise(program))`. Plain `it()` is fine\n  only for genuinely non-Effect pure code (`Jsonc.stripComments`, `Yaml.equals`).\n- **The rule is UNCONDITIONAL. \"But the layer is fully synchronous\" is not a\n  carve-out.** The tempting shape is a `describe` block with a local\n  `const validate = (doc) => Effect.runSync(Effect.provide(program, Svc.layer))`\n  helper, justified because the service's implementation happens to be\n  synchronous (a `Layer.succeed` over a sync engine such as ajv). It shipped in\n  `packages\u002Fschemastore\u002F__test__\u002Fschema-validator.test.ts`, alongside four\n  sibling blocks in the same file that use `layer(...)` + `it.effect`\n  correctly. Synchrony is a property of **today's implementation**, never of\n  the **contract**: the member's type is `Effect\u003CA, E>`, which permits async,\n  and nothing in the type system tells you when that changes. The two costs:\n  - Swap one member for an async implementation and every test in the block\n    dies at *runtime* with `AsyncFiberError: An asynchronous Effect was\n    executed with Effect.runSync` — no type error, no warning, and the blast\n    radius is the whole `describe`.\n  - A typed failure escapes `runSync` as a **throw** (in v4 the error instance\n    itself, `_tag` intact — not a wrapper), so it lands in Vitest's generic\n    exception path instead of `Effect.flip` \u002F `Effect.result`, and the test\n    asserts on a stack trace instead of the error channel.\n\n  The correct shape costs one line: `layer(Svc.layer)(\"the shipped engine\",\n  (it) => { it.effect(…, () => Effect.gen(…)) })` — and it gets you\n  `TestClock`\u002F`TestConsole` and layer memoization for free.\n- **Never** `it(\"...\", () => Effect.gen(...))` either — the inverse mistake, and\n  the worse one. Returning an Effect without running it hands Vitest a\n  non-promise it does nothing with: the test reports **green having evaluated\n  zero assertions**. The two shapes are inverses and only the first one looks\n  wrong:\n\n  | shape | runs? | symptom |\n  | --- | --- | --- |\n  | `it(..., () => Effect.runPromise(p))` | yes | correct result, execution laundered |\n  | `it(..., () => p)` | **no** | always green, no assertion ever evaluated |\n\n  The fix in both directions is `it.effect`. This shipped in\n  `@effected\u002Fschemastore` and was caught\n  only in review — and the vacuous test was the one cited as proof to a\n  downstream consumer who had reported the very finding it failed to pin. A\n  false green does not merely miss a regression; it gets used as evidence. The\n  shape is greppable, so it belongs in a structural check (see\n  [references\u002Fstructural-checks.md](.\u002Freferences\u002Fstructural-checks.md)).\n- **Never launder an Effect into a fixture with `Effect.runSync`.** If a test\n  input comes from an Effect (a parse, a decode), the test *is* an `it.effect`\n  and you `yield*` it; if you only need a domain value, build it with `X.make`.\n- **`yield* import(...)` breaks** — it throws `(intermediate value) is not\n  iterable`, naming neither the import nor the yield. A dynamic import inside\n  `Effect.gen` is `yield* Effect.promise(() => import(\".\u002Fthing.js\"))`; a bulk\n  `await` → `yield*` rewrite produces the broken form mechanically.\n\n## Asserting on typed errors\n\nA test for the failure channel must not let the error escape as a defect.\n**`Effect.flip`** — swaps channels so the typed error becomes the success value\n— is our house pattern:\n\n```ts\nimport { assert, it } from \"@effect\u002Fvitest\";\nimport { Jsonc } from \"@effected\u002Fjsonc\";\nimport { Effect } from \"effect\";\n\nit.effect(\"fails with an aggregate JsoncParseError\", () =>\n  Effect.gen(function* () {\n    const error = yield* Effect.flip(Jsonc.parse(\"{ bad }\"));\n    assert.strictEqual(error._tag, \"JsoncParseError\");\n    assert.isAbove(error.errors.length, 0);\n  }),\n);\n```\n\n**`Effect.result`** — never fails; returns a `Result` you narrow with\n`Result.isSuccess`\u002F`isFailure` (the v4 replacement for the removed `Either`).\nReach for it when one program must assert on *both* channels. **`Effect.exit`**\n— the full `Exit` (defects and interrupts included) when you must inspect a\n`Cause`. Signatures (verified): `flip: Effect\u003CA,E,R> => Effect\u003CE,A,R>`,\n`result: … => Effect\u003CResult\u003CA,E>,never,R>`, `exit: … => Effect\u003CExit\u003CA,E>,never,R>`.\n\n**`Effect.flip` is WRONG for a defect.** It swaps only the *typed* channel, so a\ndefect escapes it and the test errors instead of asserting. Defects go through\n`Effect.exit`, **with an explicit throw\u002Ffail on the non-failure branch**:\n\n```ts\nimport { assert, it } from \"@effect\u002Fvitest\";\nimport { Cause, Effect, Exit } from \"effect\";\n\nconst subject = Effect.die(new Error(\"the expected message\"))\n\nit.effect(\"the subject dies with the expected message\", () =>\n  Effect.gen(function* () {\n    const exit = yield* Effect.exit(subject);\n    if (Exit.isFailure(exit)) {\n      assert.include(Cause.pretty(exit.cause), \"the expected message\");\n    } else {\n      assert.fail(\"expected a defect, but the effect succeeded\");\n    }\n  }),\n);\n```\n\n**A narrowing `if` with no `else` asserts nothing on the other path.** A bare\n`if (Exit.isFailure(exit)) { …assert… }` passes silently on success — found six\nseparate times in one package's suite. It is its own anti-pattern, not an\nExit-specific one.\n\n**Genuine defects must NOT be swallowed into the typed channel** — the half a\nflip-based test cannot prove. Assert `Effect.exit`, that the cause holds no\n`Fail` reason (the discriminating line), and that the `Die` defect is the\nORIGINAL error. **Assert helpers are never type predicates** — narrow with a\nreal `if`; and `assert.deepStrictEqual` against literal-typed encodes needs an\nexplicit `\u003Cunknown>` type argument. Worked example and both traps →\n**[references\u002Fasserting-errors.md](.\u002Freferences\u002Fasserting-errors.md)**.\n\n## Providing test \u002F mock layers\n\n`layer(...)` applies to **any service in a test's `R` — owned or consumed**. Its\nsignature takes any `Layer.Layer\u003CR, E>`; nothing requires the package under test\nto declare the service. A package that owns no services but *consumes*\n`Path.Path` or `FileSystem.FileSystem` needs suite-boundary layers most.\n\n```ts\nimport { assert, describe, layer } from \"@effect\u002Fvitest\";\nimport { Context, Effect, Layer } from \"effect\";\n\nclass Foo extends Context.Service\u003CFoo, string>()(\"Foo\") {\n  static readonly layer = Layer.succeed(Foo, \"foo\");\n}\n\ndescribe(\"foo\", () => {\n  layer(Foo.layer)((it) => {\n    it.effect(\"gets foo\", () =>\n      Effect.gen(function* () { assert.strictEqual(yield* Foo, \"foo\"); }));\n  });\n});\n```\n\n### `layer()` memoizes; plain `Effect.provide` does NOT. That asymmetry is the whole decision\n\nThe top-level `layer` builds once per group and keeps the scope open until\n`afterAll`; a per-test `.pipe(Effect.provide(L))` rebuilds per test. Nested\nprovides inside one running effect memoize constituent consts by reference, so\na fault-injected variant can silently fall back to the REAL services already\nbuilt outside.\n\n**Per-test provide is the SAFE default; collapsing a suite onto a\nsuite-boundary `layer()` is the RISKY move.** Build-once means every stateful\nresource is cumulative across the group — `TestClock.adjust`, in-memory\nstores, TTL expiry, `TestConsole.logLines` — so a clock-driving test must NOT\nlive inside a `layer()` block. Pre-flight before collapsing, the nested-layer\nand `excludeTestServices` forms, and why `MethodsNonLive` has no `.live` →\n**[references\u002Fproviding-layers.md](.\u002Freferences\u002Fproviding-layers.md)**; worked\nfailures in [references\u002Fmigrating-a-repo.md](.\u002Freferences\u002Fmigrating-a-repo.md).\nA mock service is a `Context.Service` with a test `Layer`, swapped `Live` →\n`Test` at this boundary, never inside test bodies.\n\n**Testing a boundary-tier package that does real IO needs no platform package.**\n`Path.layer` comes from `effect` core (`Path.ts:931`) and is the POSIX `Path`\nonly (`\u002F` separator, POSIX semantics): provide it in tests, never in code under\n`src\u002F`, where it would give Windows users POSIX paths. The filesystem double\nis `@effected\u002Fmemfs`, a pure package with no `node:*` import — core ships\n**no** `FileSystem.layer`, only the deny-by-default `layerNoop` (`FileSystem.ts:848`),\nwhich is not a double\n([references\u002Fproviding-layers.md](.\u002Freferences\u002Fproviding-layers.md)). So `@effected\u002Fwalker` tests filesystem behavior\nwith zero `@effect\u002Fplatform-node` devDependency:\n\n```ts\nimport { MemoryFileSystem } from \"@effected\u002Fmemfs\";\nimport { assert, layer } from \"@effect\u002Fvitest\";\nimport { Effect, FileSystem, Layer, Path } from \"effect\";\n\nlayer(Path.layer)(\"path ops\", (it) => {\n  it.effect(\"Path is in R, no Effect.provide in the body\", () =>\n    Effect.gen(function* () {\n      const path = yield* Path.Path;\n      assert.strictEqual(path.dirname(\"\u002Fa\u002Fb\"), \"\u002Fa\");\n    }));\n});\n\nconst Volume = Layer.merge(Path.layer, MemoryFileSystem.layerWith({ \"\u002Fa\u002F.rc\": \"\" }));\n\nlayer(Volume)(\"seeded filesystem\", (it) => {\n  it.effect(\"fs.exists consults the volume\", () =>\n    Effect.gen(function* () {\n      const fs = yield* FileSystem.FileSystem;\n      assert.isTrue(yield* fs.exists(\"\u002Fa\u002F.rc\"));\n      assert.isFalse(yield* fs.exists(\"\u002Fa\u002Fother\"));\n    }));\n});\n```\n\n**`layerNoop`'s unstubbed members answer in THREE different ways**\n(`makeNoop` (`FileSystem.ts:712`) splits them) — typed `NotFound`, silent success (`exists` → `false`, `remove` → `Effect.void`), and\n`Effect.die` (`makeDirectory`, `makeTemp*`), which `Effect.catch` cannot\nabsorb. **None of this is a reason to stub `layerNoop` better — it is the\nargument for `@effected\u002Fmemfs`.** This repo's rule: a `FileSystem` double is\n`@effected\u002Fmemfs`, never a `layerNoop` stub and never a hand-rolled `node:fs`\nport stub. The one exception is an **oracle test that runs a third-party\nengine** (the tool your code mirrors, such as `@changesets\u002Fapply-release-plan`\nor a package manager) on the same input as your code: the engine reads\n`node:fs` and real git itself, where no volume can reach it. Copy the fixture\ninto a temporary directory, run both sides there over `@effect\u002Fplatform-node`,\nand keep every other test on memfs. **Every `Effect.provide` of a memfs layer re-seeds a fresh\nvolume**, so assert inside the one provide or provide a pinned\n`handle.layer`. The table, the BOM trap, the seed forms and the\none-`layer(...)`-block-per-fixture shape →\n**[references\u002Fproviding-layers.md](.\u002Freferences\u002Fproviding-layers.md)**;\npicking the memfs form, seeds, faults, case-insensitive volumes and traps →\n**[references\u002Fmemfs.md](.\u002Freferences\u002Fmemfs.md)**.\n\n**A service built on `@effected\u002Fstore` is tested over its REAL implementation, never a hand-written double**: share one implementation effect written against `Store` between `layer(filename)` (production, `Store.layerSqlite`) and a `layerMemory()` FACTORY over `Store.layerTest({ migrations })`, which opens a fresh migrated `:memory:` database per build. A factory, not a const, so two consumers in one composed graph never share a database by reference memoization. Pair it with `@effected\u002Fmemfs` for a fully hermetic pipeline. An application wired through `@effected\u002Fapp` tests over `AppTest.layer(options)` from `@effected\u002Fapp\u002Ftesting` — fixed XDG paths, `:memory:` `Store`\u002F`Cache` and a memfs volume, `R = never`; `@effected\u002Fmemfs` is that subpath's optional peer, so add it as a devDependency.\n\n**Every stub effect goes through `Effect.suspend`.** A recorder that pushes\neagerly logs calls that never executed. Worked probe →\n[references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md).\n\n### Faulting ONE method of a real layer\n\nFor \"behaves like the real service except this one method fails on demand\",\n`layerNoop` is the wrong tool. The house recipe is `Layer.effect` + spread the\nbase + `Layer.provide(base)`, with `Layer.updateService` as the shorter form\nand `Layer.mock` for partial stubs that die loudly. Full scaffold, the source\nanchors and the three ways to get the spread wrong →\n**[references\u002Ffault-injection.md](.\u002Freferences\u002Ffault-injection.md)**.\n\n### The env seam: swap `ConfigProvider`, never `process.env`\n\nCode reading its environment through `Config.*` already has a test seam, and\nit is not in `R`: `ConfigProvider.ConfigProvider` is a `Context.Reference`, so\na test replaces it with `Effect.provide(ConfigProvider.layer(ConfigProvider.fromEnv({ env: record })))`.\nAn empty record is the \"variable unset\" case; the default provider would\nanswer from whatever the developer's shell exports. Never mutate\n`process.env` in `beforeEach`. Worked example →\n**[references\u002Fenv-seam.md](.\u002Freferences\u002Fenv-seam.md)**.\n\n## Property testing with `it.effect.prop` and `it.prop`\n\nFeed a Schema (or class) directly as an arbitrary. The engine is core's native\n**`Arbitrary`**, not fast-check — there is no `FastCheck` module, and **no\n`fastCheck: { numRuns }` option**: the bag is `arbitrary: { runs, size, … }`.\nThe traps a probe settled, each with its fix in\n**[references\u002Fproperty-testing.md](.\u002Freferences\u002Fproperty-testing.md)**:\n\n- The `size` clamp (default **10**) silently shrinks a domain — pass\n  `size: \u003Ccap>` for long-input properties.\n- A brand whose check is a bare `makeFilter` EXHAUSTS instead of hanging.\n- The generator emits `-0`; round-trip properties over serialized numbers\n  exclude it.\n- A partial dictionary is a Struct of `optionalKey`, not a `Record`.\n- `isPattern` regexes must be lookaround-free, free of `i`\u002F`m`\u002F`v`, and carry\n  `u`; otherwise the pattern is silently dropped.\n- A custom-alphabet string is `Arbitrary.array` over a `Schema.Literals`\n  of characters, mapped through `join(\"\")`; `Arbitrary.array` is under the\n  same `size` clamp.\n- Reading a failure: the agent reporter compacts it to one line; the full\n  shrunk input and replay token are in the `--reporter=json` output file. Pin\n  the counterexample as an ordinary regression test.\n\n## Time-dependent logic: `TestClock`\n\n**`it.effect` ALWAYS installs a virtual `TestClock`. This is not opt-in.**\n\n- **A small REAL delay anywhere under the test — usually in `src` — hangs to\n  the vitest timeout** with no message pointing at the clock. Any\n  `Effect.sleep`, retry schedule, timeout or polling interval needs a driven\n  clock or `it.live`; grep the implementation, not only the test. A test that\n  hangs for exactly five seconds: suspect wall-clock time first.\n- **It starts at the EPOCH**, so clock *reads* return 1970 — set the clock\n  with `TestClock.setTime(...)` whenever the code under test reads time.\n- **Real async I\u002FO interleaved with sleeps desyncs the drain loop** — use\n  `it.live` for exactly those tests, outside the `layer()` block.\n- **Do not manually provide `TestClock.layer()` under `it.effect`**, and never\n  call `TestClock.adjust` under `it.live`.\n- **Stage an interleaving with latches, not sleeps**, and a *leak* test needs\n  **two** latches.\n\nThe grep pattern, the driving example, the clock-free interrupt restructure\nand the source-visible reasoning →\n**[references\u002Ftestclock.md](.\u002Freferences\u002Ftestclock.md)**; the two-latch probe →\n[references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md).\n\n## `it.effect` also intercepts CONSOLE output — including `Effect.log*`\n\n`TestEnv` installs `TestConsole` alongside the clock, so a spy on the real\n`console.log` captures **nothing** — and auditing for `Console.*` call sites\nis insufficient, because Effect's default logger writes through the same ref.\n**A test whose only assertions are negative is the vacuous-pass shape**; a\npositive sibling is the cheap proof the sink is live. Source identity and the\nimmune cases → **[references\u002Ftest-console.md](.\u002Freferences\u002Ftest-console.md)**;\n`TestConsole.logLines` accumulation →\n[references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md).\n\n## A test that cannot fail is worse than no test — mutate the edges\n\nA green suite proves nothing about the properties no test can observe. The\ndiscipline: **capture a baseline** (`git status --porcelain > \u002Ftmp\u002Fbaseline`),\nbreak the implementation in the way the property forbids (with the editor —\nnever `git checkout`\u002F`git stash`, other work lives in the tree), watch that\nexact test go red, revert, and confirm the status matches the **baseline**.\n\n- **The assertion must DISCRIMINATE** — fail for the right reason.\n- **The failure to look for is a rule with no input that could falsify it.**\n  Ask of every rule: *what input would make this fire alone, and does it\n  exist?* Mutate **per clause and per path**; **two code paths implementing\n  one rule are two things to pin, not one**.\n- **`as const satisfies ReadonlyArray\u003CUnion>` enforces NOTHING about\n  exhaustiveness** — use a residue-must-be-empty type or a total\n  `Record\u003CUnion, …>`.\n- **One assertion, one rule.** A passing test is evidence about the path it\n  takes, not about the rule it appears to test.\n- **Before acting on \"nothing found\", run a control that FIRES**, with a\n  non-zero expected answer, against a KNOWN-GOOD input.\n- **Read the failure TEXT; never infer a catch from a missing pass line.**\n  Empty output is a failed experiment.\n- **Never verify a change by grepping for the text you just wrote.** Only a\n  mutation finds the emit site.\n- **A semantics-preserving perf fix cannot be pinned** — report it as\n  fixed-but-unpinned.\n- **A surviving mutant is a question about the CODE**; deleting the code is a\n  legitimate answer. When sweeping, assert the on-disk state every run, and\n  settle disagreeing reads against `git show HEAD:\u003Cpath>`.\n\nFull discipline, the checklist, the `satisfies` spellings that do fire and the\nworked failures →\n**[references\u002Fmutation-testing.md](.\u002Freferences\u002Fmutation-testing.md)**.\n\n### Structural checks over source text\n\nAn invariant a type cannot express — \"this module does not reach that\ndependency\", \"the entrypoint exports this by name\" — gets pinned by asserting\nover source text, and those assertions fail silently where ordinary ones shout.\n**Raw source is SAFE for a `notInclude` check (a comment mention is a spurious\nalarm) and DANGEROUS for an `include` one (a comment mention passes).** Strip\ncomments — LINE comments **before** block comments — remove module specifiers,\nmatch on a word boundary, and give the stripper its own discriminating test once\nit is load-bearing → **[references\u002Fstructural-checks.md](.\u002Freferences\u002Fstructural-checks.md)**.\n\n## Other false greens, in one place\n\n`Tests: 0\u002F0 passed` is a FAILED run whose **summary line** says passed (a\nfilter that matched no test file; the separate `ERR_LOAD_URL` a repo suffers\nwhile its config declares a cwd-relative `globalSetup` path is a config defect\nto fix, not a cwd rule to obey); `TestConsole.logLines` accumulation; the eager\n`layerNoop` recorder; `PubSub.takeAll` hanging on an empty subscription; a\ndrain test whose subscriber took every message inside `publish`, so nothing\nwas ever queued; `PubSub.shutdown` dropping the tail it was meant to drain; a\nstream over an ended subscription repeating `PubSub.end`'s sticky final\nmessage forever; a race that only shows below the default\n`Scheduler.MaxOpsBeforeYield` budget; timing\ngates lying under coverage, and a timing guard that cannot catch a loop\nthat never returns (its control runs in a subprocess with a hard timeout);\na green suite that fails the vitest **process**\nbecause a test left `process.exitCode` set; a big green count for a surface the\nsuite never calls; a helper used on **both sides** of every comparison, which\nagrees with itself however broken it is; an `Effect.timeout` guard that never\nfires — under `it.effect` any guard is inert until `TestClock.adjust` passes\nit, and under a real clock a guard of 5 seconds or more loses to vitest's own\ndefault; a forked fiber's failure that is never observed anywhere unless the\nfiber is joined. Each with its probe →\n**[references\u002Ffalse-greens.md](.\u002Freferences\u002Ffalse-greens.md)**.\n\n**Zero collected tests is never a pass — read BOTH the Tests line and the exit\ncode.** A filter that matches no test file prints `Tests: 0\u002F0 passed` and exits\n**1**: the Tests line is the liar and the exit code is honest. Treat any\ndisagreement between the two signals as the alarm, and read `unhandledErrors`\nalongside both. **Run vitest from the repo root** — from inside a package it\ndoes not load the root config — and never `--passWithNoTests`. In a kit\nmonorepo a workspace link resolves to a sibling's `src\u002F`, so no sibling needs\nbuilding first; only a test that reads its own `dist` does, and a `globalSetup` build through `AgentPlugin.runScript` is\nnot a guarantee against it: the script is skipped while its done-marker is\nyounger than `VITEST_AGENT_RUNSCRIPT_BUILT_RECENTLY_MS` (30 s by default),\nso pin that to `1` in the setup or a run inside the window reads the\nprevious build. The `ERR_LOAD_URL` setup-file case and the rest →\n**[references\u002Frunning-the-suite.md](.\u002Freferences\u002Frunning-the-suite.md)**.\n\n## Test the sync facade over the same fixture as the Effect form\n\nWhen an external consumer calls a synchronous facade (a `*Sync` function, or a\n`parseResult`\u002F`Result` form beside an `Effect` one), the facade is a separate\ncode path and a green Effect-form suite proves nothing about it. Run the facade\nover the **same fixture** the Effect form reads and assert the same answer. The\nfacade can fail where the service passes: a layout only the Effect suite had a\nfixture for (a yarn repository's `package.json#workspaces`, say) discovers\nmembers through the service while the sync facade the consuming tool calls\nreturns none.\n\n**Piping vitest into `tail` (or `head`, `grep`) hides its exit code.** The pipe\nreports the last command's status, so a failing run looks green. Under zsh or\nbash use `set -o pipefail` before the pipeline (or read `${PIPESTATUS[0]}` \u002F\n`$pipestatus[1]`), or redirect to a file and read the code of the vitest\ncommand itself.\n\n## House conventions\n\n- Tests live in each package's `__test__\u002F` directory (`*.test.ts`), never\n  co-located in `src\u002F`.\n- **A probe writes no file.** A probe left under `__test__\u002F` is collected by\n  the ordinary suite and inflates the `Tests:` count. Run it as a script that\n  never touches disk, from inside the package:\n  `cd packages\u002F\u003Cname> && node --input-type=module -e '\u003Cscript>'` →\n  [references\u002Frunning-the-suite.md](.\u002Freferences\u002Frunning-the-suite.md).\n- Construct domain values via the schema's `X.make`, never `new`.\n- **In this monorepo, assert with `assert.*` from `@effect\u002Fvitest`, never\n  `expect`** — the root `CLAUDE.md` mandates it and every test file here obeys.\n  `toEqual` → `assert.deepStrictEqual`; `toBe` → `assert.strictEqual`;\n  `toBeInstanceOf` → `assert.instanceOf`; `toBe(true)` → `assert.isTrue`;\n  `toHaveLength` → `assert.lengthOf`. **This is house convention, not a\n  technical constraint** — `expect` works unchanged inside `it.effect`, so in a\n  repo whose house style is `expect`, do **not** sweep it. Follow the host repo.\n- Keep the boundary honest: assert that the package's own error escapes\n  (`error._tag === \"JsoncParseError\"`), and that the schema path surfaces a\n  `SchemaError` — the two must not drift.\n- **A test that cannot fail is worse than no test.** Two cases beyond the walker\n  eight: a prototype-pollution guard whose payload could never mutate the\n  asserted object, and a `@ts-expect-error` in a tsconfig-excluded file.\n",{"name":5,"targets":24,"description":7,"when_to_use":27},{"copilot":25},{"description":26},"Use when writing, reviewing, or fixing tests for Effect v4 code with @effect\u002Fvitest — it.effect + Effect.gen as the default runner, asserting typed errors via Effect.flip or Effect.result (Exit + Cause for defects), providing test\u002Fmock layers with layer(...) for any service in R (owned or consumed), fault-injecting one method of a real layer, property tests with it.effect.prop over a Schema, TestClock for time-dependent logic, converting a plain-Vitest repo, and the mutate-the-edges discipline for proving a suite can actually fail — the discriminating input wrong in exactly one way, per-clause and per-path mutation, and the positive control a \"nothing found\" result needs before it's believed. Also triggers on: Tests: 0\u002F0 passed lying while the exit code is honest, TestClock at the epoch (1970), layer() memoizing while Effect.provide does not, TestConsole swallowing Effect.log* through ConsoleRef, vi.mock must import vi from vitest, structural checks over source text.","it.scoped removed, Arbitrary size clamp\u002F-0\u002Fexhaustion\u002Fdropped-regex traps, Path.layer + @effected\u002Fmemfs need no platform package, vi.mock must import vi from vitest, layer() memoizing while Effect.provide does not, TestConsole swallowing Effect.log* through ConsoleRef, a small real delay hanging the virtual clock, Tests: 0\u002F0 passed lying while the exit code is honest, a project-filtered run from inside a package not loading the root config, TestClock starting at the epoch (1970), an eagerly-recording layerNoop stub, a narrowing if with no else branch, structural checks over source text (import walkers, export assertions, comment strippers), the two-latch rule for concurrency-leak tests, unhandledErrors and a stray process.exitCode making a green suite lie","main","0b59ef50d270bac16abbb7729cf4326d16de63f9","plugin\u002Fskills\u002Feffect-v4-testing",2,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected","https:\u002F\u002Fgithub.com\u002Fspencerbeggs","2026-11-14 07:03:25",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add spencerbeggs\u002Feffected --skill effect-v4-testing",{"tool":41,"command":42},"bunx","bunx skills add spencerbeggs\u002Feffected --skill effect-v4-testing",{"tool":44,"command":45},"pnpm","pnpm dlx skills add spencerbeggs\u002Feffected --skill effect-v4-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002FSKILL.md",true,[49,55,59,63,67,71,75,79,83,87,91,95,99],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fasserting-errors.md","REFERENCE","参考文档",2273,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Fasserting-errors.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fenv-seam.md",2067,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Fenv-seam.md",{"path":60,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Ffalse-greens.md",46241,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Ffalse-greens.md",{"path":64,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Ffault-injection.md",10063,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Ffault-injection.md",{"path":68,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fmemfs.md",20505,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Fmemfs.md",{"path":72,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fmigrating-a-repo.md",7213,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Fmigrating-a-repo.md",{"path":76,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fmutation-testing.md",17401,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Fmutation-testing.md",{"path":80,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fproperty-testing.md",9491,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Fproperty-testing.md",{"path":84,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fproviding-layers.md",9896,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Fproviding-layers.md",{"path":88,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Frunning-the-suite.md",4639,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Frunning-the-suite.md",{"path":92,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fstructural-checks.md",8597,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Fstructural-checks.md",{"path":96,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Ftest-console.md",1442,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Ftest-console.md",{"path":100,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Ftestclock.md",6698,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Feffect-v4-testing\u002Freferences\u002Ftestclock.md",[104,111,118,125,132,139],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M780NVTD800KMFV869YNZED6","testing-actions","Use when writing or reviewing tests for @effected\u002Fgithub-actions, @effected\u002Fgithub, @effected\u002Fsbom or @effected\u002Fcommands — stubbing the GitHub API, writing a service's layerTest or makeTest double, testing the pre\u002Fmain\u002Fpost lifecycle through Action.run, or debugging why a test hits the real network or hangs.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Ftesting-actions\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M780NPDSGFC0FCP7696NW11J","supply-chain-attestation","Use when generating a CycloneDX SBOM, checking NTIA minimum elements, building an in-toto statement or a SLSA provenance predicate, signing into a Sigstore DSSE bundle, or uploading an attestation to GitHub.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fsupply-chain-attestation\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M780NGP4QNZDH8T8Q8WZ18SA","structuring-an-action","Use when laying out a new GitHub Action repository on the @effected suite, deciding where a piece of code belongs (an entry point, a step, a shared service, a shim), or reviewing an existing action's file structure against the canonical shape.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fstructuring-an-action\u002FSKILL.md",[],[],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":19},"01M780NCD52H1Y03FS83WJ8BT5","running-commands-and-tools","Use when running a subprocess in Effect v4, spawning a command, capturing stdout\u002Fstderr\u002Fexit code, checking whether a CLI tool is installed or which copy to run, running a package-manager script through the project's launcher, detaching a background process, or redacting a secret from argv or captured output.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Frunning-commands-and-tools\u002FSKILL.md",[],[],{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":19},"01M780N823DWNRMSY5X2NT5MSR","release-and-publish","Use when publishing a package to npm, reading the npm registry from Effect v4, checking whether a version is already published, cutting a release tag or GitHub release from an action, applying a release-age gate, or deriving tracking tags for GitHub Actions distribution.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Frelease-and-publish\u002FSKILL.md",[],[],{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":19},"01M780MXRF6H20KCESTSSFB3HQ","hardening-a-parser-port","Use when porting or writing a recursive-descent parser, lexer, or tree-walker over untrusted text in the @effected monorepo — the class of hardening the cloud reviewer scans for on every migration. Covers stack-overflow depth guards (on EVERY recursion surface, which a facade has N of — not two), numeric bound guards that must reject NaN and non-integers, code-point range checks scoped to formats with wide escapes, prototype-pollution, control-character rejection, and the invariant that malformed input must fail through the typed error channel, never as an unhandled defect.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fhardening-a-parser-port\u002FSKILL.md",[],[]]