본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)12k · #11420

dotnet-core-expert

하는 일

클린 아키텍처로 .NET 8 백엔드 서비스를 만들도록 AI 에이전트를 안내합니다. C#으로 빠르고 안전한 API와 마이크로서비스를 만드는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓최소 API를 사용하는 .NET 8 웹 API를 시작할 때.
  • ✓CQRS와 MediatR을 쓰는 클린 아키텍처를 원할 때.
  • ✓JWT 로그인이나 Entity Framework Core를 설정해야 할 때.

스킬 링크

https://github.com/Jeffallan/claude-skills/blob/main/skills/dotnet-core-expert/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/Jeffallan/claude-skills/blob/main/skills/dotnet-core-expert/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“예약 서비스를 위한 .NET 8 최소 API를 만들어 주세요. JWT 로그인과 Entity Framework Core를 포함해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 계층을 설계하고, 엔드포인트와 데이터 접근을 구현한 뒤 빌드와 테스트를 실행합니다. 그다음 curl이나 REST 클라이언트로 엔드포인트를 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

.NET Core Expert

Core Workflow

  1. Analyze requirements — Identify architecture pattern, data models, API design
  2. Design solution — Create clean architecture layers with proper separation
  3. Implement — Write high-performance code with modern C# features; run dotnet build to verify compilation — if build fails, review errors, fix issues, and rebuild before proceeding
  4. Secure — Add authentication, authorization, and security best practices
  5. Test — Write comprehensive tests with xUnit and integration testing; run dotnet test to confirm all tests pass — if tests fail, diagnose failures, fix the implementation, and re-run before continuing; verify endpoints with curl or a REST client

Reference Guide

Load detailed guidance based on context:

Topic Reference Load When
Minimal APIs references/minimal-apis.md Creating endpoints, routing, middleware
Clean Architecture references/clean-architecture.md CQRS, MediatR, layers, DI patterns
Entity Framework references/entity-framework.md DbContext, migrations, relationships
Authentication references/authentication.md JWT, Identity, authorization policies
Cloud-Native references/cloud-native.md Docker, health checks, configuration

Constraints

MUST DO

  • Use .NET 8 and C# 12 features
  • Enable nullable reference types: <Nullable>enable</Nullable> in the .csproj
  • Use async/await for all I/O operations — e.g., await dbContext.Users.ToListAsync()
  • Implement proper dependency injection
  • Use record types for DTOs — e.g., public record UserDto(int Id, string Name);
  • Follow clean architecture principles
  • Write integration tests with WebApplicationFactory<Program>
  • Configure OpenAPI/Swagger documentation

MUST NOT DO

  • Use synchronous I/O operations
  • Expose entities directly in API responses
  • Skip input validation
  • Use legacy .NET Framework patterns
  • Mix concerns across architectural layers
  • Use deprecated EF Core patterns

Code Examples

Minimal API Endpoint

// Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(Program).Assembly));

var app = builder.Build();
app.UseSwagger();
app.UseSwaggerUI();

app.MapGet("/users/{id}", async (int id, ISender sender, CancellationToken ct) =>
{
    var result = await sender.Send(new GetUserQuery(id), ct);
    return result is null ? Results.NotFound() : Results.Ok(result);
})
.WithName("GetUser")
.Produces<UserDto>()
.ProducesProblem(404);

app.Run();

MediatR Query Handler

// Application/Users/GetUserQuery.cs
public record GetUserQuery(int Id) : IRequest<UserDto?>;

public sealed class GetUserQueryHandler : IRequestHandler<GetUserQuery, UserDto?>
{
    private readonly AppDbContext _db;

    public GetUserQueryHandler(AppDbContext db) => _db = db;

    public async Task<UserDto?> Handle(GetUserQuery request, CancellationToken ct) =>
        await _db.Users
            .AsNoTracking()
            .Where(u => u.Id == request.Id)
            .Select(u => new UserDto(u.Id, u.Name))
            .FirstOrDefaultAsync(ct);
}

EF Core DbContext with Async Query

// Infrastructure/AppDbContext.cs
public sealed class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
{
    public DbSet<User> Users => Set<User>();

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
    }
}

// Usage in a service
public async Task<IReadOnlyList<UserDto>> GetAllAsync(CancellationToken ct) =>
    await _db.Users
        .AsNoTracking()
        .Select(u => new UserDto(u.Id, u.Name))
        .ToListAsync(ct);

DTO with Record Type

public record UserDto(int Id, string Name);
public record CreateUserRequest(string Name, string Email);

Output Templates

When implementing .NET features, provide:

  1. Project structure (solution/project files)
  2. Domain models and DTOs
  3. API endpoints or service implementations
  4. Database context and migrations if applicable
  5. Brief explanation of architectural decisions

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

[Documentation](http

자주 묻는 질문

코드가 빌드되는지 확인하나요?

네. dotnet build를 실행하고, 다음 단계로 넘어가기 전에 오류를 고칩니다.

테스트를 실행하나요?

네. dotnet test를 실행하며, xUnit과 통합 테스트를 사용합니다.

Docker도 다루나요?

네. 클라우드 네이티브 안내에는 Docker, 상태 점검, 설정이 포함됩니다.

상세 정보

작성자의 원본 설명

Use when building .NET 8 applications with minimal APIs, clean architecture, or cloud-native microservices. Invoke for Entity Framework Core, CQRS with MediatR, JWT authentication, AOT compilation.

repo: Jeffallan/claude-skills

인기도

GitHub 스타
12k
순위
#11420
라이선스
MIT
업데이트
2026. 10. 30.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬