[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CRM2TT7C30ARJWFBCQ7VRH":3,"skill-same:01M7CRM2TT7C30ARJWFBCQ7VRH":49},{"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":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M7CRM2TT7C30ARJWFBCQ7VRH","node-typescript-service",null,"Use when building or extending a TypeScript service on Node.js - Fastify, NestJS, Express or Hono, runtime validation at the boundary, strict types, the repository's ORM and migrations, async error handling, graceful shutdown","makifbaysal\u002Ftasktrooper","makifbaysal","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F25031940?v=4","01M7CRG3ZCSYZSSEVDMW3DEYC8","Mehmet Akif Baysal","01M7CRG401FJ8YAXH5ER730XYV",122,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fbackend-developer\u002Fskills\u002Fnode-typescript-service\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: node-typescript-service\ncategory: architecture\ndescription: Use when building or extending a TypeScript service on Node.js - Fastify, NestJS, Express or Hono, runtime validation at the boundary, strict types, the repository's ORM and migrations, async error handling, graceful shutdown\ntech_stack: TypeScript (Node.js)\n---\n# TypeScript Service on Node.js\n\n## Overview\n\nA Node.js service is TypeScript at compile time and untyped JavaScript at run time. Every type at the edge — a request body, a header, an environment variable, a queue message, a row from a raw query — is a claim until something checks it.\n\n**Core principle:** the repository's framework, package manager, module system and ORM win. Parse input at the boundary into typed values; keep the domain free of the framework.\n\n## Choosing, only when there is nothing to follow\n\n- **Fastify** for a new HTTP service: schema-first routes, `app.inject()` for tests, pino logging built in.\n- **NestJS** when the service is domain-rich and the team wants modules, DI and decorators (the Quarkus\u002FSpring of Node).\n- **Express 5** or **Hono** only to match a repository or a platform that already uses them.\n\n## Layers\n\n| Layer | Responsibility |\n|-------|----------------|\n| Route \u002F controller | Parse and validate input, call one service, map the result and errors to HTTP |\n| Service | Use-case orchestration and business rules; takes plain typed values |\n| Domain | Types, invariants, pure functions — no framework import |\n| Adapter | Database, outbound HTTP, queues — behind an interface the service depends on |\n\n## Patterns\n\n- **Package manager from the lockfile:** `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm; install with the frozen form (`pnpm install --frozen-lockfile`, `npm ci`). Node version from `.nvmrc`, `.node-version` or `engines`; a new service targets the current Active LTS.\n- **Module system from `package.json`:** `\"type\": \"module\"` means ESM (relative imports carry `.js` under `NodeNext`); otherwise CommonJS. Never mix them in one package.\n- **`strict: true`.** No `any`; `unknown` at the boundary, narrowed by a parser. No non-null `!` to silence a real `undefined`.\n- **Validate at runtime at the boundary:** zod (or TypeBox \u002F Fastify JSON schema, class-validator in NestJS — whatever the repository uses) on body, params, query and headers; derive the TypeScript type from the schema (`z.infer`) so the two cannot drift. Environment variables are parsed once at startup by the same means and the process exits on a bad one.\n- **Errors in one shape:** a central error handler (`setErrorHandler`, a Nest exception filter, Express 5's error middleware) maps domain errors to 400\u002F404\u002F409 problem+json; an unknown error is logged with its stack and answered 500 without it.\n- **No floating promises:** every promise is awaited, returned or explicitly handled (`@typescript-eslint\u002Fno-floating-promises` catches the rest). An unhandled rejection crashes the process in current Node.\n- **Outbound calls have a deadline:** `fetch(url, { signal: AbortSignal.timeout(5_000) })` or the client's own timeout; retries only for idempotent calls (resilient-io-and-jobs).\n- **Never block the event loop:** no `*Sync` file or crypto calls on a request path, no unbounded `JSON.parse` of a large body, CPU-heavy work in a worker thread or a job.\n- **Database:** the repository's tool — Prisma, Drizzle, Kysely, TypeORM, MikroORM or `pg` — with parameters, never string-built SQL (`$queryRawUnsafe` and `sql.raw` with input are bugs). Migrations through that tool (`prisma migrate dev --name`, `drizzle-kit generate`), committed with the schema change; postgres-migrations covers safe DDL.\n- **Logging:** pino (Fastify's logger, `nestjs-pino`) with structured fields, request id bound per request; no `console.log` in service code; redact secrets and tokens (`redact` option).\n- **Graceful shutdown:** on SIGTERM stop accepting connections, finish in-flight requests, close the pool, then exit — Fastify `close()`, Nest `enableShutdownHooks()`.\n- **Dependencies:** a new package is a decision (reuse-before-you-write) — exact name from the registry, added with the repository's package manager, lockfile in the same commit.\n\n## Worked Example\n\n`POST \u002Ftasks` in Fastify with zod:\n\n```ts\nconst CreateTask = z.object({ title: z.string().trim().min(1).max(200) });\n\nexport function taskRoutes(app: FastifyInstance, service: TaskService) {\n  app.post(\"\u002Ftasks\", async (req, reply) => {\n    const parsed = CreateTask.safeParse(req.body);\n    if (!parsed.success) {\n      return reply.code(400).type(\"application\u002Fproblem+json\").send(problemFrom(parsed.error));\n    }\n    const task = await service.create(parsed.data.title, req.user.id);\n    return reply.code(201).header(\"location\", `\u002Ftasks\u002F${task.id}`).send(toResponse(task));\n  });\n}\n```\n\n`TaskService.create` takes a `string` and an owner id and knows nothing of Fastify; `Task.create` enforces the 200-character rule again for callers that are not HTTP.\n\n## Verify\n\nThe repository's scripts first (list_component_checks, `package.json`, CI): typically `npm run typecheck` (or `tsc --noEmit`), `npm run lint`, `npm test`, `npm run build`. For the runtime check build once and run the output — `npm run build`, then `PORT=18080 node dist\u002Fmain.js` in the background with its pid recorded — not a watcher (`npm run dev`, `tsx watch`, `nodemon`), which never exits and restarts under you.\n\n## Common Mistakes\n\n- Trusting `req.body as CreateTaskDto` — a cast is not a check.\n- `async` route handlers in Express 4 without a wrapper: the rejection never reaches the error middleware.\n- A request path that awaits in a `for` loop where one query or `Promise.all` with a bound would do — or `Promise.all` over an unbounded list.\n- `process.env.X!` scattered through the code instead of one parsed config object.\n\n## Red Flags\n\n- `any` in a new signature, or `\u002F\u002F @ts-ignore` \u002F `@ts-expect-error` added to get a build green.\n- String-concatenated SQL, or a raw query helper fed user input.\n- A promise created and never awaited in a request handler.\n- `console.log` of a request body that may hold a token or a password.\n","# TypeScript Service on Node.js\n\n## Overview\n\nA Node.js service is TypeScript at compile time and untyped JavaScript at run time. Every type at the edge — a request body, a header, an environment variable, a queue message, a row from a raw query — is a claim until something checks it.\n\n**Core principle:** the repository's framework, package manager, module system and ORM win. Parse input at the boundary into typed values; keep the domain free of the framework.\n\n## Choosing, only when there is nothing to follow\n\n- **Fastify** for a new HTTP service: schema-first routes, `app.inject()` for tests, pino logging built in.\n- **NestJS** when the service is domain-rich and the team wants modules, DI and decorators (the Quarkus\u002FSpring of Node).\n- **Express 5** or **Hono** only to match a repository or a platform that already uses them.\n\n## Layers\n\n| Layer | Responsibility |\n|-------|----------------|\n| Route \u002F controller | Parse and validate input, call one service, map the result and errors to HTTP |\n| Service | Use-case orchestration and business rules; takes plain typed values |\n| Domain | Types, invariants, pure functions — no framework import |\n| Adapter | Database, outbound HTTP, queues — behind an interface the service depends on |\n\n## Patterns\n\n- **Package manager from the lockfile:** `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `package-lock.json` → npm; install with the frozen form (`pnpm install --frozen-lockfile`, `npm ci`). Node version from `.nvmrc`, `.node-version` or `engines`; a new service targets the current Active LTS.\n- **Module system from `package.json`:** `\"type\": \"module\"` means ESM (relative imports carry `.js` under `NodeNext`); otherwise CommonJS. Never mix them in one package.\n- **`strict: true`.** No `any`; `unknown` at the boundary, narrowed by a parser. No non-null `!` to silence a real `undefined`.\n- **Validate at runtime at the boundary:** zod (or TypeBox \u002F Fastify JSON schema, class-validator in NestJS — whatever the repository uses) on body, params, query and headers; derive the TypeScript type from the schema (`z.infer`) so the two cannot drift. Environment variables are parsed once at startup by the same means and the process exits on a bad one.\n- **Errors in one shape:** a central error handler (`setErrorHandler`, a Nest exception filter, Express 5's error middleware) maps domain errors to 400\u002F404\u002F409 problem+json; an unknown error is logged with its stack and answered 500 without it.\n- **No floating promises:** every promise is awaited, returned or explicitly handled (`@typescript-eslint\u002Fno-floating-promises` catches the rest). An unhandled rejection crashes the process in current Node.\n- **Outbound calls have a deadline:** `fetch(url, { signal: AbortSignal.timeout(5_000) })` or the client's own timeout; retries only for idempotent calls (resilient-io-and-jobs).\n- **Never block the event loop:** no `*Sync` file or crypto calls on a request path, no unbounded `JSON.parse` of a large body, CPU-heavy work in a worker thread or a job.\n- **Database:** the repository's tool — Prisma, Drizzle, Kysely, TypeORM, MikroORM or `pg` — with parameters, never string-built SQL (`$queryRawUnsafe` and `sql.raw` with input are bugs). Migrations through that tool (`prisma migrate dev --name`, `drizzle-kit generate`), committed with the schema change; postgres-migrations covers safe DDL.\n- **Logging:** pino (Fastify's logger, `nestjs-pino`) with structured fields, request id bound per request; no `console.log` in service code; redact secrets and tokens (`redact` option).\n- **Graceful shutdown:** on SIGTERM stop accepting connections, finish in-flight requests, close the pool, then exit — Fastify `close()`, Nest `enableShutdownHooks()`.\n- **Dependencies:** a new package is a decision (reuse-before-you-write) — exact name from the registry, added with the repository's package manager, lockfile in the same commit.\n\n## Worked Example\n\n`POST \u002Ftasks` in Fastify with zod:\n\n```ts\nconst CreateTask = z.object({ title: z.string().trim().min(1).max(200) });\n\nexport function taskRoutes(app: FastifyInstance, service: TaskService) {\n  app.post(\"\u002Ftasks\", async (req, reply) => {\n    const parsed = CreateTask.safeParse(req.body);\n    if (!parsed.success) {\n      return reply.code(400).type(\"application\u002Fproblem+json\").send(problemFrom(parsed.error));\n    }\n    const task = await service.create(parsed.data.title, req.user.id);\n    return reply.code(201).header(\"location\", `\u002Ftasks\u002F${task.id}`).send(toResponse(task));\n  });\n}\n```\n\n`TaskService.create` takes a `string` and an owner id and knows nothing of Fastify; `Task.create` enforces the 200-character rule again for callers that are not HTTP.\n\n## Verify\n\nThe repository's scripts first (list_component_checks, `package.json`, CI): typically `npm run typecheck` (or `tsc --noEmit`), `npm run lint`, `npm test`, `npm run build`. For the runtime check build once and run the output — `npm run build`, then `PORT=18080 node dist\u002Fmain.js` in the background with its pid recorded — not a watcher (`npm run dev`, `tsx watch`, `nodemon`), which never exits and restarts under you.\n\n## Common Mistakes\n\n- Trusting `req.body as CreateTaskDto` — a cast is not a check.\n- `async` route handlers in Express 4 without a wrapper: the rejection never reaches the error middleware.\n- A request path that awaits in a `for` loop where one query or `Promise.all` with a bound would do — or `Promise.all` over an unbounded list.\n- `process.env.X!` scattered through the code instead of one parsed config object.\n\n## Red Flags\n\n- `any` in a new signature, or `\u002F\u002F @ts-ignore` \u002F `@ts-expect-error` added to get a build green.\n- String-concatenated SQL, or a raw query helper fed user input.\n- A promise created and never awaited in a request handler.\n- `console.log` of a request body that may hold a token or a password.\n",{"name":5,"category":24,"tech_stack":25,"description":7},"architecture","TypeScript (Node.js)","main","910394a0b6db9fc8c9a8f36328ec421d3ebd8b38","catalog\u002Fagents\u002Fbackend-developer\u002Fskills\u002Fnode-typescript-service",18,"https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper","https:\u002F\u002Ftasktrooper.ai","https:\u002F\u002Fgithub.com\u002Fmakifbaysal","Senior Software Developer","2026-11-15 04:50:29",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add makifbaysal\u002Ftasktrooper --skill node-typescript-service",{"tool":41,"command":42},"bunx","bunx skills add makifbaysal\u002Ftasktrooper --skill node-typescript-service",{"tool":44,"command":45},"pnpm","pnpm dlx skills add makifbaysal\u002Ftasktrooper --skill node-typescript-service","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fbackend-developer\u002Fskills\u002Fnode-typescript-service\u002FSKILL.md",true,[],[50,56,63,70,77,84],{"skillNo":51,"name":52,"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":53,"categories":54,"keywords":55,"publishedAt":19},"01M7CSVEPQW6J6TD6CS2T5FPNZ","visual-craft","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fvisual-craft\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7CSVAQG91ETHQ0HBNZDG5FR","ux-copy","Use when you write any words a user reads in a mockup or a hand-off - content language and voice, buttons, labels, errors, empty states, confirmations, numbers and dates, and the longest-string check","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fux-copy\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7CSV6H0J38659NDXHJQ8396","screen-mockup-html","Use when you draw screens as the design task's HTML mockup - ONE canvas document holding every screen and every variant side by side, the sanitizer-safe recipe, phone and wide frames, the states grid, static control states, and the loopback self-check with screenshots at 375, 768 and 1440 attached to the task","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fscreen-mockup-html\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7CSV3JFRF3BM3XK52M7YEYR","performance-awareness","How the performance score moves for your role. Use when the score context shows a declining trend, or before handing off work you have not self-checked against every criterion.","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fperformance-awareness\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7CSTZDH00YRF5SCT7BRT9QD","design-variants","Use when a screen design needs variants - how many, variants as side-by-side rows on the one canvas, what makes two variants genuinely different, recommending one, how the human's choice is read, and narrowing to the chosen one in revision","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fdesign-variants\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7CSTV6P3SM3PAE28DB0RF77","design-system-authoring","Use when you derive, change or extend a design system - where tokens live per stack, the DTCG token tree, role-based names for both themes, base vs layer vs drift, the DESIGN.md section order, the inventory format, the contrast check and the lint every proposal returns","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fdesign-system-authoring\u002FSKILL.md",[],[]]