一键导入
clean-architecture
.NET clean architecture enforcement — layer rules, dependency direction, DI registration patterns, and project reference validation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
.NET clean architecture enforcement — layer rules, dependency direction, DI registration patterns, and project reference validation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
JWT bearer auth, ASP.NET Identity, OIDC, and policy-based authorization patterns for ASP.NET Core APIs.
HybridCache (.NET 9+), output caching, cache-aside pattern, and IMemoryCache — registration, usage, invalidation, and key strategy.
Protocol for detecting and replicating existing project conventions before generating new code — naming, folder structure, DI registration, test framework, DTOs, and error handling.
Domain-Driven Design patterns for .NET — aggregates, value objects, strongly-typed IDs, domain events, repositories, and layer rules.
Result pattern, ProblemDetails (RFC 7807), global exception boundaries, and typed error records for .NET APIs.
Serilog structured logging for ASP.NET Core — setup, message templates, LogContext enrichment, request logging middleware, and log level guidelines.
| name | clean-architecture |
| description | .NET clean architecture enforcement — layer rules, dependency direction, DI registration patterns, and project reference validation. |
Reference for architectural decisions. Used by dnp-architect and dnp-planner.
// In Infrastructure project:
public static class InfrastructureServiceExtensions
{
public static IServiceCollection AddInfrastructureServices(
this IServiceCollection services, IConfiguration config)
{
services.AddDbContext<ApplicationDbContext>(options =>
options.UseNpgsql(config.GetConnectionString("DefaultConnection")));
services.AddScoped<IUserRepository, UserRepository>();
return services;
}
}
// In Application project:
public static class ApplicationServiceExtensions
{
public static IServiceCollection AddApplicationServices(this IServiceCollection services)
{
services.AddScoped<IUserService, UserService>();
services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(ApplicationServiceExtensions).Assembly));
return services;
}
}
// In Program.cs (API project):
builder.Services.AddApplicationServices();
builder.Services.AddInfrastructureServices(builder.Configuration);
| Rule | Check |
|---|---|
| Domain independence | Domain .csproj has 0 <ProjectReference> elements |
| Application → Domain only | Application .csproj references only Domain |
| No reverse dependencies | Domain never references Application/Infrastructure/API |
| Interface segregation | Application defines interfaces, Infrastructure implements |
| Composition root | Only API project wires DI container |