Scaffolds or restructures backend projects using Clean Architecture or Vertical Slice Architecture across multiple stacks. Generates consistent folder layout, dependency wiring, a working sample feature, and architecture guardrail tests.
Ships in AI for Developers 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 backend structure - Clean Architecture (layered) or Vertical Slice Architecture (feature-first) - with dependencies wired correctly and one working sample feature so the pattern is obvious. The concepts are universal; the folder/project layout follows each stack's idioms.
For a new project, take the name and stack. For an existing project (path or GitHub URL - clone with git clone --depth 1 <url> /tmp/repo), detect the stack and current architecture first, then scaffold a new slice/feature that matches the house style instead of imposing one.
Detect:
ls <target> # *.sln/*.csproj | package.json | pyproject.toml | pom.xml/build.gradle* | go.mod
find <target> -type d \( -iname features -o -iname domain -o -iname application -o -iname infrastructure -o -iname internal \) -not -path "*/node_modules/*"
When adding to an existing codebase, read one existing feature end to end first and mirror its conventions (endpoint style, validation, error/result type, DI, tests).
common/shared area. Good for fast-moving teams and CRUD-heavy apps; fewer cross-layer jumps.Choosing: match the style to the team and the problem, not the trend. Don't turn a CRUD app into four layers. If unclear, ask about team size, domain complexity, and expected lifetime, then recommend one.
Clean Architecture:
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/ Acme.ArchitectureTests/
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
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 src/Acme.Infrastructure/Acme.Infrastructure.csproj
Vertical Slice: a single Acme.Api project with Features/Orders/CreateOrder.cs (request, handler, validator, endpoint in one file), Features/Orders/GetOrder.cs, and Common/ for the DbContext, pipeline behaviors, and the Result type.
Sample feature:
public record CreateOrderCommand(Guid CustomerId, List<OrderLine> Lines) : IRequest<Result<Guid>>;
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);
}
}
public class CreateOrderValidator : AbstractValidator<CreateOrderCommand>
{
public CreateOrderValidator()
{
RuleFor(x => x.CustomerId).NotEmpty();
RuleFor(x => x.Lines).NotEmpty();
}
}
app.MapPost("/orders", async (CreateOrderCommand cmd, ISender sender, CancellationToken ct) =>
{
var result = await sender.Send(cmd, ct);
return result.IsSuccess
? Results.Created($"/orders/{result.Value}", result.Value)
: Results.BadRequest(result.Error);
});
Building blocks to offer (not force): MediatR or a hand-rolled dispatcher (check MediatR's current license terms for commercial use), FluentValidation as a pipeline behavior, a Result type, and in Vertical Slice use the DbContext directly instead of repository wrappers. Keep Domain free of EF attributes (use Fluent configuration).
Guardrail (NetArchTest):
[Fact]
public void Domain_should_not_depend_on_other_layers()
{
var result = Types.InAssembly(typeof(Order).Assembly)
.Should().NotHaveDependencyOnAny("Acme.Application", "Acme.Infrastructure", "Acme.Api")
.GetResult();
Assert.True(result.IsSuccessful, string.Join(", ", result.FailingTypeNames ?? []));
}
NestJS (feature modules = natural vertical slices; layers inside each module for Clean):
src/
├── orders/
│ ├── domain/ order.entity.ts, order.ts (rules, no Nest imports)
│ ├── application/ create-order.handler.ts, order.repository.ts (interface / abstract class)
│ ├── infrastructure/ prisma-order.repository.ts (or TypeORM)
│ ├── api/ orders.controller.ts, create-order.dto.ts (class-validator)
│ └── orders.module.ts binds { provide: OrderRepository, useClass: PrismaOrderRepository }
├── shared/ database, errors, auth
└── main.ts
Create: npx @nestjs/cli new acme, then nest g module orders, nest g controller orders. @nestjs/cqrs is optional for CQRS.
Express: same folders under src/features/orders/ with a router.ts per feature, zod for validation, and a small composition root (src/app.ts) that wires implementations into handlers by constructor/factory injection.
Guardrail: dependency-cruiser rule forbidding domain/ from importing infrastructure/, api/, or framework packages; run it in CI.
src/acme/
├── domain/ orders.py (dataclasses / plain classes, no FastAPI or SQLAlchemy imports)
├── application/ create_order.py (use case), ports.py (typing.Protocol repositories)
├── infrastructure/ db.py, sqlalchemy_order_repository.py
└── api/ orders.py (APIRouter, Pydantic request/response models), main.py
tests/
Vertical Slice alternative: src/acme/features/orders/{router.py, schemas.py, service.py, models.py}.
Wire implementations through FastAPI Depends(...) providers in api/ (the composition root); the use case receives a Protocol, not a concrete repository. Use uv or Poetry with a pyproject.toml.
Guardrail: import-linter with a layers contract (acme.api > acme.infrastructure > acme.application > acme.domain), run in CI via lint-imports.
Package-by-feature with layers inside (single module), or one Gradle/Maven module per layer for hard boundaries:
com.acme.orders
├── domain/ Order.java, OrderLine.java (no Spring/JPA annotations)
├── application/ CreateOrderUseCase.java, OrderRepository.java (port interface)
├── infrastructure/ JpaOrderRepository.java, OrderEntity.java, OrderJpaMapper.java
└── api/ OrderController.java, CreateOrderRequest.java (record + Bean Validation)
Start from Spring Initializr (start.spring.io) with Web, Validation, Data JPA. Use constructor injection; the use case depends on the OrderRepository interface. For modular monoliths, Spring Modulith can verify module boundaries.
Guardrail: ArchUnit, e.g. layeredArchitecture().consideringAllDependencies().layer("Domain").definedBy("..domain..")...whereLayer("Domain").mayNotAccessAnyLayer() in a JUnit test.
cmd/api/main.go # composition root: config, DB, wiring, HTTP server
internal/
├── orders/
│ ├── order.go # domain type + rules (no net/http, no SQL)
│ ├── service.go # use cases; depends on the Repository interface it declares
│ ├── postgres.go # Repository implementation (database/sql, pgx, sqlc, GORM)
│ └── http.go # handlers (net/http, chi, Gin, or Echo)
└── platform/ # db, logging, middleware
go.mod
Go favors package-per-feature (a vertical slice) with small interfaces declared by the consumer; avoid deep domain/application/infrastructure trees unless the team wants them. internal/ prevents imports from outside the module. Pass context.Context through every layer.
Guardrail: a test that runs go list -deps on the domain/service package and fails if it imports net/http or database packages, or a linter such as depguard (golangci-lint) rules.
## Structure
<chosen style + why, tree>
## Commands
<shell commands to create and wire it>
## Key files
<sample feature end to end + DI wiring>
## Guardrail
<architecture test + how to run it>
What SKILL.md sets; muted values are Claude Code's defaults
/ai-dev-toolkit:clean-architecture-scaffolderfrom AI for Developers Toolkit
npx claudepluginhub stefanthecode/ai-for-developers --plugin ai-dev-toolkit45 skills in this plugin
/api-endpoint-scaffolderScaffold HTTP API endpoints in any stack - ASP.NET Core Minimal APIs or controllers, Express, Fastify, NestJS, FastAPI, Django REST Framework, Spring Boot controllers, Go net/http, chi, Gin - one feature per endpoint (REPR style) with request validation, typed responses, route grouping, auth, and OpenAPI metadata. Use this skill whenever the user wants to add an endpoint or route, convert controllers to minimal APIs, structure routes or routers, set up endpoint groups, TypedResults, route handlers, request DTOs/schemas (zod, Pydantic, Bean Validation, binding tags), or asks "how do I add an endpoint / structure my API routes". Always use this skill for endpoint scaffolding; it generates a complete, validated endpoint that matches the project's conventions./architecture-test-generatorGenerate architecture tests / fitness functions that fail the build when architectural rules are violated - layer dependencies, module boundaries, cycles, naming, and visibility conventions - in any stack: NetArchTest or ArchUnitNET (.NET), ArchUnit or Konsist (Java/Kotlin), dependency-cruiser or eslint-plugin-boundaries (TypeScript/JavaScript), import-linter (Python), go-arch-lint or depguard (Go). Use this skill whenever the user wants architecture tests, to enforce layering or the dependency rule, dependency rules as tests, import rules, forbidden imports, no circular dependencies, naming conventions, fitness functions, or asks "how do I stop people breaking the architecture / enforce my layers / keep modules from importing each other". Always use this skill for architecture-test requests; it generates rules matching the project's real structure./async-await-auditorAudit async and concurrent code in any language for correctness and performance bugs - C#/.NET (async/await, Task), JavaScript/TypeScript (Promises, async/await), Python (asyncio), Java/Kotlin (CompletableFuture, virtual threads, coroutines), Go (goroutines, channels, context), Rust (tokio/async). Use this skill whenever the user shares async or concurrent code, or asks about deadlocks, hangs, blocking calls, .Result/.Wait(), async void, ConfigureAwait, floating or unhandled promises, await in a loop vs Promise.all, blocking the event loop, forgotten await, asyncio.gather/TaskGroup, CompletableFuture.join, virtual thread pinning, goroutine leaks, context cancellation, WaitGroup/errgroup, holding a lock across .await, fire-and-forget tasks, cancellation tokens, or "why does my async code hang". Always use this skill for async/concurrency reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-setupDesign API authorization in any stack - policy-based, role-based, claims/permission-based, and resource-based (ownership) checks. Covers ASP.NET Core policies and AuthorizationHandler, NestJS guards, Express middleware and CASL, FastAPI dependencies/scopes, Django and DRF permission classes, Spring Security (@PreAuthorize, SecurityFilterChain), Go middleware, and Casbin/OPA. Use this skill whenever the user wants authorization policies, role/claim/permission checks, RBAC/ABAC, custom authorization rules, resource-based authorization, IDOR protection, "deny by default", or asks "how do I authorize this / policy vs role / restrict this endpoint to X / stop users seeing other users' data". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring./benchmark-setupSet up correct micro-benchmarks in any stack and interpret the results - BenchmarkDotNet (.NET), JMH (Java/Kotlin), pytest-benchmark / pyperf (Python), Vitest bench / tinybench / mitata (JavaScript/TypeScript), Go testing.B + benchstat, Rust criterion. Use this skill whenever the user wants to benchmark code, measure performance, compare two implementations or functions, set up a benchmark harness, or asks "which is faster", "benchmark these two functions", "how do I benchmark this", "is this optimization worth it", or "interpret these benchmark results". Always use this skill for micro-benchmarking requests; it writes correct benchmarks, avoids the classic pitfalls, and explains the numbers./caching-strategy-setupAdd the right caching to an app in any stack - in-process, distributed (Redis/Valkey/Memcached), two-level, or HTTP/output caching - with correct keys, expiration, stampede protection, and invalidation. Covers HybridCache / IMemoryCache / IDistributedCache / output caching in .NET, lru-cache / keyv / cache-manager / ioredis in Node, functools / cachetools / redis-py / Django cache in Python, Spring Cache with Caffeine or Redis in Java/Kotlin, and ristretto / groupcache / singleflight / go-redis in Go. Use this skill whenever the user wants caching, to cache a query/response, Redis caching, @Cacheable, lru_cache, HybridCache, cache-aside, output caching, or asks "how do I cache this / add caching / avoid cache stampede / invalidate this cache". Always use this skill for caching requests; it picks the right layer and wires expiration + invalidation correctly.Other plugins' skills for the same job