create-nestjs-exception — community create-nestjs-exception, nestjs-infra-template, community, ide skills, Claude Code, Cursor, Windsurf

v1.0
GitHub

About this Skill

Ideal for Full-Stack Agents specializing in NestJS framework, seeking to standardize exception handling and error management. Nestjs Project Starter template

sharifli4 sharifli4
[0]
[0]
Updated: 3/5/2026

Agent Capability Analysis

The create-nestjs-exception skill by sharifli4 is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Ideal for Full-Stack Agents specializing in NestJS framework, seeking to standardize exception handling and error management.

Core Value

Empowers agents to create standardized exceptions following NestJS project patterns, utilizing BaseExceptionDto and ExceptionTypeEnum, while ensuring Swagger documentation compliance for seamless API integration.

Capabilities Granted for create-nestjs-exception

Creating feature-specific exceptions with reusable core exception patterns
Developing custom exceptions with standardized naming conventions
Implementing Swagger documentation for transparent error handling and API communication

! Prerequisites & Limits

  • Requires NestJS project setup
  • Follows specific naming conventions and patterns
  • Needs understanding of ExceptionTypeEnum and BaseExceptionDto
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

create-nestjs-exception

Install create-nestjs-exception, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Create NestJS Exception

Create standardized exceptions following this project's patterns.

Quick Start

When creating an exception:

  1. Check if a core exception exists first - Can you reuse NotFoundException, CustomBadRequestException?
  2. Determine location - Feature-specific or core/reusable?
  3. Follow naming - {Concept}{Action}Exception
  4. Use BaseExceptionDto - Required for all exceptions
  5. Pick ExceptionTypeEnum - From available types
  6. Add Swagger docs - Document in controller

Exception Template

typescript
1// Location: 2// - Feature-specific: src/features/{feature}/exceptions/{exception-name}.exception.ts 3// - Reusable: src/core/exceptions/http/{exception-name}.exception.ts 4 5import { HttpException, HttpStatus } from '@nestjs/common'; 6import { ExceptionTypeEnum, BaseExceptionDto } from '@/core/exceptions'; 7 8/** 9 * Thrown when [describe specific condition] 10 * 11 * @example 12 * throw new {ExceptionName}(identifier); 13 */ 14export class {ExceptionName} extends HttpException { 15 constructor(identifier: string | number) { 16 const baseExceptionDto = BaseExceptionDto.CreateBaseException( 17 [identifier.toString()], 18 HttpStatus.{STATUS_CODE}, 19 ExceptionTypeEnum.{TYPE}, 20 '{Detailed error message}', 21 ); 22 super(baseExceptionDto, HttpStatus.{STATUS_CODE}); 23 } 24}

Available Exception Types

typescript
1ExceptionTypeEnum.BAD_REQUEST // Invalid request data 2ExceptionTypeEnum.NOT_FOUND // Resource not found 3ExceptionTypeEnum.VALIDATION // DTO validation failures 4ExceptionTypeEnum.UNAUTHORIZED // No authentication 5ExceptionTypeEnum.FORBIDDEN // Insufficient permissions 6ExceptionTypeEnum.CONFLICT // Resource conflict 7ExceptionTypeEnum.UNIQUE_VIOLATION // DB unique constraint 8ExceptionTypeEnum.UNPROCESSABLE_ENTITY // Cannot process valid request 9ExceptionTypeEnum.INTERNAL_SERVER_ERROR // Server-side errors

Quick Patterns

Not Found

typescript
1export class {Resource}NotFoundException extends HttpException { 2 constructor(id: string) { 3 const baseExceptionDto = BaseExceptionDto.CreateBaseException( 4 [id], 5 HttpStatus.NOT_FOUND, 6 ExceptionTypeEnum.NOT_FOUND, 7 `{Resource} with ID ${id} not found`, 8 ); 9 super(baseExceptionDto, HttpStatus.NOT_FOUND); 10 } 11}

Validation with Multiple Fields

typescript
1export class Invalid{Resource}DataException extends HttpException { 2 constructor(fields: string[], detail: string) { 3 const baseExceptionDto = BaseExceptionDto.CreateBaseException( 4 fields, 5 HttpStatus.BAD_REQUEST, 6 ExceptionTypeEnum.VALIDATION, 7 detail, 8 ); 9 super(baseExceptionDto, HttpStatus.BAD_REQUEST); 10 } 11}

Business Logic

typescript
1export class {BusinessRule}Exception extends HttpException { 2 constructor(detail: string) { 3 const baseExceptionDto = BaseExceptionDto.CreateBaseException( 4 [], 5 HttpStatus.UNPROCESSABLE_ENTITY, 6 ExceptionTypeEnum.UNPROCESSABLE_ENTITY, 7 detail, 8 ); 9 super(baseExceptionDto, HttpStatus.UNPROCESSABLE_ENTITY); 10 } 11}

Reuse Core Exceptions

Always check first: Can you use an existing core exception?

typescript
1import { 2 CustomBadRequestException, 3 NotFoundException, 4 UnauthorizedException, 5 ForbiddenException, 6 DatabaseOperationException, 7} from '@/core/exceptions'; 8 9// Generic not found 10throw new NotFoundException('User', userId); 11 12// Generic validation 13throw new CustomBadRequestException( 14 ['email'], 15 ExceptionTypeEnum.VALIDATION, 16 'Invalid email format' 17);

Create custom exceptions only when:

  • Core exceptions don't cover the use case
  • You need feature-specific error details
  • You want better type safety

Swagger Documentation

Always document in controllers:

typescript
1import { ApiCustomExceptionResponse } from '@/core/exceptions'; 2 3@Post() 4@ApiCustomExceptionResponse(400, 'Invalid data') 5@ApiCustomExceptionResponse(409, 'Resource conflict') 6async create(@Body() dto: CreateDto) { 7 // Implementation 8}

Checklist

Before creating an exception:

  • Checked if core exceptions can be reused
  • Determined location (feature-specific or core)
  • Name follows {Concept}{Action}Exception format
  • Extends HttpException
  • Uses BaseExceptionDto.CreateBaseException()
  • Includes proper ExceptionTypeEnum
  • Has JSDoc with description and example
  • Target array specifies relevant fields
  • Documented with @ApiCustomExceptionResponse

Rules

NEVER use raw NestJS exceptions:

typescript
1// ❌ WRONG 2throw new BadRequestException('Error'); 3throw new NotFoundException('Not found');

ALWAYS use BaseExceptionDto system:

typescript
1// ✅ CORRECT 2throw new NotFoundException('User', userId); 3// Or create custom 4throw new UserNotFoundException(userId);

⚠️ PREFER core exceptions when possible - don't create unnecessary custom exceptions.

Full Documentation

See .cursor/rules/exceptions.mdc for complete rules and patterns.

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is create-nestjs-exception?

Ideal for Full-Stack Agents specializing in NestJS framework, seeking to standardize exception handling and error management. Nestjs Project Starter template

How do I install create-nestjs-exception?

Run the command: npx killer-skills add sharifli4/nestjs-infra-template/create-nestjs-exception. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for create-nestjs-exception?

Key use cases include: Creating feature-specific exceptions with reusable core exception patterns, Developing custom exceptions with standardized naming conventions, Implementing Swagger documentation for transparent error handling and API communication.

Which IDEs are compatible with create-nestjs-exception?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for create-nestjs-exception?

Requires NestJS project setup. Follows specific naming conventions and patterns. Needs understanding of ExceptionTypeEnum and BaseExceptionDto.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add sharifli4/nestjs-infra-template/create-nestjs-exception. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use create-nestjs-exception immediately in the current project.

Related Skills

Looking for an alternative to create-nestjs-exception or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI