Install any skill in seconds. Free to start, no credit card required.
Get Started Free →NestJS best practices and architecture patterns for building production-ready applications. This skill should be used when writing, reviewing, or refactoring NestJS code to ensure proper patterns for modules, dependency injection, security, and performance.
.claude/skills/asymmetric-al-nestjs-best-practices/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 38% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 21% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 45% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 31% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 36% | 0% |
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.mdEach rule file contains:
For the complete guide with all rules expanded: AGENTS.md
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | pass→pass | 15,804 | 11,929 | -25% | 1 | 1 | 0% | 2,791 | 3,385 | +21% | 0 | 0 | — |
case-05 | fail→pass | 9,395 | 7,164 | -24% | 1 | 1 | 0% | 1,742 | 2,409 | +38% | 0 | 0 | — |
case-01 | pass→pass | 13,622 | 12,055 | -12% | 1 | 1 | 0% | 2,317 | 3,352 | +45% | 0 | 0 | — |
case-02 | pass→pass | 12,816 | 8,919 | -30% | 1 | 1 | 0% | 2,221 | 2,908 | +31% | 0 | 0 | — |
case-03 | pass→pass | 16,267 | 14,154 | -13% | 1 | 1 | 0% | 2,827 | 3,836 | +36% | 0 | 0 | — |
case-06 | pass→pass | 10,159 | 7,071 | -30% | 1 | 1 | 0% | 1,617 | 2,403 | +49% | 0 | 0 | — |
case-07 | pass→pass | 16,127 | 14,964 | -7% | 1 | 1 | 0% | 2,713 | 3,748 | +38% | 0 | 0 | — |
case-08 | pass→pass | 12,812 | 12,306 | -4% | 1 | 1 | 0% | 2,393 | 3,577 | +49% | 0 | 0 | — |
case-09 | pass→pass | 6,832 | 6,076 | -11% | 1 | 1 | 0% | 1,340 | 2,284 | +70% | 0 | 0 | — |
case-10 | pass→pass | 9,261 | 9,419 | +2% | 1 | 1 | 0% | 1,762 | 2,745 | +56% | 0 | 0 | — |
case-11 | pass→pass | 13,173 | 11,781 | -11% | 1 | 1 | 0% | 2,354 | 3,415 | +45% | 0 | 0 | — |
case-12 | pass→pass | 14,264 | 12,136 | -15% | 1 | 1 | 0% | 2,526 | 3,342 | +32% | 0 | 0 | — |
case-13 | pass→pass | 13,419 | 11,501 | -14% | 1 | 1 | 0% | 2,409 | 3,224 | +34% | 0 | 0 | — |
case-14 | pass→pass | 11,748 | 9,664 | -18% | 1 | 1 | 0% | 2,186 | 3,037 | +39% | 0 | 0 | — |
case-15 | pass→pass | 11,974 | 12,122 | +1% | 1 | 1 | 0% | 2,134 | 3,461 | +62% | 0 | 0 | — |
case-16 | pass→pass | 12,722 | 12,041 | -5% | 1 | 1 | 0% | 2,178 | 3,219 | +48% | 0 | 0 | — |
case-17 | pass→pass | 13,478 | 12,649 | -6% | 1 | 1 | 0% | 2,490 | 3,507 | +41% | 0 | 0 | — |
case-18 | pass→pass | 10,877 | 8,427 | -23% | 1 | 1 | 0% | 2,073 | 2,732 | +32% | 0 | 0 | — |
case-19 | pass→pass | 13,814 | 9,754 | -29% | 1 | 1 | 0% | 2,629 | 3,053 | +16% | 0 | 0 | — |
case-20 | pass→pass | 13,731 | 12,703 | -7% | 1 | 1 | 0% | 2,486 | 3,746 | +51% | 0 | 0 | — |
case-21 | pass→pass | 11,666 | 10,855 | -7% | 1 | 1 | 0% | 2,176 | 3,256 | +50% | 0 | 0 | — |
case-22 | pass→pass | 15,381 | 12,170 | -21% | 1 | 1 | 0% | 2,836 | 3,493 | +23% | 0 | 0 | — |
case-23 | pass→pass | 14,005 | 13,135 | -6% | 1 | 1 | 0% | 2,527 | 3,537 | +40% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +4 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.