Awesome-jetbrains-claude nest-dev
Professional NestJS backend development. Covers module creation, controllers, services, Mongoose schemas, DTOs with class-validator, guards, interceptors, caching with Redis, cursor-based pagination, JWT authentication decorators, and TypeScript patterns. Use this skill when working on any backend code - creating or editing modules, adding endpoints, writing services, defining schemas/DTOs, configuring guards/interceptors, or following project conventions. Triggers on any NestJS, Mongoose, MongoDB, backend API, DTO, guard, interceptor, or server architecture task within this project.
git clone https://github.com/IliyaBrook/awesome-jetbrains-claude
T=$(mktemp -d) && git clone --depth=1 https://github.com/IliyaBrook/awesome-jetbrains-claude "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/nest-dev" ~/.claude/skills/iliyabrook-awesome-jetbrains-claude-nest-dev && rm -rf "$T"
.claude/skills/nest-dev/SKILL.mdProject Stack
- NestJS 11 + TypeScript 5.7 (target ES2023, nodenext modules)
- MongoDB + Mongoose 9 (
)@nestjs/mongoose - JWT auth via
+@nestjs/jwt
(Google OAuth)@nestjs/passport - Redis caching via
+cache-manager
(in-memory fallback)@keyv/redis
+class-validator
for DTO validationclass-transformer
for OpenAPI docs@nestjs/swagger
for rate limiting (3 tiers)@nestjs/throttler
for health checks@nestjs/terminus- Helmet + compression + CORS middleware
- Jest 30 + supertest for testing
Critical Rules
- Barrel exports — every new file MUST be exported from its
index.ts - Named exports only — no
export default - DRY — extract shared logic into services/utils, never copy-paste
- Types co-located — export interfaces from the file that defines them (schema, service, DTO)
- Path aliases with
extension —.js
(nodenext resolution)import { X } from '#modules/auth/index.js' - Aliases:
,#modules/*
,#shared/*
,#common/*
,#config/*#email-templates/* - Swagger decorators — every controller endpoint MUST have
,@ApiTags
,@ApiOperation@ApiResponse - Auth by default — all routes require JWT; use
to opt out@Public() - Ownership checks — services must verify
matches the document owneruserId
Workflow: New Module
- Create directory
src/modules/feature-name/ - Create schema:
(Mongoosefeature-name.schema.ts
+@Schema
)@Prop - Create DTOs:
,dto/create-feature.dto.ts
,dto/update-feature.dto.tsdto/index.ts - Create service:
(feature-name.service.ts
, inject model)@Injectable() - Create controller:
(REST endpoints + Swagger)feature-name.controller.ts - Create module:
(register schema, providers, exports)feature-name.module.ts - Create barrel:
(export everything)index.ts - Register module in
src/app.module.ts
See references/modules.md for complete templates.
Workflow: New Endpoint
- Add method to controller with HTTP decorator (
,@Get
,@Post
,@Patch
)@Delete - Add Swagger decorators:
,@ApiBearerAuth()
,@ApiOperation@ApiResponse - Use
for authenticated user ID@CurrentUser('sub') - Use
,@Body()
,@Param()
for input extraction@Query() - Create/update DTO if new input is needed
- Implement business logic in service (not controller)
- Controllers are thin — delegate to service, return result
See references/modules.md for controller and service patterns.
Workflow: New Schema
- Create
feature-name.schema.ts - Define
FeatureDocument = HydratedDocument<Feature> - Use
@Schema({ timestamps: true, collection: 'features' }) - Use
with options:@Prop()
,required
,unique
,default
,enum
,ref
,selectindex - For refs:
@Prop({ type: Types.ObjectId, ref: 'OtherModel' }) - Export
FeatureSchema = SchemaFactory.createForClass(Feature) - Add compound indexes after schema creation
See references/database.md for schema and DTO templates.
Workflow: New DTO
- Create
dto/create-feature.dto.ts - Use
decorators:class-validator
,@IsString
,@IsNotEmpty
,@IsOptional
, etc.@IsMongoId - Add
/@ApiProperty
with@ApiPropertyOptional
valuesexample - For updates:
export class UpdateFeatureDto extends PartialType(CreateFeatureDto) {} - Export from
dto/index.ts
See references/database.md for DTO patterns and validation decorators.
Workflow: Cursor-Based Pagination
- Accept
(PaginationDto
) from{ limit?, cursor? }#shared/index.js - Return
(PaginatedResponse<T>
){ data, nextCursor, hasMore } - Query with
to detectlimit + 1hasMore - Build compound cursor from last item (e.g.,
)date_id - Use
with cursor for consistent sort order$or
See references/database.md for pagination implementation.
Workflow: Guard / Interceptor / Pipe
- Create in
,src/common/guards/
, orsrc/common/interceptors/src/common/pipes/ - Implement
,CanActivate
, orNestInterceptorPipeTransform - Export from directory
andindex.tssrc/common/index.ts - Register globally in
or per-route with decoratormain.ts
See references/infrastructure.md for guard, interceptor, and caching patterns.
Workflow: Caching
- Inject
fromCacheService#shared/index.js - Use
for read-through cachegetOrSet(key, factory, ttl?) - Use
to invalidate on mutationsdel(key)
and@CacheTTL()
decorators for HTTP cache interceptor@CacheKey()
to skip caching on specific routes@NoCache()
See references/infrastructure.md for cache service API and patterns.
Reference Files
- references/modules.md — module template, controller template, service template, barrel exports
- references/database.md — schema template, DTO template, validation decorators, pagination pattern
- references/infrastructure.md — guards, interceptors, caching, rate limiting, config patterns