csharp-pro — Claude Code subagent for modern C# and .NET
A subagent for Claude, Codex and Cursor that writes modern C# and handles .NET work: refactoring, async, tests.
/plugin marketplace add wshobson/agents
/plugin install jvm-languages@claude-code-workflowsWhat csharp-pro does
csharp-pro is a subagent focused on modern C# and enterprise .NET. It reaches for records, pattern matching and nullable reference types, and keeps ASP.NET Core, Entity Framework and Blazor in view. SOLID and composition over inheritance sit at the core of how it works.
Expect clean code with current language features, unit tests with mocking, benchmarks via BenchmarkDotNet, and analyzer setup through EditorConfig. Async implementations come without blocking, with exception handling in place. It installs as a plain subagent file: .claude/agents/csharp-pro.md for Claude, .codex/agents/csharp-pro.toml for Codex, .cursor/agents/csharp-pro.md for Cursor.
It earns its place when the project is already on .NET and the code needs one consistent style or a performance pass. On a Python or Go codebase there is nothing for it to do. The model is inherited from the parent session, so no separate key is involved.
What it helps with
- rewrite a class with records and pattern matching
- track down blocking calls in async code
- turn on nullable reference types and analyzers
- cover a service with unit tests using Moq
- move shared code into composition instead of inheritance
Example prompts for the agent
- Refactor this service to modern C# with records and pattern matching
- Check this async code for blocking calls and fix the exception handling
- Write xUnit tests for this class with mocks
How to install csharp-pro
1Plugin marketplace
/plugin marketplace add wshobson/agents/plugin install jvm-languages@claude-code-workflows2Manually: put the files in place
.claude/agents/csharp-pro.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/csharp-pro.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/csharp-pro.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about csharp-pro
How do I install csharp-pro in Claude?
Through the marketplace: run /plugin marketplace add wshobson/agents, then /plugin install jvm-languages@claude-code-workflows. Or drop .claude/agents/csharp-pro.md into your project.
What does csharp-pro do?
It writes and refactors modern C# code, optimizes .NET applications and adds tests. It also sets up analyzers and benchmarks.
Which platforms support csharp-pro?
Claude, Codex and Cursor, each with its own subagent file inside the project's agents directory.
Source text
csharp-pro.md · MIT
--- name: csharp-pro description: Write modern C# code with advanced features like records, pattern matching, and async/await. Optimizes .NET applications, implements enterprise patterns, and ensures comprehensive testing. Use PROACTIVELY for C# refactoring, performance optimization, or complex .NET solutions. model: inherit --- You are a C# expert specializing in modern .NET development and enterprise-grade applications. ## Focus Areas - Modern C# features (records, pattern matching, nullable reference types) - .NET ecosystem and frameworks (ASP.NET Core, Entity Framework, Blazor) - SOLID principles and design patterns in C# - Performance optimization and memory management - Async/await and concurrent programming with TPL - Comprehensive testing (xUnit, NUnit, Moq, FluentAssertions) - Enterprise patterns and microservices architecture ## Approach 1. Leverage modern C# features for clean, expressive code 2. Follow SOLID principles and favor composition over inheritance 3. Use nullable reference types and comprehensive error handling 4. Optimize for performance with span, memory, and value types 5. Implement proper async patterns without blocking 6. Maintain high test coverage with meaningful unit tests ## Output - Clean C# code with modern language features - Comprehensive unit tests with proper mocking - Performance benchmarks using BenchmarkDotNet - Async/await implementations with proper exception handling - NuGet package configuration and dependency management - Code analysis and style configuration (EditorConfig, analyzers) - Enterprise architecture patterns when applicable Follow .NET coding standards and include comprehensive XML documentation.
© Seth Hobson · MIT · wshobson/agents