Scaffolds .NET solutions using Clean Architecture or Vertical Slice Architecture with CQRS/MediatR. Detects existing project style and generates consistent folder layout, project references, and a working sample feature.
Ships in TheCodeMan .NET AI ToolKit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate a consistent, opinionated .NET solution structure — either Clean Architecture (layered) or Vertical Slice Architecture (feature-first) — with project references wired correctly and one working sample feature so the pattern is obvious.
For a new solution, just take the name. For an existing project, point this at the repo so it matches the house style instead of imposing one:
git clone --depth 1 <url> /tmp/repo && cd /tmp/repoDetect the existing style yourself before generating, e.g.:
find <target> -name "*.sln" -o -name "*.csproj" | grep -vi "/obj/\|/bin/"
ls <target>/**/Features 2>/dev/null # Vertical Slice? vs Domain/Application/Infrastructure folders = Clean
grep -rln "ICarterModule\|IRequestHandler\|MediatR\|FluentValidation\|OneOf" --include=*.cs <target> | head
When adding to an existing codebase, read one existing feature first and mirror its conventions (endpoint style, validation, result type) so the new code looks like it belongs.
The user is starting a new .NET solution, restructuring one, or adding a feature to an existing one. For new work, decide the style first (ask if unclear). For existing projects, detect the style from the code and match it:
Also confirm: project name, .NET version (default 8/9), and whether they want CQRS/MediatR (default yes for both styles).
Produce (a) the dotnet CLI commands to create projects and references, and (b) the contents of the key files. The user should be able to run the commands and paste the files and have a building solution.
src/
├── Acme.Domain/ # entities, value objects, domain events — NO dependencies
├── Acme.Application/ # use cases (CQRS handlers), interfaces, DTOs — depends on Domain
├── Acme.Infrastructure/ # EF Core, external services — depends on Application
└── Acme.Api/ # endpoints, DI, middleware — depends on Application + Infrastructure
tests/
├── Acme.Domain.Tests/
├── Acme.Application.Tests/
└── Acme.Api.Tests/
The dependency rule: dependencies point inward. Domain depends on nothing. Application depends on Domain. Infrastructure and Api depend inward. Application defines interfaces (e.g. IOrderRepository); Infrastructure implements them.
dotnet new sln -n Acme
dotnet new classlib -n Acme.Domain -o src/Acme.Domain
dotnet new classlib -n Acme.Application -o src/Acme.Application
dotnet new classlib -n Acme.Infrastructure -o src/Acme.Infrastructure
dotnet new webapi -n Acme.Api -o src/Acme.Api --use-minimal-apis
dotnet sln add src/**/*.csproj
dotnet add src/Acme.Application/Acme.Application.csproj reference src/Acme.Domain/Acme.Domain.csproj
dotnet add src/Acme.Infrastructure/Acme.Infrastructure.csproj reference src/Acme.Application/Acme.Application.csproj
dotnet add src/Acme.Api/Acme.Api.csproj reference src/Acme.Application/Acme.Application.csproj
dotnet add src/Acme.Api/Acme.Api.csproj reference src/Acme.Infrastructure/Acme.Infrastructure.csproj
src/Acme.Api/
├── Features/
│ ├── Orders/
│ │ ├── CreateOrder.cs # request, handler, validator, endpoint — all in one file
│ │ ├── GetOrder.cs
│ │ └── Order.cs # the entity (or shared in Domain)
│ └── Customers/
│ └── ...
├── Common/ # cross-cutting: behaviors, results, persistence
└── Program.cs
Each slice owns its request, handler, validation, and endpoint. Shared concerns (DbContext, pipeline behaviors, Result type) live in Common/. A slice rarely touches another slice.
A "Create Order" command handler the user can copy as the template for every feature:
// Command + Result
public record CreateOrderCommand(Guid CustomerId, List<OrderLine> Lines) : IRequest<Result<Guid>>;
// Handler
public class CreateOrderHandler(IOrderRepository repo, IUnitOfWork uow)
: IRequestHandler<CreateOrderCommand, Result<Guid>>
{
public async Task<Result<Guid>> Handle(CreateOrderCommand cmd, CancellationToken ct)
{
var order = Order.Create(cmd.CustomerId, cmd.Lines);
if (order.IsFailure)
return Result.Failure<Guid>(order.Error);
await repo.AddAsync(order.Value, ct);
await uow.SaveChangesAsync(ct);
return Result.Success(order.Value.Id);
}
}
// Validator (FluentValidation)
public class CreateOrderValidator : AbstractValidator<CreateOrderCommand>
{
public CreateOrderValidator()
{
RuleFor(x => x.CustomerId).NotEmpty();
RuleFor(x => x.Lines).NotEmpty();
}
}
// Minimal API endpoint
app.MapPost("/orders", async (CreateOrderCommand cmd, ISender sender) =>
{
var result = await sender.Send(cmd);
return result.IsSuccess
? Results.Created($"/orders/{result.Value}", result.Value)
: Results.BadRequest(result.Error);
});
Result<T>.Include this so the structure can't silently rot:
[Fact]
public void Domain_should_not_depend_on_other_projects()
{
var result = Types.InAssembly(typeof(Order).Assembly)
.Should()
.NotHaveDependencyOnAny("Acme.Application", "Acme.Infrastructure", "Acme.Api")
.GetResult();
Assert.True(result.IsSuccessful, string.Join(", ", result.FailingTypeNames ?? new List<string>()));
}
What SKILL.md sets; muted values are Claude Code's defaults
/dotnet-ai-toolkit:clean-architecture-scaffolderfrom TheCodeMan .NET AI ToolKit
npx claudepluginhub stefanthecode/dotnet-ai-toolkit --plugin dotnet-ai-toolkit49 skills in this plugin
/adonet-data-access-auditorAudit and fix classic ADO.NET data-access code (SqlConnection / SqlCommand / SqlDataReader / DataSet) on .NET Framework. Use this skill whenever the user shares raw ADO.NET code, a DAL / repository built on SqlCommand, stored-proc calls, string-concatenated SQL, or mentions SQL injection, parameterized queries, connection leaks, "using / Dispose", reading the same column multiple times, transactions, or "why does my old data layer leak connections / is it safe". Always use this skill for classic ADO.NET review instead of answering from memory; it applies a fixed security + correctness + performance checklist and rewrites the code./async-await-auditorAudit C#/.NET code for async/await anti-patterns and concurrency bugs. Use this skill whenever the user shares async C# code or asks about deadlocks, async void, .Result/.Wait(), blocking calls, ConfigureAwait, sync-over-async, fire-and-forget tasks, CancellationToken usage, or "why does my async code hang/deadlock". Always use this skill for async correctness/performance reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-policy-generatorDesign ASP.NET Core authorization — policy-based, role-based, and claims/requirement-based with custom authorization handlers and resource-based checks. Use this skill whenever the user wants authorization policies, role/claim checks, custom AuthorizationHandler, resource-based authorization, permission checks, or asks "how do I authorize this / policy vs role / restrict this endpoint to X". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring./benchmarkdotnet-setupSet up BenchmarkDotNet for a .NET project and interpret the results — proper benchmark classes, memory diagnostics, baselines, and reading ns/op + allocations. Use this skill whenever the user wants to benchmark code, measure performance, compare two implementations, set up BenchmarkDotNet, or asks "which is faster / how do I benchmark this / interpret these benchmark results". Always use this skill for micro-benchmarking requests; it writes correct benchmarks and explains the numbers./caching-strategy-setupAdd the right caching to a .NET app — IMemoryCache, distributed cache, or HybridCache (.NET 9+) — with correct keys, expiration, stampede protection, and invalidation. Use this skill whenever the user wants caching, to cache a query/response, IMemoryCache, Redis/distributed cache, HybridCache, output caching, or asks "how do I cache this / add caching / avoid cache stampede". Always use this skill for caching requests; it picks the right layer and wires expiration + invalidation correctly./cicd-pipeline-generatorGenerate a CI/CD pipeline for a .NET app — GitHub Actions or Azure DevOps — with restore, build, test, coverage, vulnerability scan, container build, and deploy stages. Use this skill whenever the user wants a CI/CD pipeline, GitHub Actions workflow, Azure DevOps YAML, build/test automation, a release pipeline, or asks "how do I set up CI / pipeline for .NET / automate build and deploy". Always use this skill for CI/CD requests; it generates a complete, sensible pipeline.Other plugins' skills for the same job