[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M754A24GTBMYJ237WQZ9XY8T":3,"skill-same:01M754A24GTBMYJ237WQZ9XY8T":47},{"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":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":46},"01M754A24GTBMYJ237WQZ9XY8T","node-cli",null,"Patterns and conventions for building Node.js CLI tools — src structure, entry point setup, Commander wiring, and update notifications. Use when creating or modifying a Node.js CLI, adding Commander commands, wiring update-notifier, or asking how to structure a CLI entry point or src directory.","jd-solanki\u002Fairig","jd-solanki","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47495003?v=4","01M7548DX06078PZNSC2VBP69E","JD Solanki","01M7548FAW74WC9TD1H7NEKKBC",2,"MIT","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fairig\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fnode-cli\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: node-cli\ndescription: Patterns and conventions for building Node.js CLI tools — src structure, entry point setup, Commander wiring, and update notifications. Use when creating or modifying a Node.js CLI, adding Commander commands, wiring update-notifier, or asking how to structure a CLI entry point or src directory.\ndisable-model-invocation: true\n---\n\n# Node CLI\n\n## src structure\n\n```\nsrc\u002F\n├── index.ts              # Entry point — wires Commander, calls updateNotifier\n├── update-notifier.d.ts  # Type shim for update-notifier package\n├── commands\u002F             # One file per CLI command\n│   ├── add.ts\n│   └── remove.ts\n├── lib\u002F                  # Pure domain logic, no Commander concerns\n│   ├── github.ts         # single-file feature → stays flat\n│   ├── linker.ts\n│   └── push\u002F             # 2+ files → grouped into a feature folder, prefix dropped\n│       ├── index.ts      # barrel: re-exports the feature's public surface\n│       ├── workflow.ts\n│       └── validation.ts\n└── utils\u002F                # Generic helpers — mix flat files and nested groups freely\n    ├── format.ts         # flat single-purpose helper\n    └── fs\u002F               # related helpers grouped under one folder\n        ├── read.ts\n        └── write.ts\ntests\u002F                    # Mirrors src\u002F structure, one test file per module\n├── add.test.ts\n└── linker.test.ts\n```\n\n**conventions:**\n- `commands\u002F` — each file exports a single `Command` instance; all CLI concerns (prompts, flags, output) live here\n- `lib\u002F` — framework-agnostic helpers imported by commands; keep them testable in isolation\n- Directories don't have to be flat. Keep a feature flat by default, and group it into a folder **only once it owns 2+ files** — a folder holding one file is just noise. When you group, the folder already names the feature, so drop the redundant prefix from filenames (`lib\u002Fpush\u002Fworkflow.ts`, not `lib\u002Fpush\u002Fpush-workflow.ts`), and use `dir\u002Findex.ts` as the feature's public surface (a barrel re-exporting what commands import, or, for a provider-style seam, the interface\u002Fcontract itself). Commands import the folder, not its internals: `import { planPush } from '..\u002Flib\u002Fpush\u002Findex.js'`, so each feature's internal file split can change without touching call sites.\n\n## Entry point structure\n\n```ts\n#!\u002Fusr\u002Fbin\u002Fenv node\nimport { Command } from 'commander'\nimport updateNotifier from 'update-notifier'\nimport packageJson from '..\u002Fpackage.json' with { type: 'json' }\n\n\u002F\u002F Call before parseAsync — notify() defers display to process exit so it\n\u002F\u002F never interleaves with command output.\nupdateNotifier({ pkg: packageJson }).notify()\n\nconst program = new Command('your-cli')\n  .description('...')\n  .version(packageJson.version)\n\nprogram.addCommand(fooCommand)\n\nawait program.parseAsync()\n```\n\n## Testing CLI wiring\n\nKeep executable entrypoints and test seams distinct. If `src\u002Findex.ts` calls\n`parseAsync()` at top level, treat it as executable-only: tests should import\ncommand factories from `src\u002Fcommands\u002F*`, assemble a local `Command`, and pass a\ncontrolled argv. Do not import a top-level executable entrypoint in tests,\nbecause it will parse the test runner's `process.argv`.\n\n```ts\n\u002F\u002F src\u002Fcommands\u002Frun.ts\nimport { Command } from 'commander'\n\nexport interface RunDispatch {\n  runBatch(): Promise\u003Cvoid> | void\n}\n\nexport function createRunCommand(dispatch: RunDispatch): Command {\n  return new Command('run').action(async () => {\n    await dispatch.runBatch()\n  })\n}\n```\n\n```ts\n\u002F\u002F tests\u002Fcli.test.ts\nimport { Command } from 'commander'\nimport { describe, expect, test, vi } from 'vitest'\nimport { createRunCommand } from '..\u002Fsrc\u002Fcommands\u002Frun'\n\ntest('dispatches run', async () => {\n  const dispatch = { runBatch: vi.fn() }\n  const program = new Command('your-cli')\n  program.addCommand(createRunCommand(dispatch))\n\n  await program.parseAsync(['node', 'your-cli', 'run'])\n\n  expect(dispatch.runBatch).toHaveBeenCalledOnce()\n})\n```\n\nFor larger CLIs, a second common pattern is a thin bin file that imports a\ntestable `run(argv)` or `execute(argv)` module. Use this when the CLI has\nsubstantial startup behavior, needs integration-style tests around exit codes,\nor also exposes a public library API.\n\n## Update notifier\n\nUse the [`update-notifier`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Fupdate-notifier) package. It handles background checks (24 h interval), state persistence, CI\u002FTTY\u002F`NO_UPDATE_NOTIFIER` opt-outs automatically.\n\n```bash\npnpm add update-notifier\n```\n\n**Where to call it:** top of `index.ts`, before `program.parseAsync()` — not in a `postAction` hook.\n\n**Why before parse:** `notify()` defaults to `defer: true`, registering a `process.on('exit')` listener. Placing it before `parseAsync()` ensures the listener is always registered regardless of which command runs.\n\n**Type shim** (package ships no `.d.ts`):\n\n```ts\n\u002F\u002F src\u002Fupdate-notifier.d.ts\ndeclare module 'update-notifier' {\n  interface Package { name: string; version: string }\n  interface Options { pkg: Package; updateCheckInterval?: number; distTag?: string }\n  interface NotifyOptions { defer?: boolean; message?: string; isGlobal?: boolean }\n  interface Notifier { notify(options?: NotifyOptions): void }\n  export default function updateNotifier(options: Options): Notifier\n}\n```\n\n## Recommended stack\n\n| Concern | Package |\n|---|---|\n| CLI framework | [`commander`](https:\u002F\u002Fgithub.com\u002Ftj\u002Fcommander.js) |\n| Interactive prompts | [`@inquirer\u002Fprompts`](https:\u002F\u002Fgithub.com\u002FSBoudrias\u002FInquirer.js) |\n| Update notifications | [`update-notifier`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Fupdate-notifier) |\n| Language | TypeScript |\n| Test runner | [`vitest`](https:\u002F\u002Fvitest.dev) |\n| Version bumping | [`bumpp`](https:\u002F\u002Fgithub.com\u002Fantfu\u002Fbumpp) — bumps `package.json`, commits, tags, and pushes in one step |\n| Bundler | [`tsdown`](https:\u002F\u002Fgithub.com\u002Frolldown\u002Ftsdown) |\n| Diagnostics (structured errors\u002Fwarnings) | [`nostics`](https:\u002F\u002Fnostics.dev\u002F) — define a catalog of diagnostic codes with stable names, messages, fixes, and docs URLs |\n\n## package.json essentials\n\n```json\n{\n  \"type\": \"module\",\n  \"bin\": { \"your-cli\": \".\u002Fdist\u002Findex.js\" },\n  \"engines\": { \"node\": \"^24.0.0\" }\n}\n```\n\n## GitHub Workflow\n\nFor a complete end-to-end workflow combining npm publish + changelog generation, see `automate-npm-release\u002FEXAMPLE_WORKFLOW.yml` if that skill is installed locally.","# Node CLI\n\n## src structure\n\n```\nsrc\u002F\n├── index.ts              # Entry point — wires Commander, calls updateNotifier\n├── update-notifier.d.ts  # Type shim for update-notifier package\n├── commands\u002F             # One file per CLI command\n│   ├── add.ts\n│   └── remove.ts\n├── lib\u002F                  # Pure domain logic, no Commander concerns\n│   ├── github.ts         # single-file feature → stays flat\n│   ├── linker.ts\n│   └── push\u002F             # 2+ files → grouped into a feature folder, prefix dropped\n│       ├── index.ts      # barrel: re-exports the feature's public surface\n│       ├── workflow.ts\n│       └── validation.ts\n└── utils\u002F                # Generic helpers — mix flat files and nested groups freely\n    ├── format.ts         # flat single-purpose helper\n    └── fs\u002F               # related helpers grouped under one folder\n        ├── read.ts\n        └── write.ts\ntests\u002F                    # Mirrors src\u002F structure, one test file per module\n├── add.test.ts\n└── linker.test.ts\n```\n\n**conventions:**\n- `commands\u002F` — each file exports a single `Command` instance; all CLI concerns (prompts, flags, output) live here\n- `lib\u002F` — framework-agnostic helpers imported by commands; keep them testable in isolation\n- Directories don't have to be flat. Keep a feature flat by default, and group it into a folder **only once it owns 2+ files** — a folder holding one file is just noise. When you group, the folder already names the feature, so drop the redundant prefix from filenames (`lib\u002Fpush\u002Fworkflow.ts`, not `lib\u002Fpush\u002Fpush-workflow.ts`), and use `dir\u002Findex.ts` as the feature's public surface (a barrel re-exporting what commands import, or, for a provider-style seam, the interface\u002Fcontract itself). Commands import the folder, not its internals: `import { planPush } from '..\u002Flib\u002Fpush\u002Findex.js'`, so each feature's internal file split can change without touching call sites.\n\n## Entry point structure\n\n```ts\n#!\u002Fusr\u002Fbin\u002Fenv node\nimport { Command } from 'commander'\nimport updateNotifier from 'update-notifier'\nimport packageJson from '..\u002Fpackage.json' with { type: 'json' }\n\n\u002F\u002F Call before parseAsync — notify() defers display to process exit so it\n\u002F\u002F never interleaves with command output.\nupdateNotifier({ pkg: packageJson }).notify()\n\nconst program = new Command('your-cli')\n  .description('...')\n  .version(packageJson.version)\n\nprogram.addCommand(fooCommand)\n\nawait program.parseAsync()\n```\n\n## Testing CLI wiring\n\nKeep executable entrypoints and test seams distinct. If `src\u002Findex.ts` calls\n`parseAsync()` at top level, treat it as executable-only: tests should import\ncommand factories from `src\u002Fcommands\u002F*`, assemble a local `Command`, and pass a\ncontrolled argv. Do not import a top-level executable entrypoint in tests,\nbecause it will parse the test runner's `process.argv`.\n\n```ts\n\u002F\u002F src\u002Fcommands\u002Frun.ts\nimport { Command } from 'commander'\n\nexport interface RunDispatch {\n  runBatch(): Promise\u003Cvoid> | void\n}\n\nexport function createRunCommand(dispatch: RunDispatch): Command {\n  return new Command('run').action(async () => {\n    await dispatch.runBatch()\n  })\n}\n```\n\n```ts\n\u002F\u002F tests\u002Fcli.test.ts\nimport { Command } from 'commander'\nimport { describe, expect, test, vi } from 'vitest'\nimport { createRunCommand } from '..\u002Fsrc\u002Fcommands\u002Frun'\n\ntest('dispatches run', async () => {\n  const dispatch = { runBatch: vi.fn() }\n  const program = new Command('your-cli')\n  program.addCommand(createRunCommand(dispatch))\n\n  await program.parseAsync(['node', 'your-cli', 'run'])\n\n  expect(dispatch.runBatch).toHaveBeenCalledOnce()\n})\n```\n\nFor larger CLIs, a second common pattern is a thin bin file that imports a\ntestable `run(argv)` or `execute(argv)` module. Use this when the CLI has\nsubstantial startup behavior, needs integration-style tests around exit codes,\nor also exposes a public library API.\n\n## Update notifier\n\nUse the [`update-notifier`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Fupdate-notifier) package. It handles background checks (24 h interval), state persistence, CI\u002FTTY\u002F`NO_UPDATE_NOTIFIER` opt-outs automatically.\n\n```bash\npnpm add update-notifier\n```\n\n**Where to call it:** top of `index.ts`, before `program.parseAsync()` — not in a `postAction` hook.\n\n**Why before parse:** `notify()` defaults to `defer: true`, registering a `process.on('exit')` listener. Placing it before `parseAsync()` ensures the listener is always registered regardless of which command runs.\n\n**Type shim** (package ships no `.d.ts`):\n\n```ts\n\u002F\u002F src\u002Fupdate-notifier.d.ts\ndeclare module 'update-notifier' {\n  interface Package { name: string; version: string }\n  interface Options { pkg: Package; updateCheckInterval?: number; distTag?: string }\n  interface NotifyOptions { defer?: boolean; message?: string; isGlobal?: boolean }\n  interface Notifier { notify(options?: NotifyOptions): void }\n  export default function updateNotifier(options: Options): Notifier\n}\n```\n\n## Recommended stack\n\n| Concern | Package |\n|---|---|\n| CLI framework | [`commander`](https:\u002F\u002Fgithub.com\u002Ftj\u002Fcommander.js) |\n| Interactive prompts | [`@inquirer\u002Fprompts`](https:\u002F\u002Fgithub.com\u002FSBoudrias\u002FInquirer.js) |\n| Update notifications | [`update-notifier`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Fupdate-notifier) |\n| Language | TypeScript |\n| Test runner | [`vitest`](https:\u002F\u002Fvitest.dev) |\n| Version bumping | [`bumpp`](https:\u002F\u002Fgithub.com\u002Fantfu\u002Fbumpp) — bumps `package.json`, commits, tags, and pushes in one step |\n| Bundler | [`tsdown`](https:\u002F\u002Fgithub.com\u002Frolldown\u002Ftsdown) |\n| Diagnostics (structured errors\u002Fwarnings) | [`nostics`](https:\u002F\u002Fnostics.dev\u002F) — define a catalog of diagnostic codes with stable names, messages, fixes, and docs URLs |\n\n## package.json essentials\n\n```json\n{\n  \"type\": \"module\",\n  \"bin\": { \"your-cli\": \".\u002Fdist\u002Findex.js\" },\n  \"engines\": { \"node\": \"^24.0.0\" }\n}\n```\n\n## GitHub Workflow\n\nFor a complete end-to-end workflow combining npm publish + changelog generation, see `automate-npm-release\u002FEXAMPLE_WORKFLOW.yml` if that skill is installed locally.",{"name":5,"description":7,"disable-model-invocation":24},true,"main","aa3f7debf0c9eeb73656ed9c1b62467ed920e7bd",".ai\u002Fskills\u002Fnode-cli",0,"https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fairig","https:\u002F\u002Fgithub.com\u002Fjd-solanki","https:\u002F\u002Fjd-solanki.github.io","VueJS, Python + Automation 😍","2026-07-11 22:19:36",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":24},[36,39,42],{"tool":37,"command":38},"npx","npx skills add jd-solanki\u002Fairig --skill node-cli",{"tool":40,"command":41},"bunx","bunx skills add jd-solanki\u002Fairig --skill node-cli",{"tool":43,"command":44},"pnpm","pnpm dlx skills add jd-solanki\u002Fairig --skill node-cli","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fairig\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fnode-cli\u002FSKILL.md",[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M754ARS6MGAC344C90J4DW5D","writing-great-skills","Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fairig\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwriting-great-skills\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M754APFXT5JF0DKP3AR9Q61C","to-prd","Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fairig\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fto-prd\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"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},"01M754AJY5XN0KYXKSA6SAJ6QW","to-issues","Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices. Use when user wants to convert a plan into issues, create implementation tickets, or break down work into issues.","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fairig\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fto-issues\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},"01M754AFXQKKYXEQMWBHV6XKY2","tdd","Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions \"red-green-refactor\", or wants integration tests.","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fairig\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftdd\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M754AC5GCSJBHSZWRW05WZ5F","review","Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue\u002FPRD asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to \"review since X\".","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fairig\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"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":19},"01M754A53KW017SZDH4V2MVZAE","nostics","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`.","https:\u002F\u002Fgithub.com\u002Fjd-solanki\u002Fairig\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fnostics\u002FSKILL.md",[],[]]