ilude/claude-code-config/csharp-workflow
Claude Code and agent skill by ilude/claude-code-config
- community
Checking that the SKILL.md file is still in the repository.
C# and .NET project workflow guidelines. Activate when working with C# files (.cs), .csproj, .NET projects, or C#-specific tooling.
Install
npx vskill@latest install ilude/claude-code-config/csharp-workflowSKILL.md
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
C# Projects Workflow
Tool Grid
| Task | Tool | Command | |
|---|---|---|---|
| Lint | Roslynator | dotnet roslynator analyze | |
| Format | dotnet format | dotnet format | |
| Build | dotnet | dotnet build | |
| Test | dotnet | dotnet test | |
| Publish | dotnet | dotnet publish | |
| Watch | dotnet | dotnet watch run | |
| NuGet restore | dotnet | dotnet restore | |
| Add package | dotnet | dotnet add package <name> |
C# 12+ Features
Primary Constructors
SHOULD use primary constructors for dependency injection and simple initialization:
Collection Expressions
SHOULD use collection expressions for collection initialization:
Raw String Literals
SHOULD use raw string literals for multi-line strings and strings containing quotes:
File-Scoped Namespaces
MUST use file-scoped namespaces to reduce nesting:
.NET 8+ Patterns
Minimal APIs
SHOULD use minimal APIs for microservices and simple endpoints:
AOT Compilation
SHOULD design for AOT compatibility when targeting native deployment:
- MUST NOT use reflection-heavy patterns
- SHOULD use source generators instead of runtime reflection
- MUST use
[JsonSerializable]for System.Text.Json
Keyed Services
MAY use keyed services for named dependency resolution:
Naming Conventions
General Rules
| Element | Convention | Example | |
|---|---|---|---|
| Public members | PascalCase | GetUserAsync() | |
| Private fields | _camelCase | _userRepository | |
| Local variables | camelCase | userName | |
| Constants | PascalCase | MaxRetryCount | |
| Interfaces | IPascalCase | IUserService | |
| Type parameters | TPascalCase | TEntity | |
| Async methods | Async suffix | GetUserAsync() |
MUST Follow
- MUST use
Iprefix for interfaces - MUST use
Asyncsuffix for async methods - MUST NOT use Hungarian notation
- MUST NOT use underscores in public identifiers
Nullable Reference Types
Configuration
MUST enable nullable reference types in all projects:
Usage Rules
- MUST annotate all reference types explicitly
- MUST handle null appropriately with null-conditional operators
- SHOULD use
requiredkeyword for required properties - MUST NOT use
!(null-forgiving operator) except when absolutely necessary
Async/Await Best Practices
Rules
- MUST use async all the way (no sync-over-async)
- MUST use
ConfigureAwait(false)in library code - MUST use
CancellationTokenfor cancellable operations - SHOULD prefer
ValueTaskfor hot paths with frequent sync completion - MUST NOT use
async voidexcept for event handlers
Exception Handling
- MUST catch specific exceptions, not
Exception - SHOULD use
whenclause for conditional catches - MUST NOT swallow exceptions silently
Dependency Injection
Rules
- MUST use constructor injection for required dependencies
- SHOULD use primary constructors for DI
- MUST NOT use service locator pattern
- MUST register services with appropriate lifetime
Lifetime Guidelines
| Lifetime | Use Case | |
|---|---|---|
| Singleton | Stateless services, caches | |
| Scoped | Per-request services, DbContext | |
| Transient | Lightweight, stateless operations |
Record Types
DTOs and Value Objects
MUST use records for DTOs and immutable data:
Rules
- MUST use positional records for simple DTOs
- MAY use record classes with properties for complex objects
- SHOULD use
withexpressions for immutable updates
LINQ Best Practices
Method Syntax
SHOULD prefer method syntax over query syntax:
Performance
- MUST materialize queries when iterating multiple times
- SHOULD use
Any()instead ofCount() > 0 - SHOULD use
FirstOrDefault()with predicate - MUST NOT use LINQ in hot paths without benchmarking
Testing
Framework Options
| Framework | Command | |
|---|---|---|
| xUnit | dotnet test | |
| NUnit | dotnet test | |
| MSTest | dotnet test |
xUnit Patterns (RECOMMENDED)
Rules
- MUST follow Arrange-Act-Assert pattern
- MUST use meaningful test names
- SHOULD use
[Theory]for parameterized tests - MUST mock external dependencies
Project Structure
RECOMMENDED Layout
Directory.Build.props
SHOULD use centralized build configuration:
Error Handling
Result Pattern
SHOULD use Result pattern for expected failures:
Exceptions
- MUST use exceptions for exceptional conditions only
- SHOULD create custom exceptions for domain errors
- MUST include relevant context in exception messages
Configuration
Options Pattern
MUST use Options pattern for configuration:
Code Quality
Analyzers
SHOULD enable code analysis:
EditorConfig
MUST include .editorconfig for consistent style across team.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/csharp-workflow/SKILL.md
Popularity
- Repository stars
- 7
- 7-day trend score
- 10
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ilude/claude-code-config/csharp-workflow)