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.

242 stars

Best use case

reviewing-dotnet-code is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. 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.

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.

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "reviewing-dotnet-code" skill to help with this workflow task. Context: 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.

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/reviewing-dotnet-code/SKILL.md --create-dirs "https://raw.githubusercontent.com/aiskillstore/marketplace/main/skills/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

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

242
from aiskillstore/marketplace

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

242
from aiskillstore/marketplace

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

242
from aiskillstore/marketplace

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

dotnet-backend-patterns

242
from aiskillstore/marketplace

Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.

dotnet-architect

242
from aiskillstore/marketplace

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

242
from aiskillstore/marketplace

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

242
from aiskillstore/marketplace

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".

azure-search-documents-dotnet

242
from aiskillstore/marketplace

Azure AI Search SDK for .NET (Azure.Search.Documents). Use for building search applications with full-text, vector, semantic, and hybrid search. Covers SearchClient (queries, document CRUD), SearchIndexClient (index management), and SearchIndexerClient (indexers, skillsets). Triggers: "Azure Search .NET", "SearchClient", "SearchIndexClient", "vector search C#", "semantic search .NET", "hybrid search", "Azure.Search.Documents".

azure-resource-manager-sql-dotnet

242
from aiskillstore/marketplace

Azure Resource Manager SDK for Azure SQL in .NET. Use for MANAGEMENT PLANE operations: creating/managing SQL servers, databases, elastic pools, firewall rules, and failover groups via Azure Resource Manager. NOT for data plane operations (executing queries) - use Microsoft.Data.SqlClient for that. Triggers: "SQL server", "create SQL database", "manage SQL resources", "ARM SQL", "SqlServerResource", "provision Azure SQL", "elastic pool", "firewall rule".

azure-resource-manager-redis-dotnet

242
from aiskillstore/marketplace

Azure Resource Manager SDK for Redis in .NET. Use for MANAGEMENT PLANE operations: creating/managing Azure Cache for Redis instances, firewall rules, access keys, patch schedules, linked servers (geo-replication), and private endpoints via Azure Resource Manager. NOT for data plane operations (get/set keys, pub/sub) - use StackExchange.Redis for that. Triggers: "Redis cache", "create Redis", "manage Redis", "ARM Redis", "RedisResource", "provision Redis", "Azure Cache for Redis".

azure-resource-manager-postgresql-dotnet

242
from aiskillstore/marketplace

Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "PostgreSQL", "PostgreSqlFlexibleServer", "PostgreSQL Flexible Server", "Azure Database for PostgreSQL", "PostgreSQL database management", "PostgreSQL firewall", "PostgreSQL backup", "Postgres".

azure-resource-manager-playwright-dotnet

242
from aiskillstore/marketplace

Azure Resource Manager SDK for Microsoft Playwright Testing in .NET. Use for MANAGEMENT PLANE operations: creating/managing Playwright Testing workspaces, checking name availability, and managing workspace quotas via Azure Resource Manager. NOT for running Playwright tests - use Azure.Developer.MicrosoftPlaywrightTesting.NUnit for that. Triggers: "Playwright workspace", "create Playwright Testing workspace", "manage Playwright resources", "ARM Playwright", "PlaywrightWorkspaceResource", "provision Playwright Testing".