scaffold-cqrs-query

Generates CQRS query and handler classes for paginated list and get-by-id endpoints in .NET.

1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/GSU26SE55/backend --skill scaffold-cqrs-query-gsu26se55
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scaffold-cqrs-query
Source: https://github.com/GSU26SE55/backend/tree/main/.claude/skills/dev/be/scaffold-cqrs-query
Command: npx skills add https://github.com/GSU26SE55/backend --skill scaffold-cqrs-query-gsu26se55

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing CQRS query handlers for every new entity in a .NET microservice is repetitive boilerplate: pagination, filters, sorting, conditional includes, and data shaping all follow the same pattern but must be retyped each time. This Skill generates consistent GetList and GetById query/handler pairs from a single command. ## Core Features & Use Cases - GetList Scaffolding: Generates a paginated query with search term, status and parent filters, ascending/descending ordering, and field-based data shaping. - GetById Scaffolding: Generates a single-entity query with not-found and soft-delete checks plus opt-in navigation property includes. - Convention Enforcement: Applies project rules such as opt-in includes for lists, full includes for detail views, case-insensitive search, and non-awaited GetAllAsync calls. - Use Case: When adding a new Battery entity to BatteryService, run the scaffold to instantly produce BatteryGetListQuery, its handler, BatteryGetByIdQuery, and its handler following the team's exact patterns. ## Quick Start Ask the AI to scaffold a CQRS GetList query and handler for the Battery entity in BatteryService using this skill.

Frequently Asked Questions about scaffold-cqrs-query

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

FAQPage Schema
How do I scaffold a CQRS query handler in .NET?▼

Invoke the skill with the service name, entity name, and operation type (GetList or GetById). It generates the query class and its IRequestHandler implementation with pagination, filters, ordering, and data shaping already wired to the unit-of-work repository.

How to add pagination and filtering to a MediatR GetList query?▼

The generated GetList handler builds an IQueryable, applies conditional Where clauses for search term, status, parent id, and soft-delete flags, then orders and passes it to a ToPagedListAsync extension that maps entities to DTOs.

Does the generated code support Entity Framework Core includes?▼

Yes. Handlers use Include for navigation properties like Parent and Children, gated by HasParent and HasChildren flags. GetList defaults these to false to save bandwidth, while GetById defaults them to true for full detail views.

Why should GetAllAsync not be awaited in the handler?▼

In this codebase GetAllAsync returns an IQueryable synchronously despite its name, so awaiting it is incorrect. The skill's templates call it without await and then compose filters before the final async pagination call.

What are the limitations of this scaffolding approach?▼

The templates assume entities follow project conventions such as Name, Status, CreatedAt, IsDeleted, and optional Parent relationships. Entities with unusual shapes or custom query logic require manual adjustment after generation.