# modern-csharp-coding-standards

This skill guides C# implementation and refactoring, from strongly typed models to async methods and buffer handling.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 582 installs · ★ 86
- Author: wshaddix
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/wshaddix/dotnet-skills/tree/HEAD/skills/csharp-coding-standards/SKILL.md
- Updated: 2026-02-27
- HTML: https://affpapa.org/en/nevibecode/skills/wshaddix-modern-csharp-coding-standards

## What it does

The skill steers agents toward modern C# constructs such as `record`, `readonly record struct`, pattern matching, nullable reference types, and composition over inheritance. It also lays out conventions for names, file organization, namespaces, and access modifiers.

For asynchronous code, it recommends cancellation support. For performance-critical paths, it points to `Span<T>` and `Memory<T>`. The guidance also covers focused interfaces and public API design. It draws on C# 12+ features, so check whether those fit your project’s target version.

Use it when creating a C# service, shaping a library API, or refactoring an existing codebase. The skill provides coding guidance; you still need to verify that suggested syntax works with your target .NET version.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill modern-csharp-coding-standards -a claude-code
```
```bash
npx skills add wshaddix/dotnet-skills --skill csharp-coding-standards -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/csharp-coding-standards/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/csharp-coding-standards/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill csharp-coding-standards -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/csharp-coding-standards/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill csharp-coding-standards -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/csharp-coding-standards/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install wshaddix/dotnet-skills csharp-coding-standards
```

2. **Manually: put the files in place**
- File: `.github/skills/csharp-coding-standards/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill csharp-coding-standards -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/wshaddix/dotnet-skills --path skills/csharp-coding-standards
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/csharp-coding-standards/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill csharp-coding-standards -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/wshaddix/dotnet-skills/tree/HEAD/skills/csharp-coding-standards/SKILL.md

## When to use it
- apply consistent conventions to new C# code
- refactor models with stronger typing
- design a library’s public API
- add cancellation support to async methods
- handle buffers with Span<T> or Memory<T>

## Example prompts
- Refactor this C# class using the skill’s guidance while preserving its behavior.
- Design a public API for this library with nullable reference types in mind.
- Rewrite this buffer-handling code with Span<T> if it fits the use case.

## Similar
- [migrate-to-shoehorn](https://affpapa.org/en/nevibecode/skills/migrate-to-shoehorn.md) — skill · 475388 installs
- [write-swift](https://affpapa.org/en/nevibecode/skills/write-swift.md) — skill · 119300 installs
- [megacave](https://affpapa.org/en/nevibecode/skills/megacave.md) — skill · 25400 installs
- [find-docs](https://affpapa.org/en/nevibecode/skills/find-docs.md) — skill · 9400 installs
- [typescript-advanced-types](https://affpapa.org/en/nevibecode/skills/typescript-advanced-types.md) — skill · 92169 installs
- [smart-explore](https://affpapa.org/en/nevibecode/skills/smart-explore.md) — skill · 7300 installs

## Other versions with the same name
- [modern-csharp-coding-standards · aaronontheweb](https://affpapa.org/en/nevibecode/skills/modern-csharp-coding-standards.md) — 2200 installs

From the same set: [wshaddix/dotnet-skills](https://affpapa.org/en/nevibecode/by/wshaddix/dotnet-skills.md) — 13 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
