Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
jeffallan avatar

Nestjs Expert

  • 4.3k installs
  • 10.8k repo stars
  • Updated May 20, 2026
  • jeffallan/claude-skills

nestjs-expert is an agent skill: Creates and configures NestJS modules, controllers, services, DTOs, guards, and interceptors for enterprise-grade TypeScript backend applica

About

The nestjs-expert skill 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

  • Covers nestjs-expert quick start, workflow steps, and reference pointers from SKILL.md.
  • Tagged for stage build and subphase backend in the closed Skillselion taxonomy.
  • Documents prerequisites, permissions filesystem, shell, and compatible agents.
  • Includes AEO tagMeta with task queries, keywords, and evidence quotes for discovery.
  • Cross-links related skills and generated REFERENCE.md tables where the repo provides them.

Nestjs Expert by the numbers

  • 4,284 all-time installs (skills.sh)
  • +127 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #153 of 4,386 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

nestjs-expert capabilities & compatibility

Capabilities
nestjs expert documented workflow · quick start examples · reference parameter lookup · taxonomy aligned metadata · aeo discovery fields
Use cases
api development · testing
From the docs

What nestjs-expert says it does

Creates and configures NestJS modules, controllers, services, DTOs, guards, and interceptors for ent
SKILL.md
npx skills add https://github.com/jeffallan/claude-skills --skill nestjs-expert

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs4.3k
repo stars10.8k
Security audit3 / 3 scanners passed
Last updatedMay 20, 2026
Repositoryjeffallan/claude-skills

How do I run nestjs-expert correctly without guessing steps, tools, or parameters?

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 se

Who is it for?

Teams using nestjs-expert when SKILL.md triggers match the user request.

Skip if: Skip when the task is outside nestjs-expert documented triggers or sibling skill scope.

When should I use this skill?

User mentions nestjs-expert, related trigger phrases, or asks to follow this SKILL.md workflow.

What you get

Completed nestjs-expert workflow with outputs and checks defined in SKILL.md.

  • nestjs-expert output per SKILL.md

By the numbers

  • Stage build/backend
  • Category Backend & APIs
  • Complexity advanced

Files

SKILL.mdMarkdownGitHub ↗

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: 'strongPassword123', 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';

@ApiTags('users')
@Controller('users')
export class UsersController {
  constructor(private readonly usersService: UsersService) {}

  @Post()
  @HttpCode(HttpStatus.CREATED)
  @ApiCreatedResponse({ description: 'User created successfully.' })
  create(@Body() createUserDto: CreateUserDto) {
    return this.usersService.create(createUserDto);
  }
}

Service with Dependency Injection and Error Handling

// users.service.ts
import { Injectable, ConflictException, NotFoundException } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { User } from './entities/user.entity';
import { CreateUserDto } from './dto/create-user.dto';

@Injectable()
export class UsersService {
  constructor(
    @InjectRepository(User)
    private readonly usersRepository: Repository<User>,
  ) {}

  async create(createUserDto: CreateUserDto): Promise<User> {
    const existing = await this.usersRepository.findOneBy({ email: createUserDto.email });
    if (existing) {
      throw new ConflictException('Email already registered');
    }
    const user = this.usersRepository.create(createUserDto);
    return this.usersRepository.save(user);
  }

  async findOne(id: number): Promise<User> {
    const user = await this.usersRepository.findOneBy({ id });
    if (!user) {
      throw new NotFoundException(`User #${id} not found`);
    }
    return user;
  }
}

Module Definition

// users.module.ts
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UsersController } from './users.controller';
import { UsersService } from './users.service';
import { User } from './entities/user.entity';

@Module({
  imports: [TypeOrmModule.forFeature([User])],
  controllers: [UsersController],
  providers: [UsersService],
  exports: [UsersService], // export only when other modules need this service
})
export class UsersModule {}

Unit Test for Service

// users.service.spec.ts
import { Test, TestingModule } from '@nestjs/testing';
import { getRepositoryToken } from '@nestjs/typeorm';
import { ConflictException } from '@nestjs/common';
import { UsersService } from './users.service';
import { User } from './entities/user.entity';

const mockRepo = {
  findOneBy: jest.fn(),
  create: jest.fn(),
  save: jest.fn(),
};

describe('UsersService', () => {
  let service: UsersService;

  beforeEach(async () => {
    const module: TestingModule = await Test.createTestingModule({
      providers: [
        UsersService,
        { provide: getRepositoryToken(User), useValue: mockRepo },
      ],
    }).compile();
    service = module.get<UsersService>(UsersService);
    jest.clearAllMocks();
  });

  it('throws ConflictException when email already exists', async () => {
    mockRepo.findOneBy.mockResolvedValue({ id: 1, email: 'user@example.com' });
    await expect(
      service.create({ email: 'user@example.com', password: 'pass1234' }),
    ).rejects.toThrow(ConflictException);
  });
});

Constraints

MUST DO

  • Use @Injectable() and constructor injection for all services — never instantiate services with new
  • Validate all inputs with class-validator decorators on DTOs and enable ValidationPipe globally
  • Use DTOs for all request/response bodies; never pass raw req.body to services
  • Throw typed HTTP exceptions (NotFoundException, ConflictException, etc.) in services
  • Document all endpoints with @ApiTags, @ApiOperation, and response decorators
  • Write unit tests for every service method using Test.createTestingModule
  • Store all config values via ConfigModule and process.env; never hardcode them

MUST NOT DO

  • Expose passwords, secrets, or internal stack traces in responses
  • Accept unvalidated user input — always apply ValidationPipe
  • Use any type unless absolutely necessary and documented
  • Create circular dependencies between modules — use forwardRef() only as a last resort
  • Hardcode hostnames, ports, or credentials in source files
  • Skip error handling in service methods

Output Templates

When implementing a NestJS feature, provide in this order: 1. Module definition (.module.ts) 2. Controller with Swagger decorators (.controller.ts) 3. Service with typed error handling (.service.ts) 4. DTOs with class-validator decorators (dto/*.dto.ts) 5. Unit tests for service methods (*.service.spec.ts)

Knowledge Reference

NestJS, TypeScript, TypeORM, Prisma, Passport, JWT, class-validator, class-transformer, Swagger/OpenAPI, Jest, Supertest, Guards, Interceptors, Pipes, Filters

Documentation

Related skills

How it compares

nestjs-expert implements its own SKILL.md workflow rather than a generic substitute skill.

FAQ

Who is nestjs-expert for?

Agents and developers following the nestjs-expert SKILL.md guidance.

When should I use nestjs-expert?

When user intent matches description triggers and quick start scenarios.

Is nestjs-expert safe to install?

Review the Security Audits panel before production shell or network use.

Backend & APIsbackendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.