nestjs

📁 teachingai/full-stack-skills 📅 Jan 24, 2026
0
总安装量
20
周安装量
安装命令
npx skills add https://github.com/teachingai/full-stack-skills --skill nestjs

Agent 安装分布

gemini-cli 15
opencode 15
claude-code 15
codex 14
github-copilot 13
amp 11

Skill 文档

When to use this skill

Use this skill whenever the user wants to:

  • Build or refactor a NestJS application
  • Implement controllers, providers, and modules
  • Apply middleware, pipes, guards, or interceptors
  • Configure DI scopes, dynamic modules, or lifecycle hooks
  • Add validation, serialization, caching, logging, or queues
  • Integrate GraphQL, WebSockets, or microservices
  • Document APIs with OpenAPI/Swagger
  • Implement authentication/authorization or security hardening
  • Write unit or e2e tests for NestJS

How to use this skill

  1. Identify the topic from the user’s request and find the corresponding example file in the mapping below

  2. Load the appropriate example file from the examples/ directory

  3. Follow the specific instructions in that example file for syntax, structure, and best practices

    Important Notes:

    • All examples follow NestJS official documentation structure
    • Examples include both JavaScript and TypeScript versions where applicable
    • Each example file includes key concepts, code examples, and official documentation links
    • Always check the example file for best practices and common patterns
  4. Use templates from the templates/ directory to speed up common scaffolding

Doc mapping (one-to-one with https://docs.nestjs.com/)

Overview (概览)

Fundamentals (基础)

Techniques (技巧)

Security (安全)

GraphQL

WebSockets

Microservices

OpenAPI (Swagger)

CLI & Testing & Recipes

Examples and Templates

This skill includes detailed examples organized to match the NestJS official documentation structure (https://docs.nestjs.com/). All examples are in the examples/ directory, organized by topic (see mapping above).

To use examples:

  • Identify the topic from the user’s request
  • Load the appropriate example file from the mapping above
  • Follow the instructions, syntax, and best practices in that file
  • Adapt the code examples to your specific use case

To use templates:

  • Reference templates in templates/ directory for common scaffolding
  • Templates include: controller, provider, module, middleware, guard, pipe, interceptor, exception filter, DTO, and project structure
  • Adapt templates to your specific needs and coding style

Best Practices

  1. Use dependency injection: Leverage NestJS DI container for better testability and maintainability
  2. Organize by modules: Group related functionality into feature modules
  3. Use decorators consistently: Follow NestJS decorator patterns for controllers, providers, and routes
  4. Validate input data: Use ValidationPipe and DTOs for request validation
  5. Handle errors gracefully: Implement global exception filters for consistent error handling
  6. Use guards for authorization: Protect routes with guards rather than inline checks
  7. Leverage interceptors: Use interceptors for cross-cutting concerns like logging and transformation
  8. Type safety: Use TypeScript for better type safety and developer experience
  9. Test thoroughly: Write unit tests for services and E2E tests for API endpoints
  10. Follow official patterns: Refer to official documentation for recommended patterns and practices

Resources

Keywords

NestJS, Node.js, framework, controller, provider, module, middleware, exception filter, pipe, guard, interceptor, dependency injection, GraphQL, WebSocket, microservice, OpenAPI, Swagger, testing, validation, caching, logging, TypeScript, decorator, DI, IoC, 控制器, 提供者, 模块, 中间件, 守卫, 管道, 拦截器, 依赖注入