reviewing-dotnet-code

Reviews and generates .NET/C# code following Microsoft conventions and modern patterns. Use when reviewing C# files, writing .NET code, refactoring, or when user mentions "C#", ".NET", "dotnet", "csharp", or asks about naming conventions in .NET projects.

25 stars

Best use case

reviewing-dotnet-code is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Reviews and generates .NET/C# code following Microsoft conventions and modern patterns. Use when reviewing C# files, writing .NET code, refactoring, or when user mentions "C#", ".NET", "dotnet", "csharp", or asks about naming conventions in .NET projects.

Teams using reviewing-dotnet-code should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/reviewing-dotnet-code/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/aiskillstore/marketplace/brendanshields/reviewing-dotnet-code/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/reviewing-dotnet-code/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How reviewing-dotnet-code Compares

Feature / Agentreviewing-dotnet-codeStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Reviews and generates .NET/C# code following Microsoft conventions and modern patterns. Use when reviewing C# files, writing .NET code, refactoring, or when user mentions "C#", ".NET", "dotnet", "csharp", or asks about naming conventions in .NET projects.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Reviewing .NET Code

Apply Microsoft's .NET coding conventions and modern C# patterns when reviewing or generating code.

## Quick Reference

### Naming Conventions

| Element | Style | Example |
|---------|-------|---------|
| Classes, Records | PascalCase | `CustomerService`, `OrderRecord` |
| Interfaces | IPascalCase | `IRepository`, `IDisposable` |
| Methods | PascalCase | `GetCustomer()`, `ValidateOrder()` |
| Properties | PascalCase | `FirstName`, `IsActive` |
| Public Fields | PascalCase | `MaxRetryCount` |
| Parameters | camelCase | `customerId`, `orderDate` |
| Local Variables | camelCase | `itemCount`, `isValid` |
| Private Fields | _camelCase | `_connectionString`, `_logger` |
| Constants | PascalCase | `DefaultTimeout`, `MaxItems` |
| Enums | PascalCase (singular) | `Color.Red`, `Status.Active` |
| Async Methods | PascalCaseAsync | `GetCustomerAsync()` |

### Type Keywords

Always use language keywords over framework types:

```csharp
// Correct
string name;
int count;
bool isActive;

// Avoid
String name;
Int32 count;
Boolean isActive;
```

### Modern C# Patterns (C# 10+)

```csharp
// File-scoped namespaces
namespace MyApp.Services;

// Target-typed new
List<Customer> customers = new();

// Collection expressions
string[] items = ["one", "two", "three"];

// Primary constructors
public class Service(ILogger logger, IRepository repo);

// Records for immutable data
public record CustomerDto(string Name, string Email);

// Raw string literals
var json = """
    { "name": "test" }
    """;
```

## Review Workflow

### Step 1: Check Naming

Scan for naming violations:
- Classes/methods not in PascalCase
- Private fields without underscore prefix
- Parameters/locals not in camelCase
- Async methods missing `Async` suffix

### Step 2: Check Patterns

Look for outdated patterns:
- `String` instead of `string`
- `new List<T>()` instead of `new()` or `[]`
- Block-scoped namespaces
- Manual null checks instead of `?.` or `??`

### Step 3: Check Async/Await

Flag async anti-patterns:
- `async void` (except event handlers)
- `.Result` or `.Wait()` blocking calls
- Missing `ConfigureAwait(false)` in libraries

### Step 4: Check Exception Handling

Verify exception patterns:
- Catching `Exception` instead of specific types
- Empty catch blocks
- Not using `using` for disposables

### Step 5: Check LINQ Usage

Identify LINQ opportunities:
- Manual loops that could be `Select`/`Where`/`Any`
- Multiple enumerations (should `.ToList()`)

## When to Read Reference Files

**Read REFERENCE.md when:**
- User asks for detailed naming rules
- Reviewing complex class hierarchies
- Need specific async/await guidance
- Reviewing exception handling patterns

**Read EXAMPLES.md when:**
- Need before/after refactoring samples
- Showing concrete improvements
- User asks "how should this look?"

## Anti-Patterns to Flag

### Critical (Always Flag)

```csharp
// async void (except event handlers)
public async void ProcessData() { }

// Blocking on async
var result = GetDataAsync().Result;
task.Wait();

// Empty catch
try { } catch { }

// Catching base Exception
catch (Exception ex) { }
```

### Important (Flag in Reviews)

```csharp
// Hungarian notation
int iCount;      // use: count
string strName;  // use: name

// Screaming caps
const int MAX_SIZE = 100;  // use: MaxSize

// System types
String name;  // use: string
```

## Code Generation Templates

### Service Class

```csharp
namespace MyApp.Services;

public class CustomerService(
    ILogger<CustomerService> logger,
    ICustomerRepository repository)
{
    public async Task<Customer?> GetByIdAsync(
        int id,
        CancellationToken cancellationToken = default)
    {
        logger.LogDebug("Getting customer {Id}", id);
        return await repository.FindByIdAsync(id, cancellationToken);
    }
}
```

### Record DTO

```csharp
namespace MyApp.Models;

public record CustomerDto(
    int Id,
    string Name,
    string Email,
    DateOnly CreatedDate);
```

### Interface

```csharp
namespace MyApp.Abstractions;

public interface ICustomerRepository
{
    Task<Customer?> FindByIdAsync(int id, CancellationToken ct = default);
    Task<IReadOnlyList<Customer>> GetAllAsync(CancellationToken ct = default);
    Task AddAsync(Customer customer, CancellationToken ct = default);
}
```

## EditorConfig Integration

If project has `.editorconfig`, defer to those rules for style preferences. Check before suggesting style changes.

## Review Checklist

- [ ] Naming follows conventions
- [ ] Using language keywords (string, int, bool)
- [ ] Async methods have Async suffix
- [ ] No async void (except event handlers)
- [ ] No blocking calls (.Result, .Wait())
- [ ] Using statements for disposables
- [ ] Specific exception types caught
- [ ] LINQ used where appropriate
- [ ] Modern C# features applied

Related Skills

reviewing-cli-command

25
from ComeOnOliver/skillshub

Provides checklist for reviewing Typer CLI command implementations. Covers structure, Annotated syntax, error handling, exit codes, display module usage, destructive action patterns, and help text conventions. Use when user asks to review/check/verify a CLI command, wants feedback on implementation, or asks if a command follows best practices.

reviewing-oracle-to-postgres-migration

25
from ComeOnOliver/skillshub

Identifies Oracle-to-PostgreSQL migration risks by cross-referencing code against known behavioral differences (empty strings, refcursors, type coercion, sorting, timestamps, concurrent transactions, etc.). Use when planning a database migration, reviewing migration artifacts, or validating that integration tests cover Oracle/PostgreSQL differences.

dotnet-upgrade

25
from ComeOnOliver/skillshub

Ready-to-use prompts for comprehensive .NET framework upgrade analysis and execution

dotnet-timezone

25
from ComeOnOliver/skillshub

.NET timezone handling guidance for C# applications. Use when working with TimeZoneInfo, DateTimeOffset, NodaTime, UTC conversion, daylight saving time, scheduling across timezones, cross-platform Windows/IANA timezone IDs, or when a .NET user needs the timezone for a city, address, region, or country and copy-paste-ready C# code.

dotnet-design-pattern-review

25
from ComeOnOliver/skillshub

Review the C#/.NET code for design pattern implementation and suggest improvements.

dotnet-best-practices

25
from ComeOnOliver/skillshub

Ensure .NET/C# code meets best practices for the solution/project.

microsoft-azure-webjobs-extensions-authentication-events-dotnet

25
from ComeOnOliver/skillshub

Microsoft Entra Authentication Events SDK for .NET. Azure Functions triggers for custom authentication extensions. Use for token enrichment, custom claims, attribute collection, and OTP customization in Entra ID. Triggers: "Authentication Events", "WebJobsAuthenticationEventsTrigger", "OnTokenIssuanceStart", "OnAttributeCollectionStart", "custom claims", "token enrichment", "Entra custom extension", "authentication extension".

m365-agents-dotnet

25
from ComeOnOliver/skillshub

Microsoft 365 Agents SDK for .NET. Build multichannel agents for Teams/M365/Copilot Studio with ASP.NET Core hosting, AgentApplication routing, and MSAL-based auth. Triggers: "Microsoft 365 Agents SDK", "Microsoft.Agents", "AddAgentApplicationOptions", "AgentApplication", "AddAgentAspNetAuthentication", "Copilot Studio client", "IAgentHttpAdapter".

dotnet-backend

25
from ComeOnOliver/skillshub

Build ASP.NET Core 8+ backend services with EF Core, auth, background jobs, and production API patterns.

dotnet-architect

25
from ComeOnOliver/skillshub

Expert .NET backend architect specializing in C#, ASP.NET Core, Entity Framework, Dapper, and enterprise application patterns. Masters async/await, dependency injection, caching strategies, and performance optimization. Use PROACTIVELY for .NET API development, code review, or architecture decisions.

azure-servicebus-dotnet

25
from ComeOnOliver/skillshub

Azure Service Bus SDK for .NET. Enterprise messaging with queues, topics, subscriptions, and sessions. Use for reliable message delivery, pub/sub patterns, dead letter handling, and background processing. Triggers: "Service Bus", "ServiceBusClient", "ServiceBusSender", "ServiceBusReceiver", "ServiceBusProcessor", "message queue", "pub/sub .NET", "dead letter queue".

azure-security-keyvault-keys-dotnet

25
from ComeOnOliver/skillshub

Azure Key Vault Keys SDK for .NET. Client library for managing cryptographic keys in Azure Key Vault and Managed HSM. Use for key creation, rotation, encryption, decryption, signing, and verification. Triggers: "Key Vault keys", "KeyClient", "CryptographyClient", "RSA key", "EC key", "encrypt decrypt .NET", "key rotation", "HSM".