Skills

Nestjs Expert

Creates and configures NestJS modules, controllers, services, DTOs, guards, and...

Install

npx skills add Jeffallan/claude-skills --skill nestjs-expert -g -a claude-code -y
Category
Testing
Updated
5d ago
License
MIT
Context cost
Mediumabout 1,718 tokens
Runs scripts
No, instructions only

What it does

Creates and configures NestJS modules, controllers, services, DTOs, guards, and interceptors for enterprise-grade TypeScript backend applications. Use when building NestJS REST APIs or GraphQL services, implementing dependency injection, scaffolding modular architecture, adding JWT/Passport authentication, integrating TypeORM or Prisma, or working with .module.ts, .controller.ts, and .service.ts files. Invoke for guards, interceptors, pipes, validation, Swagger documentation, and unit/E2E testing in NestJS projects.

NestJS Expert

Senior NestJS specialist with deep expertise in enterprise-grade, scalable TypeScript backend applications.

Core Workflow

  1. Analyze requirements, Identify modules, endpoints, entities, and relationships
  2. Design structure, Plan module organization and inter-module dependencies
  3. Implement, Create modules, services, and controllers with proper DI wiring
  4. Secure, Add guards, validation pipes, and authentication
  5. Verify, Run npm run lint, npm run test, and confirm DI graph with nest info
  6. Test, Write unit tests for services and E2E tests for controllers

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Controllersreferences/controllers-routing.mdCreating controllers, routing, Swagger docs
Servicesreferences/services-di.mdServices, dependency injection, providers
DTOsreferences/dtos-validation.mdValidation, class-validator, DTOs
Authenticationreferences/authentication.mdJWT, Passport, guards, authorization
Testingreferences/testing-patterns.mdUnit tests, E2E tests, mocking
Express Migrationreferences/migration-from-express.mdMigrating from Express.js to NestJS

Code Examples

Controller with DTO Validation and Swagger

// create-user.dto.ts
import { IsEmail, IsString, MinLength } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateUserDto {
  @ApiProperty({ example: 'user@example.com' })
  @IsEmail()
  email: string;

  @ApiProperty({ example: '<password>', minLength: 8 })
  @IsString()
  @MinLength(8)
  password: string;
}

// users.controller.ts
import { Body, Controller, Post, HttpCode, HttpStatus } from '@nestjs/common';
import { ApiCreatedResponse, ApiTags } from '@nestjs/swagger';
import { UsersService } from './users.service';
import { CreateUserDto } from './dto/create-user.dto';
Read the whole SKILL.md on GitHub

More in Testing