agentsclimarketplace

Csharp coding

Skill nguyenthdat/opencode-manager/registry/skills/csharp-coding

Project-scoped OpenCode TUI plugin for grouping and managing MCP servers, custom agent skills, and pinned vendor skill registries.

Install
npx -y skills add nguyenthdat/opencode-manager --skill csharp-coding

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 13 days oldThe repository was created 13 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Comprehensive idiomatic C#/.NET guidance: 186 prioritized rules across 15 categories covering memory/resource management, error handling, async/await, API and record design, LINQ, naming, nullability, dependency injection, testing, documentation, performance, project structure, analyzers, and anti-patterns. Use when writing, reviewing, refactoring, optimizing, or debugging C# or .NET code (`.cs`, `.csproj`, `Directory.Build.props`). Targets modern C# 12/13 and .NET 8/9 idioms (primary constructors, collection expressions, required members, nullable reference types, records) while respecting the project's declared language version and target framework.

SKILL.md

28.7 KB, as published. Nobody here has run it

C# / .NET Best Practices

Comprehensive guide for writing high-quality, idiomatic C# and .NET code. Contains 186 rules across 15 categories, prioritized by impact. Project constraints override generic defaults: preserve the declared LangVersion, TargetFramework, and nullable/analyzer settings unless the user explicitly requests a migration or upgrade.

When to Apply

Reference these guidelines when:

  • Writing new C# classes, records, methods, or minimal API endpoints
  • Implementing error handling or async/await code
  • Designing public APIs for libraries or NuGet packages
  • Reviewing code for nullability, disposal, or concurrency issues
  • Optimizing memory usage or reducing allocations
  • Configuring dependency injection lifetimes and registrations
  • Writing or reviewing unit/integration tests
  • Refactoring existing C#/.NET code
  • Setting up analyzers, .editorconfig, or CI formatting checks

Modern C#/.NET (C# 12/13, .NET 8/9)

For an existing project, preserve its LangVersion and TargetFramework unless a migration is explicitly in scope. For new projects, target the latest LTS/STS release actually supported by your deployment environment. Key modern idioms to prefer when the project's language version supports them:

For the authoritative, complete list of language and runtime changes, consult the official What's New in C# and .NET release notes. Everything below applies across supported versions; prefer the modern forms above where the project's LangVersion/TargetFramework allow them.

Rule Categories by Priority

PriorityCategoryImpactPrefixRules
1Memory & Resource ManagementCRITICALmem-14
2Error HandlingCRITICALerr-13
3Async/Await & ConcurrencyCRITICALasync-17
4API & Type DesignHIGHapi-15
5Records & ImmutabilityHIGHimmut-10
6LINQ & CollectionsHIGHlinq-12
7Naming ConventionsMEDIUMname-14
8Type Safety & NullabilityMEDIUM/HIGHtype-12
9Dependency Injection & ConfigurationMEDIUMdi-10
10TestingMEDIUMtest-13
11DocumentationMEDIUMdoc-9
12Performance PatternsMEDIUMperf-12
13Project StructureLOWproj-10
14Analyzers & LintingLOWlint-10
15Anti-patternsREFERENCEanti-15

Quick Reference

1. Memory & Resource Management (CRITICAL)

2. Error Handling (CRITICAL)

3. Async/Await & Concurrency (CRITICAL)

4. API & Type Design (HIGH)

5. Records & Immutability (HIGH)

6. LINQ & Collections (HIGH)

7. Naming Conventions (MEDIUM)

8. Type Safety & Nullability (MEDIUM/HIGH)

9. Dependency Injection & Configuration (MEDIUM)

10. Testing (MEDIUM)

11. Documentation (MEDIUM)

12. Performance Patterns (MEDIUM)

13. Project Structure (LOW)

14. Analyzers & Linting (LOW)

15. Anti-patterns (REFERENCE)


Recommended .csproj / Directory.Build.props Settings

<!-- Directory.Build.props (repository root) -->
<Project>
  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
    <LangVersion>latest</LangVersion>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <AnalysisLevel>latest</AnalysisLevel>
    <AnalysisMode>Recommended</AnalysisMode>
    <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <NuGetAudit>true</NuGetAudit>
    <NuGetAuditMode>all</NuGetAuditMode>
  </PropertyGroup>
</Project>
<!-- Directory.Packages.props (repository root) -->
<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
  </PropertyGroup>
</Project>
# .editorconfig
root = true

[*.cs]
indent_style = space
indent_size = 4
csharp_style_namespace_declarations = file_scoped:warning
dotnet_style_namespace_match_folder = true:warning
dotnet_style_require_accessibility_modifiers = always:warning
dotnet_diagnostic.CA2007.severity = warning  # ConfigureAwait(false) in libraries

How to Use

This skill provides rule identifiers for quick reference. When generating or reviewing C#/.NET code:

  1. Check relevant category based on task type
  2. Apply rules with matching prefix
  3. Prioritize CRITICAL > HIGH > MEDIUM > LOW
  4. Read rule files in rules/ for detailed examples

Rule Application by Task

TaskPrimary Categories
New class/methodapi-, err-, name-
New record/DTOimmut-, api-, type-
Async codeasync-, mem-
Error handlingerr-, api-
Memory optimizationmem-, perf-
LINQ/collectionslinq-, perf-
Dependency injectiondi-
Writing teststest-
Performance tuningperf-, mem-, linq-
Code reviewanti-, lint-

Related Skills

  • design-patterns - choosing and implementing GoF and idiomatic patterns; apply alongside this skill's API and naming rules for pattern-heavy C# design.
  • security-review - security-focused audit checklists; apply alongside this skill's error-handling and interop rules when reviewing C# code for vulnerabilities.

Sources

This skill synthesizes best practices from:

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.