command-generator

Generate CQRS command scaffolding with records, validators, and handlers for .NET.

4|1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill command-generator-faysilalshareef
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: command-generator
Source: https://github.com/FaysilAlshareef/dotnet-ai-kit/tree/main/skills/cqrs/command-generator
Command: npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill command-generator-faysilalshareef

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generating consistent, production-ready CQRS command scaffolding manually is repetitive and error-prone; this Skill provides standardized command records, validators, and handlers so teams produce uniform, testable code that fits common .NET architectures.

Core Features & Use Cases

  • Command Scaffolding: Create sealed record command types for create, update, and delete operations.
  • Validation: Generate FluentValidation validators with common rules and per-item child rules for collections.
  • Handler Patterns: Produce IRequestHandler implementations that use IUnitOfWork and return Result or Result<T>, and recommend feature folder layouts.
  • Use Case: Add a CreateOrderCommand, its validator, and handler under Application/Features/Orders to enforce validation and persist via unit-of-work patterns.

Quick Start

Ask the AI to "Generate a CreateOrderCommand with a FluentValidation validator and an IRequestHandler handler for the Orders feature in Application/Features".

Frequently Asked Questions about command-generator

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

FAQPage Schema
How do I generate CQRS command scaffolding for a .NET project?

To generate CQRS command scaffolding, request the AI to create a command record, FluentValidation validator, and IRequestHandler handler for a specific feature. This produces sealed record types, validation classes, and handler implementations using IUnitOfWork and Result within your Application/Features folder.

What's the best way to structure MediatR command handlers and validators?

The best way to structure MediatR command handlers and validators is using a per-feature folder layout. Place the sealed record command, FluentValidation validator, and IRequestHandler implementation together under Application/Features/[Aggregate] to maintain uniform, testable code across create, update, and delete operations.

Does this CQRS scaffolding work with FluentValidation and MediatR?

Yes, this CQRS scaffolding works specifically with FluentValidation and MediatR. It generates FluentValidation validators with standard rules including child rules for collections, and produces IRequestHandler implementations that integrate MediatR's request handling pipeline for your .NET applications.

Can I use IUnitOfWork and Result patterns in my command handlers?

Yes, you can use IUnitOfWork and Result patterns in your command handlers. The generated IRequestHandler implementations specifically use IUnitOfWork for persistence and return Result or Result<T> objects, ensuring standardized transaction handling and consistent error reporting across your CQRS features.

How do I create a CreateOrderCommand with validation in .NET?

To create a CreateOrderCommand with validation in .NET, ask the AI to generate the command under Application/Features/Orders. It produces a sealed record command type, a FluentValidation validator with common rules, and an IRequestHandler that persists data via IUnitOfWork and returns Result.

What is CQRS command scaffolding and when do I need it?

CQRS command scaffolding is the automated generation of command records, validators, and handlers for create, update, and delete operations. You need it when building .NET applications with MediatR and FluentValidation to eliminate repetitive manual coding and ensure consistent, production-ready architectural patterns.