Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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 testin
.claude/skills/jeffallan-nestjs-expert/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 320% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 90% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 251% | 0% |
Senior NestJS specialist with deep expertise in enterprise-grade, scalable TypeScript backend applications.
npm run lint, npm run test, and confirm DI graph with nest infoLoad 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 |
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: '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); } }
typescript// 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; } }
typescript// 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 {}
typescript// 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); }); });
@Injectable() and constructor injection for all services — never instantiate services with newclass-validator decorators on DTOs and enable ValidationPipe globallyreq.body to servicesNotFoundException, ConflictException, etc.) in services@ApiTags, @ApiOperation, and response decoratorsTest.createTestingModuleConfigModule and process.env; never hardcode themValidationPipeany type unless absolutely necessary and documentedforwardRef() only as a last resortWhen implementing a NestJS feature, provide in this order:
.module.ts).controller.ts).service.ts)class-validator decorators (dto/*.dto.ts)*.service.spec.ts)NestJS, TypeScript, TypeORM, Prisma, Passport, JWT, class-validator, class-transformer, Swagger/OpenAPI, Jest, Supertest, Guards, Interceptors, Pipes, Filters
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 25,035 | 19,065 | -24% | 1 | 1 | 0% | 6,213 | 7,051 | +13% | 0 | 0 | — |
case-02 | fail→fail | 15,747 | 14,352 | -9% | 1 | 1 | 0% | 3,968 | 5,517 | +39% | 0 | 0 | — |
case-03 | fail→pass | 24,202 | 20,047 | -17% | 1 | 1 | 0% | 5,912 | 7,162 | +21% | 0 | 0 | — |
case-04 | fail→pass | 11,686 | 9,354 | -20% | 1 | 1 | 0% | 2,410 | 3,912 | +62% | 0 | 0 | — |
case-05 | fail→pass | 5,054 | 10,050 | +99% | 1 | 1 | 0% | 928 | 3,899 | +320% | 0 | 0 | — |
case-06 | fail→pass | 7,910 | 7,037 | -11% | 1 | 1 | 0% | 1,672 | 3,184 | +90% | 0 | 0 | — |
case-07 | fail→fail | 11,954 | 15,339 | +28% | 1 | 1 | 0% | 2,304 | 5,464 | +137% | 0 | 0 | — |
case-08 | fail→pass | 8,836 | 16,302 | +84% | 1 | 1 | 0% | 1,715 | 6,019 | +251% | 0 | 0 | — |
case-09 | fail→pass | 25,542 | 21,364 | -16% | 1 | 1 | 0% | 4,537 | 6,859 | +51% | 0 | 0 | — |
case-10 | fail→pass | 21,361 | 20,097 | -6% | 1 | 1 | 0% | 5,193 | 6,424 | +24% | 0 | 0 | — |
case-11 | fail→pass | 8,619 | 12,314 | +43% | 1 | 1 | 0% | 1,713 | 4,471 | +161% | 0 | 0 | — |
case-12 | pass→pass | 13,079 | 11,702 | -11% | 1 | 1 | 0% | 2,378 | 4,156 | +75% | 0 | 0 | — |
case-13 | fail→pass | 7,229 | 14,091 | +95% | 1 | 1 | 0% | 1,370 | 4,451 | +225% | 0 | 0 | — |
case-14 | fail→fail | 5,341 | 8,496 | +59% | 1 | 1 | 0% | 1,018 | 3,704 | +264% | 0 | 0 | — |
case-15 | pass→pass | 12,617 | 10,451 | -17% | 1 | 1 | 0% | 2,394 | 3,939 | +65% | 0 | 0 | — |
case-16 | pass→pass | 7,022 | 10,433 | +49% | 1 | 1 | 0% | 1,302 | 4,153 | +219% | 0 | 0 | — |
case-17 | pass→pass | 9,608 | 14,583 | +52% | 1 | 1 | 0% | 2,284 | 4,988 | +118% | 0 | 0 | — |
case-18 | pass→pass | 18,146 | 5,111 | -72% | 1 | 1 | 0% | 1,908 | 2,782 | +46% | 0 | 0 | — |
case-19 | pass→pass | 3,711 | 3,945 | +6% | 1 | 1 | 0% | 767 | 2,654 | +246% | 0 | 0 | — |
case-20 | pass→pass | 8,102 | 6,597 | -19% | 1 | 1 | 0% | 1,608 | 3,047 | +89% | 0 | 0 | — |
case-21 | pass→pass | 5,484 | 6,257 | +14% | 1 | 1 | 0% | 1,274 | 3,110 | +144% | 0 | 0 | — |
case-22 | fail→fail | 16,847 | 22,270 | +32% | 1 | 1 | 0% | 4,400 | 7,667 | +74% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +41 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.