[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DVWTT7YTXFEVRYP5CJ6EEW":3,"skill-same:01M6DVWTT7YTXFEVRYP5CJ6EEW":82},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M6DVWTT7YTXFEVRYP5CJ6EEW","node-test-conventions",null,"ACTIVATE when writing, reviewing or test-driving a test file that imports 'node:test', or a new test file in a package whose test script runs `node --test`. ACTIVATE for 'node:test', 'node --test', 'node:assert', 'mock.fn', 'mock.method', 'mock.module', 'mock.timers', 'describe\u002Fit from node:test', '--test-isolation', '--test-concurrency', '--test-force-exit', '--test-reporter'. Provides node:test runner idioms and runner mechanics; cross-language testing principles live in craft:testing-principles. DO NOT use for: Vitest or Jest files (see vitest:vitest-test-conventions), PHP\u002FPHPUnit tests (see phpunit:php-test-conventions), TDD iteration workflow (see craft:tdd-workflow-principles).","FabienSalles\u002Fclaude-marketplace","FabienSalles","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F937901?v=4","01M6DVJBD31CJKRB382FQFZ5FH","Fabien Salles","01M6DVJBQNY8Q18KJD1ESAD6TX",9,"MIT","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fnode-test\u002Fskills\u002Fnode-test-conventions\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"node test conventions","test","node","conventions","exit","module","tests","mechanics","iteration","runner","do","activate","testing","files","use","vitest","file","package","workflow","writing","2026-11-10 10:12:30",false,"---\nname: node-test-conventions\ndescription: \"ACTIVATE when writing, reviewing or test-driving a test file that imports 'node:test', or a new test file in a package whose test script runs `node --test`. ACTIVATE for 'node:test', 'node --test', 'node:assert', 'mock.fn', 'mock.method', 'mock.module', 'mock.timers', 'describe\u002Fit from node:test', '--test-isolation', '--test-concurrency', '--test-force-exit', '--test-reporter'. Provides node:test runner idioms and runner mechanics; cross-language testing principles live in craft:testing-principles. DO NOT use for: Vitest or Jest files (see vitest:vitest-test-conventions), PHP\u002FPHPUnit tests (see phpunit:php-test-conventions), TDD iteration workflow (see craft:tdd-workflow-principles).\"\n---\n\n# Test Conventions — node:test\n\n> The **cross-language testing principles** (DAMP, AAA, what NOT to test, factories, structured assertions) are defined in `craft:testing-principles`. This skill keeps the node:test runner idioms.\n\nExamples that run: `references\u002Fexamples.test.ts` (`node --test --experimental-test-module-mocks references\u002Fexamples.test.ts`).\n\n## Which runner guidance applies\n\n- A file that imports `node:test` follows this skill. A file that imports `vitest` or Jest follows its own runner's skill. In a mixed project, an existing test file follows the runner it imports.\n- A new test file follows the runner of the package whose test script will execute it (`node --test` means this skill).\n- Never both runners' guidance on one file, and never migrate a file from one runner to the other unless asked.\n- TypeScript project with no test runner yet: ask which runner before writing the test, proposing node:test as the zero-install option. Claude installs or configures nothing, and leaves `package.json` untouched, until the answer.\n\n## Declaring tests\n\n```typescript\nimport { describe, it, test } from 'node:test';\n\ntest('a standalone test', () => {});\n\ndescribe('Receipt', () => {\n  it('rejects a negative amount', () => {});\n});\n```\n\n### One test per case (counterpart of `it.each`)\n\nnode:test has no `it.each`. Declare one test per case in a loop, the case data in the title:\n\n```typescript\nconst cases = [\n  { input: 1, expected: 2 },\n  { input: 2, expected: 4 },\n];\n\nfor (const { input, expected } of cases) {\n  it(`doubles ${String(input)} into ${String(expected)}`, () => {\n    assert.strictEqual(double(input), expected);\n  });\n}\n```\n\n## Assertions — `node:assert\u002Fstrict`\n\nOne assertion vocabulary per file: under node:test it is `node:assert`, imported as `import assert from 'node:assert\u002Fstrict'`.\n\n| Need | Idiom |\n|---|---|\n| Primitive equality | `assert.strictEqual(actual, expected)` |\n| Structural equality | `assert.deepStrictEqual(actual, expected)` |\n| Narrow a union before reading the payload | `assert.ok(result.tag === 'success')` (an assertion function, TypeScript narrows after it) |\n| Sync exception | `assert.throws(() => fn(), { name: 'RangeError', message: \u002Fnegative\u002F })` |\n| Async exception | `await assert.rejects(fn(), { name: 'RangeError', message: \u002Fnegative\u002F })` |\n\nA throw test always names the error it expects (class or `name`, and message matcher); a bare `assert.throws(fn)` passes on any failure.\n\n## Test doubles — same restriction, same tool\n\n| Tool | Use | Restriction |\n|---|---|---|\n| `mock.fn()` | Spy on a callback or a standalone function | A port is never doubled with `mock.fn`; give it an in-memory stub that is its own spy |\n| `mock.method(obj, 'name')` | Wrap one method of a real object, the rest stays real | Same: never to double a port |\n| `mock.timers` | Control time | Time is injected (a `clock` parameter); use `mock.timers` only for a clock that cannot be injected |\n| `mock.module()` | Replace an imported module | Use `mock.module` only to redirect a singleton that cannot be injected |\n\n`mock.module` needs the flag `--experimental-test-module-mocks` on Node 24 (without it: `TypeError: mock.module is not a function`). Restore mocks with `mock.restoreAll()` or the context `t.mock`, which restores itself at the end of the test.\n\n## Characterization pin\n\nBefore changing behaviour no test pins, freeze the inputs and compare today's output, quirks included, to a committed golden file. The order, the gates and the retirement rules live in `craft:testing-principles` §16.\n\n```typescript\nit('keeps today\\'s summaries, quirk included', () => {\n  const frozen = [summarize('R-1', [10, 2.5, 0]), summarize('R-0', [])];\n  const golden = readFileSync(new URL('.\u002Freceipt-summary.golden.txt', import.meta.url), 'utf8');\n\n  assert.strictEqual(`${frozen.join('\\n')}\\n`, golden);\n});\n```\n\nThe golden file is plain text read with `node:fs`: no snapshot API. The choice is deliberate: with `serializers: [String]`, `t.assert.fileSnapshot` would store the same plain file, but its `--test-update-snapshots` flag rewrites every snapshot the selected tests touch, while a net only ever changes the cases a change names (§16).\n\n## Running the suite\n\n```bash\nnode --test                      # discovers **\u002F*.test.* files\nnode --test --experimental-test-module-mocks   # when a test uses mock.module\n```\n\nTypeScript runs by type stripping (Node 24, no build step): use `.ts` import specifiers and erasable syntax only (no `enum`, no constructor parameter properties).\n\n## Runner mechanics\n\nHow `node --test` runs a file decides what a test may leave behind and what a timeout can stop. The rules these mechanics serve (leave nothing behind, act once, own every file and config a test touches) are `craft:test-suite-design`'s; this section keeps how node:test meets them.\n\n- **What keeps a file alive.** Under the default process isolation each file is one process, which ends only when its event loop is empty: a pending timer or a live child keeps it running after its last test, and the runner waits for it. Clear or `unref()` a deadline timer once its race is decided; `references\u002Fexamples.test.ts` checks it with `process.getActiveResourcesInfo()`. `--test-force-exit` ends the file anyway and hides the leak, orphaned children included.\n- **A test timeout cannot stop synchronous code.** Under `{ timeout: 500 }`, a test blocked 3 s in `spawnSync` is reported as passing. Bound a sync spawn with its own `timeout` option, or spawn asynchronously with `signal: t.signal`. Either kills only the direct child: spawn a forking child asynchronously with `detached: true` and kill its group with `process.kill(-child.pid)`.\n- **A cancelled test keeps running.** `--test-timeout` (no limit by default) reports the test as cancelled, but its pending work runs on into the next test. Keep every helper's own deadline shorter than the runner's timeout.\n- **A file that declares no test passes.** `node --test` reports it as one passing test named after the file, so a pass count above zero does not prove that every file declared a test.\n- **Files run in parallel, tests in a file by default do not.** One process per file, `os.availableParallelism() - 1` files at a time (3 on a 4-vCPU runner), and `--test-concurrency` counts files, not the processes they spawn. Inside a file, tests run one after another unless a `describe('…', { concurrency: N })` lets them overlap: worth it only for independent tests whose spawns are asynchronous and bound to `t.signal`, since `spawnSync` blocks the event loop.\n- **`--test-isolation=none` is not the same suite in one process.** It ignores `--test-concurrency`, runs top-level tests one at a time, and attaches each file's top-level hooks to the shared root: a top-level `beforeEach` runs before the tests of every file. Keep it for pure in-process files, wrap per-file hooks in `describe()`, and leave out any file that changes `process.cwd()`, `process.env` or `process.exit`, or cleans up on the process `exit` event.\n- **One expensive act, several readers.** When one test can carry every assertion, prefer it (`craft:testing-principles` §15 allows several per test). When each facet of one spawned run or one install needs its own test name, run the act once in a `before()` inside a `describe()` and make each test a read-only check of the result: the exception `craft:test-suite-design` §3 makes to the per-test Arrange-Act-Assert of `craft:testing-principles` §4. A test that needs another input builds its own fixture. Cleanup goes in `after()`, which runs even when a test fails.\n- **Hermetic environment for git and spawned programs.** Build one environment and pass it to every git command and every program under test: `GIT_CONFIG_GLOBAL=\u002Fdev\u002Fnull` (Git 2.32+) and `GIT_CONFIG_NOSYSTEM=1`, author and committer from `GIT_AUTHOR_*` and `GIT_COMMITTER_*`, `maintenance.auto=false` (`GIT_CONFIG_COUNT=1`, `GIT_CONFIG_KEY_0=maintenance.auto`, `GIT_CONFIG_VALUE_0=false`, Git 2.31+), `-b main` on every `git init`, and `HOME` in a per-run temp directory. Otherwise the developer's config leaks in (default branch, excludes file, credential helpers), and every commit starts a detached `git maintenance run --auto` (in the background since Git 2.47) that races the fixture's copy or deletion.\n- **Fake executables are written once.** Write each fake binary once per run and link it into each fixture's `PATH` directory: a freshly written executable pays macOS's first-exec scan (`mac:mac-platform`). Remove the link before a test replaces a fake, or the write goes through it into the shared file.\n- **Reporter text is not an API.** Node documents built-in reporter output as subject to change between versions. Read counts, skips and durations from the TestsStream events (`test:summary`, `test:pass`, `test:fail`) through a custom reporter added next to `spec` (a second `--test-reporter`\u002F`--test-reporter-destination` pair), or through `run()`, which runs one file at a time unless given `concurrency`. A regex over `spec` output also misses what it does not name: a test stopped by `--test-timeout` shows `ℹ cancelled 1` with `ℹ fail 0`, so read the exit code first. A check may still match a `spec` summary line (`ℹ pass N`) when it reads the exit code first and the Node version is pinned (an `.nvmrc` that CI reads), so the text cannot change under it without a diff.\n\n## Quick Reference\n\n| Situation | node:test idiom |\n|---|---|\n| Which runner | The one the file imports; a new file follows its package's test script |\n| One test per case | A loop of `it()` with the case data in the title |\n| Assertions | `node:assert\u002Fstrict`; a throw test names the error it expects |\n| Doubles | `mock.fn`\u002F`mock.method` never on a port; `mock.timers` and `mock.module` only for what cannot be injected |\n| Characterization pin | A plain golden file read with `node:fs` |\n| Deadline timer | Cleared or `unref()`ed once the race is decided; never `--test-force-exit` |\n| Synchronous spawn | Its own `timeout` option, or async with `t.signal`; kill the group of a forking child |\n| Test timeout | Longer than every helper's deadline: a cancelled test's work keeps running |\n| File without a test | Counts as a passing test |\n| Parallelism | One process per file, `availableParallelism() - 1` files at once, tests in a file in sequence unless `describe('…', { concurrency: N })` |\n| `--test-isolation=none` | Pure in-process files only, per-file hooks inside `describe()` |\n| Expensive act | One test with several assertions; once in `before()` inside `describe()` when each fact needs its own name |\n| Git and spawned programs | One hermetic environment: no global or system config, `maintenance.auto=false`, `init -b`, temp `HOME` |\n| Fake executables | Written once, linked per fixture, unlinked before a replacement |\n| Counts and durations | Exit code first; counts, skips and durations from TestsStream events |\n","# Test Conventions — node:test\n\n> The **cross-language testing principles** (DAMP, AAA, what NOT to test, factories, structured assertions) are defined in `craft:testing-principles`. This skill keeps the node:test runner idioms.\n\nExamples that run: `references\u002Fexamples.test.ts` (`node --test --experimental-test-module-mocks references\u002Fexamples.test.ts`).\n\n## Which runner guidance applies\n\n- A file that imports `node:test` follows this skill. A file that imports `vitest` or Jest follows its own runner's skill. In a mixed project, an existing test file follows the runner it imports.\n- A new test file follows the runner of the package whose test script will execute it (`node --test` means this skill).\n- Never both runners' guidance on one file, and never migrate a file from one runner to the other unless asked.\n- TypeScript project with no test runner yet: ask which runner before writing the test, proposing node:test as the zero-install option. Claude installs or configures nothing, and leaves `package.json` untouched, until the answer.\n\n## Declaring tests\n\n```typescript\nimport { describe, it, test } from 'node:test';\n\ntest('a standalone test', () => {});\n\ndescribe('Receipt', () => {\n  it('rejects a negative amount', () => {});\n});\n```\n\n### One test per case (counterpart of `it.each`)\n\nnode:test has no `it.each`. Declare one test per case in a loop, the case data in the title:\n\n```typescript\nconst cases = [\n  { input: 1, expected: 2 },\n  { input: 2, expected: 4 },\n];\n\nfor (const { input, expected } of cases) {\n  it(`doubles ${String(input)} into ${String(expected)}`, () => {\n    assert.strictEqual(double(input), expected);\n  });\n}\n```\n\n## Assertions — `node:assert\u002Fstrict`\n\nOne assertion vocabulary per file: under node:test it is `node:assert`, imported as `import assert from 'node:assert\u002Fstrict'`.\n\n| Need | Idiom |\n|---|---|\n| Primitive equality | `assert.strictEqual(actual, expected)` |\n| Structural equality | `assert.deepStrictEqual(actual, expected)` |\n| Narrow a union before reading the payload | `assert.ok(result.tag === 'success')` (an assertion function, TypeScript narrows after it) |\n| Sync exception | `assert.throws(() => fn(), { name: 'RangeError', message: \u002Fnegative\u002F })` |\n| Async exception | `await assert.rejects(fn(), { name: 'RangeError', message: \u002Fnegative\u002F })` |\n\nA throw test always names the error it expects (class or `name`, and message matcher); a bare `assert.throws(fn)` passes on any failure.\n\n## Test doubles — same restriction, same tool\n\n| Tool | Use | Restriction |\n|---|---|---|\n| `mock.fn()` | Spy on a callback or a standalone function | A port is never doubled with `mock.fn`; give it an in-memory stub that is its own spy |\n| `mock.method(obj, 'name')` | Wrap one method of a real object, the rest stays real | Same: never to double a port |\n| `mock.timers` | Control time | Time is injected (a `clock` parameter); use `mock.timers` only for a clock that cannot be injected |\n| `mock.module()` | Replace an imported module | Use `mock.module` only to redirect a singleton that cannot be injected |\n\n`mock.module` needs the flag `--experimental-test-module-mocks` on Node 24 (without it: `TypeError: mock.module is not a function`). Restore mocks with `mock.restoreAll()` or the context `t.mock`, which restores itself at the end of the test.\n\n## Characterization pin\n\nBefore changing behaviour no test pins, freeze the inputs and compare today's output, quirks included, to a committed golden file. The order, the gates and the retirement rules live in `craft:testing-principles` §16.\n\n```typescript\nit('keeps today\\'s summaries, quirk included', () => {\n  const frozen = [summarize('R-1', [10, 2.5, 0]), summarize('R-0', [])];\n  const golden = readFileSync(new URL('.\u002Freceipt-summary.golden.txt', import.meta.url), 'utf8');\n\n  assert.strictEqual(`${frozen.join('\\n')}\\n`, golden);\n});\n```\n\nThe golden file is plain text read with `node:fs`: no snapshot API. The choice is deliberate: with `serializers: [String]`, `t.assert.fileSnapshot` would store the same plain file, but its `--test-update-snapshots` flag rewrites every snapshot the selected tests touch, while a net only ever changes the cases a change names (§16).\n\n## Running the suite\n\n```bash\nnode --test                      # discovers **\u002F*.test.* files\nnode --test --experimental-test-module-mocks   # when a test uses mock.module\n```\n\nTypeScript runs by type stripping (Node 24, no build step): use `.ts` import specifiers and erasable syntax only (no `enum`, no constructor parameter properties).\n\n## Runner mechanics\n\nHow `node --test` runs a file decides what a test may leave behind and what a timeout can stop. The rules these mechanics serve (leave nothing behind, act once, own every file and config a test touches) are `craft:test-suite-design`'s; this section keeps how node:test meets them.\n\n- **What keeps a file alive.** Under the default process isolation each file is one process, which ends only when its event loop is empty: a pending timer or a live child keeps it running after its last test, and the runner waits for it. Clear or `unref()` a deadline timer once its race is decided; `references\u002Fexamples.test.ts` checks it with `process.getActiveResourcesInfo()`. `--test-force-exit` ends the file anyway and hides the leak, orphaned children included.\n- **A test timeout cannot stop synchronous code.** Under `{ timeout: 500 }`, a test blocked 3 s in `spawnSync` is reported as passing. Bound a sync spawn with its own `timeout` option, or spawn asynchronously with `signal: t.signal`. Either kills only the direct child: spawn a forking child asynchronously with `detached: true` and kill its group with `process.kill(-child.pid)`.\n- **A cancelled test keeps running.** `--test-timeout` (no limit by default) reports the test as cancelled, but its pending work runs on into the next test. Keep every helper's own deadline shorter than the runner's timeout.\n- **A file that declares no test passes.** `node --test` reports it as one passing test named after the file, so a pass count above zero does not prove that every file declared a test.\n- **Files run in parallel, tests in a file by default do not.** One process per file, `os.availableParallelism() - 1` files at a time (3 on a 4-vCPU runner), and `--test-concurrency` counts files, not the processes they spawn. Inside a file, tests run one after another unless a `describe('…', { concurrency: N })` lets them overlap: worth it only for independent tests whose spawns are asynchronous and bound to `t.signal`, since `spawnSync` blocks the event loop.\n- **`--test-isolation=none` is not the same suite in one process.** It ignores `--test-concurrency`, runs top-level tests one at a time, and attaches each file's top-level hooks to the shared root: a top-level `beforeEach` runs before the tests of every file. Keep it for pure in-process files, wrap per-file hooks in `describe()`, and leave out any file that changes `process.cwd()`, `process.env` or `process.exit`, or cleans up on the process `exit` event.\n- **One expensive act, several readers.** When one test can carry every assertion, prefer it (`craft:testing-principles` §15 allows several per test). When each facet of one spawned run or one install needs its own test name, run the act once in a `before()` inside a `describe()` and make each test a read-only check of the result: the exception `craft:test-suite-design` §3 makes to the per-test Arrange-Act-Assert of `craft:testing-principles` §4. A test that needs another input builds its own fixture. Cleanup goes in `after()`, which runs even when a test fails.\n- **Hermetic environment for git and spawned programs.** Build one environment and pass it to every git command and every program under test: `GIT_CONFIG_GLOBAL=\u002Fdev\u002Fnull` (Git 2.32+) and `GIT_CONFIG_NOSYSTEM=1`, author and committer from `GIT_AUTHOR_*` and `GIT_COMMITTER_*`, `maintenance.auto=false` (`GIT_CONFIG_COUNT=1`, `GIT_CONFIG_KEY_0=maintenance.auto`, `GIT_CONFIG_VALUE_0=false`, Git 2.31+), `-b main` on every `git init`, and `HOME` in a per-run temp directory. Otherwise the developer's config leaks in (default branch, excludes file, credential helpers), and every commit starts a detached `git maintenance run --auto` (in the background since Git 2.47) that races the fixture's copy or deletion.\n- **Fake executables are written once.** Write each fake binary once per run and link it into each fixture's `PATH` directory: a freshly written executable pays macOS's first-exec scan (`mac:mac-platform`). Remove the link before a test replaces a fake, or the write goes through it into the shared file.\n- **Reporter text is not an API.** Node documents built-in reporter output as subject to change between versions. Read counts, skips and durations from the TestsStream events (`test:summary`, `test:pass`, `test:fail`) through a custom reporter added next to `spec` (a second `--test-reporter`\u002F`--test-reporter-destination` pair), or through `run()`, which runs one file at a time unless given `concurrency`. A regex over `spec` output also misses what it does not name: a test stopped by `--test-timeout` shows `ℹ cancelled 1` with `ℹ fail 0`, so read the exit code first. A check may still match a `spec` summary line (`ℹ pass N`) when it reads the exit code first and the Node version is pinned (an `.nvmrc` that CI reads), so the text cannot change under it without a diff.\n\n## Quick Reference\n\n| Situation | node:test idiom |\n|---|---|\n| Which runner | The one the file imports; a new file follows its package's test script |\n| One test per case | A loop of `it()` with the case data in the title |\n| Assertions | `node:assert\u002Fstrict`; a throw test names the error it expects |\n| Doubles | `mock.fn`\u002F`mock.method` never on a port; `mock.timers` and `mock.module` only for what cannot be injected |\n| Characterization pin | A plain golden file read with `node:fs` |\n| Deadline timer | Cleared or `unref()`ed once the race is decided; never `--test-force-exit` |\n| Synchronous spawn | Its own `timeout` option, or async with `t.signal`; kill the group of a forking child |\n| Test timeout | Longer than every helper's deadline: a cancelled test's work keeps running |\n| File without a test | Counts as a passing test |\n| Parallelism | One process per file, `availableParallelism() - 1` files at once, tests in a file in sequence unless `describe('…', { concurrency: N })` |\n| `--test-isolation=none` | Pure in-process files only, per-file hooks inside `describe()` |\n| Expensive act | One test with several assertions; once in `before()` inside `describe()` when each fact needs its own name |\n| Git and spawned programs | One hermetic environment: no global or system config, `maintenance.auto=false`, `init -b`, temp `HOME` |\n| Fake executables | Written once, linked per fixture, unlinked before a replacement |\n| Counts and durations | Exit code first; counts, skips and durations from TestsStream events |\n",{"name":5,"description":7},"main","479b264ec17cc5fafbf36287a1087472d3a386d3","plugins\u002Fnode-test\u002Fskills\u002Fnode-test-conventions",2,"https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace","https:\u002F\u002Fgithub.com\u002FFabienSalles","https:\u002F\u002Ffabiensalles.com","2026-10-13 04:33:22",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add FabienSalles\u002Fclaude-marketplace --skill node-test-conventions",{"tool":58,"command":59},"bunx","bunx skills add FabienSalles\u002Fclaude-marketplace --skill node-test-conventions",{"tool":61,"command":62},"pnpm","pnpm dlx skills add FabienSalles\u002Fclaude-marketplace --skill node-test-conventions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fnode-test\u002Fskills\u002Fnode-test-conventions\u002FSKILL.md",true,[66,72,78],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"evals\u002Fevals.json","REFERENCE","参考文档",1806,"https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fnode-test\u002Fskills\u002Fnode-test-conventions\u002Fevals\u002Fevals.json",{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fexamples.test.ts","SCRIPT","脚本",5019,"https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fnode-test\u002Fskills\u002Fnode-test-conventions\u002Freferences\u002Fexamples.test.ts",{"path":79,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Freceipt-summary.golden.txt",72,"https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fnode-test\u002Fskills\u002Fnode-test-conventions\u002Freferences\u002Freceipt-summary.golden.txt",[83,97,113,133,155,172],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":39},"01M6DW2YS1MGF65JNS1QQ15QHS","vitest-test-conventions","ACTIVATE when writing Vitest tests, creating test files, using vi.fn()\u002Fvi.mock()\u002Fvi.spyOn(), or test factories. ACTIVATE for 'Vitest', 'it.each', 'NestJS testing module', 'supertest', 'vi.fn', 'vi.mock', 'spyOn'. Provides Vitest\u002FNestJS-specific testing patterns; cross-language testing principles (DAMP, AAA, spy over mock, what NOT to test) live in craft:testing-principles. DO NOT use for: node:test files (a file importing node:test) or a project whose tests run under node --test (see node-test:node-test-conventions), TDD workflow\u002Fiterations (see vitest:vitest-tdd-workflow), PHP\u002FPHPUnit tests (see phpunit:php-test-conventions).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvitest\u002Fskills\u002Fvitest-test-conventions\u002FSKILL.md",[],[20,34,22,90,31,38,91,37,35,92,33,32,93,30,29,94,25,24,95,96],"vitest test conventions","tdd","testing patterns","nestjs","project","fn","testing principles",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":39},"01M6DW2VFE6NPFCGQKQ68P1MVZ","vitest-tdd-workflow","ACTIVATE when building new features, endpoints, or user stories using TDD with Vitest in a TypeScript\u002FNestJS context. ACTIVATE for '\u002Ffeature-tdd-dev', 'TDD', 'red-green-refactor' in TS context. Provides Vitest\u002FNestJS-specific TDD examples and commands; cross-language TDD workflow (cross-layer iterations, RED-GREEN-REFACTOR, working app, bug-fix-first-test, mocks-hiding-bugs) lives in craft:tdd-workflow-principles. DO NOT use for: node:test files (a file importing node:test) or a project whose tests run under node --test (see node-test:node-test-conventions), test writing conventions (see vitest:vitest-test-conventions), PHP TDD (see phpunit:php-tdd-workflow).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvitest\u002Fskills\u002Fvitest-tdd-workflow\u002FSKILL.md",[],[91,37,104,34,105,38,106,35,107,108,33,109,32,30,29,110,94,25,111,112],"tdd workflow","vitest tdd workflow","dev","examples","fix","red-green-refactor","green","feature","app",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":39},"01M6DW2RGMQE10D8C5Z5MA2RMY","ts-refactoring","ACTIVATE when refactoring TypeScript code. ACTIVATE for 'refactor', 'extract', 'redesign', 'simplify', or 'clean up' in a TypeScript \u002F Node \u002F NestJS context. This skill provides TS-specific examples for the cross-language refactoring rules defined in craft:refactoring-principles. DO NOT use for: writing new features from scratch, general OOP patterns (see ts-oop).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Fts-refactoring\u002FSKILL.md",[],[120,121,38,122,123,107,124,125,126,21,127,33,128,129,130,93,131,30,29,132],"refactoring","ts refactoring","typescript","code","refactor","simplify","Rules","redesign","up","general","clean","craft","patterns",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":39},"01M6DW2MHYXNBBVYEGB058Y48J","ts-ports-adapters","ACTIVATE when a TypeScript codebase with no dependency-injection container has to declare a port and wire its adapter — a repository, a clock, an id generator, an event dispatcher the domain depends on. ACTIVATE for 'port', 'adapter', 'SPI', 'dependency inversion' or 'composition root' in a codebase that wires its dependencies by hand. Covers: the port as a type of functions in the domain layer, the adapter as an object literal annotated with it, the handler that takes its dependencies first and its data second, the composition root in the infrastructure layer, and the in-memory stub that substitutes for the adapter in a unit test. DO NOT use for: NestJS, or any container-based DI with decorators and tokens (see nest-ddd-conventions), aggregate operations and smart constructors (see ddd-ts-fp), the Result type itself (see ts-functional).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Fts-ports-adapters\u002FSKILL.md",[],[140,141,142,20,143,144,33,145,146,93,147,30,29,148,149,150,151,152,153,154],"ports","ts ports adapters","memory","ddd","Composition","container","functions","Literal","dependency-injection","domain","tokens","as","type","id","adapter",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":39},"01M6DW2GRXZFYT05HEDB26C9B8","ts-oop","ACTIVATE when designing TypeScript classes, and the value objects or collections modelled as classes, or when the user asks about object design, encapsulation, Tell Don't Ask, or Symbol.iterator. Provides TS-specific examples for the cross-language OOP rules defined in craft:oop-principles, plus TS-specific patterns (Symbol.iterator, branded types for primitive identifiers). DO NOT use for: a value object or an aggregate modelled as an immutable record rather than a class (see ddd-ts-fp), refactoring methodology (see ts-refactoring).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Fts-oop\u002FSKILL.md",[],[162,163,164,122,143,107,165,166,120,126,167,33,168,131,30,29,169,170,171,151],"oop","ts oop","design","methodology","immutable","ask","refactoring methodology","objects","record","collections",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":178,"publishedAt":39},"01M6DW2D26XG5MJMTP9MSE43S2","ts-layer-boundaries","ACTIVATE when wiring a Worker entry point, a Router, a controller, or a domain event consumer in a TypeScript CQRS codebase, or when deciding where a port belongs. ACTIVATE for 'composition root', 'layer boundary', 'ESLint zones', 'domain must not import infrastructure'. Covers: the *Worker.ts composition root, the curried consumer, Router wiring of command endpoints, the five-gesture controller, the domain-to-infrastructure import boundary enforced by ESLint, infrastructure-only ports, in-memory doubles for every port, the read-can-reach-write asymmetry, and read endpoints going through a domain handler. DO NOT use for: the port's own shape and adapter binding (see ts-ports-adapters), the Result type (see ts-functional), domain event structure (see ts-ddd-events).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Fts-layer-boundaries\u002FSKILL.md",[],[179,142,143,180,181,144,140,33,182,183,184,30,29,185,149,186,187,152,154,188],"ts layer boundaries","controller","boundary","router","only","endpoints","structure","cqrs","worker","import"]