[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73DXNESXZ2FEZQ03BVPQCFK":3,"skill-same:01M73DXNESXZ2FEZQ03BVPQCFK":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":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M73DXNESXZ2FEZQ03BVPQCFK","nestjs-patterns",null,"NestJS architecture patterns for modules, controllers, providers, DTO validation, guards, interceptors, config, and production-grade TypeScript backends.","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fnestjs-patterns\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: nestjs-patterns\ndescription: NestJS architecture patterns for modules, controllers, providers, DTO validation, guards, interceptors, config, and production-grade TypeScript backends.\norigin: ECC\n---\n\n# NestJS Development Patterns\n\nProduction-grade NestJS patterns for modular TypeScript backends.\n\n## When to Activate\n\n- Building NestJS APIs or services\n- Structuring modules, controllers, and providers\n- Adding DTO validation, guards, interceptors, or exception filters\n- Configuring environment-aware settings and database integrations\n- Testing NestJS units or HTTP endpoints\n\n## Project Structure\n\n```text\nsrc\u002F\n├── app.module.ts\n├── main.ts\n├── common\u002F\n│   ├── filters\u002F\n│   ├── guards\u002F\n│   ├── interceptors\u002F\n│   └── pipes\u002F\n├── config\u002F\n│   ├── configuration.ts\n│   └── validation.ts\n├── modules\u002F\n│   ├── auth\u002F\n│   │   ├── auth.controller.ts\n│   │   ├── auth.module.ts\n│   │   ├── auth.service.ts\n│   │   ├── dto\u002F\n│   │   ├── guards\u002F\n│   │   └── strategies\u002F\n│   └── users\u002F\n│       ├── dto\u002F\n│       ├── entities\u002F\n│       ├── users.controller.ts\n│       ├── users.module.ts\n│       └── users.service.ts\n└── prisma\u002F or database\u002F\n```\n\n- Keep domain code inside feature modules.\n- Put cross-cutting filters, decorators, guards, and interceptors in `common\u002F`.\n- Keep DTOs close to the module that owns them.\n\n## Bootstrap and Global Validation\n\n```ts\nasync function bootstrap() {\n  const app = await NestFactory.create(AppModule, { bufferLogs: true });\n\n  app.useGlobalPipes(\n    new ValidationPipe({\n      whitelist: true,\n      forbidNonWhitelisted: true,\n      transform: true,\n      transformOptions: { enableImplicitConversion: true },\n    }),\n  );\n\n  app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));\n  app.useGlobalFilters(new HttpExceptionFilter());\n\n  await app.listen(process.env.PORT ?? 3000);\n}\nbootstrap();\n```\n\n- Always enable `whitelist` and `forbidNonWhitelisted` on public APIs.\n- Prefer one global validation pipe instead of repeating validation config per route.\n\n## Modules, Controllers, and Providers\n\n```ts\n@Module({\n  controllers: [UsersController],\n  providers: [UsersService],\n  exports: [UsersService],\n})\nexport class UsersModule {}\n\n@Controller('users')\nexport class UsersController {\n  constructor(private readonly usersService: UsersService) {}\n\n  @Get(':id')\n  getById(@Param('id', ParseUUIDPipe) id: string) {\n    return this.usersService.getById(id);\n  }\n\n  @Post()\n  create(@Body() dto: CreateUserDto) {\n    return this.usersService.create(dto);\n  }\n}\n\n@Injectable()\nexport class UsersService {\n  constructor(private readonly usersRepo: UsersRepository) {}\n\n  async create(dto: CreateUserDto) {\n    return this.usersRepo.create(dto);\n  }\n}\n```\n\n- Controllers should stay thin: parse HTTP input, call a provider, return response DTOs.\n- Put business logic in injectable services, not controllers.\n- Export only the providers other modules genuinely need.\n\n## DTOs and Validation\n\n```ts\nexport class CreateUserDto {\n  @IsEmail()\n  email!: string;\n\n  @IsString()\n  @Length(2, 80)\n  name!: string;\n\n  @IsOptional()\n  @IsEnum(UserRole)\n  role?: UserRole;\n}\n```\n\n- Validate every request DTO with `class-validator`.\n- Use dedicated response DTOs or serializers instead of returning ORM entities directly.\n- Avoid leaking internal fields such as password hashes, tokens, or audit columns.\n\n## Auth, Guards, and Request Context\n\n```ts\n@UseGuards(JwtAuthGuard, RolesGuard)\n@Roles('admin')\n@Get('admin\u002Freport')\ngetAdminReport(@Req() req: AuthenticatedRequest) {\n  return this.reportService.getForUser(req.user.id);\n}\n```\n\n- Keep auth strategies and guards module-local unless they are truly shared.\n- Encode coarse access rules in guards, then do resource-specific authorization in services.\n- Prefer explicit request types for authenticated request objects.\n\n## Exception Filters and Error Shape\n\n```ts\n@Catch()\nexport class HttpExceptionFilter implements ExceptionFilter {\n  catch(exception: unknown, host: ArgumentsHost) {\n    const response = host.switchToHttp().getResponse\u003CResponse>();\n    const request = host.switchToHttp().getRequest\u003CRequest>();\n\n    if (exception instanceof HttpException) {\n      return response.status(exception.getStatus()).json({\n        path: request.url,\n        error: exception.getResponse(),\n      });\n    }\n\n    return response.status(500).json({\n      path: request.url,\n      error: 'Internal server error',\n    });\n  }\n}\n```\n\n- Keep one consistent error envelope across the API.\n- Throw framework exceptions for expected client errors; log and wrap unexpected failures centrally.\n\n## Config and Environment Validation\n\n```ts\nConfigModule.forRoot({\n  isGlobal: true,\n  load: [configuration],\n  validate: validateEnv,\n});\n```\n\n- Validate env at boot, not lazily at first request.\n- Keep config access behind typed helpers or config services.\n- Split dev\u002Fstaging\u002Fprod concerns in config factories instead of branching throughout feature code.\n\n## Persistence and Transactions\n\n- Keep repository \u002F ORM code behind providers that speak domain language.\n- For Prisma or TypeORM, isolate transactional workflows in services that own the unit of work.\n- Do not let controllers coordinate multi-step writes directly.\n\n## Testing\n\n```ts\ndescribe('UsersController', () => {\n  let app: INestApplication;\n\n  beforeAll(async () => {\n    const moduleRef = await Test.createTestingModule({\n      imports: [UsersModule],\n    }).compile();\n\n    app = moduleRef.createNestApplication();\n    app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));\n    await app.init();\n  });\n});\n```\n\n- Unit test providers in isolation with mocked dependencies.\n- Add request-level tests for guards, validation pipes, and exception filters.\n- Reuse the same global pipes\u002Ffilters in tests that you use in production.\n\n## Production Defaults\n\n- Enable structured logging and request correlation ids.\n- Terminate on invalid env\u002Fconfig instead of booting partially.\n- Prefer async provider initialization for DB\u002Fcache clients with explicit health checks.\n- Keep background jobs and event consumers in their own modules, not inside HTTP controllers.\n- Make rate limiting, auth, and audit logging explicit for public endpoints.\n","# NestJS Development Patterns\n\nProduction-grade NestJS patterns for modular TypeScript backends.\n\n## When to Activate\n\n- Building NestJS APIs or services\n- Structuring modules, controllers, and providers\n- Adding DTO validation, guards, interceptors, or exception filters\n- Configuring environment-aware settings and database integrations\n- Testing NestJS units or HTTP endpoints\n\n## Project Structure\n\n```text\nsrc\u002F\n├── app.module.ts\n├── main.ts\n├── common\u002F\n│   ├── filters\u002F\n│   ├── guards\u002F\n│   ├── interceptors\u002F\n│   └── pipes\u002F\n├── config\u002F\n│   ├── configuration.ts\n│   └── validation.ts\n├── modules\u002F\n│   ├── auth\u002F\n│   │   ├── auth.controller.ts\n│   │   ├── auth.module.ts\n│   │   ├── auth.service.ts\n│   │   ├── dto\u002F\n│   │   ├── guards\u002F\n│   │   └── strategies\u002F\n│   └── users\u002F\n│       ├── dto\u002F\n│       ├── entities\u002F\n│       ├── users.controller.ts\n│       ├── users.module.ts\n│       └── users.service.ts\n└── prisma\u002F or database\u002F\n```\n\n- Keep domain code inside feature modules.\n- Put cross-cutting filters, decorators, guards, and interceptors in `common\u002F`.\n- Keep DTOs close to the module that owns them.\n\n## Bootstrap and Global Validation\n\n```ts\nasync function bootstrap() {\n  const app = await NestFactory.create(AppModule, { bufferLogs: true });\n\n  app.useGlobalPipes(\n    new ValidationPipe({\n      whitelist: true,\n      forbidNonWhitelisted: true,\n      transform: true,\n      transformOptions: { enableImplicitConversion: true },\n    }),\n  );\n\n  app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));\n  app.useGlobalFilters(new HttpExceptionFilter());\n\n  await app.listen(process.env.PORT ?? 3000);\n}\nbootstrap();\n```\n\n- Always enable `whitelist` and `forbidNonWhitelisted` on public APIs.\n- Prefer one global validation pipe instead of repeating validation config per route.\n\n## Modules, Controllers, and Providers\n\n```ts\n@Module({\n  controllers: [UsersController],\n  providers: [UsersService],\n  exports: [UsersService],\n})\nexport class UsersModule {}\n\n@Controller('users')\nexport class UsersController {\n  constructor(private readonly usersService: UsersService) {}\n\n  @Get(':id')\n  getById(@Param('id', ParseUUIDPipe) id: string) {\n    return this.usersService.getById(id);\n  }\n\n  @Post()\n  create(@Body() dto: CreateUserDto) {\n    return this.usersService.create(dto);\n  }\n}\n\n@Injectable()\nexport class UsersService {\n  constructor(private readonly usersRepo: UsersRepository) {}\n\n  async create(dto: CreateUserDto) {\n    return this.usersRepo.create(dto);\n  }\n}\n```\n\n- Controllers should stay thin: parse HTTP input, call a provider, return response DTOs.\n- Put business logic in injectable services, not controllers.\n- Export only the providers other modules genuinely need.\n\n## DTOs and Validation\n\n```ts\nexport class CreateUserDto {\n  @IsEmail()\n  email!: string;\n\n  @IsString()\n  @Length(2, 80)\n  name!: string;\n\n  @IsOptional()\n  @IsEnum(UserRole)\n  role?: UserRole;\n}\n```\n\n- Validate every request DTO with `class-validator`.\n- Use dedicated response DTOs or serializers instead of returning ORM entities directly.\n- Avoid leaking internal fields such as password hashes, tokens, or audit columns.\n\n## Auth, Guards, and Request Context\n\n```ts\n@UseGuards(JwtAuthGuard, RolesGuard)\n@Roles('admin')\n@Get('admin\u002Freport')\ngetAdminReport(@Req() req: AuthenticatedRequest) {\n  return this.reportService.getForUser(req.user.id);\n}\n```\n\n- Keep auth strategies and guards module-local unless they are truly shared.\n- Encode coarse access rules in guards, then do resource-specific authorization in services.\n- Prefer explicit request types for authenticated request objects.\n\n## Exception Filters and Error Shape\n\n```ts\n@Catch()\nexport class HttpExceptionFilter implements ExceptionFilter {\n  catch(exception: unknown, host: ArgumentsHost) {\n    const response = host.switchToHttp().getResponse\u003CResponse>();\n    const request = host.switchToHttp().getRequest\u003CRequest>();\n\n    if (exception instanceof HttpException) {\n      return response.status(exception.getStatus()).json({\n        path: request.url,\n        error: exception.getResponse(),\n      });\n    }\n\n    return response.status(500).json({\n      path: request.url,\n      error: 'Internal server error',\n    });\n  }\n}\n```\n\n- Keep one consistent error envelope across the API.\n- Throw framework exceptions for expected client errors; log and wrap unexpected failures centrally.\n\n## Config and Environment Validation\n\n```ts\nConfigModule.forRoot({\n  isGlobal: true,\n  load: [configuration],\n  validate: validateEnv,\n});\n```\n\n- Validate env at boot, not lazily at first request.\n- Keep config access behind typed helpers or config services.\n- Split dev\u002Fstaging\u002Fprod concerns in config factories instead of branching throughout feature code.\n\n## Persistence and Transactions\n\n- Keep repository \u002F ORM code behind providers that speak domain language.\n- For Prisma or TypeORM, isolate transactional workflows in services that own the unit of work.\n- Do not let controllers coordinate multi-step writes directly.\n\n## Testing\n\n```ts\ndescribe('UsersController', () => {\n  let app: INestApplication;\n\n  beforeAll(async () => {\n    const moduleRef = await Test.createTestingModule({\n      imports: [UsersModule],\n    }).compile();\n\n    app = moduleRef.createNestApplication();\n    app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));\n    await app.init();\n  });\n});\n```\n\n- Unit test providers in isolation with mocked dependencies.\n- Add request-level tests for guards, validation pipes, and exception filters.\n- Reuse the same global pipes\u002Ffilters in tests that you use in production.\n\n## Production Defaults\n\n- Enable structured logging and request correlation ids.\n- Terminate on invalid env\u002Fconfig instead of booting partially.\n- Prefer async provider initialization for DB\u002Fcache clients with explicit health checks.\n- Keep background jobs and event consumers in their own modules, not inside HTTP controllers.\n- Make rate limiting, auth, and audit logging explicit for public endpoints.\n",{"name":5,"origin":24,"description":7},"ECC","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa","core\u002Fskills\u002Fnestjs-patterns",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill nestjs-patterns",{"tool":41,"command":42},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill nestjs-patterns",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill nestjs-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fnestjs-patterns\u002FSKILL.md",true,[],[50,58,65,73,81,89],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":54,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":69,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\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":77,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"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":92,"categories":93,"keywords":94,"publishedAt":19},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]