Skip to main content
skill CX Codex

csharp-expert · personamanagmentlayer — Claude Code skill: what it does, how to install

The csharp-expert skill guides agents through modern C# work with .NET, ASP.NET Core, LINQ, and async code. Use it for backend services and enterprise application patterns.

Apache-2.0 221 installs ★ 45 updated 2026-10-12

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add personamanagmentlayer/pcl --skill csharp-expert -a claude-code
Open on GitHub

What csharp-expert does

csharp-expert gives the agent a focused set of practices for C# 12+, .NET 8+, ASP.NET Core, LINQ, and asynchronous programming. It favors records, pattern matching, nullable references, constructor injection, and async flows that avoid blocking calls.

The skill includes examples for repository and Result patterns, strongly typed settings through IOptions<EmailSettings>, EF Core data access, and the IDisposable pattern. It also points to xUnit and Moq for unit tests, with deeper material in references/CORE_CONCEPTS.md. Its allowed work includes reading, writing, editing files, and running dotnet commands.

The project needs .NET 8 or newer. Earlier runtimes do not match the stated requirement.

What it helps with

  • write modern C# 12+ code
  • keep asynchronous methods free of blocking calls
  • structure services with dependency injection
  • build LINQ queries backed by EF Core
  • return operation outcomes through a Result pattern

Example prompts for the agent

  • Create a .NET 8 service in C# with async/await and constructor injection.
  • Rewrite this LINQ query and remove the blocking .Result call.
  • Add an EF Core repository, a Result<T> type, and xUnit tests with Moq.

How to install csharp-expert

1Skills CLI (Vercel)

npx skills add personamanagmentlayer/pcl --skill csharp-expert -a claude-code

2Manually: put the files in place

~/.claude/skills/csharp-expert/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/csharp-expert/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about csharp-expert

How do I install csharp-expert in Claude Code?

Run npx skills add personamanagmentlayer/pcl --skill csharp-expert -a claude-code, then check ~/.claude/skills/csharp-expert/SKILL.md.

What does csharp-expert do?

It guides the agent on C# 12+, .NET 8+, ASP.NET Core, LINQ, and async/await. Its examples cover dependency injection, EF Core, records, pattern matching, and the Result pattern.

Which .NET version does csharp-expert require?

The skill requires .NET 8 or newer. Its guidance also targets C# 12+.

Source text

SKILL.md · Apache-2.0
---
name: csharp-expert
version: 1.1.0
description: >-
  Expert-level C# development with .NET 8+, ASP.NET Core, LINQ, async/await, and enterprise
  patterns. Use when the user mentions C#, .NET, ASP.NET, enterprise, or Microsoft
  platforms, or when the task involves Modern C#, Async/Await, LINQ, or ASP.NET Core.
category: languages
author: PCL Team
license: Apache-2.0
tags:
  - csharp
  - dotnet
  - aspnet
  - enterprise
  - microsoft
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash(dotnet:*)
  - Glob
  - Grep
requirements:
  dotnet: '>=8.0'
---

# C# Expert

You are an expert C# developer with deep knowledge of modern C# (12+), .NET 8+, ASP.NET Core, LINQ, async programming, and enterprise application development. You write clean, performant, and maintainable C# code following industry best practices.

## Best Practices

### 1. Use Modern C# Features

```csharp
// Records for DTOs
public record UserDto(int Id, string Name, string Email);

// Pattern matching
string GetMessage(object value) => value switch
{
    int i => $"Integer: {i}",
    string s => $"String: {s}",
    _ => "Unknown"
};

// Null-coalescing assignment
_cache ??= new Dictionary<string, object>();
```

### 2. Async All the Way

```csharp
// Good - async all the way
public async Task<User> GetUserAsync(int id)
{
    return await _repository.GetByIdAsync(id);
}

// Bad - blocking on async
public User GetUser(int id)
{
    return _repository.GetByIdAsync(id).Result; // Deadlock risk!
}
```

### 3. Use Dependency Injection

```csharp
// Good - constructor injection
public class UserService
{
    private readonly IUserRepository _repository;

    public UserService(IUserRepository repository)
    {
        _repository = repository;
    }
}

// Bad - new keyword
public class UserService
{
    private readonly UserRepository _repository = new UserRepository();
}
```

### 4. IDisposable Pattern

```csharp
public class ResourceManager : IDisposable
{
    private bool _disposed;
    private readonly FileStream _stream;

    public ResourceManager(string path)
    {
        _stream = new FileStream(path, FileMode.Open);
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    protected virtual void Dispose(bool disposing)
    {
        if (_disposed) return;

        if (disposing)
        {
            _stream?.Dispose();
        }

        _disposed = true;
    }
}

// Usage
using var manager = new ResourceManager("file.txt");
```

### 5. Configuration

```csharp
// appsettings.json
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=localhost;Database=mydb"
  },
  "EmailSettings": {
    "SmtpServer": "smtp.example.com",
    "Port": 587
  }
}

// Strongly-typed configuration
public class EmailSettings
{
    public string SmtpServer { get; set; } = string.Empty;
    public int Port { get; set; }
}

// Register
builder.Services.Configure<EmailSettings>(
    builder.Configuration.GetSection("EmailSettings"));

// Use
public class EmailService
{
    private readonly EmailSettings _settings;

    public EmailService(IOptions<EmailSettings> settings)
    {
        _settings = settings.Value;
    }
}
```

## Common Patterns

### Repository Pattern

```csharp
public interface IRepository<T> where T : class
{
    Task<T?> GetByIdAsync(int id);
    Task<IEnumerable<T>> GetAllAsync();
    Task<T> CreateAsync(T entity);
    Task<T> UpdateAsync(T entity);
    Task<bool> DeleteAsync(int id);
}

public class Repository<T> : IRepository<T> where T : class
{
    private readonly AppDbContext _context;
    private readonly DbSet<T> _dbSet;

    public Repository(AppDbContext context)
    {
        _context = context;
        _dbSet = context.Set<T>();
    }

    public async Task<T?> GetByIdAsync(int id) => await _dbSet.FindAsync(id);
    public async Task<IEnumerable<T>> GetAllAsync() => await _dbSet.ToListAsync();

    public async Task<T> CreateAsync(T entity)
    {
        await _dbSet.AddAsync(entity);
        await _context.SaveChangesAsync();
        return entity;
    }
}
```

### Result Pattern

```csharp
public record Result<T>
{
    public bool IsSuccess { get; init; }
    public T? Value { get; init; }
    public string? Error { get; init; }

    public static Result<T> Success(T value) => new() { IsSuccess = true, Value = value };
    public static Result<T> Failure(string error) => new() { IsSuccess = false, Error = error };
}

// Usage
public async Task<Result<User>> GetUserAsync(int id)
{
    var user = await _repository.GetByIdAsync(id);
    return user is not null
        ? Result<User>.Success(user)
        : Result<User>.Failure("User not found");
}
```

## Approach

When writing C# code:

1. **Use Modern Features**: Records, pattern matching, nullable references
2. **Async Everywhere**: Don't block on async code
3. **Dependency Injection**: Constructor injection for testability
4. **LINQ for Queries**: Readable and maintainable data operations
5. **Test Thoroughly**: Unit tests with xUnit and Moq
6. **Follow Conventions**: Pascal case for public, camel case for private
7. **Use EF Core**: ORM for database access
8. **Leverage .NET 8+**: Latest features and performance improvements

Always write clean, performant, and maintainable C# code following .NET best practices.

## Reference Documentation

Detailed material lives alongside this skill and is read on demand:

- [Core Expertise](references/CORE_CONCEPTS.md) — Modern C# (C# 12+), Async/Await, LINQ, ASP.NET Core, Entity Framework Core, Testing

© PCL Team · Apache-2.0 · personamanagmentlayer/pcl

Similar skills

All skills for Programming languages →

csharp-expert by other authors comes first.

csharp-expert dotnet csharp-expert — a skill for Claude Code, Codex, Cursor and other agents that routes C# and .NET requests to the right specialist or locates the missing plugin in the dotnet/skills marketplace. CX Codex +1 2,200installs csharp-dotnet-development official Awesome Copilot Community The csharp-dotnet-development plugin adds C# and .NET commands plus a software-engineering agent. Use it for test guidance, ASP.NET Minimal API endpoints, and .NET upgrade work. ★ 41,430repo stars openapi-to-application-csharp-dotnet official Awesome Copilot Community openapi-to-application-csharp-dotnet is a GitHub Copilot plugin that builds .NET applications from OpenAPI specifications. It creates an ASP.NET Core scaffold and generates controllers. ★ 41,430repo stars csharp-testing affaan-m csharp-testing — a skill that gives your agent C# and .NET testing patterns: xUnit, FluentAssertions, mocks, integration tests. CX Codex +1 6,200installs minimal-api codewithmukesh Teaches .NET 10 Minimal API patterns: endpoint groups, TypedResults, parameter binding, and OpenAPI metadata. CX Codex +1 4,000installs csharp-pro rmyndharis csharp-pro — a skill for Claude Code, Codex, and Cursor. Guides the AI agent in modern C# development, architecture design, and .NET runtime performance tuning. CX Codex +1 136installs csharp-developer VoltAgent Community The csharp-developer subagent inspects .NET solutions and helps build C# applications, ASP.NET Core APIs, and Entity Framework Core features. Use it when async code or clean architecture is part of the task. CX Codex 276installs

From the same set104

The whole set →
aerospace-expert The aerospace-expert skill gives coding agents aerospace context for flight systems, maintenance, safety, and aviation software. Use it when those domains shape the task. CX Codex +1 228installs scala-expert scala-expert is a Claude Code skill with a Scala reference the agent reads before writing code, covering immutability, pattern matching, monads, typed Akka actors and stream pipelines. CX Codex +1 226installs standards-expert standards-expert gives the agent a working reference on ISO management systems — processes, risk scoring, audits — for teams preparing a certification. CX Codex +1 226installs flask-expert flask-expert guides Python work with Flask apps, REST APIs, extensions, and deployment. Use it when a task involves Jinja2, Flask structure, authentication, or API design. CX Codex +1 225installs maritime-expert The maritime-expert skill gives an agent maritime domain knowledge for vessel tracking, port operations, cargo systems, and shipping software. CX Codex +1 221installs kafka-expert kafka-expert — a skill for Apache Kafka work: producer and consumer patterns, Kafka Streams topologies, partitioning and consumer groups, ready whenever a project touches event streaming. CX Codex +1 220installs fastapi-expert fastapi-expert — a skill for building FastAPI APIs: Pydantic models, JWT auth, SQLAlchemy integration and background tasks, all with working code patterns. CX Codex +1 218installs nodejs-expert nodejs-expert guides the AI assistant in backend development with Node.js, Express, async handling, clustering, and production safety practices. CX Codex +1 216installs

Project sponsors

Companies that keep this analytics open