ddd-usecase-generator

Generate TypeScript use cases and event listeners with tsyringe dependency injection.

5|1|Updated Oct 29, 2025
One-click install
npx skills add https://github.com/moasadi/ddd-bun-api-boilerplate --skill ddd-usecase-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-usecase-generator
Source: https://github.com/moasadi/ddd-bun-api-boilerplate/tree/main/.claude/skills/ddd-usecase-generator
Command: npx skills add https://github.com/moasadi/ddd-bun-api-boilerplate --skill ddd-usecase-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill scaffolds application-layer use cases and event listeners with proper DI and orchestration, enabling teams to rapidly implement domain-driven workflows without boilerplate.

Core Features & Use Cases

  • Use Case templates: Single-responsibility classes with execute() methods
  • Event Listeners: Handlers for domain events
  • DI patterns: TSyringe-based injection for repositories and use cases
  • Event Emission: Emit domain events after business operations
  • Examples: "RegisterUserUseCase", "PlaceOrderUseCase"

Quick Start

  • Create a new use case following the template; ensure injects and emits events as shown in examples

Frequently Asked Questions about ddd-usecase-generator

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

FAQPage Schema
How do I auto-generate use cases with dependency injection in TypeScript?

Auto-generate use cases by scaffolding application-layer classes with @injectable() decorators and execute() methods. The generator creates TSyringe-based dependency injection patterns, enabling rapid implementation of domain-driven use cases without manual boilerplate for repositories and service injection.

Can I automatically generate event listeners for domain events?

Yes, the generator creates event listener handlers for domain events alongside use cases. It scaffolds listeners with proper DI integration, allowing you to emit and handle domain events as part of your event-driven architecture in TypeScript projects using tsyringe.

What's the best way to structure use cases with repository injection?

Structure use cases by injecting repositories via string tokens through TSyringe. The generator applies class-based use-case injection patterns, ensuring single-responsibility execute() methods with proper error propagation and event emission after business operations complete.

How do I implement event emission in generated use cases?

Generated use cases emit domain events after executing business logic. The scaffold includes event emission templates that propagate domain events from your use case, enabling event-driven workflows and listener orchestration without manual wiring.

Does this generator work with existing TypeScript DDD projects?

Yes, the generator applies to TypeScript projects already using domain-driven design patterns and tsyringe for dependency injection. It scaffolds new use cases and listeners that integrate with your existing repositories and domain event infrastructure.

When should I use this for complex workflows?

Use the generator when building complex workflows requiring multiple coordinated use cases and event-driven logic. It satisfies functional and technical requirements for multi-operation business flows, reducing scaffolding time and ensuring consistent DI and event propagation patterns.