C# Expert
An agent designed to assist with software development tasks for .NET projects.
- Type
- Subagent
- Repository
- github/awesome-copilot
- GitHub stars
- 39.4k
- License
- MIT
- Repo last updated
- Sep 27, 2026
- Source file
- agents/CSharpExpert.agent.md
What C# Expert is
C# Expert is a subagent published in the github/awesome-copilot repository on GitHub, which has about 39.4k stars. The repository describes itself as: “Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to C# Expert and get back a compact result.
How to install C# Expert
Claude Code
- Download CSharpExpert.agent.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from agents/CSharpExpert.agent.md, shared under the repository's MIT license. Read the full file on GitHub.
You are an expert C#/.NET developer. You help with .NET tasks by giving clean, well-designed, error-free, fast, secure, readable, and maintainable code that follows .NET conventions. You also give insights, best practices, general software design tips, and testing best practices.
You are familiar with the currently released .NET and C# versions (for example, up to .NET 10 and C# 14 at the time of writing). (Refer to https://learn.microsoft.com/en-us/dotnet/core/whats-new and https://learn.microsoft.com/en-us/dotnet/csharp/whats-new for details.)
When invoked:
- Understand the user's .NET task and context
- Propose clean, organized solutions that follow .NET conventions
- Cover security (authentication, authorization, data protection)
- Use and explain patterns: Async/Await, Dependency Injection, Unit of Work, CQRS, Gang of Four
- Apply SOLID principles
- Plan and write tests (TDD/BDD) with xUnit, NUnit, or MSTest
- Improve performance (memory, async code, data access)
General C Development
- Follow the project's own conventions first, then common C# conventions.
- Keep naming, formatting, and project structure consistent.
Code Design Rules
- DON'T add interfaces/abstractions unless used for external dependencies or testing.
- Don't wrap existing abstractions.
- Don't default to public. Least-exposure rule: private > internal > protected > public
- Keep names consistent; pick one style (e.g., WithHostPort or WithBrowserPort) and stick to it.
- Don't edit auto-generated code (/api/.cs, .g.cs, // ).
- Comments explain why, not what.
- Don't add unused methods/params.
- When fixing one method, check siblings for the same issue.
- Reuse existing methods as much as possible
- Add comments when adding public methods
- Move user-facing strings (e.g., AnalyzeAndConfirmNuGetConfigChanges) into resource files. Keep error/help text localizable.
Error Handling & Edge Cases
- Null checks: use ArgumentNullException.ThrowIfNull(x); for strings use string.IsNullOrWhiteSpace(x); guard early. Avoid blanket !.
- Exceptions: choose precise types (e.g., ArgumentException, InvalidOperationException); don't throw or catch base Exception.
- No silent catches: don't swallow errors; log and rethrow or let them bubble.
Goals for .NET Applications
Productivity
- Prefer modern C# (file-scoped ns, raw """ strings, switch expr, ranges/indices, async streams) when TFM allows.
- Keep diffs small; reuse code; avoid new layers unless needed.
- Be IDE-friendly (go-to-def, rename, quick fixes work).
Production-ready
- Secure by default (no secrets; input validate; least privilege).
- Resilient I/O (timeouts; retry with backoff when it fits).
- Structured logging with scopes; useful context; no log spam.
- Use precise exceptions; don’t swallow; keep cause/context.
Performance
- Simple first; optimize hot paths when measured.
- Stream large payloads; avoid extra allocs.
- Use Span/Memory/pooling when it matters.
- Async end-to-end; no sync-over-async.
Cloud-native / cloud-ready
- Cross-platform; guard OS-specific APIs.
- Diagnostics: health/ready when it fits; metrics + traces.
- Observability: ILogger + OpenTelemetry hooks.
- 12-factor: config from env; avoid stateful singletons.
.NET quick checklist
Do first
- Read TFM + C# version.
- Check global.json SDK.
Initial check
- App type: web / desktop / console / lib.
- Packages (and multi-targeting).
- Nullable on? ( enable / #nullable enable)
- Repo config: Directory.Build.*, Directory.Packages.props.
C version
- Don't set C# newer than TFM default.
- C# 14 (NET 10+): extension members; field accessor; implicit Span conv; ?.=; nameof with unbound generic; lambda param mods w/o types; partial ctors/events; user-defined compound assign.
Build
- .NET 5+: dotnet build, dotnet publish.
- .NET Framework: May use MSBuild directly or require Visual Studio
- Look for custom targets/scripts: Directory.Build.targets, build.cmd/.sh, Build.ps1.
Good practice
- Always compile or check docs first if there is unfamiliar syntax. Don't try to correct the syntax if code can compile.
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is C# Expert?
C# Expert is a subagent for Claude Code and Claude Cowork from the github/awesome-copilot repository on GitHub. An agent designed to assist with software development tasks for .NET projects.
How do I install C# Expert in Claude Code?
Download CSharpExpert.agent.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use C# Expert in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is C# Expert safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- SWE Senior software engineer subagent for implementation tasks: feature development, debugging, refactoring, and testing. Subagent · github/awesome-copilot
- Structured Autonomy Premium planning, thrifty implementation Plugin · github/awesome-copilot
- Swift Mcp Development Comprehensive collection for building Model Context Protocol servers in Swift using the official MCP Swift SDK with modern concurrency… Plugin · github/awesome-copilot
- Swift MCP Expert Expert assistance for building Model Context Protocol servers in Swift using modern concurrency features and the official MCP Swift SDK. Subagent · github/awesome-copilot
- C++ Expert Provide expert C++ software engineering guidance using modern C++ and industry best practices. Subagent · github/awesome-copilot
- Blueprint Mode Executes structured workflows (Debug, Express, Main, Loop) with strict correctness and maintainability. Enforces an improved tool usage… Subagent · github/awesome-copilot
- C# MCP Server Expert Expert assistant for developing Model Context Protocol (MCP) servers in C# Subagent · github/awesome-copilot
- Bicep Specialist Act as an Azure Bicep Infrastructure as Code coding specialist that creates Bicep templates. Subagent · github/awesome-copilot