add-domain-module

Generate Express and TypeScript backend domain modules with layered architecture.

Updated Jul 22, 2025
One-click install
npx skills add https://github.com/jagodabie/body-harmony-BE --skill add-domain-module
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-domain-module
Source: https://github.com/jagodabie/body-harmony-BE/tree/main/.cursor/skills/add-domain-module
Command: npx skills add https://github.com/jagodabie/body-harmony-BE --skill add-domain-module

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the repetitive and error-prone work of creating a new backend domain module in an Express + TypeScript codebase with strict architectural rules. It helps you generate a full module consistently across routes, controllers, services, repositories, optional Mongo models, and API documentation.

Core Features & Use Cases

  • End-to-end module scaffolding: Generates the required files for a new domain, including routes, controller, service, repository interface, Mongo implementation, and instance wiring.
  • Architecture enforcement: Preserves separation of concerns by keeping business logic in services, HTTP handling in controllers, and database access in repositories only.
  • Swagger/OpenAPI integration: Detects the project’s existing documentation pattern and adds valid endpoint and schema docs in the matching style.
  • Use Case: When adding a new domain like nutrition, activity, or weight tracking, use this Skill to create a production-aligned scaffold with CRUD endpoints and docs without violating import boundaries or naming conventions.

Quick Start

Ask the AI to use the add-domain-module skill to create a kebab-case domain with your endpoints and specify whether it needs a Mongo model.

Frequently Asked Questions about add-domain-module

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

FAQPage Schema
How do I scaffold a complete Express TypeScript API module with layered architecture?

Scaffolding an Express TypeScript API module is done by generating routes, controllers, services, and repositories simultaneously. This process creates a complete backend domain scaffold with strict import boundaries and kebab-case naming conventions.

How do I generate Swagger or OpenAPI documentation when adding a new Express route?

Generating Swagger or OpenAPI documentation for new Express routes happens by detecting the project's existing documentation pattern. The scaffold automatically adds valid endpoint and schema docs in the matching style alongside the new domain module files.

How do I enforce the repository pattern and prevent MongoDB leakage in TypeScript controllers?

Enforcing the repository pattern requires keeping database access strictly in repository implementations while prohibiting Mongo or Express leakage across layers. Business logic stays in services, and HTTP handling remains isolated in controllers with validation.

Can I automatically include a MongoDB model when creating a new backend domain module?

Yes, you can include a MongoDB model when creating a backend domain module. You specify whether the new kebab-case domain needs a Mongo model, and the scaffold generates the repository interface and Mongo implementation accordingly.

What is the best way to add CRUD endpoints to an Express and TypeScript application consistently?

The best way to add CRUD endpoints consistently is by scaffolding an entire domain module at once. This generates all required files including routes, controllers, services, and repositories with production-aligned architecture and documentation.

Why does my TypeScript backend architecture break when adding new API domains manually?

Manual API domain creation often breaks TypeScript backend architecture by violating import boundaries and naming conventions. Automated scaffolding enforces strict separation of concerns, ensuring business logic, HTTP handling, and database access remain in their correct layers.