nestjs-expert▌
sickn33/antigravity-awesome-skills · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Enterprise-grade Nest.js architecture guidance covering modules, dependency injection, testing, databases, and authentication.
- ›Diagnoses and resolves dependency injection issues, circular dependencies, and module configuration problems with proven solutions from 500+ real GitHub issues and Stack Overflow threads
- ›Covers full request lifecycle: middleware, guards, interceptors, pipes, and exception filters with correct execution order and async handling
- ›Provides testing strategies for
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:
-
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."
-
Detect Nest.js project setup using internal tools first (Read, Grep, Glob)
-
Identify architecture patterns and existing modules
-
Apply appropriate solutions following Nest.js best practices
-
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, 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, 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, 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
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, Mongoose
Authentication & Authorization (Passport.js)
- Common issues: Strategy configuration, JWT handling, guard implementation
- Root causes: Missing strategy setup, incorrect token validation, improper guard usage
- Solution priority: 1) Configure Passport strategy, 2) Implement guards, 3) Handle JWT properly
- Tools:
@nestjs/passport,@nestjs/jwt, passport strategies - Resources: Authentication, Authorization
Configuration & Environment Management
- Common issues: Environment variables, configuration validation, async configuration
- Root causes: Missing config module, improper validation, incorrect async loading
- Solution priority: 1) Setup ConfigModule, 2) Add validation, 3) Handle async config
- Tools:
@nestjs/config, Joi validation - Resources: Configuration
Error Handling & Logging
- Common issues: Exception filters, logging configuration, error propagation
- Root causes: Missing exception filters, improper logger setup, unhandled promises
- Solution priority: 1) Implement exception filters, 2) Configure logger, 3) Handle all errors
- Tools: Built-in Logger, custom exception filters
- Resources: Exception Filters, Logger
Environmental Adaptation
Detection Phase
I analyze the project to understand:
- Nest.js version and configuration
- Module structure and organization
- Database setup (TypeORM/Mongoose/Prisma)
- Testing framework configuration
- Authentication implementation
Detection commands:
# 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.
Adaptation Strategies
- Match existing module patterns and naming conventions
- Follow established testing patterns
- Respect database strategy (repository pattern vs active record)
- Use existing authentication guards and strategies
Tool Integration
Diagnostic Tools
# Analyze module dependencies
nest info
# Check for circular dependencies
npm run build -- --watch=false
# Validate module structure
npm run lint
Fix Validation
# 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
Problem-Specific Approaches (Real Issues from GitHub & Stack Overflow)
1. "Nest can't resolve dependencies of the [Service] (?)"
Frequency: HIGHEST (500+ GitHub issues) | Complexity: LOW-MEDIUM Real Examples: GitHub #3186, #886, #2359 | SO 75483101 When encountering this error:
- Check if provider is in module's providers array
- Verify module exports if crossing boundaries
- Check for typos in provider names (GitHub #598 - misleading error)
- Review import order in barrel exports (GitHub #9095)
2. "Circular dependency detected"
Frequency: HIGH | Complexity: HIGH Real Examples: SO 65671318 (32 votes) | Multiple GitHub discussions Community-proven solutions:
- Use forwardRef() on BOTH sides of the dependency
- Extract shared logic to a third module (recommended)
- Consider if circular dependency indicates design flaw
- Note: Community warns forwardRef() can mask deeper issues
3. "Cannot test e2e because Nestjs doesn't resolve dependencies"
Frequency: HIGH | Complexity: MEDIUM Real Examples: SO 75483101, 62942112, 62822943 Proven testing solutions:
- Use @golevelup/ts-jest for createMock() helper
- Mock JwtService in test module providers
- Import all required modules in Test.createTestingModule()
- For Bazel users: Special configuration needed (SO 62942112)
4. "[TypeOrmModule] Unable to connect to the database"
Frequency: MEDIUM | Complexity: HIGH
Real Examples: GitHub typeorm#1151, #520, #2692
Key insight - this error is often misleading:
- Check entity configuration - @Column() not @Column('description')
- For multiple DBs: Use named connections (GitHub #2692)
- Implement connection error handling to prevent app crash (#520)
- SQLite: Verify database file path (typeorm#8745)
5. "Unknown authentication strategy 'jwt'"
Frequency: HIGH | Complexity: LOW Real Examples: SO 79201800, 74763077, 62799708 Common JWT authentication fixes:
- Import Strategy from 'passport-jwt' NOT 'passport-local'
- Ensure JwtModule.secret matches JwtStrategy.secretOrKey
- Check Bearer token format in Authorization header
- Set JWT_SECRET environment variable
6. "ActorModule exporting itself instead of ActorService"
Frequency: MEDIUM | Complexity: LOW Real Example: GitHub #866 Module export configuration fix:
- Export the SERVICE not the MODULE from exports array
- Common mistake: exports: [ActorModule] → exports: [ActorService]
- Check all module exports for this pattern
- Validate with nest info command
7. "secretOrPrivateKey must have a value" (JWT)
Frequency: HIGH | Complexity: LOW Real Examples: Multiple community reports JWT configuration fixes:
- Set JWT_SECRET in environment variables
- Check ConfigModule loads before JwtModule
- Verify .env file is in correct location
- Use ConfigService for dynamic configuration
8. Version-Specific Regressions
Frequency: LOW | Complexity: MEDIUM Real Example: GitHub #2359 (v6.3.1 regression) Handling version-specific bugs:
- Check GitHub issues for your specific version
- Try downgrading to previous stable version
- Update to latest patch version
- Report regressions with minimal reproduction
9. "Nest can't resolve dependencies of the UserController (?, +)"
Frequency: HIGH | Complexity: LOW Real Example: GitHub #886 Controller dependency resolution:
- The "?" indicates missing provider at that position
- Count constructor parameters to identify which is missing
- Add missing service to module providers
- Check service is properly decorated with @Injectable()
10. "Nest can't resolve dependencies of the Repository" (Testing)
Frequency: MEDIUM | Complexity: MEDIUM Real Examples: Community reports TypeORM repository testing:
- Use getRepositoryToken(Entity) for provider token
- Mock DataSource in test module
- Provide test database connection
- Consider mocking repository completely
11. "Unauthorized 401 (Missing credentials)" with Passport JWT
Frequency: HIGH | Complexity: LOW Real Example: SO 74763077 JWT authentication debugging:
- Verify Authorization header format: "Bearer [token]"
- Check token expiration (use longer exp for testing)
- Test without nginx/proxy to isolate issue
- Use jwt.io to decode and verify token structure
12. Memory Leaks in Production
Frequency: LOW | Complexity: HIGH Real Examples: Community reports Memory leak detection and fixes:
- Profile with node --inspect and Chrome DevTools
- Remove event listeners in onModuleDestroy()
- Close database connections properly
- Monitor heap snapshots over time
13. "More informative error message when dependencies are improperly setup"
Frequency: N/A | Complexity: N/A Real Example: GitHub #223 (Feature Request) Debugging dependency injection:
- NestJS errors are intentionally generic for security
- Use verbose logging during development
- Add custom error messages in your providers
- Consider using dependency injection debugging tools
14. Multiple Database Connections
Frequency: MEDIUM | Complexity: MEDIUM Real Example: GitHub #2692 Configuring multiple databases:
- Use named connections in TypeOrmModule
- Specify connection name in @InjectRepository()
- Configure separate connection options
- Test each connection independently
15. "Connection with sqlite database is not established"
Frequency: LOW | Complexity: LOW Real Example: typeorm#8745 SQLite-specific issues:
- Check database file path is absolute
- Ensure directory exists before connection
- Verify file permissions
- Use synchronize: true for development
16. Misleading "Unable to connect" Errors
Frequency: MEDIUM | Complexity: HIGH Real Example: typeorm#1151 True causes of connection errors:
- Entity syntax errors show as connection errors
- Wrong decorator usage: @Column() not @Column('description')
- Missing decorators on entity properties
- Always check entity files when connection errors occur
17. "Typeorm connection error breaks entire nestjs application"
Frequency: MEDIUM | Complexity: MEDIUM Real Example: typeorm#520 Preventing app crash on DB failure:
- Wrap connection in try-catch in useFactory
- Allow app to start without database
- Implement health checks for DB status
- Use retryAttempts and retryDelay options
Common Patterns & Solutions
Module Organization
// Feature module pattern
@Module({
imports: [CommonModule, DatabaseModule],
controllers: [FeatureController],
providers: [FeatureService, FeatureRepository],
exports: [FeatureService] // Export for other modules
})
export class FeatureModule {}
Custom Decorator Pattern
// Combine multiple decorators
export const Auth = (...roles: Role[]) =>
applyDecorators(
UseGuards(JwtAuthGuard, RolesGuard),
Roles(...rolesHow to use nestjs-expert on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add nestjs-expert
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches nestjs-expert from GitHub repository sickn33/antigravity-awesome-skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate nestjs-expert. Access the skill through slash commands (e.g., /nestjs-expert) or your agent's skill management interface.
Security & Verification Notice
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 development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
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
Competitive Analysis
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
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
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
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ 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.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.4★★★★★58 reviews- ★★★★★Li Desai· Dec 28, 2024
Keeps context tight: nestjs-expert is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Rahul Santra· Dec 20, 2024
We added nestjs-expert from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Nikhil Desai· Dec 12, 2024
nestjs-expert has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Alexander Farah· Dec 12, 2024
nestjs-expert fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Meera Rao· Dec 4, 2024
nestjs-expert fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Li Chawla· Dec 4, 2024
We added nestjs-expert from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Diego Bhatia· Nov 23, 2024
nestjs-expert is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Ren Sanchez· Nov 23, 2024
Useful defaults in nestjs-expert — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Ganesh Mohane· Nov 11, 2024
Useful defaults in nestjs-expert — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Meera Rahman· Nov 7, 2024
I recommend nestjs-expert for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
showing 1-10 of 58