nestjs-architect

Plans NestJS module architecture with Clean Architecture layers and automated scaffolding scripts.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/lucaszhh/agents --skill nestjs-architect-lucaszhh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nestjs-architect
Source: https://github.com/lucaszhh/agents/tree/main/skills/back/nestjs-architect
Command: npx skills add https://github.com/lucaszhh/agents --skill nestjs-architect-lucaszhh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Designing a new NestJS module without a clear structure leads to coupled layers, circular dependencies, and inconsistent patterns across the codebase. This Skill enforces a strict Clean Architecture / DDD layout (presentation, domain, data) and persists the full design as a plan document instead of flooding the chat. ## Core Features & Use Cases - Architecture Planning: Defines module structure with strict layer separation, abstract-class DI tokens, and TypeORM persistence strategy, written to .agents/plans/<name>.md. - Automated Scaffolding: Runs scripts/scaffold_module.sh to generate domain interfaces, abstract service/repository contracts, and the NestJS module file in dependency-safe order. - Circular Dependency Verification: Validates the generated module with npx madge --circular, with a manual layer-rule fallback when madge is unavailable. - Use Case: Ask the agent to design a new payment-requests module; it scaffolds the contracts, writes the architecture plan to disk, and replies in chat with only a summary, gaps, and business questions. ## Quick Start Ask the agent to design the architecture for a new NestJS module named payment-requests following Clean Architecture.

Frequently Asked Questions about nestjs-architect

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

FAQPage Schema
How do I structure a NestJS module with Clean Architecture?▼

Organize each module into presentation (controllers, DTOs, mappers), domain (entity interfaces, abstract service contracts), and data (repository contracts, TypeORM implementations) layers. Use abstract classes as DI tokens and register concrete implementations in the module providers.

How to scaffold a NestJS module automatically?▼

Run bash scripts/scaffold_module.sh <module-name> to generate the domain interface, abstract service contract, abstract repository contract, and the NestJS module file in dependency-safe order. Then verify with npx madge --circular src/modules/.

Why use abstract classes instead of interfaces for NestJS dependency injection?▼

TypeScript interfaces are erased at runtime, so NestJS cannot use them as injection tokens. Abstract classes like IFeatureService persist at runtime and work as providers via { provide: IFeatureService, useClass: FeatureService }.

When should I not use an architecture planning skill for NestJS?▼

Skip architecture planning when adding a method to an existing service, fixing a concrete bug, or writing tests. Those tasks go directly to implementation or testing workflows without a new architectural plan.

How do I handle database transactions in NestJS with TypeORM?▼

Define an abstract IUnitOfWork contract in the domain layer and implement it with TypeORM QueryRunner in the data layer. The runInTransaction method starts, commits, or rolls back the transaction and always releases the query runner.