csharp-pro
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.
Author
Category
Development ToolsInstall
Download and extract to your skills directory
Copy command and send to OpenClaw for auto-install:
C# Pro - Modern C# Development Expert Assistant
Skills Overview
C# Pro is an AI assistant focused on modern C# and .NET development, helping developers write high-quality C# code, optimize application performance, and implement enterprise-grade architecture patterns.
Applicable Scenarios
1. C# Code Refactoring and Modernization
When you need to upgrade legacy C# code to modern language features, C# Pro can proactively identify improvement opportunities. For example, converting traditional classes to records, using pattern matching instead of long if-else chains, or introducing nullable reference types to improve code safety.
2. .NET Application Performance Optimization
When facing performance bottlenecks, C# Pro provides professional optimization strategies, including using Span
3. Enterprise Application Architecture Design
When building complex .NET systems, C# Pro assists with implementing SOLID principles, microservice architectures, and domain-driven design. It also provides comprehensive unit testing strategies using xUnit, NUnit, and FluentAssertions to ensure code quality.
Core Features
Application of Modern C# Language Features
Make full use of C# 9+ features to write concise code. Use records to define immutable data structures, simplify conditional logic with pattern matching, and enable nullable reference types to catch null-reference errors at compile time.
Performance and Concurrent Programming
Provide guidance on asynchronous programming based on the TPL (Task Parallel Library), avoiding common async/await pitfalls. Use BenchmarkDotNet for performance benchmarking to identify hotspots and optimize accordingly.
Comprehensive Testing and Code Quality
Build a complete testing system, including unit tests, integration tests, and mock object management. Configure EditorConfig and static analysis tools to maintain consistent coding style and quality standards.
Frequently Asked Questions
What is the difference between C# records and classes?
Records are a reference type introduced in C# 9, designed specifically for immutable data models. They automatically provide value-based equality comparison, concise syntax, and a built-in with-expression for creating modified copies. Compared to classes, records are better suited as DTOs, value objects, and data transfer scenarios, significantly reducing boilerplate code.
How should async/await be used correctly in C#?
Always use async/await instead of .Result or .Wait() to avoid deadlocks. Use Task instead of Task
How to optimize C# code performance?
Prioritize reducing memory allocations and use Span