[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F77KHR53DHVMW4M6A7RED2":3,"skill-same:01M7F77KHR53DHVMW4M6A7RED2":46},{"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":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7F77KHR53DHVMW4M6A7RED2","node-ops",null,"Production Node.js operations advisor. Always use this skill when deploying or operating Node.js applications, handling graceful shutdown, SIGTERM, clustering, memory leaks, health checks, readiness probes, uncaught exceptions, or process management. Use when the user asks \"how do I handle SIGTERM in Node.js\", \"graceful shutdown in Express\", \"how do I add health checks or readiness probes\", \"my Node app crashes and restarts\", \"uncaught exception handler\", \"should I use cluster mode\", or \"Node.js kubernetes\". Read this before advising on any Node.js production or deployment topic.","alexj11324\u002FMikka","alexj11324","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F183887963?v=4","01M7F72W5NYK4AXQCEH0PZM81E","Zhixuan Jiang","01M7F72W69V101X48H9PZVBB46",87,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002Falexj11324\u002FMikka\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fnode-ops\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: node-ops\ndescription: Production Node.js operations advisor. Always use this skill when deploying or operating Node.js applications, handling graceful shutdown, SIGTERM, clustering, memory leaks, health checks, readiness probes, uncaught exceptions, or process management. Use when the user asks \"how do I handle SIGTERM in Node.js\", \"graceful shutdown in Express\", \"how do I add health checks or readiness probes\", \"my Node app crashes and restarts\", \"uncaught exception handler\", \"should I use cluster mode\", or \"Node.js kubernetes\". Read this before advising on any Node.js production or deployment topic.\n---\n\n# Production Node.js Operations\n\nA Node.js app that works in development often has silent operational problems in production: it crashes on uncaught errors, drops in-flight requests during deploys, leaks memory over time, or gives load balancers no way to know it's ready. These are all fixable, and they should be addressed before the first production deploy, not after the first incident.\n\n## Graceful shutdown\n\nWhen a container or process manager sends `SIGTERM`, the app has a window to finish what it's doing before it's killed. If you don't handle it, the process exits immediately and drops every in-flight request.\n\n```ts\nconst server = app.listen(3000);\n\nprocess.on('SIGTERM', () => {\n  server.close(() => {\n    \u002F\u002F connections drained — exit cleanly\n    process.exit(0);\n  });\n\n  \u002F\u002F Safety valve: force exit if drain takes too long\n  setTimeout(() => process.exit(1), 10_000).unref();\n});\n```\n\n`server.close()` stops accepting new connections and waits for existing ones to finish. The timeout prevents the app from hanging indefinitely if a connection never closes (e.g., a long-polling client).\n\nFor database connections, message consumers, or other resources: close them in the `SIGTERM` handler too, after the HTTP server has stopped accepting work.\n\n## Handle uncaught exceptions and unhandled rejections\n\nAn uncaught exception or unhandled rejection leaves the process in an indeterminate state. The safest response is to log the error and exit: let the process manager restart you.\n\n```ts\nprocess.on('uncaughtException', (err) => {\n  logger.error('Uncaught exception', err);\n  process.exit(1);\n});\n\nprocess.on('unhandledRejection', (reason) => {\n  logger.error('Unhandled rejection', reason);\n  process.exit(1);\n});\n```\n\nDon't try to continue after an uncaught exception. The state of the event loop and any in-flight work is unknown. Restart fast and restart clean.\n\n## Liveness vs. readiness health checks\n\nThese are different endpoints with different semantics. Mixing them up causes deployment problems.\n\n| Endpoint | Answers | Failure action |\n|---|---|---|\n| `GET \u002Fhealth\u002Flive` | \"Is the process alive?\" | Restart the container |\n| `GET \u002Fhealth\u002Fready` | \"Can this instance serve traffic?\" | Remove from load balancer rotation |\n\n```ts\n\u002F\u002F Liveness: if this fails, something is fundamentally broken — restart\napp.get('\u002Fhealth\u002Flive', (req, res) => res.sendStatus(200));\n\n\u002F\u002F Readiness: check dependencies before accepting traffic\napp.get('\u002Fhealth\u002Fready', async (req, res) => {\n  try {\n    await db.query('SELECT 1');\n    res.sendStatus(200);\n  } catch {\n    res.sendStatus(503);\n  }\n});\n```\n\nThe readiness check should fail during startup (before the DB connection is established) and during graceful shutdown (after `server.close()` is called). This prevents traffic from reaching instances that can't handle it.\n\n## Clustering: when and how\n\nNode.js runs on a single thread. A single instance won't saturate a multi-core machine. Options:\n\n- **Multiple container instances** (preferred in Kubernetes\u002FECS): each container runs one Node process; the orchestrator handles distribution and restart. Simpler, easier to observe, and matches how most modern infra works.\n- **Node cluster module**: spawns one worker per CPU core inside a single container. Works, but adds complexity: workers share no memory, IPC is manual, and a worker crash doesn't necessarily restart the master.\n- **PM2 cluster mode**: wraps the cluster module with a process manager. Useful when you control the host but not the orchestrator.\n\nIn a containerized environment, prefer horizontal scaling over in-process clustering.\n\n## Memory management\n\nNode.js V8 has a default heap limit (around 1.5GB on 64-bit). If you need more: `NODE_OPTIONS='--max-old-space-size=4096'`. But first investigate whether you actually have a leak.\n\nCommon leak sources:\n- **Event emitter listeners not removed**: `emitter.on()` without a corresponding `emitter.off()` or `{ once: true }`\n- **Closures holding large objects**: a callback capturing a large request object that never gets freed\n- **Unbounded caches**: in-memory maps that grow forever with no eviction\n- **Timers not cleared**: `setInterval` holding a reference to objects that should be GC'd\n\nDiagnose with `--inspect` and a heap snapshot in Chrome DevTools, or `clinic.js` for production-safe profiling.\n\n## Environment configuration\n\nConfig belongs in environment variables, not in the repository or bundled into the process.\n\n```ts\nconst config = {\n  port: parseInt(process.env.PORT ?? '3000', 10),\n  dbUrl: process.env.DATABASE_URL ?? throwMissing('DATABASE_URL'),\n  jwtSecret: process.env.JWT_SECRET ?? throwMissing('JWT_SECRET'),\n};\n\nfunction throwMissing(name: string): never {\n  throw new Error(`Required env var ${name} is not set`);\n}\n```\n\nFail fast at startup if required config is missing: don't let the app start and then crash on the first request that needs the config.\n\n## Logging for production\n\n- Use structured logging (JSON): log aggregators (Datadog, CloudWatch, Splunk) can parse and query it\n- Include a correlation\u002Frequest ID on every log line: essential for tracing a request across services\n- Log at the right level: `error` for actionable failures, `warn` for degraded but functional, `info` for significant events, `debug` for local dev only\n- Never log secrets, PII, or full request\u002Fresponse bodies by default\n\n## What to watch for in code review\n\n- No `SIGTERM` handler: process will drop in-flight requests on deploy\n- `process.exit()` called without flushing logs or closing connections\n- A single `\u002Fhealth` endpoint used for both liveness and readiness\n- `uncaughtException` handler that catches and continues instead of exiting\n- Large data structures cached in module scope with no eviction\n- Required config accessed without validation at startup\n","# Production Node.js Operations\n\nA Node.js app that works in development often has silent operational problems in production: it crashes on uncaught errors, drops in-flight requests during deploys, leaks memory over time, or gives load balancers no way to know it's ready. These are all fixable, and they should be addressed before the first production deploy, not after the first incident.\n\n## Graceful shutdown\n\nWhen a container or process manager sends `SIGTERM`, the app has a window to finish what it's doing before it's killed. If you don't handle it, the process exits immediately and drops every in-flight request.\n\n```ts\nconst server = app.listen(3000);\n\nprocess.on('SIGTERM', () => {\n  server.close(() => {\n    \u002F\u002F connections drained — exit cleanly\n    process.exit(0);\n  });\n\n  \u002F\u002F Safety valve: force exit if drain takes too long\n  setTimeout(() => process.exit(1), 10_000).unref();\n});\n```\n\n`server.close()` stops accepting new connections and waits for existing ones to finish. The timeout prevents the app from hanging indefinitely if a connection never closes (e.g., a long-polling client).\n\nFor database connections, message consumers, or other resources: close them in the `SIGTERM` handler too, after the HTTP server has stopped accepting work.\n\n## Handle uncaught exceptions and unhandled rejections\n\nAn uncaught exception or unhandled rejection leaves the process in an indeterminate state. The safest response is to log the error and exit: let the process manager restart you.\n\n```ts\nprocess.on('uncaughtException', (err) => {\n  logger.error('Uncaught exception', err);\n  process.exit(1);\n});\n\nprocess.on('unhandledRejection', (reason) => {\n  logger.error('Unhandled rejection', reason);\n  process.exit(1);\n});\n```\n\nDon't try to continue after an uncaught exception. The state of the event loop and any in-flight work is unknown. Restart fast and restart clean.\n\n## Liveness vs. readiness health checks\n\nThese are different endpoints with different semantics. Mixing them up causes deployment problems.\n\n| Endpoint | Answers | Failure action |\n|---|---|---|\n| `GET \u002Fhealth\u002Flive` | \"Is the process alive?\" | Restart the container |\n| `GET \u002Fhealth\u002Fready` | \"Can this instance serve traffic?\" | Remove from load balancer rotation |\n\n```ts\n\u002F\u002F Liveness: if this fails, something is fundamentally broken — restart\napp.get('\u002Fhealth\u002Flive', (req, res) => res.sendStatus(200));\n\n\u002F\u002F Readiness: check dependencies before accepting traffic\napp.get('\u002Fhealth\u002Fready', async (req, res) => {\n  try {\n    await db.query('SELECT 1');\n    res.sendStatus(200);\n  } catch {\n    res.sendStatus(503);\n  }\n});\n```\n\nThe readiness check should fail during startup (before the DB connection is established) and during graceful shutdown (after `server.close()` is called). This prevents traffic from reaching instances that can't handle it.\n\n## Clustering: when and how\n\nNode.js runs on a single thread. A single instance won't saturate a multi-core machine. Options:\n\n- **Multiple container instances** (preferred in Kubernetes\u002FECS): each container runs one Node process; the orchestrator handles distribution and restart. Simpler, easier to observe, and matches how most modern infra works.\n- **Node cluster module**: spawns one worker per CPU core inside a single container. Works, but adds complexity: workers share no memory, IPC is manual, and a worker crash doesn't necessarily restart the master.\n- **PM2 cluster mode**: wraps the cluster module with a process manager. Useful when you control the host but not the orchestrator.\n\nIn a containerized environment, prefer horizontal scaling over in-process clustering.\n\n## Memory management\n\nNode.js V8 has a default heap limit (around 1.5GB on 64-bit). If you need more: `NODE_OPTIONS='--max-old-space-size=4096'`. But first investigate whether you actually have a leak.\n\nCommon leak sources:\n- **Event emitter listeners not removed**: `emitter.on()` without a corresponding `emitter.off()` or `{ once: true }`\n- **Closures holding large objects**: a callback capturing a large request object that never gets freed\n- **Unbounded caches**: in-memory maps that grow forever with no eviction\n- **Timers not cleared**: `setInterval` holding a reference to objects that should be GC'd\n\nDiagnose with `--inspect` and a heap snapshot in Chrome DevTools, or `clinic.js` for production-safe profiling.\n\n## Environment configuration\n\nConfig belongs in environment variables, not in the repository or bundled into the process.\n\n```ts\nconst config = {\n  port: parseInt(process.env.PORT ?? '3000', 10),\n  dbUrl: process.env.DATABASE_URL ?? throwMissing('DATABASE_URL'),\n  jwtSecret: process.env.JWT_SECRET ?? throwMissing('JWT_SECRET'),\n};\n\nfunction throwMissing(name: string): never {\n  throw new Error(`Required env var ${name} is not set`);\n}\n```\n\nFail fast at startup if required config is missing: don't let the app start and then crash on the first request that needs the config.\n\n## Logging for production\n\n- Use structured logging (JSON): log aggregators (Datadog, CloudWatch, Splunk) can parse and query it\n- Include a correlation\u002Frequest ID on every log line: essential for tracing a request across services\n- Log at the right level: `error` for actionable failures, `warn` for degraded but functional, `info` for significant events, `debug` for local dev only\n- Never log secrets, PII, or full request\u002Fresponse bodies by default\n\n## What to watch for in code review\n\n- No `SIGTERM` handler: process will drop in-flight requests on deploy\n- `process.exit()` called without flushing logs or closing connections\n- A single `\u002Fhealth` endpoint used for both liveness and readiness\n- `uncaughtException` handler that catches and continues instead of exiting\n- Large data structures cached in module scope with no eviction\n- Required config accessed without validation at startup\n",{"name":5,"description":7},"main","4ae55457c0230cc1b0d4ab22ba0ac86662b8202d",".claude\u002Fskills\u002Fnode-ops",11,"https:\u002F\u002Fgithub.com\u002Falexj11324\u002FMikka","https:\u002F\u002Faspectlylabs.com\u002Fmikka","https:\u002F\u002Fgithub.com\u002Falexj11324","2026-11-15 16:49:24",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add alexj11324\u002FMikka --skill node-ops",{"tool":38,"command":39},"bunx","bunx skills add alexj11324\u002FMikka --skill node-ops",{"tool":41,"command":42},"pnpm","pnpm dlx skills add alexj11324\u002FMikka --skill node-ops","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Falexj11324\u002FMikka\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fnode-ops\u002FSKILL.md",true,[],[47,53,59,66,73,80],{"skillNo":48,"name":49,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7F7DR2H1H14E5BJ8FFG73A3","run-report","https:\u002F\u002Fgithub.com\u002Falexj11324\u002FMikka\u002Fblob\u002Fmain\u002Flib\u002Fself-improvement\u002Fskills\u002Frun-report\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7F7DN7QRPJM3QGP20AYQHRA","source-checking","https:\u002F\u002Fgithub.com\u002Falexj11324\u002FMikka\u002Fblob\u002Fmain\u002Fagents\u002Fresearch-example\u002Fskills\u002Fsource-checking\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7F7DHXRSSGKW4CXVRTYTHRC","writing-shape","Writing, exploit: shape raw material into an article, paragraph by paragraph.","https:\u002F\u002Fgithub.com\u002Falexj11324\u002FMikka\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwriting-shape\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7F7DAATWYFV4YFV0NNZ507V","writing-fragments","Writing, explore: mine raw fragments, no structure yet.","https:\u002F\u002Fgithub.com\u002Falexj11324\u002FMikka\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwriting-fragments\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7F7D3TJ6E75PEFWNVXYREHZ","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Falexj11324\u002FMikka\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7F7CYAB0GYT0R5KXY4SEPR8","writing-beats","Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.","https:\u002F\u002Fgithub.com\u002Falexj11324\u002FMikka\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwriting-beats\u002FSKILL.md",[],[]]