Nestjs Expert

Creates and configures NestJS modules, controllers, services, DTOs, guards, and interceptors for enterprise-grade TypeScript backend applications.

Development / Backenddevelopmentbackend
by AgentVoltv1.0.0Published 1y ago1 install
Free to sign up · every skill included with AgentVolt Pro

Before & after

Same prompt, same agent — the only difference is the skill.

PromptBuild a NestJS endpoint that validates and creates a user account.
Beforegeneric AI agent
You'll want to create a controller that handles the HTTP request, a service to handle the business logic, and a DTO to validate the input. NestJS uses decorators and dependency injection, so you'll need to set up the module structure. Add validation decorators to the DTO fields. You might also want to include error handling and consider using a pipe to validate the incoming data. Would you like me to walk through each piece separately?
Afterwith Nestjs Expert
NESTJS USER CREATION ENDPOINT (complete module)

FILE: src/users/create-user.dto.ts
export class CreateUserDto {
  @IsEmail()
  email: string;
  @IsString() @MinLength(8) @MaxLength(64)
  password: string;
  @IsString() @MinLength(2) @MaxLength(50)
  firstName: string;
}

FILE: src/users/users.service.ts
@Injectable()
export class UsersService {
  constructor(private prisma: PrismaService, private hash: HashService) {}
  
  async createUser(dto: CreateUserDto) {
    const existing = await this.prisma.user.findUnique({where: {email: dto.email}});
    if (existing) throw new ConflictException("Email already registered");
    
    const hashed = await this.hash.bcrypt(dto.password);
    return this.prisma.user.create({
      data: {email: dto.email, hashedPassword: hashed, firstName: dto.firstName},
      select: {id: true, email: true, firstName: true, createdAt: true}
    });
  }
}

FILE: src/users/users.controller.ts
@Controller("users")
export class UsersController {
  constructor(private users: UsersService) {}
  
  @Post()
  @HttpCode(201)
  async register(@Body(new ValidationPipe()) dto: CreateUserDto) {
    return this.users.createUser(dto);
  }
}

FILE: src/users/users.module.ts
@Module({
  imports: [PrismaModule],
  controllers: [UsersController],
  providers: [UsersService, HashService]
})
export class UsersModule {}

RESULT: POST /users with CreateUserDto triggers validation, hashes password, checks uniqueness, persists to database, returns sanitized user object (no password hash). Errors: 400 for validation, 409 for duplicate email, 500 for database failure.

About this skill


name: nestjs-expert description: Use when Creates and configures NestJS modules, controllers, services, DTOs, guards, and interceptors for enterprise-grade TypeScript backend applications.

Nestjs Expert

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.

What you get

  • Public GitHub repo
  • the skills/nestjs-expert folder with SKILL.md and references.

Customize your output

  • Fork the repo and extend the skill's reference files for your own stack conventions.

Example output

Activates on a matching request (e.g. building or reviewing Nestjs Expert code) and can chain with other skills in the pack.

Best for

Full-stack developers and engineering teams using Claude Code.

SKILL.md preview

SKILL.md
---
name: nestjs-expert
description: Use this skill when building NestJS REST or GraphQL services, scaffolding modules, controllers, and services, or wiring up guards, interceptors, and TypeORM or Prisma integration.
version: 1.0.0
category: Development / Backend
author: AgentVolt
license: proprietary
tags:
  - development
  - backend
---

# Nestjs Expert

Creates and configures NestJS modules, controllers, services, DTOs, guards, and interceptors for enterprise-grade TypeScript backend applications.

## When to use

… (sign up to view the full skill)
Sign up to view, copy, and install the full skill

More development skills

View all Development skills →