Nestjs foundation
Skill ahtishamshahzad/agent_dev_flow/.ai/skills/backend/nestjs-foundation
Use to plan a NestJS foundation after NestJS is approved — module boundaries, dependency injection, providers, pipes/guards/interceptors/filters, config module, conventions for a multi-developer codebase. Plans only; scaffolds nothing without task approval.From its SKILL.md
npx -y skills add ahtishamshahzad/agent_dev_flow --skill nestjs-foundationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.4 KB, 854 tokens by cl100k_base, as published. Nobody here has run it
NestJS Foundation
Purpose
Define the foundation of an approved NestJS API: module boundaries per domain, DI/provider conventions, the request lifecycle (pipes → guards → interceptors → filters), and configuration — so the framework's structure serves the domains rather than ceremony.
When to Use
- After
backend-stack-selectionchose NestJS and Gate 2 approved it. - Not for Express (
express-foundation) or before the stack decision.
Inputs
- Approved stack decision and architecture (
../../architecture-design). - Domain list, team conventions, async/realtime needs (queues, WebSockets, schedules).
Discovery Questions
- What are the domains, and which share providers?
- Which cross-cutting concerns are global (validation pipe, auth guard, exception filter)?
- Are queues/WebSockets/scheduling in scope now (Nest modules for each)?
Responsibilities
- Define modules per domain, each owning its controllers, services, and data providers; shared code in explicit shared modules — no circular imports.
- Set the request lifecycle: global ValidationPipe (whitelist, transform), guards for authn/authz, interceptors for logging/serialization, exception filters mapping to the error contract (
backend-error-handling). - Plan
ConfigModulewith validated env schema (fail fast). - Note where Nest's ecosystem covers approved needs (queues, WebSocket gateways, schedule module) — each still a justified choice.
- Keep providers injectable and testable; no service locators or hidden singletons.
Required Workflow
- Confirm approval + architecture inputs.
- Map domains → modules; mark shared modules explicitly.
- Define global pipes/guards/interceptors/filters and their order.
- Define config + env validation.
- Record the foundation plan; implementation follows approved tasks only.
Decision Rules
- One module per domain; split only when a module grows multiple concerns.
- Global validation pipe with
whitelist: true— unknown fields never reach services. - Authorization is a guard + service-level check, not controller
ifs (backend-authorization). - Prefer Nest-native integrations for queues/WebSockets/scheduling when those needs are approved — coherence is why NestJS was chosen.
Rules
- No scaffolding or dependency installation before task approval (Gate 4).
- Module boundaries mirror the architecture's domain boundaries.
- Every global concern (pipe/guard/filter) recorded — they are invisible in handlers.
Anti-Patterns
- One giant
AppModulewith everything registered globally. - Circular module imports patched with
forwardRefinstead of fixing boundaries. - Business logic in controllers or guards.
- Adopting every Nest feature (CQRS, microservices) without a requirement.
Validation Checklist
- Domain → module map defined; shared modules explicit; no cycles.
- Global pipes/guards/interceptors/filters planned and ordered.
- Config module + env validation planned (fail fast).
- Async/realtime module needs noted against approvals.
- Nothing installed or scaffolded yet.
Definition of Done
A recorded NestJS foundation plan — module map, request lifecycle, config, conventions — ready to drive approved implementation tasks for a multi-developer codebase.
Related Skills
backend-stack-selection, backend-api-architecture, backend-validation, backend-error-handling, backend-authorization, queues, realtime-communication, scheduled-jobs.
Related Knowledge
../../../knowledge/ (domain boundaries, team conventions).
Related References
../../../references/backend/nestjs/ (module examples, when populated).
Context Loading Guidance
- Requires: approved stack decision, domain list, architecture summary.
- Does not require: database internals, other packs, unrelated references.
- May load:
backend-api-architecture,backend-authorization(guard design). - Stop when: the foundation plan is recorded.
Token Efficiency Guidance
Plan at module-map altitude; a domain→module table beats generated code. Delegate lifecycle details to the specialist skills.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.