usecase-pattern

Create domain use cases with constructor-injected dependencies and a call(...) entry point.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/auravibes-apps/auravibes --skill usecase-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: usecase-pattern
Source: https://github.com/auravibes-apps/auravibes/tree/main/.agents/skills/usecase-pattern
Command: npx skills add https://github.com/auravibes-apps/auravibes --skill usecase-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Domain use cases help separate orchestration logic from UI/state and repositories, enabling consistent constructor injection, guard clauses, immutable updates, and testable flows across app modules.

Core Features & Use Cases

  • Orchestrates business flows by coordinating dependencies and services.
  • Enforces a single entry point via the call(...) method with constructor-injected dependencies.
  • Promotes guard clauses and immutable updates to enable deterministic behavior.

Quick Start

Define a new use case with required dependencies and implement a call(...) method to drive the workflow.

Frequently Asked Questions about usecase-pattern

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

FAQPage Schema
How do I refactor large methods into testable use cases for business logic orchestration?

Refactor large methods into testable use cases by creating orchestration units that enforce consistent dependency injection, guard clauses, and immutable updates. This separates business flows from UI and state, ensuring deterministic behavior across app modules.

What is the best way to coordinate domain use cases across app modules?

Coordinate domain use cases by defining a single entry point via a call(...) method with constructor-injected dependencies. This pattern enforces guard clauses and delegates persistence or service calls to separate concerns for clean orchestration.

How does constructor injection work with domain-driven use case patterns?

Constructor injection in domain-driven use cases supplies required dependencies upfront, ensuring the call(...) method operates with fully initialized services. This enables immutable updates and deterministic, testable orchestration flows without hidden dependencies.

When should I use guard clauses in business logic orchestration?

Use guard clauses in business logic orchestration to enforce preconditions and prevent invalid state transitions early. Combined with immutable updates, they ensure deterministic behavior and simplify testing by failing fast before executing the core workflow.

Can I use immutable updates with delegated persistence in use case orchestration?

Immutable updates work with delegated persistence by ensuring the use case call(...) method does not mutate state directly. Instead, it delegates persistence or service calls to injected dependencies, keeping orchestration logic separate and deterministic.

Why does separating orchestration logic from UI and repositories improve testability?

Separating orchestration logic from UI and repositories improves testability by isolating business flows into single-entry-point use cases. This allows you to inject mock dependencies, verify guard clauses, and test immutable updates without triggering UI or database side effects.