nest-conventions

Enforce NestJS module-per-feature layout, DI wiring, and lifecycle hooks.

9|1|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill nest-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nest-conventions
Source: https://github.com/AratKruglik/antigravity-sdlc/tree/main/plugins/nestjs-plugin/skills/nest-conventions
Command: npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill nest-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establish a shared blueprint for NestJS module structure, dependency injection wiring, and lifecycle usage to reduce architectural drift and improve maintainability.

Core Features & Use Cases

  • Module-per-feature layout: one feature equals a dedicated NestJS module.
  • Wire DI correctly: constructor injection, scopes, and custom tokens.
  • Config and lifecycle: proper ConfigModule setup, ValidationPipe usage, and exception filters.
  • Lifecycle awareness: apply OnModuleInit, OnApplicationShutdown for reliable startup and shutdown.

Quick Start

Create a NestJS feature module following this skill's conventions and wire it into the root AppModule.

Frequently Asked Questions about nest-conventions

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

FAQPage Schema
How do I structure NestJS modules to prevent architectural drift in a growing backend?

To prevent architectural drift in a NestJS backend, enforce a module-per-feature layout where one feature equals a dedicated module. This standardizes dependency injection wiring, global config patterns, and lifecycle hooks, keeping the codebase maintainable as it scales.

What is the correct way to wire dependency injection and lifecycle hooks in a NestJS feature module?

The correct way to wire dependency injection in NestJS involves using constructor injection, managing scopes, and applying custom tokens. For lifecycle usage, implement OnModuleInit and OnApplicationShutdown interfaces to ensure reliable application startup and graceful shutdown processes.

How do I set up ConfigModule and global exception filters in a NestJS backend?

Set up ConfigModule in a NestJS backend by applying proper initialization patterns at the root AppModule level. Combine this with ValidationPipe usage and proper exception filters to validate inputs and handle errors uniformly across all feature modules.

Does this NestJS module convention approach require specific dependencies or components?

No specific external dependencies or components are required to apply these NestJS module conventions. The approach relies entirely on standard NestJS structural patterns, built-in lifecycle interfaces, and native dependency injection features to enforce architectural consistency.

When should I use OnModuleInit and OnApplicationShutdown lifecycle hooks in NestJS?

Use OnModuleInit and OnApplicationShutdown lifecycle hooks in NestJS when you need reliable startup initialization and graceful shutdown processes. Applying these hooks ensures your feature modules properly manage resources during application lifecycle transitions.