dotnet-agent-kit is a free, MIT-licensed Claude Code plugin that helps Claude write .NET 10 code the way your team would. Version 0.15.0 ships 37 skills (26 knowledge skills and 11 slash commands), 3 agents, 8 rules, a set of guard hooks, 7 CLAUDE.md templates and a Roslyn MCP server with 24 read-only tools. You install it with two commands inside Claude Code, and there is no separate tool to install. In this guide, I will show you how I use it day to day.
The kit used to be called dotnet-claude-kit. I renamed it to dotnet-agent-kit in November 2026, and the repository now also ships config for Cursor, Codex CLI, OpenCode and Kimi Code. If you installed it under the old name, the plugin ID has changed, so you need to reinstall it once. I have covered the exact steps in the upgrade section below.
I built this kit, so please read this as a tour from the person who made every design decision in it, including the ones I changed later. I will go through what Claude Code gets wrong on .NET out of the box, how the kit handles each of those problems, what the measurements say, and which parts I would adopt first.
Everything here is on GitHub at codewithmukesh/dotnet-agent-kit, and the .NET Agent Kit resource page tracks every release. The current version as I write this is 0.15.0.
Let’s get into it.
Claude Code for Beginners
New to Claude Code itself? Start with the terminal basics, then come back here to specialize it for .NET.
Why Does Claude Code Write Bad .NET Code Out of the Box?
Claude Code is a general-purpose coding agent, so it has no opinion about your architecture, your conventions or your token budget until you give it one. On .NET projects, this shows up as four failures that come up again and again.
1. Legacy patterns from training data. If you ask vanilla Claude for an order service, you will usually get DateTime.Now instead of TimeProvider, new HttpClient() instead of IHttpClientFactory, and a repository interface wrapped around EF Core for no reason. None of this fails a review loudly, but all of it is code you end up correcting by hand.
2. Architecture roulette. When you tell Claude to “set up a new API”, it picks an architecture for you, usually a generic Clean Architecture layout, without asking anything about your domain, your team or how long the project needs to live. A CRUD-heavy internal tool and a payment system with rich business rules end up with the same folder structure.
3. Expensive file reading. Claude finds its way around a codebase by searching and reading files. Answering “who calls this method” means grepping for the name and opening a lot of files, even though the compiler already knows the exact answer. Claude simply has no way to ask the compiler.
4. No quality gates. Out of the box there is no verification loop. Claude writes the code, tells you it is done, and the first real feedback comes from your build server or your reviewer.
You can fix each of these with enough prompting in every session. I got tired of typing the same fixes again and again, so I packaged them into a plugin.
What Is dotnet-agent-kit?
dotnet-agent-kit gives Claude Code your .NET conventions, a set of workflows for the loops you repeat, and a Roslyn server for cheap and accurate code navigation. The knowledge lives in skills that load on demand, and the workflows, hooks and MCP tools make sure that knowledge is actually applied and checked.
Here is what version 0.15.0 ships:
| Part | What ships | What it does |
|---|---|---|
| Knowledge skills | 26 | Teach current patterns: modular slices, minimal APIs, API security, EF Core, testing, resilience, observability, Docker, Aspire and more |
| Workflow skills | 11 slash commands | /dotnet-init, /spec, /verify, /tdd, /scaffold, /code-review, /build-fix, /migrate, /de-sloppify, /wrap-up, /doctor |
| Agents | 3 | code-reviewer, build-error-resolver and refactor-cleaner |
| Roslyn MCP server | 24 read-only tools | Lets Claude ask the compiler instead of reading files |
| Rules | 8 | Coding style, architecture, security, testing, performance, error handling, packages and workflow |
| Hooks | 5 automatic hooks | Session context, Bash guard, format once per turn, restore after a .csproj change, slop guard |
| Templates | 7 CLAUDE.md files | Web API, modular monolith, Blazor, worker service, class library, console CLI and desktop app |
| Starter | 1 runnable solution | A complete modular-slices solution you install with dotnet new |
Every knowledge skill has working code, a BAD/GOOD anti-pattern pair and a decision table, and CI fails the build when a knowledge skill goes over 400 lines or a workflow skill goes over 200. In 0.15.0 I also cut the skill and agent descriptions by 39%, because those descriptions are loaded into every session, and a shorter description means fewer tokens spent before you even type anything.
You might have noticed that earlier versions had many more agents. Older releases shipped ten specialist agents, but their knowledge already lived in skills, so I folded it back into the skills. An agent now exists only where a separate context or a tool restriction is worth the extra cost. For example, the code reviewer is restricted from writing files, and the refactor cleaner runs in its own git worktree.
Skills in Claude Code
How the skill system works under the hood: SKILL.md files, triggers, and on-demand loading.
What Happens When You Open a .NET Repo?
Once the plugin is installed, you do not have to run anything to make it active. A SessionStart hook detects a .NET repo (a .csproj, .fsproj, .sln or .slnx within three levels) and adds a skill index plus a short digest of the 8 rules to the session, which is about 1.5k tokens. Outside .NET repos it adds nothing at all.
I added this hook because plugins cannot ship always-on rules, and without a nudge Claude rarely loads skills on its own. In my evals, without the session hook a kit skill loaded in about 2 of 36 runs. With the hook in place, the matching skill loaded in every run. If you ever want to turn it off, set CWM_SESSION_CONTEXT=off. When the project has no CLAUDE.md yet, the hook also suggests running /dotnet-init once.
The other hooks run on their own as well:
- Bash guard parses each shell command and blocks destructive ones like a force push,
git reset --hard,git clean -forrm -rfoutside build output. It also blocks commands that affect the whole machine, likepkill,dotnet build-server shutdownor deleting the NuGet caches. A command that only mentions one of these, such as a grep pattern or a commit message, is allowed. - Format queues every
.csfile Claude edits and formats them once at the end of the turn, withdotnet formator CSharpier if your repo uses it. Formatting after every single edit used to take about 4 seconds each, so a turn with 15 edits waited about a minute, whereas now the files are formatted with one call per project when the turn ends. - Restore runs
dotnet restoreafter a.csprojchange. - Slop guard blocks shortcuts in the lines an edit adds:
#pragma warning disablewith no reason,[Fact(Skip...)],Assert.True(true), emptycatchblocks andNotImplementedExceptionstubs in production code. Violations that were already in the file never block.
The session hook, the format hook and the slop guard each have an environment variable to turn them off, and CI runs the hook behavior tests on every push.
How Do You Install dotnet-agent-kit?
You need Claude Code and the .NET 10 SDK. Docker is optional, and you only need it for the Testcontainers-based integration tests. Inside a Claude Code session, add the marketplace and install the plugin:
/plugin marketplace add codewithmukesh/dotnet-agent-kit/plugin install dotnet-agent-kitThat is the whole install. The skills, agents, hooks and the MCP server config activate globally through the Claude Code plugin system. The Roslyn MCP server starts through dotnet dnx CWM.RoslynNavigator@<version> --yes from the plugin’s .mcp.json, which fetches and runs the pinned package on .NET 10, so there is no dotnet tool install step anymore. A global install with dotnet tool install -g CWM.RoslynNavigator still works if you prefer it, but you do not need it.
After installing, I recommend running /doctor once, which checks the kit itself and prints one table with fixes: the .NET 10 SDK, dotnet dnx, bash for the hooks (Git for Windows on Windows), whether the navigator loaded your solution, your CLAUDE.md and rules, and any leftover installs under the old name. It is read-only, so it never changes anything.
There are two install issues I see people report. On macOS or Linux, if the MCP server fails with “No .NET SDKs were found”, set DOTNET_ROOT to your .NET installation root, for example /usr/local/share/dotnet. On Windows, if the marketplace add fails with “Failed to finalize marketplace cache” (EPERM), close every Claude Code session, delete %USERPROFILE%\.claude\plugins\marketplaces\*dotnet-agent-kit*, pause OneDrive sync if your .claude folder lives under it, and run the marketplace add again. That one is a Claude Code installer issue, and the kit’s reference docs link to it.
Anatomy of the .claude Folder
Where plugins, rules, settings, and MCP config live in a project, and how Claude Code loads each one.
Upgrading from dotnet-claude-kit
When the kit was renamed, the plugin ID changed with it, so an install made under the old name no longer receives updates. You only have to reinstall it once:
/plugin uninstall dotnet-claude-kit@dotnet-claude-kit/plugin marketplace remove dotnet-claude-kit/plugin marketplace add codewithmukesh/dotnet-agent-kit/plugin install dotnet-agent-kit@dotnet-agent-kitSkills are now namespaced as dotnet-agent-kit:, for example /dotnet-agent-kit:verify. The Roslyn MCP server is still called CWM.RoslynNavigator, so nothing changes there. If you are not sure whether the old install is still around, run /doctor, which warns you when dotnet-claude-kit is still installed. An old install stops updating and also runs every hook twice, so it is worth removing.
How Do You Update dotnet-agent-kit?
To update, refresh the marketplace so it pulls the newest release from GitHub, and then reload:
/plugin marketplace update dotnet-agent-kit/reload-plugins/reload-plugins activates the new version without restarting Claude Code, and a full restart works too. If you would rather not do this by hand, open /plugin, go to the Marketplaces tab, select dotnet-agent-kit and turn on Enable auto-update. Third-party marketplaces ship with auto-update turned off by default, so this is opt-in.
You no longer need a separate step for the Roslyn MCP server. The plugin’s .mcp.json pins the navigator to the same version as the kit, and that pin moves with every release, so updating the plugin also updates the server. The only exception is if you chose a global install, in which case you update it yourself with dotnet tool update -g CWM.RoslynNavigator. To confirm where you landed, check the plugin version in the /plugin Installed tab, or run /doctor.
What Happens in Your First Session?
Once the plugin is installed, go to your project and run one command:
/dotnet-initOn an existing project, /dotnet-init reads the codebase before it asks you anything. It finds your .slnx or .sln and classifies each .csproj from its SDK and properties: Microsoft.NET.Sdk.Web means a Web API or Blazor app, Microsoft.NET.Sdk.Worker means a worker service, WPF, WinForms, MAUI or Avalonia means a desktop app, an Exe output means a console app or CLI tool, and inter-module references mean a modular monolith. It then uses the instinct-system skill to pick up the conventions you already follow, so the CLAUDE.md it generates describes the project you actually have.
On an empty folder, it asks what you are building, scaffolds the solution with dotnet new sln --format slnx, the matching project template, a Directory.Build.props with .NET 10 defaults, and src/ plus tests/ folders, and then writes the CLAUDE.md to match.
If you already have a CLAUDE.md, /dotnet-init will not overwrite it silently. It reads the existing file and asks how to proceed:
- Merge (the recommended option) keeps your hand-written sections, like deployment notes, team conventions and domain rules, and refreshes only the kit’s architecture, tech-stack and convention sections in place.
- Overwrite replaces the file with the freshly generated one.
- Keep leaves your file untouched and prints the generated content so you can copy across whatever you want.
Merge and Overwrite both back up the original to CLAUDE.md.bak first, so nothing you wrote is lost.
Then it installs the rules. Plugins cannot ship always-loaded rules, so the session hook only adds a short digest. As the last setup step, /dotnet-init asks whether to copy the kit’s 8 rules into your project’s .claude/rules/ folder. Once they are there, the full rules (with their examples) load in every session, and also for teammates who do not have the plugin installed. If a rule file already exists and differs, it shows you the diff and asks before touching it.
The architecture questions are where the kit has the strongest opinion. For a new business application, the default is modular slices, which is a modular monolith whose modules are built from vertical slices (ADR-008). The architecture-advisor skill starts from that default and asks about your domain complexity, team size, module boundaries and existing patterns. When the answers point elsewhere, it recommends single-project Vertical Slice Architecture, Clean Architecture or DDD instead and explains why. On an existing codebase, the advisor follows the architecture that is already there unless you ask to change it, so you do not have to migrate anything to use the kit.
After init, I always run one more command to see what state the project is actually in:
/verify healthThis produces a report card graded A to F across 8 dimensions: build health, code quality, architecture, test coverage, dead code, API surface, security posture and documentation. It is driven by the MCP tools, so every grade is backed by data from the compiler: detect_antipatterns for code smells, get_project_graph plus detect_circular_dependencies for architecture, get_test_coverage_map for coverage and find_dead_code for the code nobody deleted. On a brownfield project, this is the quickest way to get an honest answer about the state of the codebase.
CLAUDE.md Mastery for .NET Developers
What belongs in a CLAUDE.md, what does not, and how to keep it accurate as the project changes.
What Does the Everyday Feature Workflow Look Like?
My daily loop with the kit is three commands: /spec, /scaffold and /verify. When I want the tests first, I use /tdd in place of /scaffold, which runs red-green-refactor with xUnit v3 and Testcontainers.
Step 1: /spec agrees on the spec and writes the plan
/spec is one workflow in two phases. In the first phase, it keeps asking questions until you and Claude agree on a written specification, and it turns every gap in the idea into a question for you. In the second phase, it turns the approved spec into an implementation plan that follows your architecture, and writes both to docs/specs/. No code is written before both phases are done, which means the ambiguity gets resolved in text, where it is cheap to change.
Earlier versions had a separate /plan command, but in 0.15.0 the plan is the second phase of /spec, so you only need the one command.
Plan Mode in Claude Code
Why planning before writing code is the single biggest quality lever, and how to use plan mode well.
Step 2: /scaffold generates the complete feature
This is where the difference is most visible. If you ask vanilla Claude for a place-order feature, you will usually get something like this:
// Vanilla Claude Code outputpublic class OrderService{ private readonly IOrderRepository _repo; // abstraction over EF Core for no reason
public async Task<Order> CreateOrder(CreateOrderDto dto) { var order = new Order(); order.CreatedAt = DateTime.Now; // not testable, wrong offset handling order.Items = dto.Items.ToList(); await _repo.AddAsync(order); // no CancellationToken return order; // leaks the domain entity to the API }}With the kit installed, /scaffold first detects your architecture and then generates the feature in its own folder, Features/<VerbPhrase>/, with an endpoint, a handler, the request and response records, a FluentValidation validator and integration tests. The code below is the PlaceOrder feature from the kit’s runnable starter, which follows the same conventions. The endpoint is one class that is discovered automatically, so Program.cs never changes:
internal sealed class PlaceOrderEndpoint : IEndpoint{ public void Map(IEndpointRouteBuilder endpoints) => endpoints.MapPost("/", HandleAsync) .RequirePermission(OrdersPermissions.Manage) .WithName("PlaceOrder") .WithSummary("Places an order");
private static Task<Results<Created<OrderResponse>, ProblemHttpResult>> HandleAsync( PlaceOrderRequest request, PlaceOrderHandler handler, CancellationToken ct) => handler.HandleAsync(request, ct);}The handler is a plain class behind a marker IHandler interface. It uses the module’s DbContext directly, takes the time from TimeProvider, and returns a TypedResults union, so every expected failure is a return value:
internal sealed class PlaceOrderHandler(OrdersDbContext db, ICatalog catalog, ICurrentUser user, TimeProvider clock) : IHandler{ public async Task<Results<Created<OrderResponse>, ProblemHttpResult>> HandleAsync( PlaceOrderRequest request, CancellationToken ct) { if (await catalog.FindProductAsync(request.ProductId, ct) is not { } product) return Problems.RuleBroken("orders.product-not-found", "The product does not exist or is no longer sold.");
if (product.Available < request.Quantity) return Problems.RuleBroken("orders.out-of-stock", $"Only {product.Available} left in stock.");
var order = new Order { Id = Guid.CreateVersion7(), OwnerId = user.Id, ProductId = product.Id, Quantity = request.Quantity, Total = product.Price * request.Quantity, PlacedAt = clock.GetUtcNow(), }; db.Orders.Add(order); db.Publish(new OrderPlaced(order.Id, order.ProductId, order.Quantity, order.Total), clock); await db.SaveChangesAsync(ct); // the order and its outbox row commit together
return TypedResults.Created($"{ModuleExtensions.ApiPrefix}/orders/{order.Id}", OrderResponse.From(order)); }}Every pattern in that output is a decision documented in the kit’s ADRs. The handler returns Results<Created<OrderResponse>, ProblemHttpResult>, so the compiler checks every branch and OpenAPI documents each status code. Business errors are ProblemDetails with a stable code like orders.out-of-stock, which clients can switch on even when the detail text changes. There is no mediator, because a direct call to the handler is easier to read, debug and test. There is no repository either, because DbContext already is the repository and unit of work. The owner comes from the token and never from the request, and the event for other modules goes into the outbox in the same transaction as the order.
Before it finishes, /scaffold checks the feature against a 10-item checklist: one discovered IEndpoint, an explicit permission or AllowAnonymous(), an internal sealed handler returning a TypedResults union, Problems.* errors with <module>.<reason> codes, a validator with real rules, public request and response records with everything else internal, AsNoTracking() reads with lists paged at a maximum of 50, cross-module events through the outbox, a CancellationToken on every async call, and tests for success, 403, 400, each business rule and the cross-tenant 404. Then it builds and runs the feature tests and the architecture tests.
If your codebase uses single-project VSA, Clean Architecture or DDD, /scaffold follows those conventions instead, including an existing Result<T> and mediator setup, and keeps the endpoint, validation, data, cancellation and test items of the checklist.
Step 3: /verify is the quality gate
/verify runs a 7-phase pipeline: build, analyzer diagnostics, anti-pattern scan, tests, security check, formatting and a diff review. Each phase reports PASS, WARN or FAIL with details, and a failing build or failing test stops the pipeline, because later phases cannot say anything useful about broken code. I run it before every commit that matters, since it is the difference between Claude saying it is done and the toolchain agreeing.
The anti-pattern phase catches the usual suspects: async void, sync-over-async, new HttpClient(), DateTime.Now, broad catch blocks, string interpolation in log templates, missing CancellationToken and EF read queries without AsNoTracking.
/verify also takes a mode when you need more depth:
| Command | Question it answers |
|---|---|
/verify | Is this change ready for review? (the 7 phases) |
/verify health | How healthy is the whole project? (8 dimensions graded A to F) |
/verify security | What can an attacker exploit? (7 layers, mapped to the OWASP Top 10:2025) |
/verify architecture | Does the code still match its declared architecture? |
These modes replace the separate /health-check, /security-scan and /arch-check commands from earlier versions.
Verification Loops in Claude Code: Make .NET Code Prove Itself
How build, test and analyzer gates let Claude check its own work before you review it.
What Do the Security Skills Cover?
Version 0.15.0 added three security skills, and every API in them was checked against the .NET 10 docs on Microsoft Learn.
resource-authorizationstops users from reaching each other’s data (IDOR). It covers by-id queries scoped to the owner, returning 404 instead of 403 for another user’s row,AuthorizationHandler<TRequirement, TResource>for shared access, EF Core 10 named owner and tenant filters, and a test where user A tries to read user B’s order. You can see the pattern in the starter’s cancel handler, which filters ono.Id == id && o.OwnerId == ownerId, so someone else’s order looks exactly like a missing one.api-hardeningcovers HSTS and forwarded headers behind a proxy usingKnownIPNetworks. The olderKnownNetworksproperty is obsolete in .NET 10 (ASPDEPR005), even though the Microsoft proxy docs page still shows it. The skill also covers strict CORS, request body and upload limits, security headers and turning off detailed errors in production.rate-limitinguses the built-in middleware with per-user and per-IP partitions and a strict policy for login. Rejections return 429 with aRetry-Afterheader, and the skill explains that the limits multiply with the number of instances behind a load balancer.
/verify security was updated to match, and it now scans 7 layers instead of 6:
| # | Layer | What it checks |
|---|---|---|
| 1 | Package vulnerabilities | dotnet list package --vulnerable --include-transitive |
| 2 | Secrets detection | Keys and connection strings in .cs, .json, .yml, .xml and .config files |
| 3 | OWASP code patterns | Raw SQL, Html.Raw, BinaryFormatter, MD5 and SHA1, IDOR |
| 4 | Auth configuration | Unmarked endpoints from get_endpoint_map, then the JWT validation settings |
| 5 | Transport and hardening | CORS, HSTS, forwarded headers trust, security headers, body limits, detailed errors |
| 6 | Data protection | PII in logs, over-broad responses, sensitive data stored in plain text |
| 7 | Rate limiting | No limiter, unthrottled auth endpoints, a shared bucket, 503 without Retry-After |
How Does the Roslyn MCP Server Help?
The CWM.RoslynNavigator MCP server lets Claude ask the C# compiler about your code, so it no longer has to search and read source files to find its way around. Roslyn already holds a complete semantic model of your solution, with every type, every reference and every call chain, and the Model Context Protocol makes that model callable as tools. The kit ships 24 of these tools, and they are all read-only and return file paths, line numbers and short snippets with a Truncated flag, so no single call can flood your context window.
To measure what this changes, I asked Claude Code (Sonnet 5.5) 11 everyday questions on each of five open-source solutions, from 9 to 270 projects, once with the navigator and once without it, and a blinded judge scored each answer from 0 to 100.
| Size | Solution | Projects | Time for 11 questions | Accuracy (0-100) | Tool calls |
|---|---|---|---|---|---|
| Small | CleanArchitecture | 9 | 112 s → 62 s | 59 → 95 | 23 → 16 |
| Small | eShop | 28 | 90 s → 64 s | 78 → 95 | 17 → 11 |
| Medium | Jellyfin | 41 | 168 s → 127 s | 70 → 93 | 27 → 11 |
| Large | OrchardCore | 257 | 179 s → 133 s | 48 → 91 | 35 → 11 |
| XL | ABP Framework | 270 | 186 s → 116 s | 49 → 86 | 35 → 13 |
| All 55 questions | 734 s → 502 s (-32%) | 61 → 92 | 137 → 62 |
Accuracy is the bigger win, and speed is the smaller one. Without the navigator, Claude answers from Grep’s matching lines, which is quick but often wrong. The total cost went from $2.37 to $2.08 (-12%). To be fair about the limits of this benchmark: the navigator was slower on 7 of the 55 questions, it cost slightly more on the two largest solutions, and each question ran only once per arm. The full method and per-question results are in the navigator README.
These are the six tools I use the most:
| Tool | Question it answers | What it replaces |
|---|---|---|
find_symbol | Where is this type or method defined? | Grep across every .cs file |
find_references | Who uses this symbol? | Grep plus opening files by hand |
get_file_outline | What is in this file? | Reading the file to find out |
get_symbol_source | Show me this one method body | Reading the whole file for one method |
get_endpoint_map | Every route with its auth posture | Grepping Map* calls and controllers |
analyze_change_impact | What breaks if I change this? | Chaining reference searches by hand |
get_endpoint_map deserves a special mention. It lists every route in the solution and labels each one authorized, anonymous or unmarked in a single call, and /verify security starts its auth layer there, because an unmarked endpoint is a finding on its own. Since 0.15.0, the navigator also has get_symbol_at, preview_rename (which shows what a rename would change without writing anything) and get_workspace_status, which tells you when a project loaded incompletely, so an empty result is never mistaken for a complete answer.
The server starts on its own through the plugin’s MCP configuration. It discovers your .sln or .slnx up to 3 levels deep and loads the solution on first use. For repos with several solutions, you can pass --all-solutions to load all of them into one workspace.
Claude Code on a Large Existing .NET Codebase
How to work with Claude Code on a big brownfield solution, and where a Roslyn MCP server fits in.
Which Commands Keep the Codebase Healthy?
Beyond the feature loop, these commands cover the maintenance work that usually gets skipped:
- /code-review reviews changes prioritized by blast radius, so data access, security and concurrency get reviewed before style. The
code-revieweragent behind it is not allowed to use the Write or Edit tools, so it can never “fix” things in the middle of a review, and it keeps project memory, so it learns your conventions across sessions. - /build-fix runs a bounded loop: parse the compiler errors, apply known fix patterns, rebuild and repeat. It stops after 5 iterations by default (10 at most), and it also stops when an iteration does not reduce the error count, because an unbounded fix loop on a confused model can turn 3 errors into 40. There is a test-fix variant of the same loop for failing tests.
- /de-sloppify is the cleanup pass nobody volunteers for: formatting, unused usings, analyzer warnings, dead code, sealing classes and
CancellationTokenpropagation. It runs 7 steps in order, builds and tests between steps, commits each step separately, and therefactor-cleaneragent handles the structural steps in an isolated git worktree, so a bad cleanup never touches your branch. - /migrate handles EF Core schema changes, .NET version upgrades and NuGet updates with rollback.
/migrate packagesreports outdated packages, CVEs and commercial-license traps. MediatR 13+, AutoMapper 15+, MassTransit 9+ and FluentAssertions 8+ all changed their licensing, so an innocent update-all can change your legal position. It also keepsMicrosoft.*and EF Core packages on 10.x when you targetnet10.0, and it replaces the old/outdatedcommand. - /verify architecture checks that the code still matches its declared architecture: dependency direction, modules reaching into each other, layer violations and cycles, reported with file and line evidence. Architectures usually break down through many small changes, so this is worth running in the PR flow.
- /wrap-up writes an end-of-session handoff that the next session loads, and
/wrap-up checkpointsaves your progress in the middle of a session.
My Claude Code Prompts for .NET Work
The copy-paste prompts I use for everyday .NET tasks, which pair well with the kit's commands.
What Is the Runnable Starter?
Version 0.15.0 also ships a free, runnable starter at starters/modular-slices. It is a complete solution in the kit’s default architecture, and it is the same solution that the modular-slices skill references describe, built and tested. From a clone of the repository, you install and create it like this:
dotnet new install ./starters/modular-slicesdotnet new cwm-modular-slices -n Acme.Shopcd Acme.Shop && dotnet test --solution Acme.Shop.slnxaspire runThe tests need Docker running for Testcontainers, and aspire run starts PostgreSQL, the Migrator, the Api and the Worker. Here is what is inside:
- Two modules, Catalog and Orders, which talk to each other only through public contracts and a per-module outbox.
- Minimal APIs with one discovered
IEndpointper feature,TypedResultsunions and ProblemDetails, EF Core 10 on PostgreSQL, and built-in OpenAPI with Scalar. - Security defaults: owner-scoped orders (another user’s order is a 404), rate limiting and forwarded headers.
- Tests: 35 tests in all, which are xUnit v3 + Testcontainers integration tests plus architecture tests that enforce the module boundaries.
- Hosting and CI: an Aspire 17 AppHost, a Dockerfile and a GitHub Actions workflow.
- Claude setup: a
CLAUDE.mdand the 8 rules in.claude/rules/.
The kit’s CI installs the template, generates a project under a new name, builds it with warnings as errors and runs every test on each change, so the starter does not drift away from the skills. If you want to see what the kit’s conventions look like in a real solution before you adopt them, this is the quickest way.
Does It Work? What the Evals Say
I did not want you to take the kit on trust, so I measure it. The repository has 26 eval cases that run with claude plugin eval, and each request is answered once with the plugin and once without it. In the 2026-12-01 full run on Claude Sonnet (2 runs per arm):
- Overall, the cases score 0.99 with the plugin against 0.62 without it.
- On the 18 quality cases alone, it is 0.99 against 0.79. The other 8 are routing cases, which check that the right kit workflow loads, so they cannot pass without the plugin.
- The new security cases moved the most: resource authorization went from 0.33 to 1.0, and rate limiting went from 0.40 to 1.0.
- Pushing back on a generic repository over EF Core went from 0 to 1.0, and returning
TypedResultsunions with ProblemDetails went from 0.75 to 1.0.
I also want to be honest about what these numbers do not show. Ten of the quality cases already score 1.0 without the plugin on this model, including production hardening behind a proxy, because current Sonnet already knows KnownIPNetworks and HSTS. They stay in the suite as regression checks. These are score differences on one model with few runs per case, so please read them as a direction and keep the small sample in mind. You can run the suite yourself by following the evals README.
Does It Work With Other Coding Agents?
Claude Code is the primary target, and it is the only one that the evals, the hook tests and the session hook cover. The repository also ships config for Cursor (.cursor/rules/dotnet-rules.md, generated from the rules), Codex CLI (.codex/AGENTS.md), OpenCode (opencode.json) and Kimi Code (.kimi-plugin/plugin.json). These get the same skills and rules, and CI checks that their counts and versions match, but nobody tests them end to end yet. If you use one of them, reports and fixes are welcome. You can also install the kit through APM with apm install codewithmukesh/dotnet-agent-kit --target claude.
My Take: What Should You Adopt First?
If you take one thing from the kit, take the Roslyn navigator. If you take two, add /dotnet-init and let it copy the rules into your project. Accurate, cheap navigation changes what Claude can do on a real codebase, and an accurate CLAUDE.md with the rules in place changes the quality of everything Claude writes afterwards.
Here is how I would sequence adoption depending on where you are:
| Your situation | Start with | Then add | Skip for now |
|---|---|---|---|
| Solo dev, greenfield API | The starter, or /dotnet-init + /scaffold | /verify before commits | Instinct system, /wrap-up |
| Team, existing codebase | /dotnet-init with the rules + /verify health | /code-review and /verify architecture in the PR flow | Greenfield scaffolding |
| Inherited legacy solution | Roslyn navigator + /verify health | /de-sloppify, /migrate packages | /spec until the build and tests are stable |
| Evaluating Claude Code itself | Plugin install + the starter | The /spec, /scaffold, /verify loop | Customizing rules and hooks |
Building a .NET Architecture Skill for Claude Code
How I built the kit's first scaffolding skill, and what designing a skill teaches you about Claude's failure modes.
Since I built the kit, it deserves harder scrutiny from you than a kit built by a stranger. Here is what it will not do:
- It will not replace your judgment. The architecture advisor recommends and you decide. If you accept every recommendation without reading the rationale, you have only automated your thinking.
- It is opinionated, and you may disagree.
TypedResultsunions over exceptions, no mediator by default and no repository over EF Core are documented positions with ADRs behind them. If your team does things differently, edit the rules in.claude/rules/, since they are plain markdown files. - The session context costs tokens. The session hook adds about 1.5k tokens to every session in a .NET repo, and skills cost tokens when they load. That is why CI enforces size budgets, and you can turn the hook off with
CWM_SESSION_CONTEXT=offif you prefer. - The first navigator load on a huge solution takes a moment. The server builds a full semantic model, so the first query on a large solution can return a loading status. Responses are fast after that.
- Only Claude Code is tested end to end. The other agents get the same skills and rules, but nobody has verified the full experience on them.
Key Takeaways
- Claude Code fails on .NET in four repeatable ways: legacy patterns, architecture roulette, expensive file reading and no quality gates. dotnet-agent-kit 0.15.0 handles each of them with 37 skills, 3 agents, 8 rules, guard hooks and a 24-tool Roslyn MCP server.
- The install is two commands inside Claude Code, and the navigator starts through
dotnet dnx, so there is no tool to install. A SessionStart hook makes the kit active in every .NET repo. /dotnet-initgenerates a project-specificCLAUDE.mdand copies the 8 rules into.claude/rules/. New business apps default to modular slices, and existing codebases keep their architecture.- The everyday loop is
/spec,/scaffoldand/verify, with/verify health,/verify securityand/verify architecturefor deeper checks. - The measurements are public: the navigator raised accuracy from 61 to 92 across 55 questions, and the evals score 0.99 with the plugin against 0.62 without it.
Frequently Asked Questions
What is dotnet-agent-kit?
dotnet-agent-kit is a free, open-source Claude Code plugin that helps Claude write modern .NET 10 and C# 14 code. Version 0.15.0 ships 37 skills (26 knowledge skills and 11 slash commands), 3 agents, 8 rules, guard hooks, 7 CLAUDE.md templates, a 24-tool Roslyn MCP server and a runnable modular-slices starter.
Is dotnet-agent-kit free?
Yes. The entire kit is MIT-licensed and free, including the CWM.RoslynNavigator MCP server and the modular-slices starter. There is no signup.
How do I install dotnet-agent-kit?
You need Claude Code and the .NET 10 SDK. Inside Claude Code, run /plugin marketplace add codewithmukesh/dotnet-agent-kit followed by /plugin install dotnet-agent-kit. The Roslyn MCP server starts on its own through dotnet dnx, so there is nothing else to install. Then run /dotnet-init in your project to generate a CLAUDE.md and copy the rules, and /doctor if anything seems off.
I installed dotnet-claude-kit. How do I upgrade?
The plugin ID changed with the rename, so the old install no longer receives updates. Run /plugin uninstall dotnet-claude-kit@dotnet-claude-kit and /plugin marketplace remove dotnet-claude-kit, then /plugin marketplace add codewithmukesh/dotnet-agent-kit and /plugin install dotnet-agent-kit@dotnet-agent-kit. Skills are now namespaced as dotnet-agent-kit:, and the Roslyn MCP server is unchanged.
Does dotnet-agent-kit work on existing brownfield projects?
Yes. /dotnet-init detects your solution, scans project SDKs, reads your tech stack and generates a CLAUDE.md that matches what already exists, and the kit follows your existing architecture. /verify health then grades the codebase across eight dimensions so you know where it stands.
Do I need the Roslyn MCP server for the kit to work?
The skills, agents, commands and rules work without it, but the server starts automatically with the plugin, so there is no reason to skip it. In a benchmark of 55 questions across five open-source solutions, accuracy went from 61 to 92 with the navigator, total time dropped by 32% and tool calls went from 137 to 62.
Which architectures does dotnet-agent-kit support?
New business applications default to modular slices, which is a modular monolith whose modules are built from vertical slices. The architecture-advisor skill asks questions first and recommends single-project Vertical Slice Architecture, Clean Architecture or DDD when they fit better. On an existing codebase, the kit follows the architecture that is already there, and /scaffold generates features in that architecture.
Does dotnet-agent-kit work with Cursor or other AI coding tools?
Claude Code is the primary target and the only one the evals and hook tests cover. The repository also ships config for Cursor, Codex CLI, OpenCode and Kimi Code with the same skills and rules, and CI keeps their counts and versions in step, but they are not tested end to end.
How is this different from writing my own CLAUDE.md?
A CLAUDE.md holds static instructions. The kit adds skills that load when the task matches, slash commands that run whole workflows, hooks that format and guard automatically, a session hook that keeps the kit active, and MCP tools that query the compiler. The instructions tell Claude what good code looks like, and the rest of the kit checks that it gets written that way.
Troubleshooting
Something seems off after installing. Run /doctor first. It checks the .NET 10 SDK, dotnet dnx, bash for the hooks, whether the navigator loaded your solution, your CLAUDE.md and rules, and leftover installs under the old name, and it prints a fix for each problem.
MCP tools are not available. Confirm that a .sln or .slnx file exists within 3 directory levels of where you started Claude Code, since that is how far the server searches. On macOS or Linux, set DOTNET_ROOT if you see “No .NET SDKs were found”.
Slash commands do not show up. Run /plugin inside Claude Code and confirm that dotnet-agent-kit is installed and enabled. If you still have the old dotnet-claude-kit install, follow the upgrade steps. If you loaded the kit with --plugin-dir for local testing, remember that the flag only applies to that session.
Hooks do not run on Windows. The hooks are bash scripts, so they need bash, which comes with Git for Windows, and /doctor checks that it is available.
The first MCP query returns a loading status. This is normal on large solutions, because the server builds the full semantic model on first use. Give it a moment and query again, or call get_workspace_status to see the load progress.
/build-fix hits the iteration limit. Check whether the error count went down each round. If it did not, look for circular dependencies with detect_circular_dependencies and confirm that packages restore cleanly, since some architecture-level errors need a human.
Testcontainers tests fail. Confirm that Docker is running with docker info and has enough memory allocated. The kit’s testing workflow and the starter use real databases through Testcontainers, so Docker is a hard requirement for that part.
Summary
Claude Code out of the box is a strong generalist that writes average .NET code. dotnet-agent-kit makes it a .NET specialist: current .NET 10 patterns from the skills, a session hook that keeps those skills in play, quality gates from the workflow commands, and accurate codebase answers from the Roslyn MCP server, all installed with two commands.
I would start small, so install the plugin, run /dotnet-init on a project you know well, and then run /verify health. If the report card tells you things about your own codebase that you did not know, that is a good sign the rest of the kit will be useful to you. If you are starting something new, try the starter first and see whether its conventions fit how your team works.
The kit is MIT-licensed and open to contributions at github.com/codewithmukesh/dotnet-agent-kit. If it generates code you disagree with, open an issue and tell me why, and if you find guidance that is wrong or out of date, there is an issue template for exactly that. The ADRs are there to be argued with.
If you found this helpful, share it with your colleagues, and if there is a topic you would like to see covered next, drop a comment and let me know.
Happy Coding :)
What's your take?
Push back, share a war story, or ask the obvious question someone else is wondering. I read every comment.