40 NestJS best practices organized by priority across architecture, dependency injection, security, and performance.
Works with
Covers 10 rule categories from critical (architecture, DI) to low-medium (DevOps), each with specific, actionable patterns and anti-patterns
Includes rules for modules, controllers, services, error handling, authentication, database optimization, testing, and microservices
Each rule provides explanation, incorrect vs. correct code examples, and context for when to appl
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionnestjs-best-practicesExecute the skills CLI command in your project's root directory to begin installation:
Fetches nestjs-best-practices from kadajett/agent-nestjs-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate nestjs-best-practices. Access via /nestjs-best-practices in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
65
total installs
65
this week
111
GitHub stars
0
upvotes
Run in your terminal
65
installs
65
this week
111
stars
Comprehensive best practices guide for NestJS applications. Contains 40 rules across 10 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Architecture | CRITICAL | arch- |
| 2 | Dependency Injection | CRITICAL | di- |
| 3 | Error Handling | HIGH | error- |
| 4 | Security | HIGH | security- |
| 5 | Performance | HIGH | perf- |
| 6 | Testing | MEDIUM-HIGH | test- |
| 7 | Database & ORM | MEDIUM-HIGH | db- |
| 8 | API Design | MEDIUM | api- |
| 9 | Microservices | MEDIUM | micro- |
| 10 | DevOps & Deployment | LOW-MEDIUM | devops- |
arch-avoid-circular-deps - Avoid circular module dependenciesarch-feature-modules - Organize by feature, not technical layerarch-module-sharing - Proper module exports/imports, avoid duplicate providersarch-single-responsibility - Focused services over "god services"arch-use-repository-pattern - Abstract database logic for testabilityarch-use-events - Event-driven architecture for decouplingdi-avoid-service-locator - Avoid service locator anti-patterndi-interface-segregation - Interface Segregation Principle (ISP)di-liskov-substitution - Liskov Substitution Principle (LSP)di-prefer-constructor-injection - Constructor over property injectiondi-scope-awareness - Understand singleton/request/transient scopesdi-use-interfaces-tokens - Use injection tokens for interfaceserror-use-exception-filters - Centralized exception handlingerror-throw-http-exceptions - Use NestJS HTTP exceptionserror-handle-async-errors - Handle async errors properlysecurity-auth-jwt - Secure JWT authenticationsecurity-validate-all-input - Validate with class-validatorsecurity-use-guards - Authentication and authorization guardssecurity-sanitize-output - Prevent XSS attackssecurity-rate-limiting - Implement rate limitingperf-async-hooks - Proper async lifecycle hooksperf-use-caching - Implement caching strategiesperf-optimize-database - Optimize database queriesperf-lazy-loading - Lazy load modules for faster startuptest-use-testing-module - Use NestJS testing utilitiestest-e2e-supertest - E2E testing with Supertesttest-mock-external-services - Mock external dependenciesdb-use-transactions - Transaction managementdb-avoid-n-plus-one - Avoid N+1 query problemsdb-use-migrations - Use migrations for schema changesapi-use-dto-serialization - DTO and response serializationapi-use-interceptors - Cross-cutting concernsapi-versioning - API versioning strategiesapi-use-pipes - Input transformation with pipesmicro-use-patterns - Message and event patternsmicro-use-health-checks - Health checks for orchestrationmicro-use-queues - Background job processingdevops-use-config-module - Environment configurationdevops-use-logging - Structured loggingdevops-graceful-shutdown - Zero-downtime deploymentsRead individual rule files for detailed explanations and code examples:
rules/arch-avoid-circular-deps.md
rules/security-validate-all-input.md
rules/_sections.md
Each rule file contains:
For the complete guide with all rules expanded: AGENTS.md
Make data-driven prioritization decisions faster
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Prerequisites
Time Estimate
30-60 minutes to see productivity improvements
Steps
Common Pitfalls
β Do
β Don't
π‘ Pro Tips
β Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
β Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
jwynia/agent-skills
asyrafhussin/agent-skills
mattpocock/skills
parcadei/continuous-claude-v3
cursor/plugins
pproenca/dot-skills
nestjs-best-practices reduced setup friction for our internal harness; good balance of opinion and flexibility.
Registry listing for nestjs-best-practices matched our evaluation β installs cleanly and behaves as described in the markdown.
Registry listing for nestjs-best-practices matched our evaluation β installs cleanly and behaves as described in the markdown.
nestjs-best-practices reduced setup friction for our internal harness; good balance of opinion and flexibility.
Useful defaults in nestjs-best-practices β fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
Useful defaults in nestjs-best-practices β fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
nestjs-best-practices fits our agent workflows well β practical, well scoped, and easy to wire into existing repos.
I recommend nestjs-best-practices for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Registry listing for nestjs-best-practices matched our evaluation β installs cleanly and behaves as described in the markdown.
We added nestjs-best-practices from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 62