# Review .NET Code

C# reviews often miss style, async, and exception-handling issues. This skill applies Microsoft conventions and modern .NET patterns to reviews and refactors.

## Install

```bash
npx skillstore add brendanshields/reviewing-dotnet-code
```

## Metadata

- - Slug: brendanshields-reviewing-dotnet-code
- - Version: 1.0.0
- - Author: BrendanShields
- - GitHub username: BrendanShields
- - License: MIT
- - Repository: https://github.com/BrendanShields/spec-flow/tree/main/plugins/spec/skills/reviewing-dotnet-code
- - Ref: main
- - Supported tools: Claude, Codex, Claude Code
- - Risk level: low
- - Risk factors: filesystem
- - Quality score: 78
- - Quality tier: bronze
- - Public page: https://skillstore.pages.dev/skills/brendanshields-reviewing-dotnet-code
- - Manifest: https://skillstore.pages.dev/api/skills/brendanshields-reviewing-dotnet-code/manifest

## Capabilities

- Checks C\# naming conventions for classes, methods, fields, parameters, constants, and async methods.
- Reviews async and await usage for blocking calls, async void, cancellation tokens, and library patterns.
- Identifies exception-handling issues such as empty catches, broad catches, missing disposal, and lost stack traces.
- Suggests modern C\# features including file-scoped namespaces, records, target-typed new, and collection expressions.
- Provides before-and-after refactoring guidance using examples from the included reference files.
- Defers to project .editorconfig rules when local style preferences are available.

## Use Cases

- Review a Pull Request: Find naming, async, exception-handling, and LINQ issues before merging C\# changes.
- Refactor Legacy C\#: Modernize older .NET code with records, file-scoped namespaces, target-typed new, and clearer naming.
- Standardize Team Guidance: Apply consistent Microsoft-style conventions when generating services, DTOs, interfaces, and repositories.

## Prompt Templates

### Basic C\# Review

```
Review this C# file for naming, async usage, exception handling, and modern .NET style. Prioritize clear findings with fixes.
```

### Refactor Suggestions

```
Suggest a focused refactor for this .NET class. Preserve behavior and explain each naming, LINQ, async, or disposal improvement.
```

### Pull Request Audit

```
Review these .NET changes like a pull request. Group findings by severity and include concise replacement guidance.
```

### Architecture-Aware Review

```
Review this .NET feature against the project conventions. Check .editorconfig first, then evaluate async boundaries, DTOs, repositories, and error handling.
```

## Limitations

- It focuses on C\# and .NET style, structure, and common patterns, not full application security testing.
- It does not compile, run tests, or verify runtime behavior unless the user asks and tools are available.
- It may need project context before recommending architecture or library-level async changes.
- It follows the included guidance and may not match every team-specific coding standard.

## Best Practices

- Read project .editorconfig and existing conventions before suggesting style-only changes.
- Separate correctness risks from readability improvements so reviewers can prioritize fixes.
- Ask for surrounding code when async behavior, disposal, or exception flow depends on call context.

## Anti Patterns

- Do not apply modern C\# syntax when the project targets an older language version.
- Do not recommend broad refactors when the user asked for a narrow review.
- Do not treat style examples as proof that production code has the same issue.

## Security Audit

- - Safe to publish: true
- - Audited at: 2026-06-28T17:18:52.37\+00:00
- - Summary: Static analysis reported command execution and weak-crypto patterns, but manual review found Markdown backticks, headings, and C\# examples rather than executable shell or Ruby code. No prompt injection, secret exfiltration, network callback, or malicious intent was found. The remaining risk is normal filesystem access for reviewing and editing code.

## Stats

- - Views: 334
- - Downloads: 1
- - Favorites: 0
- - Popularity score: 0
