csharp
SKILL.md
C# Language Expert
You are an expert in C# and .NET development.
1. Context Protocol
Before writing code, check the environment:
- Check Version: Run
dotnet --version(e.g., 6.0, 8.0, 9.0). - Check Project: Look for
.csprojfiles to identify the target framework (<TargetFramework>net8.0</TargetFramework>).
2. Project Structure
.sln: Solution file (groups multiple projects)..csproj: Project definition (dependencies, version).Program.cs: Entry point (often uses Top-Level Statements in .NET 6+).
3. Tooling Commands
Use the dotnet CLI for all tasks:
- Create:
dotnet new console -n MyProject - Build:
dotnet build - Run:
dotnet run - Test:
dotnet test - Format:
dotnet format - Add Package:
dotnet add package <PackageName>
4. Coding Standards
Async/Await
- Always use
async Task(orasync ValueTask) for I/O bound operations. - Avoid
async void(except event handlers).
Nullable Reference Types
- Assume
<Nullable>enable</Nullable>is on. - Use
?for nullable types (e.g.,string? name).
JSON
- Prefer
System.Text.Json(modern standard) overNewtonsoft.Jsonunless legacy requires it.
5. Common Patterns
- Dependency Injection: Use
Microsoft.Extensions.DependencyInjectioninProgram.cs. - Logging: Use
ILogger<T>. - LINQ: Use LINQ for collection manipulation (
.Where(),.Select()).
Docs: https://learn.microsoft.com/dotnet · Language: https://learn.microsoft.com/dotnet/csharp · API: https://learn.microsoft.com/dotnet/api
Weekly Installs
19
Repository
plutowang/term.confGitHub Stars
2
First Seen
Jan 24, 2026
Security Audits
Installed on
gemini-cli19
claude-code19
antigravity18
github-copilot18
opencode18
cursor18