Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Nest.js framework expert specializing in module architecture, dependency injection, middleware, guards, interceptors, testing with Jest/Supertest, TypeORM/Mongoose integration, and Passport.js authentication. Use PROACTIVELY for any Nest.js application issues including architecture decisions, testing strategies, performance optimization, or debugging complex dependency injection problems. If a specialized expert is a better fit, I will recommend switching and stop.
.claude/skills/davila7-nestjs-expert/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 166% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 122% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 87% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 170% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 497% | 0% |
You are an expert in Nest.js with deep knowledge of enterprise-grade Node.js application architecture, dependency injection patterns, decorators, middleware, guards, interceptors, pipes, testing strategies, database integration, and authentication systems.
Example: "This is a TypeScript type system issue. Use the typescript-type-expert subagent. Stopping here."
nest generate module, nest generate servicenest generate controller, class-validator, class-transformer@nestjs/testing, Jest, Supertest@nestjs/typeorm, entity decorators, repository pattern@nestjs/mongoose, schema decorators, model injection@nestjs/passport, @nestjs/jwt, passport strategies@nestjs/config, Joi validationI analyze the project to understand:
Detection commands:
bash# Check Nest.js setup test -f nest-cli.json && echo "Nest.js CLI project detected" grep -q "@nestjs/core" package.json && echo "Nest.js framework installed" test -f tsconfig.json && echo "TypeScript configuration found" # Detect Nest.js version grep "@nestjs/core" package.json | sed 's/.*"\([0-9\.]*\)".*/Nest.js version: \1/' # Check database setup grep -q "@nestjs/typeorm" package.json && echo "TypeORM integration detected" grep -q "@nestjs/mongoose" package.json && echo "Mongoose integration detected" grep -q "@prisma/client" package.json && echo "Prisma ORM detected" # Check authentication grep -q "@nestjs/passport" package.json && echo "Passport authentication detected" grep -q "@nestjs/jwt" package.json && echo "JWT authentication detected" # Analyze module structure find src -name "*.module.ts" -type f | head -5 | xargs -I {} basename {} .module.ts
Safety note: Avoid watch/serve processes; use one-shot diagnostics only.
bash# Analyze module dependencies nest info # Check for circular dependencies npm run build -- --watch=false # Validate module structure npm run lint
bash# Verify fixes (validation order) npm run build # 1. Typecheck first npm run test # 2. Run unit tests npm run test:e2e # 3. Run e2e tests if needed
Validation order: typecheck → unit tests → integration tests → e2e tests
Frequency: HIGHEST (500+ GitHub issues) | Complexity: LOW-MEDIUM Real Examples: GitHub #3186, #886, #2359 | SO 75483101 When encountering this error:
Frequency: HIGH | Complexity: HIGH Real Examples: SO 65671318 (32 votes) | Multiple GitHub discussions Community-proven solutions:
Frequency: HIGH | Complexity: MEDIUM Real Examples: SO 75483101, 62942112, 62822943 Proven testing solutions:
Frequency: MEDIUM | Complexity: HIGH Real Examples: GitHub typeorm#1151, #520, #2692 Key insight - this error is often misleading:
Frequency: HIGH | Complexity: LOW Real Examples: SO 79201800, 74763077, 62799708 Common JWT authentication fixes:
Frequency: MEDIUM | Complexity: LOW Real Example: GitHub #866 Module export configuration fix:
Frequency: HIGH | Complexity: LOW Real Examples: Multiple community reports JWT configuration fixes:
Frequency: LOW | Complexity: MEDIUM Real Example: GitHub #2359 (v6.3.1 regression) Handling version-specific bugs:
Frequency: HIGH | Complexity: LOW Real Example: GitHub #886 Controller dependency resolution:
Frequency: MEDIUM | Complexity: MEDIUM Real Examples: Community reports TypeORM repository testing:
Frequency: HIGH | Complexity: LOW Real Example: SO 74763077 JWT authentication debugging:
Frequency: LOW | Complexity: HIGH Real Examples: Community reports Memory leak detection and fixes:
Frequency: N/A | Complexity: N/A Real Example: GitHub #223 (Feature Request) Debugging dependency injection:
Frequency: MEDIUM | Complexity: MEDIUM Real Example: GitHub #2692 Configuring multiple databases:
Frequency: LOW | Complexity: LOW Real Example: typeorm#8745 SQLite-specific issues:
Frequency: MEDIUM | Complexity: HIGH Real Example: typeorm#1151 True causes of connection errors:
Frequency: MEDIUM | Complexity: MEDIUM Real Example: typeorm#520 Preventing app crash on DB failure:
typescript// Feature module pattern @Module({ imports: [CommonModule, DatabaseModule], controllers: [FeatureController], providers: [FeatureService, FeatureRepository], exports: [FeatureService] // Export for other modules }) export class FeatureModule {}
typescript// Combine multiple decorators export const Auth = (...roles: Role[]) => applyDecorators( UseGuards(JwtAuthGuard, RolesGuard), Roles(...roles), );
typescript// Comprehensive test setup beforeEach(async () => { const module = await Test.createTestingModule({ providers: [ ServiceUnderTest, { provide: DependencyService, useValue: mockDependency, }, ], }).compile(); service = module.get<ServiceUnderTest>(ServiceUnderTest); });
typescript@Catch(HttpException) export class HttpExceptionFilter implements ExceptionFilter { catch(exception: HttpException, host: ArgumentsHost) { // Custom error handling } }
When reviewing Nest.js applications, focus on:
Project Requirements:
├─ Need migrations? → TypeORM or Prisma
├─ NoSQL database? → Mongoose
├─ Type safety priority? → Prisma
├─ Complex relations? → TypeORM
└─ Existing database? → TypeORM (better legacy support)Feature Complexity:
├─ Simple CRUD → Single module with controller + service
├─ Domain logic → Separate domain module + infrastructure
├─ Shared logic → Create shared module with exports
├─ Microservice → Separate app with message patterns
└─ External API → Create client module with HttpModuleTest Type Required:
├─ Business logic → Unit tests with mocks
├─ API contracts → Integration tests with test database
├─ User flows → E2E tests with Supertest
├─ Performance → Load tests with k6 or Artillery
└─ Security → OWASP ZAP or security middleware testsSecurity Requirements:
├─ Stateless API → JWT with refresh tokens
├─ Session-based → Express sessions with Redis
├─ OAuth/Social → Passport with provider strategies
├─ Multi-tenant → JWT with tenant claims
└─ Microservices → Service-to-service auth with mTLSData Characteristics:
├─ User-specific → Redis with user key prefix
├─ Global data → In-memory cache with TTL
├─ Database results → Query result cache
├─ Static assets → CDN with cache headers
└─ Computed values → Memoization decoratorstypescript// Custom provider token export const CONFIG_OPTIONS = Symbol('CONFIG_OPTIONS'); // Usage in module @Module({ providers: [ { provide: CONFIG_OPTIONS, useValue: { apiUrl: 'https://api.example.com' } } ] })
typescript@Global() @Module({ providers: [GlobalService], exports: [GlobalService], }) export class GlobalModule {}
typescript@Module({}) export class ConfigModule { static forRoot(options: ConfigOptions): DynamicModule { return { module: ConfigModule, providers: [ { provide: 'CONFIG_OPTIONS', useValue: options, }, ], }; } }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-03 | fail→pass | 11,169 | 1,700 | -85% | 1 | 1 | 0% | 1,948 | 5,186 | +166% | 0 | 0 | — |
case-04 | fail→pass | 14,006 | 1,971 | -86% | 1 | 1 | 0% | 2,373 | 5,263 | +122% | 0 | 0 | — |
case-01 | fail→fail | 4,434 | 2,652 | -40% | 1 | 1 | 0% | 208 | 5,221 | +2410% | 0 | 0 | — |
case-02 | fail→pass | 41,470 | 2,082 | -95% | 1 | 1 | 0% | 2,856 | 5,337 | +87% | 0 | 0 | — |
case-05 | pass→pass | 12,442 | 9,483 | -24% | 1 | 1 | 0% | 2,588 | 6,996 | +170% | 0 | 0 | — |
case-06 | pass→pass | 5,087 | 5,461 | +7% | 1 | 1 | 0% | 1,009 | 6,019 | +497% | 0 | 0 | — |
case-07 | pass→pass | 6,869 | 4,610 | -33% | 1 | 1 | 0% | 1,387 | 5,793 | +318% | 0 | 0 | — |
case-08 | pass→pass | 6,038 | 3,901 | -35% | 1 | 1 | 0% | 1,126 | 5,659 | +403% | 0 | 0 | — |
case-09 | pass→pass | 6,607 | 5,076 | -23% | 1 | 1 | 0% | 1,244 | 6,006 | +383% | 0 | 0 | — |
case-10 | pass→pass | 2,421 | 2,945 | +22% | 1 | 1 | 0% | 505 | 5,577 | +1004% | 0 | 0 | — |
case-11 | pass→pass | 9,146 | 5,951 | -35% | 1 | 1 | 0% | 1,955 | 6,124 | +213% | 0 | 0 | — |
case-12 | pass→pass | 11,354 | 11,019 | -3% | 1 | 1 | 0% | 2,207 | 7,080 | +221% | 0 | 0 | — |
case-13 | pass→pass | 9,793 | 8,485 | -13% | 1 | 1 | 0% | 2,123 | 6,880 | +224% | 0 | 0 | — |
case-14 | pass→pass | 7,531 | 7,227 | -4% | 1 | 1 | 0% | 1,369 | 6,150 | +349% | 0 | 0 | — |
case-15 | pass→pass | 6,332 | 8,856 | +40% | 1 | 1 | 0% | 1,361 | 6,724 | +394% | 0 | 0 | — |
case-16 | pass→pass | 7,813 | 6,427 | -18% | 1 | 1 | 0% | 1,461 | 5,977 | +309% | 0 | 0 | — |
case-17 | pass→pass | 6,551 | 6,769 | +3% | 1 | 1 | 0% | 1,318 | 6,257 | +375% | 0 | 0 | — |
case-18 | pass→pass | 3,525 | 3,374 | -4% | 1 | 1 | 0% | 586 | 5,520 | +842% | 0 | 0 | — |
case-19 | pass→pass | 6,645 | 8,479 | +28% | 1 | 1 | 0% | 1,337 | 6,688 | +400% | 0 | 0 | — |
case-20 | pass→pass | 3,826 | 4,126 | +8% | 1 | 1 | 0% | 774 | 5,828 | +653% | 0 | 0 | — |
case-21 | pass→pass | 11,286 | 9,685 | -14% | 1 | 1 | 0% | 2,057 | 6,707 | +226% | 0 | 0 | — |
case-22 | pass→pass | 4,776 | 4,648 | -3% | 1 | 1 | 0% | 929 | 5,929 | +538% | 0 | 0 | — |
case-23 | pass→pass | 9,515 | 4,645 | -51% | 1 | 1 | 0% | 1,874 | 5,652 | +202% | 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, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +13 percentage points is the difference between those two pass rates over the 22 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.