create-dapper-query

Generate read-only Dapper SQL queries with Domain and Infrastructure artifacts.

2|Updated May 2, 2026
One-click install
npx skills add https://github.com/andrecini/dotnet-squad-copilot-agent --skill create-dapper-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-dapper-query
Source: https://github.com/andrecini/dotnet-squad-copilot-agent/tree/main/.claude/skills/create-dapper-query
Command: npx skills add https://github.com/andrecini/dotnet-squad-copilot-agent --skill create-dapper-query

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you create a correct, convention-compliant Dapper SQL query and the related C# artifacts without mixing in EF Core logic or unsafe patterns.

Core Features & Use Cases

  • SQL generation with guardrails: Produces a Dapper-ready SQL statement that follows repository conventions, including mandatory soft-delete filtering via deleted_at IS NULL.
  • Repository-ready implementation: Adds the SQL constant in the Domain, updates the repository interface, implements the repository method in Infrastructure, and wires parameters properly.
  • Test scaffolding and validation: Generates repository unit tests (including empty and non-empty result scenarios) and corresponding data mocks to keep behavior verifiable.
  • Use case: When you need a custom read-only report or lookup (for example, “list orders with customer name and status”), this skill generates the SQL and all required code changes to support it end-to-end.

Quick Start

Use the create-dapper-query skill to create a Dapper query for listing order summaries by customer, including the SQL and the repository method plus tests.

Frequently Asked Questions about create-dapper-query

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

FAQPage Schema
How do I generate Dapper SQL queries with soft-delete filtering in C#?

To generate Dapper SQL queries with soft-delete filtering, define the SQL constant in the Domain layer and ensure the repository method queries include `deleted_at IS NULL`. This approach keeps read-only reporting lookups safe and convention-compliant.

What is the best way to structure Dapper repository methods for clean architecture?

Structuring Dapper repository methods for clean architecture involves parameterizing repository interfaces in Infrastructure and keeping SQL constants in the Domain. This separation ensures safe read-only data access without mixing unsafe patterns or Entity Framework logic.

How do I write unit tests for Dapper repository methods with data mocks?

Writing unit tests for Dapper repository methods requires scaffolding empty and non-empty result scenarios using data mocks. This validates the repository behavior and ensures the generated SQL queries handle various data states correctly.

Does Dapper work with PostgreSQL snake_case tables and PascalCase aliases?

Dapper works with PostgreSQL by mapping snake_case table and column names to PascalCase aliases in the query. This convention ensures the SQL statement correctly aligns with C# domain models while maintaining database naming standards.

Can I use natural language intent to generate Dapper SQL for reporting?

You can use natural-language intent or a provided SQL draft to generate Dapper SQL for reporting. The process creates the SQL statement and wires all required Domain and Infrastructure artifacts to support the lookup end-to-end.