Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
40 prioritized NestJS best practices across architecture, DI, security, performance, testing, and microservices.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/_sections.md
1# Sections23This file defines all sections, their ordering, impact levels, and descriptions.4The section ID (in parentheses) is the filename prefix used to group rules.56---78## 1. Architecture (arch)910**Impact:** CRITICAL11**Description:** Proper module organization and dependency management are the foundation of maintainable NestJS applications. Circular dependencies and god services are the #1 architecture killer.1213## 2. Dependency Injection (di)1415**Impact:** CRITICAL16**Description:** NestJS's IoC container is powerful but can be misused. Understanding scopes, injection tokens, and proper patterns is essential for testable code.1718## 3. Error Handling (error)1920**Impact:** HIGH21**Description:** Consistent error handling improves debugging, user experience, and API reliability. Centralized exception filters ensure uniform error responses.2223## 4. Security (security)2425**Impact:** HIGH26**Description:** Security vulnerabilities can be catastrophic. Input validation, authentication, authorization, and data protection are non-negotiable.2728## 5. Performance (perf)2930**Impact:** HIGH31**Description:** Optimizing request handling, caching, and database queries directly impacts application responsiveness and scalability.3233## 6. Testing (test)3435**Impact:** MEDIUM-HIGH36**Description:** Well-tested applications are more reliable. NestJS testing utilities enable comprehensive unit and e2e coverage.3738## 7. Database & ORM (db)3940**Impact:** MEDIUM-HIGH41**Description:** Proper database access patterns, transactions, and query optimization are crucial for data-intensive applications.4243## 8. API Design (api)4445**Impact:** MEDIUM46**Description:** RESTful conventions, versioning, DTOs, and consistent response formats improve API usability and maintainability.4748## 9. Microservices (micro)4950**Impact:** MEDIUM51**Description:** Building distributed systems requires understanding message patterns, health checks, and inter-service communication.5253## 10. DevOps & Deployment (devops)5455**Impact:** LOW-MEDIUM56**Description:** Configuration management, structured logging, and graceful shutdown ensure production readiness and zero-downtime deployments.57