nestjs-best-practices

Enforce NestJS architecture best practices during module design, refactors, and reviews.

3|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/dongitran/ai-agent-config --skill nestjs-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nestjs-best-practices
Source: https://github.com/dongitran/ai-agent-config/tree/main/.agent/skills/nestjs-best-practices
Command: npx skills add https://github.com/dongitran/ai-agent-config --skill nestjs-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the challenge of building and maintaining scalable, well-architected NestJS applications.

Core Features & Use Cases

  • Enforces architecture best practices (feature-based modules, single-responsibility services, proper module sharing)
  • Standardizes dependency injection, interfaces, and injection tokens
  • Improves security, performance, testing, and API design through vetted guidelines
  • Use cases: when designing NestJS modules, reviewing or refactoring code, or establishing consistent patterns across teams

Quick Start

To apply these rules, consult the AGENTS guidelines or incorporate this skill into code reviews to guide NestJS refactors.

Frequently Asked Questions about nestjs-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure scalable NestJS applications?

Scalable NestJS applications should use feature-based modules with single-responsibility services and proper module sharing to enforce architecture best practices. This approach standardizes module design and maintains code consistency across REST and microservices.

What is the best way to standardize dependency injection in NestJS?

The best way to standardize NestJS dependency injection is using constructor injection alongside proper interfaces and injection tokens. This enforces consistent architectural patterns across teams during module design and code refactoring.

How do I apply security and performance best practices in NestJS?

To apply NestJS security and performance best practices, implement vetted guidelines using guards, pipes, and lifecycle hooks. This ensures robust API design and application protection during development and code reviews.

Does this approach work for both REST APIs and microservices in NestJS?

Yes, this architectural approach works for both REST APIs and microservices in NestJS. It provides consistent guidance for module design, refactors, and reviews across different communication paradigms to maintain scalable applications.

When should I use feature-based modules in NestJS?

You should use feature-based modules in NestJS when establishing consistent patterns across teams or refactoring existing code. This pattern solves the challenge of building maintainable applications by enforcing single-responsibility services and proper module sharing.