create-usecase

Generate NestJS Clean Architecture use case boilerplate with DTOs and module scaffold.

13|1|Updated Jun 28, 2023
One-click install
npx skills add https://github.com/jovicon/nestjs-clean-architecture-event-driven-template --skill create-usecase
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-usecase
Source: https://github.com/jovicon/nestjs-clean-architecture-event-driven-template/tree/main/.claude/skills/create-usecase
Command: npx skills add https://github.com/jovicon/nestjs-clean-architecture-event-driven-template --skill create-usecase

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes the process of adding new use cases in a NestJS Clean Architecture project, reducing boilerplate and ensuring consistent structure across modules.

Core Features & Use Cases

  • Generates boilerplate for a new use case, its DTOs, and a minimal module file.
  • Enforces UseCase interface implementation, Result/Either error handling, and constructor-based dependency injection.
  • Follow the pattern from existing use cases in the Order module.

Quick Start

Run the create-usecase skill with module-name and usecase-name to generate the boilerplate under src/modules/{module-name}/application/useCases/{usecase-name}/.

Frequently Asked Questions about create-usecase

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

FAQPage Schema
How do I generate a new use case in a NestJS clean architecture project?

Generating a new use case in a NestJS clean architecture project involves creating boilerplate for DTOs, a UseCase interface, and module scaffolding. This enforces input validation, dependency injection, and consistent structure across modules.

What boilerplate is needed for a clean architecture use case?

Clean architecture use case boilerplate requires DTOs for input validation, a UseCase interface, and a minimal module file. It enforces Result/Either error handling and constructor-based dependency injection for production-ready code.

Can I use this scaffolding to expand an existing NestJS module?

Yes, you can use this scaffolding to expand an existing NestJS module. It applies to module expansion scenarios by generating new business workflow files under the module's application useCases directory, following the existing Order module pattern.

How does dependency injection work in a generated NestJS use case?

Dependency injection in a generated NestJS use case works via constructor-based injection. The boilerplate enforces proper dependency injection patterns, ensuring the new business workflow aligns with the existing module architecture.

Where are generated use case files placed in a clean architecture structure?

Generated use case files are placed under src/modules/{module-name}/application/useCases/{usecase-name}/ directory. This standardized path ensures new business workflows align with the existing NestJS clean architecture module organization.