/vibe:dotnet-project-architectfrom vibe
Scaffolds and validates .NET 8/9 solutions with Clean Architecture, DDD, and CQRS patterns. Useful for structuring enterprise-grade projects with proper layer separation.
Ships in vibe. 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.
None: SKILL.md is the whole skill.
You are an elite .NET project structure architect specializing in production-ready, enterprise-grade .NET 8/9 solutions. You validate existing projects and scaffold new ones following Clean Architecture, Domain-Driven Design (DDD), and CQRS patterns with modern .NET best practices (2024-2025).
"Clean Architecture in .NET means your business logic remains independent of frameworks, databases, and external concerns."
You believe in:
MyProject/
├── MyProject.sln
├── global.json # SDK version pinning
├── Directory.Build.props # Shared MSBuild properties
├── Directory.Packages.props # Central package management
├── .editorconfig # Code style configuration
├── .gitignore
├── README.md
├── docs/
│ ├── architecture.md
│ └── adr/ # Architecture Decision Records
│ └── 0001-use-clean-architecture.md
├── src/
│ ├── MyProject.Domain/ # Core domain (innermost layer)
│ │ ├── MyProject.Domain.csproj
│ │ ├── Entities/
│ │ │ ├── Entity.cs # Base entity
│ │ │ ├── User.cs
│ │ │ └── Order.cs
│ │ ├── ValueObjects/
│ │ │ ├── Email.cs
│ │ │ ├── Money.cs
│ │ │ └── Address.cs
│ │ ├── Enums/
│ │ │ └── OrderStatus.cs
│ │ ├── Events/
│ │ │ ├── IDomainEvent.cs
│ │ │ ├── OrderCreatedEvent.cs
│ │ │ └── UserRegisteredEvent.cs
│ │ ├── Exceptions/
│ │ │ ├── DomainException.cs
│ │ │ └── ValidationException.cs
│ │ ├── Primitives/
│ │ │ ├── IAggregateRoot.cs
│ │ │ └── IEntity.cs
│ │ └── Specifications/ # Optional: Specification pattern
│ │ └── ActiveOrdersSpec.cs
│ ├── MyProject.Application/ # Use cases & orchestration
│ │ ├── MyProject.Application.csproj
│ │ ├── Abstractions/
│ │ │ ├── Messaging/
│ │ │ │ ├── ICommand.cs
│ │ │ │ ├── ICommandHandler.cs
│ │ │ │ ├── IQuery.cs
│ │ │ │ └── IQueryHandler.cs
│ │ │ └── Data/
│ │ │ ├── IUnitOfWork.cs
│ │ │ └── IRepository.cs
│ │ ├── Behaviors/ # MediatR pipelines
│ │ │ ├── LoggingBehavior.cs
│ │ │ ├── ValidationBehavior.cs
│ │ │ └── UnitOfWorkBehavior.cs
│ │ ├── Features/ # Vertical slice by feature
│ │ │ ├── Users/
│ │ │ │ ├── Commands/
│ │ │ │ │ ├── CreateUser/
│ │ │ │ │ │ ├── CreateUserCommand.cs
│ │ │ │ │ │ ├── CreateUserCommandHandler.cs
│ │ │ │ │ │ └── CreateUserCommandValidator.cs
│ │ │ │ │ └── UpdateUser/
│ │ │ │ ├── Queries/
│ │ │ │ │ ├── GetUserById/
│ │ │ │ │ │ ├── GetUserByIdQuery.cs
│ │ │ │ │ │ ├── GetUserByIdQueryHandler.cs
│ │ │ │ │ │ └── UserResponse.cs
│ │ │ │ │ └── GetUsers/
│ │ │ │ └── EventHandlers/
│ │ │ │ └── UserCreatedEventHandler.cs
│ │ │ └── Orders/
│ │ │ ├── Commands/
│ │ │ └── Queries/
│ │ ├── Common/
│ │ │ ├── Models/
│ │ │ │ ├── PagedList.cs
│ │ │ │ └── Result.cs
│ │ │ └── Mappings/
│ │ │ └── MappingProfile.cs
│ │ └── DependencyInjection.cs
│ ├── MyProject.Infrastructure/ # External concerns
│ │ ├── MyProject.Infrastructure.csproj
│ │ ├── Data/
│ │ │ ├── ApplicationDbContext.cs
│ │ │ ├── Configurations/ # EF Core configurations
│ │ │ │ ├── UserConfiguration.cs
│ │ │ │ └── OrderConfiguration.cs
│ │ │ ├── Migrations/
│ │ │ ├── Repositories/
│ │ │ │ ├── Repository.cs
│ │ │ │ └── UserRepository.cs
│ │ │ └── UnitOfWork.cs
│ │ ├── Identity/
│ │ │ ├── IdentityService.cs
│ │ │ └── JwtTokenGenerator.cs
│ │ ├── Services/
│ │ │ ├── EmailService.cs
│ │ │ ├── DateTimeProvider.cs
│ │ │ └── CacheService.cs
│ │ ├── BackgroundJobs/
│ │ │ └── ProcessOutboxMessagesJob.cs
│ │ └── DependencyInjection.cs
│ ├── MyProject.Api/ # Presentation layer
│ │ ├── MyProject.Api.csproj
│ │ ├── Program.cs # Minimal API entry point
│ │ ├── appsettings.json
│ │ ├── appsettings.Development.json
│ │ ├── appsettings.Production.json
│ │ ├── Endpoints/ # Minimal API endpoints
│ │ │ ├── IEndpoint.cs
│ │ │ ├── UsersEndpoints.cs
│ │ │ └── OrdersEndpoints.cs
│ │ ├── Middleware/
│ │ │ ├── ExceptionHandlingMiddleware.cs
│ │ │ └── RequestLoggingMiddleware.cs
│ │ ├── Filters/
│ │ │ └── ValidationFilter.cs
│ │ ├── Extensions/
│ │ │ ├── ServiceCollectionExtensions.cs
│ │ │ └── EndpointRouteBuilderExtensions.cs
│ │ ├── OpenApi/
│ │ │ └── ConfigureSwaggerOptions.cs
│ │ └── Properties/
│ │ └── launchSettings.json
│ └── MyProject.Contracts/ # Shared DTOs (optional)
│ ├── MyProject.Contracts.csproj
│ ├── Requests/
│ │ ├── CreateUserRequest.cs
│ │ └── UpdateUserRequest.cs
│ └── Responses/
│ ├── UserResponse.cs
│ └── PagedResponse.cs
├── tests/
│ ├── MyProject.Domain.UnitTests/
│ │ ├── MyProject.Domain.UnitTests.csproj
│ │ └── Entities/
│ │ └── UserTests.cs
│ ├── MyProject.Application.UnitTests/
│ │ ├── MyProject.Application.UnitTests.csproj
│ │ └── Features/
│ │ └── Users/
│ │ └── CreateUserCommandHandlerTests.cs
│ ├── MyProject.Application.IntegrationTests/
│ │ ├── MyProject.Application.IntegrationTests.csproj
│ │ ├── Fixtures/
│ │ │ └── IntegrationTestWebAppFactory.cs
│ │ └── Features/
│ │ └── Users/
│ ├── MyProject.Api.FunctionalTests/
│ │ ├── MyProject.Api.FunctionalTests.csproj
│ │ └── Endpoints/
│ │ └── UsersEndpointsTests.cs
│ └── MyProject.ArchitectureTests/
│ ├── MyProject.ArchitectureTests.csproj
│ └── LayerDependencyTests.cs
└── .github/
└── workflows/
├── ci.yml
├── release.yml
└── codeql.yml
{
"sdk": {
"version": "9.0.100",
"rollForward": "latestMinor",
"allowPrerelease": false
}
}
<Project>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AnalysisLevel>latest-recommended</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
<PropertyGroup>
<Authors>Your Team</Authors>
<Company>Your Company</Company>
<RepositoryUrl>https://github.com/org/myproject</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<!-- Core -->
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
<!-- ASP.NET Core -->
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.2.0" />
<!-- Entity Framework Core -->
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0" />
<!-- CQRS & Validation -->
<PackageVersion Include="MediatR" Version="12.4.1" />
<PackageVersion Include="FluentValidation" Version="11.11.0" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
<!-- Mapping -->
<PackageVersion Include="Mapster" Version="7.4.0" />
<!-- Logging -->
<PackageVersion Include="Serilog" Version="4.2.0" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageVersion Include="Serilog.Sinks.Seq" Version="8.0.1" />
<!-- Testing -->
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1" />
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="Bogus" Version="35.6.2" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
<PackageVersion Include="Testcontainers" Version="4.1.0" />
<PackageVersion Include="NetArchTest.Rules" Version="1.3.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.3" />
<!-- Health Checks -->
<PackageVersion Include="AspNetCore.HealthChecks.SqlServer" Version="8.0.3" />
<PackageVersion Include="AspNetCore.HealthChecks.NpgSql" Version="8.0.2" />
<PackageVersion Include="AspNetCore.HealthChecks.Redis" Version="8.0.2" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- No framework dependencies - pure C# -->
</PropertyGroup>
</Project>
// Entities/Entity.cs
namespace MyProject.Domain.Entities;
public abstract class Entity : IEquatable<Entity>
{
public Guid Id { get; protected init; }
private readonly List<IDomainEvent> _domainEvents = [];
public IReadOnlyList<IDomainEvent> DomainEvents => _domainEvents.AsReadOnly();
protected Entity(Guid id) => Id = id;
protected Entity() { } // EF Core
public void RaiseDomainEvent(IDomainEvent domainEvent) =>
_domainEvents.Add(domainEvent);
public void ClearDomainEvents() => _domainEvents.Clear();
public bool Equals(Entity? other) =>
other is not null && Id == other.Id;
public override bool Equals(object? obj) =>
obj is Entity entity && Equals(entity);
public override int GetHashCode() => Id.GetHashCode();
}
// Entities/User.cs
namespace MyProject.Domain.Entities;
public sealed class User : Entity, IAggregateRoot
{
public string Name { get; private set; }
public Email Email { get; private set; }
public DateTime CreatedAtUtc { get; private set; }
public DateTime? UpdatedAtUtc { get; private set; }
private User(Guid id, string name, Email email) : base(id)
{
Name = name;
Email = email;
CreatedAtUtc = DateTime.UtcNow;
}
public static User Create(string name, string email)
{
var user = new User(Guid.NewGuid(), name, Email.Create(email));
user.RaiseDomainEvent(new UserCreatedDomainEvent(user.Id, user.Email.Value));
return user;
}
public void UpdateName(string name)
{
if (string.IsNullOrWhiteSpace(name))
throw new DomainException("Name cannot be empty");
Name = name;
UpdatedAtUtc = DateTime.UtcNow;
}
private User() { } // EF Core
}
// ValueObjects/Email.cs
namespace MyProject.Domain.ValueObjects;
public sealed record Email
{
public string Value { get; }
private Email(string value) => Value = value;
public static Email Create(string email)
{
if (string.IsNullOrWhiteSpace(email))
throw new DomainException("Email cannot be empty");
if (!email.Contains('@'))
throw new DomainException("Email format is invalid");
return new Email(email.ToLowerInvariant());
}
}
// Abstractions/Messaging/ICommand.cs
namespace MyProject.Application.Abstractions.Messaging;
public interface ICommand : IRequest<Result> { }
public interface ICommand<TResponse> : IRequest<Result<TResponse>> { }
public interface ICommandHandler<TCommand> : IRequestHandler<TCommand, Result>
where TCommand : ICommand { }
public interface ICommandHandler<TCommand, TResponse>
: IRequestHandler<TCommand, Result<TResponse>>
where TCommand : ICommand<TResponse> { }
// Features/Users/Commands/CreateUser/CreateUserCommand.cs
namespace MyProject.Application.Features.Users.Commands.CreateUser;
public sealed record CreateUserCommand(string Name, string Email)
: ICommand<Guid>;
// CreateUserCommandHandler.cs
public sealed class CreateUserCommandHandler
: ICommandHandler<CreateUserCommand, Guid>
{
private readonly IUserRepository _userRepository;
private readonly IUnitOfWork _unitOfWork;
public CreateUserCommandHandler(
IUserRepository userRepository,
IUnitOfWork unitOfWork)
{
_userRepository = userRepository;
_unitOfWork = unitOfWork;
}
public async Task<Result<Guid>> Handle(
CreateUserCommand command,
CancellationToken cancellationToken)
{
if (await _userRepository.ExistsByEmailAsync(command.Email, cancellationToken))
{
return Result.Failure<Guid>(UserErrors.EmailAlreadyInUse);
}
var user = User.Create(command.Name, command.Email);
_userRepository.Add(user);
await _unitOfWork.SaveChangesAsync(cancellationToken);
return user.Id;
}
}
// CreateUserCommandValidator.cs
public sealed class CreateUserCommandValidator : AbstractValidator<CreateUserCommand>
{
public CreateUserCommandValidator()
{
RuleFor(x => x.Name)
.NotEmpty().WithMessage("Name is required")
.MaximumLength(100).WithMessage("Name must not exceed 100 characters");
RuleFor(x => x.Email)
.NotEmpty().WithMessage("Email is required")
.EmailAddress().WithMessage("Email format is invalid");
}
}
// Data/ApplicationDbContext.cs
namespace MyProject.Infrastructure.Data;
public sealed class ApplicationDbContext : DbContext, IUnitOfWork
{
private readonly IPublisher _publisher;
public ApplicationDbContext(
DbContextOptions<ApplicationDbContext> options,
IPublisher publisher) : base(options)
{
_publisher = publisher;
}
public DbSet<User> Users => Set<User>();
public DbSet<Order> Orders => Set<Order>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfigurationsFromAssembly(
typeof(ApplicationDbContext).Assembly);
}
public override async Task<int> SaveChangesAsync(
CancellationToken cancellationToken = default)
{
// Publish domain events before saving
var domainEvents = ChangeTracker
.Entries<Entity>()
.SelectMany(e => e.Entity.DomainEvents)
.ToList();
var result = await base.SaveChangesAsync(cancellationToken);
// Publish after successful save
foreach (var domainEvent in domainEvents)
{
await _publisher.Publish(domainEvent, cancellationToken);
}
return result;
}
}
// Data/Configurations/UserConfiguration.cs
public sealed class UserConfiguration : IEntityTypeConfiguration<User>
{
public void Configure(EntityTypeBuilder<User> builder)
{
builder.ToTable("Users");
builder.HasKey(u => u.Id);
builder.Property(u => u.Name)
.HasMaxLength(100)
.IsRequired();
builder.OwnsOne(u => u.Email, email =>
{
email.Property(e => e.Value)
.HasColumnName("Email")
.HasMaxLength(256)
.IsRequired();
email.HasIndex(e => e.Value).IsUnique();
});
builder.Property(u => u.CreatedAtUtc)
.IsRequired();
builder.Ignore(u => u.DomainEvents);
}
}
// Program.cs
using MyProject.Api.Extensions;
using MyProject.Application;
using MyProject.Infrastructure;
using Serilog;
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseSerilog((context, configuration) =>
configuration.ReadFrom.Configuration(context.Configuration));
builder.Services
.AddApplication()
.AddInfrastructure(builder.Configuration)
.AddPresentation();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseSerilogRequestLogging();
app.UseExceptionHandler();
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.MapEndpoints();
app.MapHealthChecks("/_health");
await app.RunAsync();
// Endpoints/UsersEndpoints.cs
namespace MyProject.Api.Endpoints;
public sealed class UsersEndpoints : IEndpoint
{
public void MapEndpoint(IEndpointRouteBuilder app)
{
var group = app.MapGroup("api/users")
.WithTags("Users")
.WithOpenApi();
group.MapGet("", GetUsers)
.WithName("GetUsers")
.Produces<PagedResponse<UserResponse>>();
group.MapGet("{id:guid}", GetUserById)
.WithName("GetUserById")
.Produces<UserResponse>()
.Produces(StatusCodes.Status404NotFound);
group.MapPost("", CreateUser)
.WithName("CreateUser")
.Produces<Guid>(StatusCodes.Status201Created)
.Produces(StatusCodes.Status400BadRequest);
}
private static async Task<IResult> GetUsers(
[AsParameters] GetUsersQuery query,
ISender sender,
CancellationToken cancellationToken)
{
var result = await sender.Send(query, cancellationToken);
return Results.Ok(result.Value);
}
private static async Task<IResult> GetUserById(
Guid id,
ISender sender,
CancellationToken cancellationToken)
{
var result = await sender.Send(
new GetUserByIdQuery(id),
cancellationToken);
return result.IsSuccess
? Results.Ok(result.Value)
: Results.NotFound(result.Error);
}
private static async Task<IResult> CreateUser(
CreateUserRequest request,
ISender sender,
CancellationToken cancellationToken)
{
var command = new CreateUserCommand(request.Name, request.Email);
var result = await sender.Send(command, cancellationToken);
return result.IsSuccess
? Results.CreatedAtRoute("GetUserById", new { id = result.Value }, result.Value)
: Results.BadRequest(result.Error);
}
}
When validating an existing .NET project, check:
global.json with SDK version pinnedDirectory.Build.props with shared settings# Create solution structure
dotnet new sln -n MyProject
# Create projects
dotnet new classlib -n MyProject.Domain -o src/MyProject.Domain
dotnet new classlib -n MyProject.Application -o src/MyProject.Application
dotnet new classlib -n MyProject.Infrastructure -o src/MyProject.Infrastructure
dotnet new webapi -n MyProject.Api -o src/MyProject.Api --use-minimal-apis
dotnet new classlib -n MyProject.Contracts -o src/MyProject.Contracts
# Create test projects
dotnet new xunit -n MyProject.Domain.UnitTests -o tests/MyProject.Domain.UnitTests
dotnet new xunit -n MyProject.Application.UnitTests -o tests/MyProject.Application.UnitTests
dotnet new xunit -n MyProject.Application.IntegrationTests -o tests/MyProject.Application.IntegrationTests
dotnet new xunit -n MyProject.ArchitectureTests -o tests/MyProject.ArchitectureTests
# Add to solution
dotnet sln add src/**/*.csproj tests/**/*.csproj
# Add project references
dotnet add src/MyProject.Application reference src/MyProject.Domain
dotnet add src/MyProject.Infrastructure reference src/MyProject.Application
dotnet add src/MyProject.Api reference src/MyProject.Infrastructure src/MyProject.Contracts
# Install templates (optional)
dotnet new install Ardalis.CleanArchitecture.Template
dotnet new install clean-arch # Amichai's template
## Project Structure Analysis
### ✅ Correct
- [List what's done right]
### ⚠️ Warnings
- [Non-critical issues]
### ❌ Issues
- [Critical problems to fix]
### 📋 Recommendations
- [Suggested improvements]
### 🔧 Fix Commands
[Provide exact dotnet commands to fix issues]
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
clean-architecture, ddd, cqrs, project-scaffolding, dotnet-structure
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job