Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

csharp-review

verified

An agent designed to assist with software development tasks for C#/.NET projects.

View on GitHub

Marketplace

lbussell-agent-skills

lbussell/agent-skills

Plugin

agent-skills

Repository

lbussell/agent-skills

skills/csharp-review/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/lbussell/agent-skills/blob/main/skills/csharp-review/SKILL.md -a claude-code --skill csharp-review

Installation paths:

Claude
.claude/skills/csharp-review/
Powered by add-skill CLI

Instructions

# C#/.NET Code Review

Review C# code changes for best practices, modern patterns, and maintainability.

## Getting Changes to Review

Determine what the user wants reviewed, then get the diffs:

```bash
# Last N commits
git --no-pager diff HEAD~3..HEAD -- '*.cs'

# Since a specific commit
git --no-pager diff abcd1234..HEAD -- '*.cs'

# Between two commits
git --no-pager diff abcd1234..2345bcde -- '*.cs'

# Staged changes
git --no-pager diff --cached -- '*.cs'

# Unstaged changes
git --no-pager diff -- '*.cs'
```

For full file context when needed:
```bash
git --no-pager show HEAD:path/to/file.cs
```

## Review Checklist

Review changes against these principles:

### Modern C# 14/.NET 10

- [ ] Use collection expressions `[1, 2, 3]` instead of `new List<int> { 1, 2, 3 }`
- [ ] Use primary constructors where appropriate
- [ ] Use file-scoped namespaces
- [ ] Use pattern matching over type checks and casts
- [ ] Use switch expressions where applicable

### DTOs and Records

- [ ] DTOs should be `record` types, not classes
- [ ] Records should be immutable (use `init` properties or positional parameters)
- [ ] Records should use primary constructors
- [ ] Collections in records should be `ImmutableList<T>`/`ImmutableDictionary<K,V>` or `IReadOnlyList<T>`/`IReadOnlyDictionary<K,V>`
- [ ] DTOs/Records should have minimal behavior (no business logic)

### SOLID Principles

- [ ] **Single Responsibility**: Each class has one reason to change
- [ ] **Open-Closed**: Open for extension, closed for modification
- [ ] **Dependency Inversion**: Depend on interfaces, not concrete implementations
- [ ] Always question inheritance — prefer composition

### Error Handling

- [ ] Do not use `null` for control flow
- [ ] Avoid redundant null checks—let errors bubble up
- [ ] Avoid unnecessary try/catch blocks—don't swallow exceptions
- [ ] Use result types or exceptions appropriately for the context

### Code Smells

- [ ] Avoid primitive obsession (use domain types)
- [ ] No new `New

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
2811 chars