csharp-dotnet

Generate C# and .NET service patterns with clean architecture and EF Core.

19|2|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/CamiloAndresGTRUniandes/lucy-ai --skill csharp-dotnet-camiloandresgtruniandes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-dotnet
Source: https://github.com/CamiloAndresGTRUniandes/lucy-ai/tree/main/skills/csharp-dotnet
Command: npx skills add https://github.com/CamiloAndresGTRUniandes/lucy-ai --skill csharp-dotnet-camiloandresgtruniandes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you produce consistent, production-ready C# and .NET code by enforcing clean architecture boundaries, safe dependency injection, reliable async patterns, and predictable data access with EF Core.

Core Features & Use Cases

  • Clean Architecture (required): Keeps Domain independent by structuring Domain/Application/Infrastructure/API with inward-only dependencies.
  • Dependency Injection (required): Establishes interface-based DI lifetimes (Scoped DbContext/repositories/services) and common registration patterns.
  • Entity Framework Core (required): Defines DbContext modeling and query patterns such as eager loading and DTO projections.
  • Async/Await (required): Ensures async boundaries with CancellationToken propagation to support responsive APIs.
  • Result pattern + error handling (required): Encourages explicit business-result modeling and global exception-to-HTTP mapping.
  • Minimal APIs (preferred) + DTO records: Promotes clean endpoint definitions and immutable DTOs for safer data flow.
  • Testing conventions: Recommends unit-testing with mocks and scenario-based naming.

Quick Start

Implement your next OpenClaw .NET feature using clean architecture, DI lifetimes, EF Core query projections, async methods with CancellationToken, and Result-based business logic by aligning your C# code to this skill’s required patterns.

Frequently Asked Questions about csharp-dotnet

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

FAQPage Schema
How do I structure a .NET service using clean architecture?

Structure your .NET service using clean architecture by enforcing inward-only dependencies across Domain, Application, Infrastructure, and API layers. This keeps the Domain layer independent while ensuring production-grade boundaries.

What is the best way to configure dependency injection lifetimes for EF Core DbContext?

Configure EF Core DbContext with a Scoped dependency injection lifetime to ensure safe data access. Interface-based registration for repositories and services ensures predictable scoping and prevents concurrency issues across your .NET APIs.

How do I handle errors in Minimal APIs using the Result pattern?

Handle errors in Minimal APIs by implementing explicit Result-based business logic modeling alongside global exception-to-HTTP mapping. This pattern ensures predictable error handling and consistent endpoint structures for your .NET services.

Why should I pass CancellationToken through async await methods in C#?

Pass CancellationToken through async await methods to support responsive APIs and allow cooperative cancellation of long-running operations. Propagating the token ensures your C# services handle client disconnects and application shutdowns safely.

How do I project DTOs in EF Core queries for C# APIs?

Project DTOs in EF Core queries by using immutable records and immediate query projections to shape data directly at the database level. This prevents over-fetching and ensures safer data flow across your .NET Minimal APIs.

Can I use Minimal APIs with DTO records for clean architecture in .NET?

Yes, you can use Minimal APIs with immutable DTO records to define clean endpoints and safer data flow in .NET. This preferred approach aligns with clean architecture by keeping endpoint definitions lightweight and isolated from business logic.