[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M754AENRFDTJBYM67JKFMXER":3,"skill-same:01M754AENRFDTJBYM67JKFMXER":56},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M754AENRFDTJBYM67JKFMXER","nostics",null,"Structured diagnostic code library for JavaScript\u002FTypeScript. Turns errors and other conditions into typed, machine-readable `Diagnostic` instances with stable codes, docs URLs, and actionable fields. Use this skill whenever the project imports `nostics`, or works with `defineDiagnostics`\u002F`defineProdDiagnostics`, the `Diagnostic` class, diagnostic code registries, or structured error handling. Also covers reporters (`createConsoleReporter`, `createFetchReporter` from nostics\u002Freporters\u002Ffetch, `createFileReporter` from nostics\u002Freporters\u002Fnode, `createDevReporter` from nostics\u002Freporters\u002Fdev), formatters (`formatDiagnostic`, `ansiFormatter`, `jsonFormatter`), and Vite plugins (`nosticsStrip` from @nostics\u002Funplugin\u002Fstrip-transform, `nosticsCollector` from @nostics\u002Funplugin\u002Fdev-server-collector). Also use when migrating a library's existing `console.warn`\u002F`console.error`\u002F`warn()` helpers or thrown `Error`s to diagnostics: follow `references\u002Fmigration.md`.","jd-solanki\u002Fenvolix","jd-solanki","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47495003?v=4","01M7548DX06078PZNSC2VBP69E","JD Solanki","01M7548DXPN10KP53906AB0GX7",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fenvolix\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fnostics\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: nostics\ndescription: \"Structured diagnostic code library for JavaScript\u002FTypeScript. Turns errors and other conditions into typed, machine-readable `Diagnostic` instances with stable codes, docs URLs, and actionable fields. Use this skill whenever the project imports `nostics`, or works with `defineDiagnostics`\u002F`defineProdDiagnostics`, the `Diagnostic` class, diagnostic code registries, or structured error handling. Also covers reporters (`createConsoleReporter`, `createFetchReporter` from nostics\u002Freporters\u002Ffetch, `createFileReporter` from nostics\u002Freporters\u002Fnode, `createDevReporter` from nostics\u002Freporters\u002Fdev), formatters (`formatDiagnostic`, `ansiFormatter`, `jsonFormatter`), and Vite plugins (`nosticsStrip` from @nostics\u002Funplugin\u002Fstrip-transform, `nosticsCollector` from @nostics\u002Funplugin\u002Fdev-server-collector). Also use when migrating a library's existing `console.warn`\u002F`console.error`\u002F`warn()` helpers or thrown `Error`s to diagnostics: follow `references\u002Fmigration.md`.\"\nlicense: MIT\n---\n\n# nostics\n\nEvery error condition becomes a typed `Diagnostic` (extends `Error`) with a stable code, docs URL, and actionable `fix`. Serializable via `toJSON()`.\n\n`Diagnostic`: `name` (the code), `message`\u002F`why` (interpolated text), `fix?`, `docs?`, `sources?` (`'file:line:column'`), `cause?`, `toJSON()`. Throw it, catch it with `instanceof Diagnostic`, send `toJSON()` across process boundaries.\n\n## defineDiagnostics\n\nReturns one callable handle per code. Calling a handle builds a fresh `Diagnostic`, fires every reporter in order, and returns it. `throw` the return value to raise (reporters still run, so a thrown diagnostic also reports).\n\n```ts\nimport { createConsoleReporter, defineDiagnostics } from 'nostics'\n\nconst diagnostics = \u002F*#__PURE__*\u002F defineDiagnostics({\n  docsBase: (code) => `https:\u002F\u002Fnuxt.com\u002Fe\u002F${code.replace('NUXT_', '').toLowerCase()}`,\n  reporters: [\u002F*#__PURE__*\u002F createConsoleReporter()],\n  codes: {\n    NUXT_B1001: {\n      why: 'Could not compile template.',\n      fix: 'Check the template for syntax errors.',\n    },\n    NUXT_B2011: {\n      why: (p: { src: string }) => `Invalid plugin \"${p.src}\". src option is required.`,\n      fix: 'Pass a string path or an object with a `src` to `addPlugin()`.',\n    },\n    NUXT_W9001: { why: 'message', docs: false }, \u002F\u002F per-code: string overrides docsBase, false opts out\n  },\n})\n```\n\n- **`docsBase`** `string | (code) => string | undefined`: string appends `\u002F${code.toLowerCase()}`; function returns the full URL (or `undefined` to omit).\n- **`codes`**: each definition needs `why` (`string | (params) => string`, the only required field, becomes `Error.message`); optional `fix` (`string | (params) => string`) and `docs` (`string | false`).\n- **`reporters`**: fired on every call; optional. Their `options` types are intersected; required reporter options become required at the call site. Omit it (or pass `[]`) for a catalog whose codes are only ever `throw`n: the thrown `Diagnostic` already carries the message, so a console reporter would print it once and surface it again from the uncaught error, a visible duplicate. Keep report-only warnings and fatal throws in separate catalogs when one needs a reporter and the other does not.\n- **Param inference**: params from `why` and `fix` are intersected and required at the call site. If `why` needs `{ src }` and `fix` needs `{ date }`, the call requires `{ src, date }`.\n\n## Call sites\n\n```ts\ndiagnostics.NUXT_B1001() \u002F\u002F no params: report only\ndiagnostics.NUXT_B2011({ src: '\u002Fplugins\u002Fbad.ts' }) \u002F\u002F params first\ndiagnostics.NUXT_B2011({\n  src,\n  cause: originalError,\n  sources: ['nuxt.config.ts:42:3'],\n}) \u002F\u002F runtime fields merge in\ndiagnostics.NUXT_B2011({ src }, { method: 'error' }) \u002F\u002F reporter options second\nthrow diagnostics.NUXT_B2011({ src }) \u002F\u002F raise\n```\n\n`cause`\u002F`sources` go in the params object; `sources` matters most for build\u002Fconfig diagnostics where the JS stack points inside the library. Catch with `if (err instanceof Diagnostic)` then read `.name`, `.message`, `.fix`, `.docs`.\n\n## Reporters\n\n`(diagnostic: Diagnostic, options?: Opts) => void`. Declaring a required `options` type makes the second call-site argument required and typed.\n\n| Reporter                          | Import                    | Description                                                                                                                                                                            |\n| --------------------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `createConsoleReporter(options?)` | `nostics`                 | `console[method](formatter(d))`. `method` defaults `'warn'` (`'log'\\|'warn'\\|'error'`), `formatter` defaults `formatDiagnostic`; both via options, `method` also overridable per call. |\n| `createFetchReporter(url)`        | `nostics\u002Freporters\u002Ffetch` | POSTs diagnostic JSON to the URL; failures swallowed.                                                                                                                                  |\n| `createFileReporter(options?)`    | `nostics\u002Freporters\u002Fnode`  | Appends NDJSON to a local file (default `.nostics.log`).                                                                                                                               |\n| `createDevReporter()`             | `nostics\u002Freporters\u002Fdev`   | Sends `toJSON()` to the Vite dev server via `import.meta.hot.send()`.                                                                                                                  |\n\n```ts\nimport type { DiagnosticReporter } from 'nostics'\nconst sentryReporter: DiagnosticReporter = (d) =>\n  sentry.captureMessage(d.message, { tags: { code: d.name } })\nconst audited: DiagnosticReporter\u003C{ priority: number }> = (d, o) =>\n  audit.log({ name: d.name, priority: o.priority })\n\u002F\u002F → audited makes diagnostics.X({...}, { priority: 1 }) required and type-checked.\n```\n\n## Formatters\n\n| Formatter               | Import                    | Description                                                                                                |\n| ----------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------- |\n| `formatDiagnostic`      | `nostics`                 | Plain unicode-decorated string (built-in reporters use it).                                                |\n| `ansiFormatter(colors)` | `nostics\u002Fformatters\u002Fansi` | Colorized; accepts a `Colors` interface (`red`\u002F`yellow`\u002F`cyan`\u002F`gray`\u002F`bold`\u002F`dim`, each `(s) => string`). |\n| `jsonFormatter`         | `nostics\u002Fformatters\u002Fjson` | `JSON.stringify(diagnostic)` via `toJSON()`.                                                               |\n\n`formatDiagnostic` output, detail order fixed `fix` → `sources` → `see`, missing fields omitted:\n\n```\n[NUXT_B2011] Invalid plugin `\u002Fplugins\u002Fbad.ts`. src option is required.\n├▶ fix: Pass a string path or an object with a `src` to `addPlugin()`.\n├▶ sources: nuxt.config.ts:42:3\n╰▶ see: https:\u002F\u002Fnuxt.com\u002Fe\u002Fb2011\n```\n\n## Vite plugins (`@nostics\u002Funplugin`, dev dependency)\n\n`@nostics\u002Funplugin\u002Fstrip-transform` (library authors, build optimization) and `@nostics\u002Funplugin\u002Fdev-server-collector` (app developers, dev-time collection). Both unplugin-based: `.vite()`, `.webpack()`, `.rollup()`, etc.\n\n- **`nosticsStrip`** marks `defineDiagnostics()` `\u002F*#__PURE__*\u002F` and wraps bare diagnostic expression statements with a `NODE_ENV` guard so they tree-shake out of production. Option `packageName?` (default `'nostics'`). Throws\u002Freturns\u002Fassignments stay (they are behavior). For tracking: relative imports, export the catalog directly, no factory wrappers or deep barrels.\n  - The plugin is optional. The same production output happens with no build transform if the catalog is annotated by hand: put `\u002F*#__PURE__*\u002F` before `defineDiagnostics(` and before each reporter factory call inside it (as in every example here), and dev-guard each report-only call site (`process.env.NODE_ENV !== 'production' && diagnostics.CODE(p)`). Always write the annotations in source; reach for the plugin when report-only call sites are unguarded and you want stripping without touching them.\n- **`nosticsCollector`** listens for `createDevReporter()` diagnostics over the Vite WebSocket and writes them as NDJSON via `createFileReporter`. Vite-only. Options `logFile?` (default `.nostics.log`), `debug?` (default `!!process.env.DEBUG`).\n\n```ts\n\u002F\u002F vite.config.ts\nimport { nosticsStrip } from '@nostics\u002Funplugin\u002Fstrip-transform'\nimport { nosticsCollector } from '@nostics\u002Funplugin\u002Fdev-server-collector'\nexport default defineConfig({\n  plugins: [nosticsStrip.vite(), nosticsCollector.vite()],\n})\n\n\u002F\u002F src\u002Fdiagnostics.ts — pair the collector with createDevReporter()\nimport { createConsoleReporter, defineDiagnostics } from 'nostics'\nimport { createDevReporter } from 'nostics\u002Freporters\u002Fdev'\nexport const diagnostics = \u002F*#__PURE__*\u002F defineDiagnostics({\n  reporters: [\u002F*#__PURE__*\u002F createConsoleReporter(), \u002F*#__PURE__*\u002F createDevReporter()],\n  codes: {\n    \u002F* ... *\u002F\n  },\n})\n```\n\n## Production builds\n\n- **Report-only** diagnostics (bare `diagnostics.X()`) should disappear: `nosticsStrip` or hand annotations drop them, then the unused catalog tree-shakes.\n- **Surviving** diagnostics (`throw`\u002F`return`\u002Fassigned\u002Fargument) stay, and each keeps the _whole_ catalog reachable, so every `why`\u002F`fix` ships. Not every library throws in production: if yours only reports, stripping is enough, stop here.\n\nWhen a library _does_ `throw` in production, pick `defineProdDiagnostics` at definition time with a `NODE_ENV` ternary, so a consumer bundler drops the dev branch (all catalog text):\n\n```ts\nimport { defineDiagnostics, defineProdDiagnostics } from 'nostics'\nexport const diagnostics =\n  process.env.NODE_ENV === 'production'\n    ? \u002F*#__PURE__*\u002F defineProdDiagnostics({ docsBase })\n    : \u002F*#__PURE__*\u002F defineDiagnostics({\n        docsBase,\n        reporters: [\n          \u002F* ... *\u002F\n        ],\n        codes: {\n          \u002F* text *\u002F\n        },\n      })\n```\n\nThe accessed code becomes the `message`, `docs` still derives from `docsBase`, no `why`\u002F`fix` text ships. No `reporters` by default (so a surviving `throw` doesn't also log and then resurface as the uncaught error); pass `reporters` to keep prod telemetry. `nosticsStrip` tracks this ternary like a direct catalog export.\n\n## Conventions\n\n- **Codes** are stable, fully-qualified `PREFIX_XNNNN` (`B` build, `R` runtime, `C` config, `D` deprecation). Never reuse or reassign a published code.\n- Always provide `why`; provide `fix` whenever the solution is known (the most actionable field for humans and agents). Use parameterized templates for runtime values, not string concatenation outside the factory.\n- **`why` is the diagnosis, `fix` is the remedy — split them, don't overlap them.** `why` states only what is wrong; `fix` states only what to do. The reporter prints both, so any wording that appears in both is dead weight. When a single source sentence carries both (`\"A hash must start with '#'. Prefix it with '#'.\"`), cut it in two — diagnosis to `why`, remedy to `fix` — rather than pasting the whole thing into `why` and echoing it in `fix`. `fix` accepts a param function too (`(p) => ...`), so move value-bearing remedies (`use \"#${p.hash}\"`) into it instead of leaving them in `why`.\n- Pass `cause` when re-raising; pass `sources` when the JS stack doesn't reflect the user's source.\n- Split large catalogs by domain (`diagnostics\u002Fbuild.ts`, `runtime.ts`, `config.ts`, re-exported from `index.ts`), each `defineDiagnostics()` sharing `docsBase` with its own code range.\n\n## References\n\n- **Migrating an existing library** to nostics (replacing `console.warn`\u002F`console.error`\u002F`warn()`\u002Fthrown `Error`s with diagnostic codes, without changing runtime behavior): follow `references\u002Fmigration.md` start to finish.\n- Building the error-code documentation site (page template, deployment, agent optimization): `references\u002Fdocumentation-site.md`.\n","# nostics\n\nEvery error condition becomes a typed `Diagnostic` (extends `Error`) with a stable code, docs URL, and actionable `fix`. Serializable via `toJSON()`.\n\n`Diagnostic`: `name` (the code), `message`\u002F`why` (interpolated text), `fix?`, `docs?`, `sources?` (`'file:line:column'`), `cause?`, `toJSON()`. Throw it, catch it with `instanceof Diagnostic`, send `toJSON()` across process boundaries.\n\n## defineDiagnostics\n\nReturns one callable handle per code. Calling a handle builds a fresh `Diagnostic`, fires every reporter in order, and returns it. `throw` the return value to raise (reporters still run, so a thrown diagnostic also reports).\n\n```ts\nimport { createConsoleReporter, defineDiagnostics } from 'nostics'\n\nconst diagnostics = \u002F*#__PURE__*\u002F defineDiagnostics({\n  docsBase: (code) => `https:\u002F\u002Fnuxt.com\u002Fe\u002F${code.replace('NUXT_', '').toLowerCase()}`,\n  reporters: [\u002F*#__PURE__*\u002F createConsoleReporter()],\n  codes: {\n    NUXT_B1001: {\n      why: 'Could not compile template.',\n      fix: 'Check the template for syntax errors.',\n    },\n    NUXT_B2011: {\n      why: (p: { src: string }) => `Invalid plugin \"${p.src}\". src option is required.`,\n      fix: 'Pass a string path or an object with a `src` to `addPlugin()`.',\n    },\n    NUXT_W9001: { why: 'message', docs: false }, \u002F\u002F per-code: string overrides docsBase, false opts out\n  },\n})\n```\n\n- **`docsBase`** `string | (code) => string | undefined`: string appends `\u002F${code.toLowerCase()}`; function returns the full URL (or `undefined` to omit).\n- **`codes`**: each definition needs `why` (`string | (params) => string`, the only required field, becomes `Error.message`); optional `fix` (`string | (params) => string`) and `docs` (`string | false`).\n- **`reporters`**: fired on every call; optional. Their `options` types are intersected; required reporter options become required at the call site. Omit it (or pass `[]`) for a catalog whose codes are only ever `throw`n: the thrown `Diagnostic` already carries the message, so a console reporter would print it once and surface it again from the uncaught error, a visible duplicate. Keep report-only warnings and fatal throws in separate catalogs when one needs a reporter and the other does not.\n- **Param inference**: params from `why` and `fix` are intersected and required at the call site. If `why` needs `{ src }` and `fix` needs `{ date }`, the call requires `{ src, date }`.\n\n## Call sites\n\n```ts\ndiagnostics.NUXT_B1001() \u002F\u002F no params: report only\ndiagnostics.NUXT_B2011({ src: '\u002Fplugins\u002Fbad.ts' }) \u002F\u002F params first\ndiagnostics.NUXT_B2011({\n  src,\n  cause: originalError,\n  sources: ['nuxt.config.ts:42:3'],\n}) \u002F\u002F runtime fields merge in\ndiagnostics.NUXT_B2011({ src }, { method: 'error' }) \u002F\u002F reporter options second\nthrow diagnostics.NUXT_B2011({ src }) \u002F\u002F raise\n```\n\n`cause`\u002F`sources` go in the params object; `sources` matters most for build\u002Fconfig diagnostics where the JS stack points inside the library. Catch with `if (err instanceof Diagnostic)` then read `.name`, `.message`, `.fix`, `.docs`.\n\n## Reporters\n\n`(diagnostic: Diagnostic, options?: Opts) => void`. Declaring a required `options` type makes the second call-site argument required and typed.\n\n| Reporter                          | Import                    | Description                                                                                                                                                                            |\n| --------------------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `createConsoleReporter(options?)` | `nostics`                 | `console[method](formatter(d))`. `method` defaults `'warn'` (`'log'\\|'warn'\\|'error'`), `formatter` defaults `formatDiagnostic`; both via options, `method` also overridable per call. |\n| `createFetchReporter(url)`        | `nostics\u002Freporters\u002Ffetch` | POSTs diagnostic JSON to the URL; failures swallowed.                                                                                                                                  |\n| `createFileReporter(options?)`    | `nostics\u002Freporters\u002Fnode`  | Appends NDJSON to a local file (default `.nostics.log`).                                                                                                                               |\n| `createDevReporter()`             | `nostics\u002Freporters\u002Fdev`   | Sends `toJSON()` to the Vite dev server via `import.meta.hot.send()`.                                                                                                                  |\n\n```ts\nimport type { DiagnosticReporter } from 'nostics'\nconst sentryReporter: DiagnosticReporter = (d) =>\n  sentry.captureMessage(d.message, { tags: { code: d.name } })\nconst audited: DiagnosticReporter\u003C{ priority: number }> = (d, o) =>\n  audit.log({ name: d.name, priority: o.priority })\n\u002F\u002F → audited makes diagnostics.X({...}, { priority: 1 }) required and type-checked.\n```\n\n## Formatters\n\n| Formatter               | Import                    | Description                                                                                                |\n| ----------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------- |\n| `formatDiagnostic`      | `nostics`                 | Plain unicode-decorated string (built-in reporters use it).                                                |\n| `ansiFormatter(colors)` | `nostics\u002Fformatters\u002Fansi` | Colorized; accepts a `Colors` interface (`red`\u002F`yellow`\u002F`cyan`\u002F`gray`\u002F`bold`\u002F`dim`, each `(s) => string`). |\n| `jsonFormatter`         | `nostics\u002Fformatters\u002Fjson` | `JSON.stringify(diagnostic)` via `toJSON()`.                                                               |\n\n`formatDiagnostic` output, detail order fixed `fix` → `sources` → `see`, missing fields omitted:\n\n```\n[NUXT_B2011] Invalid plugin `\u002Fplugins\u002Fbad.ts`. src option is required.\n├▶ fix: Pass a string path or an object with a `src` to `addPlugin()`.\n├▶ sources: nuxt.config.ts:42:3\n╰▶ see: https:\u002F\u002Fnuxt.com\u002Fe\u002Fb2011\n```\n\n## Vite plugins (`@nostics\u002Funplugin`, dev dependency)\n\n`@nostics\u002Funplugin\u002Fstrip-transform` (library authors, build optimization) and `@nostics\u002Funplugin\u002Fdev-server-collector` (app developers, dev-time collection). Both unplugin-based: `.vite()`, `.webpack()`, `.rollup()`, etc.\n\n- **`nosticsStrip`** marks `defineDiagnostics()` `\u002F*#__PURE__*\u002F` and wraps bare diagnostic expression statements with a `NODE_ENV` guard so they tree-shake out of production. Option `packageName?` (default `'nostics'`). Throws\u002Freturns\u002Fassignments stay (they are behavior). For tracking: relative imports, export the catalog directly, no factory wrappers or deep barrels.\n  - The plugin is optional. The same production output happens with no build transform if the catalog is annotated by hand: put `\u002F*#__PURE__*\u002F` before `defineDiagnostics(` and before each reporter factory call inside it (as in every example here), and dev-guard each report-only call site (`process.env.NODE_ENV !== 'production' && diagnostics.CODE(p)`). Always write the annotations in source; reach for the plugin when report-only call sites are unguarded and you want stripping without touching them.\n- **`nosticsCollector`** listens for `createDevReporter()` diagnostics over the Vite WebSocket and writes them as NDJSON via `createFileReporter`. Vite-only. Options `logFile?` (default `.nostics.log`), `debug?` (default `!!process.env.DEBUG`).\n\n```ts\n\u002F\u002F vite.config.ts\nimport { nosticsStrip } from '@nostics\u002Funplugin\u002Fstrip-transform'\nimport { nosticsCollector } from '@nostics\u002Funplugin\u002Fdev-server-collector'\nexport default defineConfig({\n  plugins: [nosticsStrip.vite(), nosticsCollector.vite()],\n})\n\n\u002F\u002F src\u002Fdiagnostics.ts — pair the collector with createDevReporter()\nimport { createConsoleReporter, defineDiagnostics } from 'nostics'\nimport { createDevReporter } from 'nostics\u002Freporters\u002Fdev'\nexport const diagnostics = \u002F*#__PURE__*\u002F defineDiagnostics({\n  reporters: [\u002F*#__PURE__*\u002F createConsoleReporter(), \u002F*#__PURE__*\u002F createDevReporter()],\n  codes: {\n    \u002F* ... *\u002F\n  },\n})\n```\n\n## Production builds\n\n- **Report-only** diagnostics (bare `diagnostics.X()`) should disappear: `nosticsStrip` or hand annotations drop them, then the unused catalog tree-shakes.\n- **Surviving** diagnostics (`throw`\u002F`return`\u002Fassigned\u002Fargument) stay, and each keeps the _whole_ catalog reachable, so every `why`\u002F`fix` ships. Not every library throws in production: if yours only reports, stripping is enough, stop here.\n\nWhen a library _does_ `throw` in production, pick `defineProdDiagnostics` at definition time with a `NODE_ENV` ternary, so a consumer bundler drops the dev branch (all catalog text):\n\n```ts\nimport { defineDiagnostics, defineProdDiagnostics } from 'nostics'\nexport const diagnostics =\n  process.env.NODE_ENV === 'production'\n    ? \u002F*#__PURE__*\u002F defineProdDiagnostics({ docsBase })\n    : \u002F*#__PURE__*\u002F defineDiagnostics({\n        docsBase,\n        reporters: [\n          \u002F* ... *\u002F\n        ],\n        codes: {\n          \u002F* text *\u002F\n        },\n      })\n```\n\nThe accessed code becomes the `message`, `docs` still derives from `docsBase`, no `why`\u002F`fix` text ships. No `reporters` by default (so a surviving `throw` doesn't also log and then resurface as the uncaught error); pass `reporters` to keep prod telemetry. `nosticsStrip` tracks this ternary like a direct catalog export.\n\n## Conventions\n\n- **Codes** are stable, fully-qualified `PREFIX_XNNNN` (`B` build, `R` runtime, `C` config, `D` deprecation). Never reuse or reassign a published code.\n- Always provide `why`; provide `fix` whenever the solution is known (the most actionable field for humans and agents). Use parameterized templates for runtime values, not string concatenation outside the factory.\n- **`why` is the diagnosis, `fix` is the remedy — split them, don't overlap them.** `why` states only what is wrong; `fix` states only what to do. The reporter prints both, so any wording that appears in both is dead weight. When a single source sentence carries both (`\"A hash must start with '#'. Prefix it with '#'.\"`), cut it in two — diagnosis to `why`, remedy to `fix` — rather than pasting the whole thing into `why` and echoing it in `fix`. `fix` accepts a param function too (`(p) => ...`), so move value-bearing remedies (`use \"#${p.hash}\"`) into it instead of leaving them in `why`.\n- Pass `cause` when re-raising; pass `sources` when the JS stack doesn't reflect the user's source.\n- Split large catalogs by domain (`diagnostics\u002Fbuild.ts`, `runtime.ts`, `config.ts`, re-exported from `index.ts`), each `defineDiagnostics()` sharing `docsBase` with its own code range.\n\n## References\n\n- **Migrating an existing library** to nostics (replacing `console.warn`\u002F`console.error`\u002F`warn()`\u002Fthrown `Error`s with diagnostic codes, without changing runtime behavior): follow `references\u002Fmigration.md` start to finish.\n- Building the error-code documentation site (page template, deployment, agent optimization): `references\u002Fdocumentation-site.md`.\n",{"name":5,"license":15,"description":7},"main","47d3b5be89f764ea77ebdbc8f47fc34b3c56a9e0",".ai\u002Fskills\u002Fnostics","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fenvolix","https:\u002F\u002Fgithub.com\u002Fjd-solanki","https:\u002F\u002Fjd-solanki.github.io","VueJS, Python + Automation 😍","2026-08-01 01:32:54",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add jd-solanki\u002Fenvolix --skill nostics",{"tool":38,"command":39},"bunx","bunx skills add jd-solanki\u002Fenvolix --skill nostics",{"tool":41,"command":42},"pnpm","pnpm dlx skills add jd-solanki\u002Fenvolix --skill nostics","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fenvolix\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fnostics\u002FSKILL.md",true,[46,52],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fdocumentation-site.md","REFERENCE","参考文档",2172,"https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fenvolix\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fnostics\u002Freferences\u002Fdocumentation-site.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fmigration.md",10799,"https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fenvolix\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fnostics\u002Freferences\u002Fmigration.md",[57,64,69],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M75495M1H02MGX3BKXA17KYS","clean-code","Write readable, maintainable code through disciplined naming, small functions, and clean error handling. Use when the user mentions \"code review\", \"naming conventions\", \"function too long\", \"code smells\", \"readable code\", \"boy scout rule\", \"single responsibility\", or \"unit test quality\". Also trigger when reviewing pull requests for readability, refactoring messy functions, debating comment styles, or improving error handling patterns. Covers SRP, comment discipline, formatting, and unit testing. For refactoring techniques, see refactoring-patterns. For architecture, see clean-architecture.","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fenvolix\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcoding\u002Fclean-code\u002FSKILL.md",[],[],{"skillNo":65,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7548VQCQ1KN07CSCCZRG3E6","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fenvolix\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fclean-code\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7548FN9FWGYAZA8ZHGNN0WG","add-diagnostic","Add a new diagnostic code following the defineDiagnostics() conventions from nostics","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fenvolix\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fadd-diagnostic\u002FSKILL.md",[],[]]