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.

install
source · Clone the upstream repo
git clone https://github.com/IliyaBrook/awesome-jetbrains-claude
Claude Code · Install into ~/.claude/skills/
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"
manifest: .claude/skills/nest-dev/SKILL.md
source content

Project Stack

  • NestJS 11 + TypeScript 5.7 (target ES2023, nodenext modules)
  • MongoDB + Mongoose 9 (
    @nestjs/mongoose
    )
  • JWT auth via
    @nestjs/jwt
    +
    @nestjs/passport
    (Google OAuth)
  • Redis caching via
    cache-manager
    +
    @keyv/redis
    (in-memory fallback)
  • class-validator
    +
    class-transformer
    for DTO validation
  • @nestjs/swagger
    for OpenAPI docs
  • @nestjs/throttler
    for rate limiting (3 tiers)
  • @nestjs/terminus
    for health checks
  • Helmet + compression + CORS middleware
  • Jest 30 + supertest for testing

Critical Rules

  1. Barrel exports — every new file MUST be exported from its
    index.ts
  2. Named exports only — no
    export default
  3. DRY — extract shared logic into services/utils, never copy-paste
  4. Types co-located — export interfaces from the file that defines them (schema, service, DTO)
  5. Path aliases with
    .js
    extension
    import { X } from '#modules/auth/index.js'
    (nodenext resolution)
  6. Aliases:
    #modules/*
    ,
    #shared/*
    ,
    #common/*
    ,
    #config/*
    ,
    #email-templates/*
  7. Swagger decorators — every controller endpoint MUST have
    @ApiTags
    ,
    @ApiOperation
    ,
    @ApiResponse
  8. Auth by default — all routes require JWT; use
    @Public()
    to opt out
  9. Ownership checks — services must verify
    userId
    matches the document owner

Workflow: New Module

  1. Create directory
    src/modules/feature-name/
  2. Create schema:
    feature-name.schema.ts
    (Mongoose
    @Schema
    +
    @Prop
    )
  3. Create DTOs:
    dto/create-feature.dto.ts
    ,
    dto/update-feature.dto.ts
    ,
    dto/index.ts
  4. Create service:
    feature-name.service.ts
    (
    @Injectable()
    , inject model)
  5. Create controller:
    feature-name.controller.ts
    (REST endpoints + Swagger)
  6. Create module:
    feature-name.module.ts
    (register schema, providers, exports)
  7. Create barrel:
    index.ts
    (export everything)
  8. Register module in
    src/app.module.ts

See references/modules.md for complete templates.

Workflow: New Endpoint

  1. Add method to controller with HTTP decorator (
    @Get
    ,
    @Post
    ,
    @Patch
    ,
    @Delete
    )
  2. Add Swagger decorators:
    @ApiBearerAuth()
    ,
    @ApiOperation
    ,
    @ApiResponse
  3. Use
    @CurrentUser('sub')
    for authenticated user ID
  4. Use
    @Body()
    ,
    @Param()
    ,
    @Query()
    for input extraction
  5. Create/update DTO if new input is needed
  6. Implement business logic in service (not controller)
  7. Controllers are thin — delegate to service, return result

See references/modules.md for controller and service patterns.

Workflow: New Schema

  1. Create
    feature-name.schema.ts
  2. Define
    FeatureDocument = HydratedDocument<Feature>
  3. Use
    @Schema({ timestamps: true, collection: 'features' })
  4. Use
    @Prop()
    with options:
    required
    ,
    unique
    ,
    default
    ,
    enum
    ,
    ref
    ,
    select
    ,
    index
  5. For refs:
    @Prop({ type: Types.ObjectId, ref: 'OtherModel' })
  6. Export
    FeatureSchema = SchemaFactory.createForClass(Feature)
  7. Add compound indexes after schema creation

See references/database.md for schema and DTO templates.

Workflow: New DTO

  1. Create
    dto/create-feature.dto.ts
  2. Use
    class-validator
    decorators:
    @IsString
    ,
    @IsNotEmpty
    ,
    @IsOptional
    ,
    @IsMongoId
    , etc.
  3. Add
    @ApiProperty
    /
    @ApiPropertyOptional
    with
    example
    values
  4. For updates:
    export class UpdateFeatureDto extends PartialType(CreateFeatureDto) {}
  5. Export from
    dto/index.ts

See references/database.md for DTO patterns and validation decorators.

Workflow: Cursor-Based Pagination

  1. Accept
    PaginationDto
    (
    { limit?, cursor? }
    ) from
    #shared/index.js
  2. Return
    PaginatedResponse<T>
    (
    { data, nextCursor, hasMore }
    )
  3. Query with
    limit + 1
    to detect
    hasMore
  4. Build compound cursor from last item (e.g.,
    date_id
    )
  5. Use
    $or
    with cursor for consistent sort order

See references/database.md for pagination implementation.

Workflow: Guard / Interceptor / Pipe

  1. Create in
    src/common/guards/
    ,
    src/common/interceptors/
    , or
    src/common/pipes/
  2. Implement
    CanActivate
    ,
    NestInterceptor
    , or
    PipeTransform
  3. Export from directory
    index.ts
    and
    src/common/index.ts
  4. Register globally in
    main.ts
    or per-route with decorator

See references/infrastructure.md for guard, interceptor, and caching patterns.

Workflow: Caching

  1. Inject
    CacheService
    from
    #shared/index.js
  2. Use
    getOrSet(key, factory, ttl?)
    for read-through cache
  3. Use
    del(key)
    to invalidate on mutations
  4. @CacheTTL()
    and
    @CacheKey()
    decorators for HTTP cache interceptor
  5. @NoCache()
    to skip caching on specific routes

See references/infrastructure.md for cache service API and patterns.

Reference Files