create-repository

Generates Domain repository interfaces and Infrastructure implementations for SQL/NoSQL with EF Core or Dapper and soft delete via DeletedAt.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It streamlines adding a data access repository by creating the Domain interface and the Infrastructure implementation without mixing responsibilities across layers.

Core Features & Use Cases

  • Scaffold Domain repository contracts: Generate I[Recurso]Repository inside the Domain layer so Application/UseCases can depend on abstractions.
  • Implement Infrastructure data access safely: Create [Recurso]Repository in Infrastructure with either EF Core or Dapper, including soft delete via DeletedAt (no EF Remove()).
  • Produce required supporting artifacts: Add Dapper SQL constants in Domain and create corresponding Infrastructure tests and mocks.
  • Use Cases: Implementing persistence for a new aggregate (e.g., Order, Product) or adding a read-heavy repository (e.g., paged lists or JOIN-based projections) while keeping endpoints and migrations out of scope.

Quick Start

Ask to create the repository for a resource and list the operations you need, for example: "create the repository for Product with GetById, GetPaged, and SearchByName."

Frequently Asked Questions about create-repository

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

FAQPage Schema
How do I implement the repository pattern in C# keeping domain interfaces separate from infrastructure?

Generating a repository in Domain-Driven Design involves creating an interface in the Domain layer and its implementation in Infrastructure. This maintains clean architecture boundaries, allowing use cases to depend on abstractions rather than concrete data access code.

How do I scaffold a new repository for an aggregate using EF Core and Dapper?

Scaffolding a repository for an aggregate requires specifying the resource and operations. You decide between EF Core or Dapper per operation, generating the interface, implementation, and extracting Dapper SQL constants into the Domain layer.

How do I enforce soft delete in an EF Core repository without calling Remove?

Enforcing soft delete in an EF Core repository requires using a DeletedAt timestamp instead of the Remove method. The generated repository implementation sets the DeletedAt property to safely mark records as deleted without physically removing them from the database.

Does this repository scaffolding approach work for both SQL and NoSQL persistence scenarios?

Yes, this repository scaffolding works for both SQL and NoSQL persistence scenarios. It generates the Domain repository interface and Infrastructure implementation tailored to the specified resource, accommodating different database technologies while maintaining consistent soft delete rules.

Do I need to register the generated repository in the Unit of Work manually?

You do not need to manually register the generated repository in the Unit of Work separately. The scaffolding process automatically registers the repository in the Unit of Work and InfrastructureDependency modules to ensure transactional consistency and dependency injection.

Can I generate unit tests with mocks for my Dapper repository queries?

Yes, you can generate safe unit tests with mocks for Dapper repository queries. The scaffolding process produces corresponding Infrastructure tests and mocks alongside the Dapper SQL constant extraction to verify data access logic without hitting a live database.