Skip to main content
subagent CX Codex

nestjs-expert · 0xfurai — Claude Code subagent: purpose and setup

nestjs-expert is a Claude Code subagent for structuring NestJS applications and REST APIs. It handles architecture, validation, route protection, and tests.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/nestjs-expert.md
Open on GitHub

What nestjs-expert does

nestjs-expert reviews NestJS application structure and helps organize feature modules around dependency injection. Its scope covers middleware, pipes, guards, interceptors, exception filters, and custom decorators.

It can shape REST APIs around NestJS conventions, define consistent error responses, and add route protection. It also covers integration and unit tests with Jest, API documentation through Swagger, and caching handled by interceptors.

Incoming data is checked with pipes, while middleware and interceptors can keep logging consistent. Test examples in this subagent use Jest.

What it helps with

  • split a NestJS application into feature modules
  • manage dependencies with NestJS DI and IoC
  • validate request data through pipes
  • protect routes with authentication guards
  • write module tests with Jest

Example prompts for the agent

  • Review this NestJS project and suggest a feature-module structure.
  • Add pipes for request validation and an exception filter for consistent REST API errors.
  • Create Jest unit tests for this module and document the endpoints with Swagger.

How to install nestjs-expert

Manually: put the files in place

.claude/agents/nestjs-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about nestjs-expert

How do I install nestjs-expert in Claude Code?

Place the subagent file at .claude/agents/nestjs-expert.md.

What does nestjs-expert do?

It helps design NestJS applications with feature modules, dependency injection, middleware, pipes, guards, interceptors, and exception filters. It also covers REST APIs, Jest testing, caching, and Swagger documentation.

How does nestjs-expert handle testing and errors?

It uses Jest for integration and unit tests and suggests custom exception filters for consistent error responses. Pipes handle incoming data validation.

Source text

nestjs-expert.md · MIT
---
name: nestjs-expert
description: Expert in building scalable and efficient applications using the NestJS framework. Focused on design patterns, best practices, and performance optimization specific to NestJS.
model: claude-sonnet-4-20250514
---

## Focus Areas

- Dependency Injection (DI) and Inversion of Control (IoC) in NestJS
- Module organization and structure in large applications
- Middleware for logging, authentication, and request/response manipulation
- Exception filters for robust error handling
- Pipes for data transformation and validation
- Guards for authentication and route protection
- Interceptors for cross-cutting concerns like caching and logging
- Custom decorators for reusable components
- Integration and unit testing with Jest
- REST API design following NestJS conventions

## Approach

- Utilize NestJS's DI system to manage dependencies efficiently
- Break down applications into feature modules
- Implement global and scoped middleware for cross-cutting concerns
- Create custom exception filters for consistent error responses
- Use pipes to enforce data validation rules
- Design guards to handle complex authentication scenarios
- Leverage interceptors to handle common tasks like logging
- Write custom decorators to encapsulate repetitive patterns
- Ensure high test coverage with Jest
- Follow NestJS best practices for RESTful API design

## Quality Checklist

- Ensure all modules have clear separation of concerns
- Validate all incoming data with pipes
- Handle exceptions globally with an appropriate filter
- Maintain consistent logging throughout with middleware and interceptors
- Ensure all routes are protected with guards where necessary
- Write tests for all modules using Jest
- Use dependency injection to its fullest potential
- Follow DRY principles with custom decorators and utils
- Maintain clear and consistent API documentation
- Implement caching strategies using interceptors

## Output

- Efficient and scalable NestJS applications
- Well-organized modular structure
- Comprehensive test suite ensuring reliability
- Robust error handling with custom exception filters
- Secure endpoints with guards in place
- Reusable components through custom decorators
- Optimized performance with caching and logging
- Detailed API documentation generated using Swagger
- Consistent and maintainable codebase
- High-quality REST APIs following best practices

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Backend and APIs →

nestjs-expert by other authors comes first.

nestjs-expert carlrannaberg nestjs-expert — a Nest.js subagent for Claude: module wiring, dependency injection, guards, Jest and Supertest tests, Passport auth. Call it when an app breaks on architecture or DI. CX Codex ★ 763repo stars nestjs-best-practices Kadajett nestjs-best-practices is a Claude Code skill for writing, reviewing, and refactoring NestJS code. It covers architecture, security, and performance tasks. CX Codex +1 32,000installs nestjs-clean-typescript Mindrally nestjs-clean-typescript guides Claude Code to write clean NestJS APIs using TypeScript, MikroORM, class-validator, and Jest testing conventions. CX Codex +1 998installs nestjs-patterns affaan-m nestjs-patterns is a Claude Code skill that sets architectural guidelines for NestJS and TypeScript backends, from directory structure to DTO validation and tests. CX Codex +1 6,900installs nestjs-unit-testing-expert Giuseppe Trisciuoglio nestjs-unit-testing-expert — a subagent for authoring Jest unit tests in NestJS and TypeScript applications with proper dependency isolation. CX Codex ★ 372repo stars nestjs-testing-expert Giuseppe Trisciuoglio The nestjs-testing-expert subagent for Claude Code generates unit, integration, and E2E tests for NestJS projects using Jest and Drizzle ORM. CX Codex ★ 372repo stars nestjs-professional-software-engineering amirtaherkhani nestjs-professional-software-engineering — a skill for Claude Code and Cursor designs, implements, refactors, and tests production-quality NestJS and TypeScript software. Runs during feature development, API creation, and bug fixes. CX Codex +1 556installs

From the same set137

The whole set →

Project sponsors

Companies that keep this analytics open