affaan-m avatar

Nestjs Patterns

This is a solid reference for building production NestJS backends the right way. It covers the full stack: module organization, DTO validation with class-validator, guards and interceptors, environment config validation at boot, and keeping controllers thin while services own business logic. The structure guidance is opinionated but practical, pushing cross-cutting concerns into common folders and keeping DTOs close to their modules. You'll want this active when setting up new NestJS projects or refactoring messy ones, especially if you're tired of inconsistent error handling or controllers that do too much. The testing and transaction patterns alone save you from common pitfalls.

skills.sh installs
6.1K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --skill nestjs-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

NestJS Development Patterns

Production-grade NestJS patterns for modular TypeScript backends.

When to Activate

  • Building NestJS APIs or services
  • Structuring modules, controllers, and providers
  • Adding DTO validation, guards, interceptors, or exception filters
  • Configuring environment-aware settings and database integrations
  • Testing NestJS units or HTTP endpoints

Project Structure

src/
├── app.module.ts
├── main.ts
├── common/
│   ├── filters/
│   ├── guards/
│   ├── interceptors/
│   └── pipes/
├── config/
│   ├── configuration.ts
│   └── validation.ts
├── modules/
│   ├── auth/
│   │   ├── auth.controller.ts
│   │   ├── auth.module.ts
│   │   ├── auth.service.ts
│   │   ├── dto/
│   │   ├── guards/
│   │   └── strategies/
│   └── users/
│       ├── dto/
│       ├── entities/
│       ├── users.controller.ts
│       ├── users.module.ts
│       └── users.service.ts
└── prisma/ or database/
  • Keep domain code inside feature modules.
  • Put cross-cutting filters, decorators, guards, and interceptors in common/.
  • Keep DTOs close to the module that owns them.

Bootstrap and Global Validation

Sponsors

Details

Repository
github.com/affaan-m/ecc
Category
Code Review & Quality
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263
1affaan-m avatardesign-systemaffaan-m/eccUse this skill to generate or audit design systems, check visual consistency, and review PRs that touch styling.6Kskills.sh installs
2lijigang avatarljg-travellijigang/ljg-skillsDeep travel research workflow for museums and ancient architecture. Input a city name, auto-generates structured knowledge document (org-mode) + portable refere6Kskills.sh installs
3jeffallan avatarfullstack-guardianjeffallan/claude-skillsBuilds security-focused full-stack web applications by implementing integrated frontend and backend components with layered security at every level. Covers the 5.9Kskills.sh installs
4anthropics avatardesign-critiqueanthropics/knowledge-work-pluginsGet structured design feedback on usability, hierarchy, and consistency. Trigger with "review this design", "critique this mockup", "what do you think of this s5.8Kskills.sh installs
5affaan-m avatarspringboot-tddaffaan-m/eccTest-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.5.7Kskills.sh installs
6julianoczkowski avatarfrontend-designjulianoczkowski/designer-skillsBuild distinctive, production-grade frontend interfaces with high design quality, guided by named aesthetic philosophies. Use when building components, pages, o5.6Kskills.sh installs