nestjs

Provides comprehensive guidance for NestJS using the official documentation. Use when the user asks about NestJS architecture, controllers, providers, modules, middleware, guards, pipes, interceptors, dependency injection, GraphQL, WebSockets, microservices, OpenAPI/Swagger, security, or testing.

261 stars

Best use case

nestjs is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Provides comprehensive guidance for NestJS using the official documentation. Use when the user asks about NestJS architecture, controllers, providers, modules, middleware, guards, pipes, interceptors, dependency injection, GraphQL, WebSockets, microservices, OpenAPI/Swagger, security, or testing.

Provides comprehensive guidance for NestJS using the official documentation. Use when the user asks about NestJS architecture, controllers, providers, modules, middleware, guards, pipes, interceptors, dependency injection, GraphQL, WebSockets, microservices, OpenAPI/Swagger, security, or testing.

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "nestjs" skill to help with this workflow task. Context: Provides comprehensive guidance for NestJS using the official documentation. Use when the user asks about NestJS architecture, controllers, providers, modules, middleware, guards, pipes, interceptors, dependency injection, GraphQL, WebSockets, microservices, OpenAPI/Swagger, security, or testing.

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/nestjs/SKILL.md --create-dirs "https://raw.githubusercontent.com/partme-ai/full-stack-skills/main/skills/nodejs-skills/nestjs/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/nestjs/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How nestjs Compares

Feature / AgentnestjsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Provides comprehensive guidance for NestJS using the official documentation. Use when the user asks about NestJS architecture, controllers, providers, modules, middleware, guards, pipes, interceptors, dependency injection, GraphQL, WebSockets, microservices, OpenAPI/Swagger, security, or testing.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

## 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 (概览)**
- `examples/overview/introduction.md` → https://docs.nestjs.com/
- `examples/fundamentals/first-steps.md` → https://docs.nestjs.com/first-steps
- `examples/fundamentals/controllers.md` → https://docs.nestjs.com/controllers
- `examples/fundamentals/providers.md` → https://docs.nestjs.com/providers
- `examples/fundamentals/modules.md` → https://docs.nestjs.com/modules
- `examples/fundamentals/middleware.md` → https://docs.nestjs.com/middleware
- `examples/fundamentals/exception-filters.md` → https://docs.nestjs.com/exception-filters
- `examples/fundamentals/pipes.md` → https://docs.nestjs.com/pipes
- `examples/fundamentals/guards.md` → https://docs.nestjs.com/guards
- `examples/fundamentals/interceptors.md` → https://docs.nestjs.com/interceptors
- `examples/overview/custom-decorators.md` → https://docs.nestjs.com/custom-decorators

**Fundamentals (基础)**
- `examples/fundamentals/custom-providers.md` → https://docs.nestjs.com/fundamentals/custom-providers
- `examples/fundamentals/async-providers.md` → https://docs.nestjs.com/fundamentals/async-providers
- `examples/fundamentals/dynamic-modules.md` → https://docs.nestjs.com/fundamentals/dynamic-modules
- `examples/fundamentals/module-ref.md` → https://docs.nestjs.com/fundamentals/module-ref
- `examples/fundamentals/execution-context.md` → https://docs.nestjs.com/fundamentals/execution-context
- `examples/fundamentals/lifecycle-events.md` → https://docs.nestjs.com/fundamentals/lifecycle-events
- `examples/fundamentals/injection-scopes.md` → https://docs.nestjs.com/fundamentals/injection-scopes
- `examples/fundamentals/request-scoped.md` → https://docs.nestjs.com/fundamentals/request-scoped
- `examples/fundamentals/circular-dependency.md` → https://docs.nestjs.com/fundamentals/circular-dependency

**Techniques (技巧)**
- `examples/techniques/configuration.md` → https://docs.nestjs.com/techniques/configuration
- `examples/techniques/validation.md` → https://docs.nestjs.com/techniques/validation
- `examples/techniques/serialization.md` → https://docs.nestjs.com/techniques/serialization
- `examples/techniques/caching.md` → https://docs.nestjs.com/techniques/caching
- `examples/techniques/logger.md` → https://docs.nestjs.com/techniques/logger
- `examples/techniques/events.md` → https://docs.nestjs.com/techniques/events
- `examples/techniques/task-scheduling.md` → https://docs.nestjs.com/techniques/task-scheduling
- `examples/techniques/queues.md` → https://docs.nestjs.com/techniques/queues
- `examples/techniques/file-upload.md` → https://docs.nestjs.com/techniques/file-upload
- `examples/techniques/streaming-files.md` → https://docs.nestjs.com/techniques/streaming-files
- `examples/techniques/database.md` → https://docs.nestjs.com/techniques/database
- `examples/techniques/mongodb.md` → https://docs.nestjs.com/techniques/mongodb
- `examples/techniques/mongoose.md` → https://docs.nestjs.com/techniques/mongoose
- `examples/techniques/sequelize.md` → https://docs.nestjs.com/techniques/sequelize
- `examples/techniques/prisma.md` → https://docs.nestjs.com/recipes/prisma

**Security (安全)**
- `examples/security/authentication.md` → https://docs.nestjs.com/security/authentication
- `examples/security/authorization.md` → https://docs.nestjs.com/security/authorization
- `examples/security/helmet.md` → https://docs.nestjs.com/security/helmet
- `examples/security/cors.md` → https://docs.nestjs.com/security/cors
- `examples/security/rate-limiting.md` → https://docs.nestjs.com/security/rate-limiting

**GraphQL**
- `examples/graphql/quick-start.md` → https://docs.nestjs.com/graphql/quick-start
- `examples/graphql/resolvers.md` → https://docs.nestjs.com/graphql/resolvers
- `examples/graphql/scalars.md` → https://docs.nestjs.com/graphql/scalars
- `examples/graphql/interfaces.md` → https://docs.nestjs.com/graphql/interfaces
- `examples/graphql/unions.md` → https://docs.nestjs.com/graphql/unions
- `examples/graphql/directives.md` → https://docs.nestjs.com/graphql/directives
- `examples/graphql/plugins.md` → https://docs.nestjs.com/graphql/plugins
- `examples/graphql/subscriptions.md` → https://docs.nestjs.com/graphql/subscriptions
- `examples/graphql/federation.md` → https://docs.nestjs.com/graphql/federation
- `examples/graphql/migration.md` → https://docs.nestjs.com/graphql/migration

**WebSockets**
- `examples/websockets/gateways.md` → https://docs.nestjs.com/websockets/gateways
- `examples/websockets/exception-filters.md` → https://docs.nestjs.com/websockets/exception-filters
- `examples/websockets/guards.md` → https://docs.nestjs.com/websockets/guards
- `examples/websockets/interceptors.md` → https://docs.nestjs.com/websockets/interceptors
- `examples/websockets/adapters.md` → https://docs.nestjs.com/websockets/adapters

**Microservices**
- `examples/microservices/basics.md` → https://docs.nestjs.com/microservices/basics
- `examples/microservices/redis.md` → https://docs.nestjs.com/microservices/redis
- `examples/microservices/mqtt.md` → https://docs.nestjs.com/microservices/mqtt
- `examples/microservices/nats.md` → https://docs.nestjs.com/microservices/nats
- `examples/microservices/kafka.md` → https://docs.nestjs.com/microservices/kafka
- `examples/microservices/grpc.md` → https://docs.nestjs.com/microservices/grpc
- `examples/microservices/rabbitmq.md` → https://docs.nestjs.com/microservices/rabbitmq
- `examples/microservices/custom-transport.md` → https://docs.nestjs.com/microservices/custom-transport
- `examples/microservices/hybrid-application.md` → https://docs.nestjs.com/microservices/hybrid-application

**OpenAPI (Swagger)**
- `examples/openapi/introduction.md` → https://docs.nestjs.com/openapi/introduction
- `examples/openapi/operations.md` → https://docs.nestjs.com/openapi/operations
- `examples/openapi/types-and-parameters.md` → https://docs.nestjs.com/openapi/types-and-parameters
- `examples/openapi/security.md` → https://docs.nestjs.com/openapi/security
- `examples/openapi/mapped-types.md` → https://docs.nestjs.com/openapi/mapped-types

**CLI & Testing & Recipes**
- `examples/cli/overview.md` → https://docs.nestjs.com/cli/overview
- `examples/testing/unit-testing.md` → https://docs.nestjs.com/fundamentals/testing
- `examples/testing/e2e-testing.md` → https://docs.nestjs.com/fundamentals/testing
- `examples/recipes/cqrs.md` → https://docs.nestjs.com/recipes/cqrs
- `examples/recipes/mikroorm.md` → https://docs.nestjs.com/recipes/mikroorm
- `examples/recipes/terminus.md` → https://docs.nestjs.com/recipes/terminus
- `examples/faq.md` → https://docs.nestjs.com/faq

## 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

- **Official Documentation**: https://docs.nestjs.com/
- **GitHub Repository**: https://github.com/nestjs/nest

## 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, 控制器, 提供者, 模块, 中间件, 守卫, 管道, 拦截器, 依赖注入

Related Skills

vant-vue3

261
from partme-ai/full-stack-skills

Provides structured guidance for Vant of Vue 3.0. Use when the user needs Vant with Vue 3, asks about mobile UI components such as Button, Cell, Form, Dialog, Toast, Popup, ConfigProvider, theme customization, project setup, or wants to implement mobile-first interfaces with vant or van- components.

layui-vue3

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Layui Vue component library including components, layer dialogs, and utilities. Use when the user asks about Layui Vue, needs to use Layui components in Vue 3, or implement UI components.

element-plus-vue3

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Element Plus Vue 3 component library including installation, components, themes, internationalization, and API reference. Use when the user asks about Element Plus for Vue 3, needs to build Vue 3 applications with Element Plus, or customize component styles.

bootstrap-vue3

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Bootstrap Vue 3 component library including Bootstrap components, grid system, utilities, and Vue 3 integration. Use when the user asks about Bootstrap Vue 3, needs to use Bootstrap components in Vue 3, or implement responsive layouts.

vuex-vue2

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Vuex 2.x state management in Vue 2 applications including state, mutations, actions, getters, modules, and plugins. Use when the user asks about Vuex for Vue 2, needs to manage state in Vue 2 applications, or implement Vuex patterns.

vue3

261
from partme-ai/full-stack-skills

Guidance for Vue 3 using the official guide and API reference. Use when the user needs Vue 3 concepts, patterns, or API details to build components, apps, and tooling.

vue2

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Vue 2.x development including Options API, components, directives, lifecycle hooks, computed properties, watchers, Vuex state management, and Vue Router. Use when the user asks about Vue 2, needs to create Vue 2 components, implement reactive data binding, handle component communication, or work with Vue 2 ecosystem tools.

vue-router

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Vue Router including route configuration, navigation, dynamic routes, nested routes, route guards, programmatic navigation, and route meta. Use when the user asks about Vue Router, needs to set up routing, implement navigation guards, handle route parameters, or manage route transitions.

vue-router-v4

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Vue Router v4 including route configuration, navigation, nested routes, route guards, and Vue 3 integration. Use when the user asks about Vue Router v4, needs to set up routing for Vue 3 applications, implement navigation guards, or work with Vue Router v4 features.

vue-router-v3

261
from partme-ai/full-stack-skills

Guidance for Vue Router v3 using the official Installation, Guide, and API docs. Use when users need routing setup, navigation patterns, or API details for Vue 2 projects.

pinia

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Pinia state management including stores, state, getters, actions, plugins, and TypeScript support. Use when the user asks about Pinia, needs to manage application state, create stores, implement state persistence, or migrate from Vuex.

vscode-project-init

261
from partme-ai/full-stack-skills

Scaffold a new VS Code extension project using TypeScript via Yeoman generator (yo code), creating src/extension.ts entry point and package.json manifest. Use when the user wants to start a new VS Code extension project from scratch.