cqrs-scaffolder

Scaffold CQRS commands and queries with handlers, validators, and DTOs.

Updated Dec 31, 2025
One-click install
npx skills add https://github.com/ademceper/merge --skill cqrs-scaffolder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cqrs-scaffolder
Source: https://github.com/ademceper/merge/tree/main/server/.cursor/skills/cqrs-scaffolder
Command: npx skills add https://github.com/ademceper/merge --skill cqrs-scaffolder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill scaffolds a complete CQRS command or query structure with handlers, validators, and DTOs following Merge project patterns.

Core Features & Use Cases

  • Automatic scaffolding for creating new CRUD operations within the Merge architecture.
  • Generates the folder structure Merge.Application/{Module}/Commands/{Name}/ and Merge.Application/{Module}/Queries/{Name}/ with templates for Command, CommandHandler, CommandValidator, Query, and QueryHandler.
  • Enforces guidelines: primary constructor usage, CancellationToken in every async method, mandatory logger injection, a validator per command, and query caching for read models.

Quick Start

Use the cqrs-scaffolder skill to scaffold a new command named CreateOrder under Module Orders.

Frequently Asked Questions about cqrs-scaffolder

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

FAQPage Schema
How do I scaffold a CQRS command and query structure automatically?

To scaffold a CQRS structure, generate the appropriate folder structure and templates for commands, handlers, validators, and queries within a modular module to streamline creating new CRUD operations.

What is the required pattern for CancellationToken and logger injection in CQRS handlers?

CQRS handlers require CancellationToken in every async method and mandatory logger injection. This ensures task cancellation propagation and diagnostic logging during command and query execution.

Can I auto-generate validators and DTOs for a new CQRS module?

Yes, scaffolding generates templates for Command, CommandHandler, CommandValidator, Query, and QueryHandler. It mandates a validator per command and creates data transfer objects following modular project patterns.

Does CQRS scaffolding enforce primary constructor usage in generated handlers?

Yes, scaffolding enforces primary constructor usage for handlers. It also mandates query caching for read models to optimize data retrieval within the application's modular architecture.

How do I create a new CRUD operation following CQRS patterns in a modular application?

Create a new CRUD operation by auto-scaffolding the complete CQRS command or query structure within the Merge.Application/{Module}/ directory, generating handlers, validators, and DTOs automatically.

When do I need query caching in a CQRS read model?

Query caching is mandated for CQRS read models during scaffolding. It is applied to queries to optimize data retrieval performance and reduce database load when executing query handlers.