📦codewithmukesh / dotnet-claude-kit
← 返回首页
Make Claude Code a .NET 10 Expert
⚖️ MIT🌐 codewithmukesh.com📅 创建于 2026-02-20🔄 更新于 2026-08-07

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有

dotnet-claude-kit

Make Claude Code an expert .NET developer.
47 skills • 10 specialist agents • 16 slash commands • 10 rules • 5 project templates • 22 MCP tools • automation hooks
Built for .NET 10 / C# 14. Architecture-aware. Token-efficient.

Read the complete dotnet-claude-kit guide

📖 Full Guide • Installation • Quick Start • 10x Features • Commands • Skills • Agents • Rules • Templates • MCP Server • Contributing


📖 New here? Start with the guide

How I Use dotnet-claude-kit: Making Claude Code Write Senior-Level .NET →

The complete walkthrough: install and update the plugin, what happens in your first session, the everyday feature workflow, how the Roslyn MCP server cuts token usage, which commands keep a codebase healthy, plus FAQ and troubleshooting.

This README is the reference. The guide is how to actually use it.

The Problem

Claude Code is powerful, but out of the box it doesn't know your .NET conventions. It generates DateTime.Now instead of TimeProvider. It wraps EF Core in repository abstractions. It picks an architecture without asking about your domain. It reads entire source files when a Roslyn query would cost 10x fewer tokens.

dotnet-claude-kit fixes all of that.

What This Is

A curated knowledge and action layer that sits between Claude Code and your .NET project. Drop a single CLAUDE.md into your repo and Claude instantly knows:

  • Which architecture fits your project (VSA, Clean Architecture, DDD, Modular Monolith)
  • How to write modern C# 14 with primary constructors, collection expressions, and records
  • How to build minimal APIs with IEndpointGroup auto-discovery, TypedResults, and proper OpenAPI metadata
  • How to use EF Core without repository wrappers, with compiled queries and interceptors
  • How to test with WebApplicationFactory + Testcontainers instead of in-memory fakes
  • How to navigate your codebase via Roslyn semantic analysis instead of expensive file reads
  • How to scaffold complete features, run health checks, review PRs, and enforce conventions

No configuration. No setup wizards. Just copy one file and go.

What Makes This 10x

An action layer on top of the knowledge layer — Claude doesn't just know the right patterns, it actively applies and enforces them:

Capability What It Does
Surgical Code Analysis 22 Roslyn-powered MCP tools with guaranteed bounded responses. get_symbol_source reads ONE method body instead of the whole file. get_file_outline shows what's in a file before reading it. resolve_stack_trace turns an exception into file:line in your own code. analyze_change_impact answers "what breaks if I change this?" in one call. Every list-returning tool reports Truncated — no tool can blow your context window.
Architecture Enforcement /arch-check verifies the code still matches its declared architecture (VSA, Clean, DDD, Modular Monolith): dependency direction, layer violations, module leaks, cycles — with file:line evidence and fixes.
Dependency Health /outdated reports stale packages, CVEs, and commercial-license traps (MediatR 13+, MassTransit 9+, FluentAssertions 8+, AutoMapper 15+) before an innocent update-all changes your legal position.
Security Mapping get_endpoint_map inventories every route with its auth posture (authorized/anonymous/unmarked) in one token-cheap call — /security-scan starts every auth audit there.
DI X-Ray get_di_registrations maps every service registration with lifetimes, duplicate detection, and captive-dependency risks (singleton holding scoped).
Agents That Learn Specialist agents carry memory: project — the code reviewer, architect, and security auditor learn your conventions across sessions instead of rediscovering them. The reviewer is tool-enforced read-only; the cleanup agent works in an isolated worktree.
Scaffolding One command → complete feature with Result pattern, validation, OpenAPI metadata, pagination, CancellationToken, and tests. 9-point checklist enforced. All 4 architectures.
Health Check Automated codebase analysis using MCP tools: anti-pattern scan, diagnostics, dead code detection, test coverage → graded report card.
PR Review Multi-dimensional code review: anti-patterns, diagnostics, API surface changes, blast radius, architecture compliance, test coverage.
Convention Learning Detects project-specific patterns (naming, structure, modifiers) and enforces them in new code. Adapts to your codebase.
Active Hooks Automated quality scripts — format on edit, destructive-command guard, restore on .csproj change — tested on Windows and Linux in CI.
Always Current Every package recommendation verified against NuGet with licensing-trap warnings, and a .NET 11 preview watch so guidance never rots.

Why dotnet-claude-kit?

Metric Without Kit With Kit Impact
Architecture decisions Claude picks randomly Asks questions, recommends with rationale Correct architecture from day one
Code quality Generic C#, legacy patterns Modern C# 14 with idiomatic .NET 10 Zero "fix this pattern" revision cycles
Codebase navigation Reads entire files (500-2000+ tokens each) Roslyn MCP queries (30-150 tokens each) ~10x token savings on exploration
Anti-patterns generated DateTime.Now, repository-over-EF, new HttpClient() TimeProvider, direct DbContext, IHttpClientFactory Production-ready on first generation
Testing approach In-memory fakes, mocked everything WebApplicationFactory + Testcontainers Tests that catch real bugs
Production resilience No retry, no circuit breakers Polly v8 pipelines with telemetry Handles transient failures automatically

The result: Less time reviewing and correcting Claude's output. More time shipping features.

Installation

Prefer a narrated walkthrough with screenshots and troubleshooting? Read the complete installation and usage guide.

Plugin Install (Recommended)

Install as a Claude Code plugin — all 47 skills (including 16 slash-command workflows), 10 agents, hooks, and MCP config activate globally. The 10 rules ship in this repo for you to copy into your project's .claude/rules/:

# In your terminal — install the Roslyn MCP server
dotnet tool install -g CWM.RoslynNavigator

macOS/Linux: If the server fails with "No .NET SDKs were found", set DOTNET_ROOT to your .NET installation root (e.g. /usr/local/share/dotnet). See the MCP server troubleshooting guide.

Then inside a Claude Code session:

# Add the marketplace and install the plugin
/plugin marketplace add codewithmukesh/dotnet-claude-kit
/plugin install dotnet-claude-kit

For local development/testing (loads directly from disk, no install needed):

claude --plugin-dir /path/to/dotnet-claude-kit

Per-Project Setup

Navigate to your project directory (existing or empty) and run:

/dotnet-init

Existing project? It detects your solution, scans .csproj SDKs, reads your tech stack from config, asks architecture questions, and generates a customized CLAUDE.md.

Greenfield project? It asks what you're building, scaffolds the full solution structure (dotnet new sln, projects, Directory.Build.props, src/ and tests/ folders), then generates CLAUDE.md. Follow up with /scaffold to add your first feature.

No manual template copying needed.

Manual Template Copy (Alternative) If you prefer manual setup, copy the template matching your project type:
cp templates/web-api/CLAUDE.md ./CLAUDE.md           # REST API
cp templates/modular-monolith/CLAUDE.md ./CLAUDE.md   # Multi-module system
cp templates/blazor-app/CLAUDE.md ./CLAUDE.md          # Blazor app
cp templates/worker-service/CLAUDE.md ./CLAUDE.md      # Background workers
cp templates/class-library/CLAUDE.md ./CLAUDE.md       # NuGet packages
Replace `[ProjectName]`, update tech stack, choose your architecture.

Start Claude Code — 47 skills, 10 agents, and 22 MCP tools activate automatically. Copy the 10 rules into your project's .claude/rules/ to make them always-loaded.

That's it. Claude now writes .NET code the way a senior .NET engineer would.

Manual Install (Alternative) If you prefer to clone the repo and wire things up manually:
# 1. Install the MCP server globally
dotnet tool install -g CWM.RoslynNavigator

# 2. Register it in Claude Code at user scope (available in ALL projects)
claude mcp add --scope user cwm-roslyn-navigator -- cwm-roslyn-navigator --solution ${workspaceFolder}

# 3. Clone the kit
git clone https://github.com/codewithmukesh/dotnet-claude-kit.git

# 4. Load as a local plugin (or copy a template manually)
claude --plugin-dir ./dotnet-claude-kit

What You Get

Before dotnet-claude-kit

// Claude generates this
public class OrderService
{
    private readonly IOrderRepository _repo;  // unnecessary abstraction over EF Core

    public async Task<Order> CreateOrder(CreateOrderDto dto)
    {
        var order = new Order();
        order.CreatedAt = DateTime.Now;  // wrong — use TimeProvider
        order.Items = dto.Items.ToList();
        await _repo.AddAsync(order);
        return order;  // leaks domain entity to API
    }
}

After dotnet-claude-kit

```csharp // Claude generates this public static class CreateOrder { public record Command(string CustomerId, List Items) : IRequest<

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR