Agent skill

NestJS Expert

by Jeffallan in Jeffallan/claude-skills

Scaffolds NestJS modules, controllers, services, DTOs and guards for TypeScript backends, with validation, JWT and Passport auth, Swagger docs and unit and E2E tests.

MITAuto-check passedBackend & APIs

Install NestJS Expert

skills CLI
$ npx skills add Jeffallan/claude-skills --skill nestjs-expert -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Jeffallan/claude-skills nestjs-expert --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Jeffallan/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nestjs-expert .claude/skills/nestjs-expert && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nestjs-expert
GitHub stars
12k
Token cost
~2k tokens
SKILL.md length
351 words
Files
7 (incl. references)
Skills in repo
58
Repo updated
First seen
Licence
MIT

At a glance

Scaffolds NestJS modules, controllers, services, DTOs and guards for TypeScript backends, with validation, JWT and Passport auth, Swagger docs and unit and E2E tests.

  • Works in 6 steps: Analyze requirements — Identify modules,… → Design structure — Plan module… → Implement — Create modules, services,… → …
  • Scaffolding a NestJS module with controller, service and DTOs
  • SKILL.md covers Core Workflow, Reference Guide, Code Examples and Constraints, plus 2 more sections
  • Calls npm

What it does

The agent identifies modules, endpoints, entities and relationships, plans how modules depend on each other, then creates modules, services and controllers with correct dependency injection. The security step adds guards, validation pipes and authentication. Verification runs npm run lint and npm run test and confirms the DI graph with nest info, followed by unit tests for services and E2E tests for controllers.

The rules require @Injectable and constructor injection, never creating services with new, class-validator decorators on DTOs with ValidationPipe enabled globally, and DTOs for all request and response bodies rather than raw req.body. Reference files cover controllers and routing with Swagger, services and DI, DTO validation, JWT and Passport authentication, testing patterns and migrating from Express. The examples use TypeORM repositories.

When your agent uses it

  • Scaffolding a NestJS module with controller, service and DTOs
  • Adding JWT and Passport authentication with guards
  • Validating request bodies with class-validator and ValidationPipe
  • Documenting a NestJS API with Swagger
  • Migrating an Express app to NestJS

Example prompts

  • “Create a users module with a controller, service, TypeORM entity and validated DTOs.”
  • “Add JWT login with Passport and a guard that protects the admin routes.”
  • “Write unit tests for the orders service with a mocked repository.”
  • “Migrate our Express routes for products into NestJS controllers.”

Requirements

  • A NestJS project with npm scripts for lint and test

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  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

What it can do on your machine

Read from SKILL.md and the folder at commit 1be15d8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • synergetic.solutions
    • jeffallan.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

NestJS Expert loads about 2k tokens when it runs, and up to ~14k if it reads all its reference files. Until then it costs about 134 tokens; SKILL.md has 351 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~134
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~14k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Jeffallan/claude-skills at commit 1be15d8, republished under its MIT licence (© Jeffallan). 351 words, ~1,960 tokens.

Download SKILL.mdSave it as .claude/skills/nestjs-expert/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
nestjs-expert
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.
license
MIT
metadata.author
https://github.com/Jeffallan
metadata.company
https://synergetic.solutions
metadata.version
1.1.0
metadata.domain
backend
metadata.triggers
NestJS, Nest, Node.js backend, TypeScript backend, dependency injection, controller, service, module, guard, interceptor
metadata.role
specialist
metadata.scope
implementation
metadata.output-format
code
metadata.related-skills
fullstack-guardian, test-master, devops-engineer

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
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);
  }
}
Service with Dependency Injection and Error Handling
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;
  }
}
Module Definition
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 {}
Unit Test for Service
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);
  });
});

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
Show full SKILL.md (120 more words)Show less
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

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

© Jeffallan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in skills/nestjs-expert of Jeffallan/claude-skills.

  • SKILL.md
  • references/authentication.md
  • references/controllers-routing.md
  • references/dtos-validation.md
  • references/migration-from-express.md
  • references/services-di.md
  • references/testing-patterns.md

Open the folder on GitHubat commit 1be15d8

Compare with similar skills

NestJS Expert next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

NestJS Expert compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
NestJS Expert this skillJeffallan/claude-skills12k—~2kAutomated safety check: PassMIT
VibexRaja0sama/vibex388—~7.8kAutomated safety check: PassMIT
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
Projectsamchon/nestia2.2k—~3kAutomated safety check: PassMIT
Vss Add Nest Moduleopen-edge-platform/edge-ai-libraries169—~2.5kAutomated safety check: PassApache-2.0
Soundcloud API Integrationsoundcloud/api259—~787Automated safety check: PassNone

Similar skills

  • Vibex

    Raja0sama/vibex

    Diagrams and checkable docs from a codebase. An agent skill from Raja0sama/vibex.

    388 GitHub stars~7.8k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Project

    samchon/nestia

    Defines the nestia product contract, workspace layout, package boundaries, the Go plugin composition model, and canonical commands.

    2.2k GitHub stars~3k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Vss Add Nest Module

    open-edge-platform/edge-ai-libraries

    Scaffolds and wires a new NestJS service/module for the Video Search & Summarization sample app's pipeline-manager using the repo's real conventions.

    169 GitHub stars~2.5k tokensUpdated today
    Backend & APIsAuto-check passed
  • Integrates applications with the SoundCloud HTTP API using OAuth 2.1, OpenAPI, and developer docs.

    259 GitHub stars~787 tokensUpdated 9 days ago
    Backend & APIsAuto-check passed
  • Add API Resource

    wso2/agent-manager

    Add or change a REST API resource in agent-manager-service (the Go control plane).

    105 GitHub stars~1.1k tokensUpdated today
    Backend & APIsAuto-check passed

More from Jeffallan/claude-skills

All 58 skills in this repo
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • CLI Developer

    Jeffallan/claude-skills

    Walks through designing, building and polishing a command-line tool: user workflow and command hierarchy, implementation in commander, click, typer or cobra, completions and cross-platform testing.

    12k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Kubernetes Specialist

    Jeffallan/claude-skills

    Creates and checks Kubernetes manifests, Helm charts, RBAC and network policies, and helps debug pod problems, with kubectl checks and rollback steps.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Laravel Specialist

    Jeffallan/claude-skills

    Builds Laravel 10+ applications with Eloquent models, Sanctum authentication, Horizon queues, API resources and Livewire components, tested with Pest or PHPUnit.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Pandas Pro

    Jeffallan/claude-skills

    Handles pandas DataFrame work: cleaning, merging, groupby aggregation, pivots, time-series resampling and memory tuning, with checks on dtypes, shapes and nulls.

    12k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Apache Spark Engineer

    Jeffallan/claude-skills

    Guides writing and tuning Apache Spark jobs: DataFrame and RDD code, Spark SQL, partitioning, caching, shuffle tuning and structured streaming.

    12k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed

Categories

Questions about NestJS Expert

What does NestJS Expert do?

Scaffolds NestJS modules, controllers, services, DTOs and guards for TypeScript backends, with validation, JWT and Passport auth, Swagger docs and unit and E2E tests. The agent identifies modules, endpoints, entities and relationships, plans how modules depend on each other, then creates modules, services and controllers with correct dependency injection. The security step adds guards, validation pipes and authentication.

When should I use NestJS Expert?

NestJS Expert fits situations like: scaffolding a NestJS module with controller, service and DTOs; adding JWT and Passport authentication with guards; validating request bodies with class-validator and ValidationPipe; documenting a NestJS API with Swagger.

How do I install NestJS Expert in Claude Code?

Run `npx skills add Jeffallan/claude-skills --skill nestjs-expert -a claude-code`. Or copy the skill folder (skills/nestjs-expert in Jeffallan/claude-skills) into .claude/skills/nestjs-expert in your project. Claude Code loads it when a task matches its description.

How do I install NestJS Expert in Codex?

Run `npx skills add Jeffallan/claude-skills --skill nestjs-expert -a codex`. Or copy the skill folder (skills/nestjs-expert in Jeffallan/claude-skills) into .agents/skills/nestjs-expert in your project. Codex loads it when a task matches its description.

Can I use NestJS Expert in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Jeffallan/claude-skills --skill nestjs-expert -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nestjs-expert, .gemini/skills/nestjs-expert, .github/skills/nestjs-expert and .opencode/skills/nestjs-expert in your project.

What does NestJS Expert need to run?

Going by SKILL.md and its folder, NestJS Expert needs the command-line tools its instructions call (npm). Our summary lists: A NestJS project with npm scripts for lint and test.

Does NestJS Expert access the network?

SKILL.md names 3 domains. As links in the text: github.com, synergetic.solutions and jeffallan.github.io. This is read from the text; nothing was executed.

Is NestJS Expert safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does NestJS Expert use?

NestJS Expert is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does NestJS Expert use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.

What are the alternatives to NestJS Expert?

Skills that share tags, products or a category with NestJS Expert: Vibex (Raja0sama/vibex, 388 stars), OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars), Project (samchon/nestia, 2.2k stars) and Vss Add Nest Module (open-edge-platform/edge-ai-libraries, 169 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains NestJS Expert?

Jeffallan (a GitHub user) maintains it in Jeffallan/claude-skills, which has 11,788 GitHub stars. The repository holds 58 skills in this directory. The repository was last updated on October 3, 2026.

Source: Jeffallan/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.