
Nestjs Expert
Guide Nest.js module design, dependency injection, guards, interceptors, Jest/Supertest tests, and Passport auth when your API agent hits architecture or DI debugging walls.
Overview
Nest.js Expert is an agent skill most often used in Build (also Ship, Operate) that architects Nest modules, dependency injection, auth, and tests for enterprise-style Node APIs.
Install
npx skills add https://github.com/davila7/claude-code-templates --skill nestjs-expertWhat is this skill?
- Proactive Nest.js guidance for modules, DI, decorators, middleware, guards, interceptors, and pipes
- Testing workflow ordered as typecheck then unit tests with Jest and Supertest
- Database integration patterns for TypeORM and Mongoose inside Nest modules
- Passport.js authentication setup within Nest guard pipelines
- Explicit handoff rules to typescript-type-expert, database-expert, nodejs-expert, or react-expert when out of scope
Adoption & trust: 576 installs on skills.sh; 27.8k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Nest.js codebase has circular DI errors, unclear module boundaries, or weak test coverage and generic coding advice is making things worse.
Who is it for?
Intermediate solo builders maintaining or greenfielding Nest APIs who want opinionated Nest patterns instead ofExpress-style shortcuts in an agent session.
Skip if: Pure frontend React work, deep SQL-only optimization, or projects not using Nest—those cases should route to the specialized experts named in the skill.
When should I use this skill?
Use PROACTIVELY for any Nest.js application issues including architecture decisions, testing strategies, performance optimization, or debugging complex dependency injection problems.
What do I get? / Deliverables
You get Nest-aligned module splits, guard and interceptor patterns, and a validated test order so the API is easier to extend and debug in production.
- Module and provider architecture recommendations
- Guard, interceptor, and auth configuration guidance
- Ordered validation steps ending in unit or e2e tests
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Nest.js backend work sits canonically in build/backend because the skill targets application modules and services—the bulk of solo SaaS API construction—even though it also supports ship-time testing and review. Backend subphase matches enterprise Node patterns: modules, providers, middleware, TypeORM/Mongoose, and authentication—not frontend React concerns the skill explicitly defers elsewhere.
Where it fits
Split a growing monolith into feature modules with shared providers without breaking Nest DI.
Wire TypeORM entities and repositories into a new billing module with proper imports.
Add Supertest e2e coverage for auth-guarded controllers after typecheck passes.
Trace a runtime provider resolution failure across lazy-loaded modules.
How it compares
Framework-specific Nest playbook versus a generic Node.js helper that ignores modules, decorators, and Nest testing harnesses.
Common Questions / FAQ
Who is nestjs-expert for?
Solo and small-team developers building SaaS or API products on Nest.js who rely on AI agents for architecture, testing, and auth implementation.
When should I use nestjs-expert?
In build while structuring modules and integrations; in ship during Jest/Supertest passes and review; in operate when debugging DI or performance regressions in a live Nest service.
Is nestjs-expert safe to install?
Treat it like any third-party skill: confirm findings against your codebase and read the Security Audits panel on this Prism page before automated refactors touch auth or data layers.
SKILL.md
READMESKILL.md - Nestjs Expert
# Nest.js Expert 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. ## When invoked: 0. If a more specialized expert fits better, recommend switching and stop: - Pure TypeScript type issues → typescript-type-expert - Database query optimization → database-expert - Node.js runtime issues → nodejs-expert - Frontend React issues → react-expert Example: "This is a TypeScript type system issue. Use the typescript-type-expert subagent. Stopping here." 1. Detect Nest.js project setup using internal tools first (Read, Grep, Glob) 2. Identify architecture patterns and existing modules 3. Apply appropriate solutions following Nest.js best practices 4. Validate in order: typecheck → unit tests → integration tests → e2e tests ## Domain Coverage ### Module Architecture & Dependency Injection - Common issues: Circular dependencies, provider scope conflicts, module imports - Root causes: Incorrect module boundaries, missing exports, improper injection tokens - Solution priority: 1) Refactor module structure, 2) Use forwardRef, 3) Adjust provider scope - Tools: `nest generate module`, `nest generate service` - Resources: [Nest.js Modules](https://docs.nestjs.com/modules), [Providers](https://docs.nestjs.com/providers) ### Controllers & Request Handling - Common issues: Route conflicts, DTO validation, response serialization - Root causes: Decorator misconfiguration, missing validation pipes, improper interceptors - Solution priority: 1) Fix decorator configuration, 2) Add validation, 3) Implement interceptors - Tools: `nest generate controller`, class-validator, class-transformer - Resources: [Controllers](https://docs.nestjs.com/controllers), [Validation](https://docs.nestjs.com/techniques/validation) ### Middleware, Guards, Interceptors & Pipes - Common issues: Execution order, context access, async operations - Root causes: Incorrect implementation, missing async/await, improper error handling - Solution priority: 1) Fix execution order, 2) Handle async properly, 3) Implement error handling - Execution order: Middleware → Guards → Interceptors (before) → Pipes → Route handler → Interceptors (after) - Resources: [Middleware](https://docs.nestjs.com/middleware), [Guards](https://docs.nestjs.com/guards) ### Testing Strategies (Jest & Supertest) - Common issues: Mocking dependencies, testing modules, e2e test setup - Root causes: Improper test module creation, missing mock providers, incorrect async handling - Solution priority: 1) Fix test module setup, 2) Mock dependencies correctly, 3) Handle async tests - Tools: `@nestjs/testing`, Jest, Supertest - Resources: [Testing](https://docs.nestjs.com/fundamentals/testing) ### Database Integration (TypeORM & Mongoose) - Common issues: Connection management, entity relationships, migrations - Root causes: Incorrect configuration, missing decorators, improper transaction handling - Solution priority: 1) Fix configuration, 2) Correct entity setup, 3) Implement transactions - TypeORM: `@nestjs/typeorm`, entity decorators, repository pattern - Mongoose: `@nestjs/mongoose`, schema decorators, model injection - Resources: [TypeORM](https://docs.nestjs.com/techniques/database), [Mongoose](https://docs.ne