[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6P82R51235YQ5VJ7B4PZTZ3":3,"skill-same:01M6P82R51235YQ5VJ7B4PZTZ3":65},{"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":14,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M6P82R51235YQ5VJ7B4PZTZ3","nodejs-backend-patterns",null,"Build production-ready Node.js backend services with Express or Fastify, including middleware, error handling, authentication, database integration, and API design. USE FOR: build a Fastify REST API, structure a Node GraphQL service for a microservices architecture, improve error handling in a Node REST API, create Node.js servers or backend services. DO NOT USE FOR: React component tests, frontend-only implementation or testing.","sarthchawla\u002FSetupMyAI","sarthchawla","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F41484686?v=4","01M6P7D22NFMY9MA11Q2YGPKV2","Sarthak Chawla","01M6P7D26JJ9KW98SD1G8BB83R",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsarthchawla\u002FSetupMyAI\u002Fblob\u002Fmain\u002Fpackages\u002Freact-frontend\u002Fskills\u002Fnodejs-backend-patterns\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"nodejs","nodejs backend","nodejs backend patterns","backend patterns","backend","patterns","only","production-ready","middleware","fastify","error","express","backend services","ready","testing","improve","database","authentication","design","frontend","2026-11-10 10:12:30",false,"---\nname: nodejs-backend-patterns\ndescription: >-\n  Build production-ready Node.js backend services with Express or Fastify,\n  including middleware, error handling, authentication, database integration,\n  and API design. USE FOR: build a Fastify REST API, structure a Node GraphQL\n  service for a microservices architecture, improve error handling in a Node\n  REST API, create Node.js servers or backend services. DO NOT USE FOR: React\n  component tests, frontend-only implementation or testing.\n---\n\n# Node.js Backend Patterns\n\nComprehensive guidance for building scalable, maintainable, and production-ready Node.js backend applications with modern frameworks, architectural patterns, and best practices.\n\n## When to Use This Skill\n\n- Building REST APIs or GraphQL servers\n- Creating microservices with Node.js\n- Implementing authentication and authorization\n- Designing scalable backend architectures\n- Setting up middleware and error handling\n- Integrating databases (SQL and NoSQL)\n- Building real-time applications with WebSockets\n- Implementing background job processing\n\n## Core Frameworks\n\n### Express.js - Minimalist Framework\n\n**Basic Setup:**\n\n```typescript\nimport express, { Request, Response, NextFunction } from \"express\";\nimport helmet from \"helmet\";\nimport cors from \"cors\";\nimport compression from \"compression\";\n\nconst app = express();\n\n\u002F\u002F Security middleware\napp.use(helmet());\napp.use(cors({ origin: process.env.ALLOWED_ORIGINS?.split(\",\") }));\napp.use(compression());\n\n\u002F\u002F Body parsing\napp.use(express.json({ limit: \"10mb\" }));\napp.use(express.urlencoded({ extended: true, limit: \"10mb\" }));\n\nconst PORT = process.env.PORT || 3000;\napp.listen(PORT, () => {\n  console.log(`Server running on port ${PORT}`);\n});\n```\n\n### Fastify - High Performance Framework\n\n**Basic Setup:**\n\n```typescript\nimport Fastify from \"fastify\";\nimport helmet from \"@fastify\u002Fhelmet\";\nimport cors from \"@fastify\u002Fcors\";\nimport compress from \"@fastify\u002Fcompress\";\n\nconst fastify = Fastify({\n  logger: {\n    level: process.env.LOG_LEVEL || \"info\",\n    transport: {\n      target: \"pino-pretty\",\n      options: { colorize: true },\n    },\n  },\n});\n\nawait fastify.register(helmet);\nawait fastify.register(cors, { origin: true });\nawait fastify.register(compress);\n\nawait fastify.listen({ port: 3000, host: \"0.0.0.0\" });\n```\n\n## Architectural Patterns\n\n### Pattern 1: Layered Architecture\n\n```\nsrc\u002F\n  controllers\u002F     # Handle HTTP requests\u002Fresponses\n  services\u002F        # Business logic\n  repositories\u002F    # Data access layer\n  models\u002F          # Data models\n  middleware\u002F      # Express\u002FFastify middleware\n  routes\u002F          # Route definitions\n  utils\u002F           # Helper functions\n  config\u002F          # Configuration\n  types\u002F           # TypeScript types\n```\n\n### Pattern 2: Dependency Injection\n\nUse a DI container to manage service dependencies, making code testable and maintainable.\n\n## Middleware Patterns\n\n- **Authentication**: JWT verification, session management\n- **Validation**: Zod\u002FJoi schema validation on request body\u002Fparams\n- **Rate Limiting**: Redis-backed rate limiting per IP\u002Fuser\n- **Logging**: Structured logging with Pino\u002FWinston\n\n## Error Handling\n\nUse custom error classes with proper HTTP status codes:\n\n```typescript\nexport class AppError extends Error {\n  constructor(\n    public message: string,\n    public statusCode: number = 500,\n    public isOperational: boolean = true,\n  ) {\n    super(message);\n  }\n}\n\nexport class ValidationError extends AppError {\n  constructor(message: string, public errors?: any[]) {\n    super(message, 400);\n  }\n}\n\nexport class NotFoundError extends AppError {\n  constructor(message: string = \"Resource not found\") {\n    super(message, 404);\n  }\n}\n\nexport class UnauthorizedError extends AppError {\n  constructor(message: string = \"Unauthorized\") {\n    super(message, 401);\n  }\n}\n```\n\n## Database Patterns\n\n- **PostgreSQL**: Connection pooling with `pg`\n- **MongoDB**: Mongoose with proper indexes\n- **Transactions**: Use client-level transactions for multi-step operations\n\n## Caching Strategies\n\n- **Redis**: LRU cache with TTL for frequently accessed data\n- **Cache Invalidation**: Pattern-based key invalidation\n\n## API Response Format\n\n```typescript\n\u002F\u002F Success\n{ status: \"success\", message: \"...\", data: { ... } }\n\n\u002F\u002F Error\n{ status: \"error\", message: \"...\", errors: [...] }\n\n\u002F\u002F Paginated\n{ status: \"success\", data: [...], pagination: { page, limit, total, pages } }\n```\n\n## Best Practices\n\n1. **Use TypeScript**: Type safety prevents runtime errors\n2. **Implement proper error handling**: Use custom error classes\n3. **Validate input**: Use libraries like Zod or Joi\n4. **Use environment variables**: Never hardcode secrets\n5. **Implement logging**: Use structured logging (Pino, Winston)\n6. **Add rate limiting**: Prevent abuse\n7. **Use HTTPS**: Always in production\n8. **Implement CORS properly**: Don't use `*` in production\n9. **Use dependency injection**: Easier testing and maintenance\n10. **Write tests**: Unit, integration, and E2E tests\n11. **Handle graceful shutdown**: Clean up resources\n12. **Use connection pooling**: For databases\n13. **Implement health checks**: For monitoring\n14. **Use compression**: Reduce response size\n15. **Monitor performance**: Use APM tools\n\n## Resources\n\n- **Node.js Best Practices**: https:\u002F\u002Fgithub.com\u002Fgoldbergyoni\u002Fnodebestpractices\n- **Express.js Guide**: https:\u002F\u002Fexpressjs.com\u002Fen\u002Fguide\u002F\n- **Fastify Documentation**: https:\u002F\u002Fwww.fastify.io\u002Fdocs\u002F\n","# Node.js Backend Patterns\n\nComprehensive guidance for building scalable, maintainable, and production-ready Node.js backend applications with modern frameworks, architectural patterns, and best practices.\n\n## When to Use This Skill\n\n- Building REST APIs or GraphQL servers\n- Creating microservices with Node.js\n- Implementing authentication and authorization\n- Designing scalable backend architectures\n- Setting up middleware and error handling\n- Integrating databases (SQL and NoSQL)\n- Building real-time applications with WebSockets\n- Implementing background job processing\n\n## Core Frameworks\n\n### Express.js - Minimalist Framework\n\n**Basic Setup:**\n\n```typescript\nimport express, { Request, Response, NextFunction } from \"express\";\nimport helmet from \"helmet\";\nimport cors from \"cors\";\nimport compression from \"compression\";\n\nconst app = express();\n\n\u002F\u002F Security middleware\napp.use(helmet());\napp.use(cors({ origin: process.env.ALLOWED_ORIGINS?.split(\",\") }));\napp.use(compression());\n\n\u002F\u002F Body parsing\napp.use(express.json({ limit: \"10mb\" }));\napp.use(express.urlencoded({ extended: true, limit: \"10mb\" }));\n\nconst PORT = process.env.PORT || 3000;\napp.listen(PORT, () => {\n  console.log(`Server running on port ${PORT}`);\n});\n```\n\n### Fastify - High Performance Framework\n\n**Basic Setup:**\n\n```typescript\nimport Fastify from \"fastify\";\nimport helmet from \"@fastify\u002Fhelmet\";\nimport cors from \"@fastify\u002Fcors\";\nimport compress from \"@fastify\u002Fcompress\";\n\nconst fastify = Fastify({\n  logger: {\n    level: process.env.LOG_LEVEL || \"info\",\n    transport: {\n      target: \"pino-pretty\",\n      options: { colorize: true },\n    },\n  },\n});\n\nawait fastify.register(helmet);\nawait fastify.register(cors, { origin: true });\nawait fastify.register(compress);\n\nawait fastify.listen({ port: 3000, host: \"0.0.0.0\" });\n```\n\n## Architectural Patterns\n\n### Pattern 1: Layered Architecture\n\n```\nsrc\u002F\n  controllers\u002F     # Handle HTTP requests\u002Fresponses\n  services\u002F        # Business logic\n  repositories\u002F    # Data access layer\n  models\u002F          # Data models\n  middleware\u002F      # Express\u002FFastify middleware\n  routes\u002F          # Route definitions\n  utils\u002F           # Helper functions\n  config\u002F          # Configuration\n  types\u002F           # TypeScript types\n```\n\n### Pattern 2: Dependency Injection\n\nUse a DI container to manage service dependencies, making code testable and maintainable.\n\n## Middleware Patterns\n\n- **Authentication**: JWT verification, session management\n- **Validation**: Zod\u002FJoi schema validation on request body\u002Fparams\n- **Rate Limiting**: Redis-backed rate limiting per IP\u002Fuser\n- **Logging**: Structured logging with Pino\u002FWinston\n\n## Error Handling\n\nUse custom error classes with proper HTTP status codes:\n\n```typescript\nexport class AppError extends Error {\n  constructor(\n    public message: string,\n    public statusCode: number = 500,\n    public isOperational: boolean = true,\n  ) {\n    super(message);\n  }\n}\n\nexport class ValidationError extends AppError {\n  constructor(message: string, public errors?: any[]) {\n    super(message, 400);\n  }\n}\n\nexport class NotFoundError extends AppError {\n  constructor(message: string = \"Resource not found\") {\n    super(message, 404);\n  }\n}\n\nexport class UnauthorizedError extends AppError {\n  constructor(message: string = \"Unauthorized\") {\n    super(message, 401);\n  }\n}\n```\n\n## Database Patterns\n\n- **PostgreSQL**: Connection pooling with `pg`\n- **MongoDB**: Mongoose with proper indexes\n- **Transactions**: Use client-level transactions for multi-step operations\n\n## Caching Strategies\n\n- **Redis**: LRU cache with TTL for frequently accessed data\n- **Cache Invalidation**: Pattern-based key invalidation\n\n## API Response Format\n\n```typescript\n\u002F\u002F Success\n{ status: \"success\", message: \"...\", data: { ... } }\n\n\u002F\u002F Error\n{ status: \"error\", message: \"...\", errors: [...] }\n\n\u002F\u002F Paginated\n{ status: \"success\", data: [...], pagination: { page, limit, total, pages } }\n```\n\n## Best Practices\n\n1. **Use TypeScript**: Type safety prevents runtime errors\n2. **Implement proper error handling**: Use custom error classes\n3. **Validate input**: Use libraries like Zod or Joi\n4. **Use environment variables**: Never hardcode secrets\n5. **Implement logging**: Use structured logging (Pino, Winston)\n6. **Add rate limiting**: Prevent abuse\n7. **Use HTTPS**: Always in production\n8. **Implement CORS properly**: Don't use `*` in production\n9. **Use dependency injection**: Easier testing and maintenance\n10. **Write tests**: Unit, integration, and E2E tests\n11. **Handle graceful shutdown**: Clean up resources\n12. **Use connection pooling**: For databases\n13. **Implement health checks**: For monitoring\n14. **Use compression**: Reduce response size\n15. **Monitor performance**: Use APM tools\n\n## Resources\n\n- **Node.js Best Practices**: https:\u002F\u002Fgithub.com\u002Fgoldbergyoni\u002Fnodebestpractices\n- **Express.js Guide**: https:\u002F\u002Fexpressjs.com\u002Fen\u002Fguide\u002F\n- **Fastify Documentation**: https:\u002F\u002Fwww.fastify.io\u002Fdocs\u002F\n",{"name":5,"description":7},"main","3934845b800ff514cb89eb81d43f3dc4cbf51ff2","packages\u002Freact-frontend\u002Fskills\u002Fnodejs-backend-patterns","https:\u002F\u002Fgithub.com\u002Fsarthchawla\u002FSetupMyAI","https:\u002F\u002Fgithub.com\u002Fsarthchawla","there ain't no problem i can't solve","2026-10-23 01:26:57",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add sarthchawla\u002FSetupMyAI --skill nodejs-backend-patterns",{"tool":57,"command":58},"bunx","bunx skills add sarthchawla\u002FSetupMyAI --skill nodejs-backend-patterns",{"tool":60,"command":61},"pnpm","pnpm dlx skills add sarthchawla\u002FSetupMyAI --skill nodejs-backend-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsarthchawla\u002FSetupMyAI\u002Fblob\u002Fmain\u002Fpackages\u002Freact-frontend\u002Fskills\u002Fnodejs-backend-patterns\u002FSKILL.md",true,[],[66,74,89,98,108,129],{"skillNo":67,"name":68,"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":69,"categories":70,"keywords":71,"publishedAt":39},"01M6P8953HNC422WFQSPP2FMQE","sample-skill","https:\u002F\u002Fgithub.com\u002Fsarthchawla\u002FSetupMyAI\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fmock-repo\u002F.claude\u002Fskills\u002Fsample-skill\u002FSKILL.md",[],[72,73],"sample","sample skill",{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":39},"01M6P8924ZSDAZ88Y5Q9P3KAQV","synthetic-review-candidate","Candidate for smoke testing an evaluation runner only.","https:\u002F\u002Fgithub.com\u002Fsarthchawla\u002FSetupMyAI\u002Fblob\u002Fmain\u002Fscripts\u002Fskill-eval\u002Ffixtures\u002Fcandidate\u002FSKILL.md",[],[81,82,83,84,25,33,85,86,87,88],"synthetic review candidate","candidate","synthetic","review","Evaluation","smoke","runner","for",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":39},"01M6P88FEGGNH8EZY0PDHD9KQA","synthetic-review-baseline","Baseline for smoke testing an evaluation runner only.","https:\u002F\u002Fgithub.com\u002Fsarthchawla\u002FSetupMyAI\u002Fblob\u002Fmain\u002Fscripts\u002Fskill-eval\u002Ffixtures\u002Fbaseline\u002FSKILL.md",[],[96,83,97,84,86,87,88,25,33,85],"synthetic review baseline","baseline",{"skillNo":99,"name":84,"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},"01M6P87ZXVEHRM860960DB5FEQ","Run the existing user-invoked review bundle and independently adjudicate its findings.","https:\u002F\u002Fgithub.com\u002Fsarthchawla\u002FSetupMyAI\u002Fblob\u002Fmain\u002Fpackages\u002Funiversal\u002Fskills\u002Freview\u002FSKILL.md",[],[84,104,105,106,107],"run","user","bundle","Existing",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":39},"01M6P87FC73MZTRB6ZBP4GR1VQ","review-adjudication","Verify generated or human review findings before fixing, defending, replying, resolving, or reusing them as learned guidance. Use within a review, review-comment fix, monitor, or readiness workflow.","https:\u002F\u002Fgithub.com\u002Fsarthchawla\u002FSetupMyAI\u002Fblob\u002Fmain\u002Fpackages\u002Funiversal\u002Fskills\u002Freview-adjudication\u002FSKILL.md",[],[115,84,116,117,118,119,120,121,122,123,124,125,126,127,128],"review adjudication","workflow","generated","human review","guidance","human","as","readiness","learned","review findings","fix","use","verify","monitor",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":39},"01M6P871Q44KQES293T60JQETA","monitor-mr","Monitor review findings and CI using the shared adjudication procedure.","https:\u002F\u002Fgithub.com\u002Fsarthchawla\u002FSetupMyAI\u002Fblob\u002Fmain\u002Fpackages\u002Funiversal\u002Fskills\u002Fmonitor-mr\u002FSKILL.md",[],[128,136,137,124,138,139,84],"mr","monitor mr","shared","ci"]