# Nestjs Expert

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

- Repository: https://github.com/Jeffallan/claude-skills (12164 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Jeffallan/claude-skills --skill nestjs-expert -g -a claude-code -y`
Codex: `npx skills add Jeffallan/claude-skills --skill nestjs-expert -g -a codex -y`
Cursor: `npx skills add Jeffallan/claude-skills --skill nestjs-expert -g -a cursor -y`
Gemini CLI: `npx skills add Jeffallan/claude-skills --skill nestjs-expert -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add Jeffallan/claude-skills`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

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

| Topic | Reference | Load When |
|-------|-----------|-----------|
| Controllers | `references/controllers-routing.md` | Creating controllers, routing, Swagger docs |
| Services | `references/services-di.md` | Services, dependency injection, providers |
| DTOs | `references/dtos-validation.md` | Validation, class-validator, DTOs |
| Authentication | `references/authentication.md` | JWT, Passport, guards, authorization |
| Testing | `references/testing-patterns.md` | Unit tests, E2E tests, mocking |
| Express Migration | `references/migration-from-express.md` | Migrating from Express.js to NestJS |

## Code Examples

### Controller with DTO Validation and Swagger

```typescript
// 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';

The rest: https://github.com/Jeffallan/claude-skills/blob/HEAD/skills/nestjs-expert/SKILL.md
