use-case

Implement CQRS use cases with standardized Commands, Queries, Handlers, and tests.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/dairectiv/dairectiv --skill use-case
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: use-case
Source: https://github.com/dairectiv/dairectiv/tree/main/.claude/skills/use-case
Command: npx skills add https://github.com/dairectiv/dairectiv --skill use-case

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps software teams implement CQRS use cases in the application layer by providing standardized patterns for Commands, Queries, Handlers, and their tests to reduce boilerplate and improve maintainability.

Core Features & Use Cases

  • Command and Query inputs follow the same namespace and interface conventions.
  • Handlers coordinate business logic, validation, and repository interaction.
  • Tests cover happy paths and common error scenarios using the defined patterns.

Quick Start

Create a new UseCase by defining Input, Handler, and Output in the correct namespace, implement the business logic in the Handler, and add integration tests that validate the flow according to the documented patterns.

Frequently Asked Questions about use-case

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

FAQPage Schema
How do I standardize CQRS command and query handlers in PHP?

To standardize CQRS handlers in PHP, define final readonly classes for inputs and outputs, enforce namespace locality, and orchestrate business logic through dedicated handler patterns to reduce boilerplate and improve maintainability.

What is the best way to structure CQRS use cases across different domains?

Structure CQRS use cases by standardizing Commands, Queries, and Handlers in the application layer, applying consistent input, handler orchestration, and testable output patterns across domains.

How do I write tests for CQRS command and query handlers?

Write tests for CQRS handlers by covering happy paths and common error scenarios using the defined patterns, validating the flow from input through handler orchestration to testable outputs.

Do I need final readonly classes to implement CQRS use cases?

Yes, implementing CQRS use cases requires final readonly classes to enforce immutability and conventions for inputs and outputs, ensuring proper namespace locality and maintainable handler orchestration.

Can I use this approach to coordinate validation and repository interaction in my handlers?

Yes, this approach lets you coordinate validation and repository interaction, as the handlers standardize business logic orchestration and repository interaction within the application layer.