Back to Skills

nestjs-best-practices

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.

119stars11forksUpdated 4/14/2026

Security Assessment

Medium Risk(50/100)

Detected risks:

Secret Exposure([AGENTS.md] Token =, [AGENTS.md] token =, [rules/test-e2e-supertest.md] Token =)
Sensitive File Access([AGENTS.md] .env, [rules/devops-use-config-module.md] .env, [rules/devops-use-logging.md] .env)
Security Score50/100

About nestjs-best-practices

The 'nestjs-best-practices' skill provides a comprehensive guide to building production-ready applications using NestJS, ensuring developers follow best practices across various critical areas such as architecture, dependency injection, error handling, and security. This skill helps developers avoid common pitfalls, ensuring that their applications are scalable, maintainable, and efficient. By following this skill’s guidelines, developers can ensure they are adopting the best practices in their NestJS codebases, improving code quality and reducing the risk of technical debt over time.

FAQ

When should I use this skill?

This skill is best used when writing new NestJS modules, controllers, or services, reviewing code for architecture and security issues, or refactoring existing NestJS codebases to follow best practices.

Is this skill compatible with older versions of NestJS?

This skill is tailored for NestJS, and while it provides generally applicable best practices, some guidelines may require adjustments based on the specific version of NestJS you are using.

What are the prerequisites for using this skill?

To effectively use this skill, you should have a basic understanding of NestJS and its core concepts, including modules, dependency injection, and decorators.

Can this skill be used in microservices architectures?

Yes, this skill includes specific guidelines for building microservices with NestJS, focusing on patterns, event-driven architectures, and background job processing.

What if my project doesn't require all the best practices outlined?

The skill categorizes best practices by priority, so you can choose to implement the most critical rules first, tailoring the application of guidelines to your project's specific needs.

All Files

53 files
.github/workflows/branch-protection.yml0.7 KB
View
.github/workflows/deploy.yml1.2 KB
View
rules/api-use-pipes.md5.3 KB
View
rules/devops-graceful-shutdown.md5.8 KB
View
.gitignore0.2 KB
View
rules/api-versioning.md4.9 KB
View
AGENTS.md158.9 KB
View
README.md4.4 KB
View
SKILL.md4.5 KB
View
metadata.json0.8 KB
View
rules/api-use-dto-serialization.md4.3 KB
View
rules/api-use-interceptors.md5.4 KB
View
rules/arch-avoid-circular-deps.md2.0 KB
View
rules/devops-use-config-module.md4.3 KB
View
rules/devops-use-logging.md5.6 KB
View
rules/di-interface-segregation.md5.1 KB
View
rules/micro-use-queues.md6.1 KB
View
rules/micro-use-health-checks.md5.8 KB
View
rules/test-e2e-supertest.md4.7 KB
View
rules/_sections.md2.1 KB
View
rules/_template.md0.6 KB
View
rules/arch-feature-modules.md2.0 KB
View
rules/arch-use-repository-pattern.md2.8 KB
View
rules/db-avoid-n-plus-one.md3.8 KB
View
rules/arch-module-sharing.md3.8 KB
View
rules/di-liskov-substitution.md7.1 KB
View
rules/perf-async-hooks.md2.8 KB
View
rules/test-mock-external-services.md4.5 KB
View
rules/arch-single-responsibility.md2.9 KB
View
rules/di-prefer-constructor-injection.md2.3 KB
View
rules/perf-lazy-loading.md3.7 KB
View
rules/test-use-testing-module.md4.3 KB
View
rules/arch-use-events.md3.0 KB
View
rules/di-use-interfaces-tokens.md2.5 KB
View
rules/perf-use-caching.md3.4 KB
View
scripts/build.sh0.4 KB
View
rules/db-use-migrations.md3.7 KB
View
rules/error-throw-http-exceptions.md3.1 KB
View
rules/security-rate-limiting.md3.2 KB
View
scripts/package.json0.4 KB
View
rules/db-use-transactions.md3.9 KB
View
rules/error-use-exception-filters.md3.6 KB
View
rules/security-sanitize-output.md3.7 KB
View
rules/di-avoid-service-locator.md2.9 KB
View
rules/micro-use-patterns.md5.0 KB
View
rules/security-validate-all-input.md3.3 KB
View
rules/di-scope-awareness.md2.6 KB
View
rules/perf-optimize-database.md3.2 KB
View
scripts/build-agents.ts8.5 KB
View
rules/error-handle-async-errors.md3.4 KB
View
rules/security-auth-jwt.md4.0 KB
View
scripts/package-lock.json8.5 KB
View
rules/security-use-guards.md3.6 KB
View

Install nestjs-best-practices

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill