add-module

Scaffolds NestJS modules with entities, repositories, services, controllers, DTOs, and AppModule wiring.

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/aymansalkhatib/medledger --skill add-module-aymansalkhatib
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: add-module
Source: https://github.com/aymansalkhatib/medledger/tree/main/.claude/skills/add-module
Command: npx skills add https://github.com/aymansalkhatib/medledger --skill add-module-aymansalkhatib

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually creating a new NestJS feature module means writing a dozen boilerplate files and keeping naming, layering, and wiring consistent with the rest of the codebase. This Skill generates a complete module under src/modules/<plural>/ that matches the existing conventions of the MedLedger codebase exactly. ## Core Features & Use Cases - Full module scaffolding: Generates the module class, controller, DTOs, entity, repository, service, exceptions, interfaces, and utils in the correct folder layout. - Layer-aware design: Classifies the module as a leaf (owns state) or operation (orchestrates leaves in one transaction) and enforces downward-only imports to prevent circular dependencies. - Convention enforcement: Mirrors sibling modules like transfers/ and waste-records/ for naming, file shapes, idempotency handling, and contract-exact response DTOs. - Use Case: When you need to add a new domain feature such as waste records to the API, invoke the Skill with the feature name and it produces every file, wires AppModule alphabetically, and verifies lint, build, and tests pass. ## Quick Start Ask the AI to scaffold a new module named waste-record with a controller so it generates the full NestJS module structure and wires it into AppModule.

Frequently Asked Questions about add-module

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

FAQPage Schema
How do I scaffold a new NestJS module with entity, service, and controller?▼

Invoke the Skill with a kebab-case singular feature name, such as waste-record. It generates the module class, controller, DTOs, entity, repository, and service under src/modules/<plural>/, then wires the module into AppModule after its dependencies.

How to add a new API endpoint module in a NestJS TypeORM project?▼

Provide the feature name and the Skill creates the full module following the codebase conventions: class-validator input DTOs, contract-ordered response types, a controller named after the URL segment, and a repository using TypeORM with pessimistic locking where needed.

Can I scaffold a NestJS module without an HTTP controller?▼

Yes, pass the --no-controller flag for internal modules like ledger or idempotency-keys that expose no HTTP surface. The Skill still generates the entity, repository, service, and module wiring.

How does the Skill prevent circular dependencies between NestJS modules?▼

It classifies each module as a leaf (owns state, imports nothing) or an operation (orchestrates leaves in one transaction) and only allows downward imports. A module needing an import from a higher layer is flagged as mis-layered instead of using forwardRef.

Does the generated NestJS entity work without a database migration?▼

No, the entity is not considered complete until a migration creates its table. The Skill directs you to a follow-up step that hand-writes the migration and repository, and it forbids TypeORM synchronize: true.