Guide · Agent skill
How to use the .NET Best Practices Reviewer agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The dotnet-best-practices skill is a set of .NET and C# coding guidelines that an AI agent reads before it reviews or writes code. It is aimed at C# developers working on .NET 8 projects who want output that follows typical .NET project conventions rather than generic C#. This guide explains what the skill changes, how to install it, how to trigger it, and where its limits are.
Quick start
- 1Download the ZIP. Download the skill ZIP from this page and unzip it. The folder contains SKILL.md.
- 2Choose a location. Place the skill folder in ~/.claude/skills/ for all projects, or in .claude/skills/ inside one project.
- 3Or upload in the Claude apps. In the Claude apps, open Settings, go to Capabilities, and upload the skill under Skills.
- 4Select your C# code. Open the file or select the class, method or project you want reviewed.
- 5Make a plain request. Ask for the change in plain language, such as adding XML documentation or writing MSTest tests.
- 6Review the changes. Read each proposed edit, then build and run your tests before committing.
What the skill makes the agent do
When the skill is installed, the agent reviews or writes .NET and C# code with a checklist of conventions in mind. The checklist in SKILL.md covers documentation, design patterns, dependency injection, resource and localization handling, async/await, testing, configuration, Semantic Kernel integration, error handling and logging, performance and security, and general code quality.
The agent applies these rules to the code you select or point it at. The skill's stated goal is to ensure .NET/C# code meets the best practices specific to the solution or project.
- XML documentation comments for public classes, interfaces, methods and properties, including parameter and return value descriptions
- Constructor dependency injection with null checks via ArgumentNullException, and primary constructor syntax where it fits
- async/await for all I/O operations and long-running tasks, with ConfigureAwait(false) where appropriate
- MSTest tests with FluentAssertions assertions, the AAA pattern, Moq for mocking, and null parameter validation tests
- Structured logging with Microsoft.Extensions.Logging and ResourceManager lookups for localized messages
- SOLID-style design, meaningful names and focused methods
Install the skill from a ZIP or the Claude apps
Download the ZIP file from this page and unzip it. The package contains a single file, SKILL.md. Put the unzipped skill folder in one of these locations, depending on whether you want it for every project or just one:
For all your projects, place it in ~/.claude/skills/. For one project only, place it in the .claude/skills/ folder inside that project.
If you use the Claude apps instead, open Settings, go to Capabilities, and upload the skill under Skills.
- Personal (all projects): ~/.claude/skills/
- Single project: .claude/skills/ inside the project folder
- Claude apps: Settings → Capabilities → Skills
Trigger the skill with natural requests
You do not need a special command. Ask for .NET or C# work in plain language and point the agent at the code. The skill's description is about ensuring .NET/C# code meets best practices for the solution or project, so requests that name that goal, or that mention C# code, tests, documentation or dependency injection, are the ones it is meant to serve.
Select the relevant code or name the file or project before you ask. The skill refers to the selected code, so a clear selection gives the agent a clear target.
- Review this service class against .NET best practices and fix what you find.
- Add XML documentation comments to the public methods in this file.
- Write MSTest unit tests with FluentAssertions and Moq for this handler, including null parameter checks.
- Refactor this class to use constructor injection with ArgumentNullException checks.
- Make these I/O methods async and check the await usage.
Examples of what the output looks like
Given a plain C# class, the agent should return changes shaped by the checklist: documented public members, constructor parameters with null checks, async methods returning Task or Task<T>, and tests that use MSTest attributes with FluentAssertions and Moq. The exact output depends on your code and the agent you use, so review each change as you would a pull request.
What you need before you start
You need a .NET/C# codebase for the agent to review, and an agent environment that can read and edit code files. The skill's guidelines assume MSTest, Moq and C# 12 with .NET 8, so the fit is best when your project already uses those tools.
The skill runs no scripts and makes no network calls. It is a SKILL.md guideline file, so it only changes how the agent reasons about your code.
- A .NET/C# codebase
- An agent environment that can read and edit code files
- Ideally a project already using MSTest, FluentAssertions, Moq and Microsoft.Extensions.* libraries
Safety notes: scripts and network access
The skill declares that it runs no scripts and uses no network access. Its only file is SKILL.md. Because it contains guidelines rather than executable code, the main risk is the agent making edits you did not intend, not the skill itself running anything.
Treat the agent's edits as proposed changes. Review diffs, run your own build and tests, and keep the work in version control so you can revert.
- Runs scripts: no
- Uses network: no
- Review all edits before committing
Tips for getting useful results
The skill is a set of guidelines, not an analyzer, so it can miss issues or suggest changes that do not fit your codebase. Give the agent context about your existing conventions so it can weigh the checklist against them.
- Select a small, specific piece of code rather than the whole repository
- Tell the agent when your project uses a different convention, for example a different test framework
- Ask for one kind of change at a time, such as documentation first, then tests
- Run your build and test suite after each change
What people use it for
- Adding XML documentation comments to public APIs in an existing .NET 8 library
- Converting constructor dependencies to injected interfaces with null checks
- Writing MSTest unit tests with FluentAssertions and Moq for success and failure paths
- Making I/O-bound methods async and reviewing await and ConfigureAwait usage
- Moving user-facing strings into ResourceManager-based resource files
Frequently asked questions
How do I install the dotnet-best-practices skill?
Download the ZIP from this page and unzip it. Place the folder in ~/.claude/skills/ to use it everywhere, or in a project's .claude/skills/ folder to use it in one project. In the Claude apps, you can instead upload it under Settings → Capabilities → Skills.
Does the skill require a paid plan or cost money?
The source material for this page does not state pricing or licence terms beyond the MIT licence shown for the repository. Check your agent product's own terms for any costs. The skill itself is listed under MIT.
Does it work with xUnit or NUnit?
The skill's testing rules assume MSTest with FluentAssertions and Moq. If your project uses xUnit, NUnit or NSubstitute, the agent may push conventions that do not match, so tell it your framework or expect to make corrections.
Does it work with .NET Framework or older .NET versions?
The rules assume C# 12 and .NET 8. For older .NET versions, the suggested features may not apply, so state your target version in your request.
Does the skill run scripts or access the internet?
No. The listing states it runs no scripts and uses no network access. It consists of a single SKILL.md guideline file.
Is this a code analyzer that finds every issue?
No. It is a set of guidelines the agent follows, not an analyzer. It can miss issues or suggest changes that do not fit your codebase, so run your own build, tests and analyzers.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you write .NET 8 C# code with MSTest, FluentAssertions, Moq and Microsoft.Extensions libraries and want an agent to follow those conventions when documenting, testing or refactoring. Pick something else if your project uses xUnit, NUnit, NSubstitute or older .NET, or if you need strict, verified compliance checking rather than guidelines.
Download the skill