[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NSGSRWDZPBGY7NQ560EEST":3,"skill-same:01M6NSGSRWDZPBGY7NQ560EEST":172},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M6NSGSRWDZPBGY7NQ560EEST","clean-architecture-dotnet",null,"Use when domain logic leaks into API\u002FInfrastructure, project references violate layer boundaries, or CQRS handlers\u002Fbuses need implementation.","mattonweb\u002Fai-assistant-foundry","mattonweb","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2309734?v=4","01M6NQYCY846TKYN2ZCRS71WQ7","Matt Johnson","01M6NQYD2NPAQEFVD8TW9W0SVX",1,"MIT","https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"clean","clean architecture dotnet","clean architecture","dotnet","architecture","use","project references","implementation","references","api","infrastructure","domain","cqrs","project","logic","layer","buses","2026-11-10 10:12:30",false,"---\nname: clean-architecture-dotnet\ndescription: Use when domain logic leaks into API\u002FInfrastructure, project references violate layer boundaries, or CQRS handlers\u002Fbuses need implementation.\nmetadata:\n   version: 2\n   authors: [\"Sébastien DEGODEZ\"]\n---\n\n# Clean Architecture in .NET\n\n## Overview\n\nClean Architecture organizes code into independent layers (Domain → Application → Infrastructure → API).\n\n**The Iron Law**: Violating layer boundaries is a failure. If API references Application or Domain references Infrastructure, delete the change and start over.\n\n## When to Use\n\n- Business logic is leaking into Controllers or Repositories\n- Circular dependencies occur between projects\n- Need to isolate core business rules from external frameworks (EF Core, APIs)\n- Autonomy is required: sealed Domain objects, strongly-typed IDs\n\n## DDD vs POCO — Quick Decision\n\n| Use | When |\n|-----|------|\n| `sealed class Foo : AggregateRoot` + factory method | The object has domain invariants, raises events, or owns child entities |\n| Plain `sealed record Foo(...)` (POCO) | Pure data carrier, no invariants, used only inside Application or API (DTOs, ViewModels) |\n| `sealed class Bar : ValueObject` | Immutable, identity-by-value, represents a domain concept (e.g., `PolicyNumber`, `Horsepower`) |\n\n**Rule of thumb:** if you're tempted to add an `if` or `throw` to protect the object's state — it's a Domain object (aggregate or value object), not a POCO.\n\n## Implementation Flow\n\n```dot\ndigraph clean_arch {\n    \"New Feature?\" [shape=diamond];\n    \"Define Logic in Domain\" [shape=box];\n    \"Create Handler in Application\" [shape=box];\n    \"Inject Handler in API\" [shape=box];\n\n    \"New Feature?\" -> \"Define Logic in Domain\" [label=\"Business Rule\"];\n    \"New Feature?\" -> \"Create Handler in Application\" [label=\"Orchestration Only\"];\n    \"Define Logic in Domain\" -> \"Create Handler in Application\";\n    \"Create Handler in Application\" -> \"Inject Handler in API\";\n}\n```\n\n## Core Pattern (CQRS)\n\nCommands (writes) and Queries (reads) separate side-effects:\n\n```csharp\n\u002F\u002F Application\u002FFeatures\u002FOrders\u002FPlaceOrderCommandHandler.cs\npublic sealed class PlaceOrderCommandHandler : ICommandHandler\u003CPlaceOrderCommand, OrderId>\n{\n    private readonly IOrderRepository _repository; \u002F\u002F Interface defined in Application\u002FDomain\n\n    public async Task\u003COrderId> HandleAsync(PlaceOrderCommand cmd, CancellationToken ct)\n    {\n        var order = Order.Create(cmd.OrderId, cmd.CustomerName);\n        await _repository.AddAsync(order, ct);\n        return order.Id;\n    }\n}\n\n\u002F\u002F API\u002FOrdersEndpoints.cs — inject ICommandBus (never ICommandHandler\u003C,> directly)\napp.MapPost(\"\u002Forders\", async (PlaceOrderCommand cmd, ICommandBus bus)\n    => Results.Created($\"\u002Forders\u002F{await bus.PublishAsync\u003CPlaceOrderCommand, OrderId>(cmd)}\"));\n\n\u002F\u002F Queries follow the same rule — inject IQueryBus\napp.MapGet(\"\u002Forders\u002F{id}\", async (Guid id, IQueryBus bus)\n    => Results.Ok(await bus.SendAsync\u003CGetOrderQuery, OrderViewModel>(new GetOrderQuery(new OrderId(id)))));\n\n\u002F\u002F Both buses resolve via Infrastructure DI. API never references Application assembly.\n```\n\n## Layer Responsibilities\n\n| Layer | Purpose | Allowed Dependencies |\n|-------|---------|----------------------|\n| **SharedKernel** *(multi-context only)* | Generic interfaces + base classes only — zero domain logic | None |\n| **Domain** | Pure business logic, aggregates | SharedKernel *(optional)* |\n| **Application** | Use cases, Handler orchestration | Domain, SharedKernel *(optional)* |\n| **Infrastructure** | Database, DI registration, CQRS Bus | Application, Domain |\n| **API** | Endpoints, JSON mapping | **Infrastructure** (Transitive: Application, Domain) |\n\n## Shared Kernel (Multi-Context Solutions)\n\nUse a `SharedKernel` project when **two or more Bounded Contexts** need to share handler interfaces or base classes. It must contain **zero domain logic**.\n\n```\nSharedKernel\u002F\n├── Abstractions\u002F\n│   ├── ICommandHandler.cs   ← generic interface only\n│   ├── IQueryHandler.cs\n│   ├── ValueObject.cs       ← base class, no business logic\n│   └── AggregateRoot.cs     ← base class, exposes DomainEvents collection\n└── Events\u002F\n    └── DomainEvent.cs       ← abstract base for all domain events\n```\n\n**Dependency rule for SharedKernel:** it depends on **nothing**. Domain and Application reference it, not the other way around.\n\n```csharp\n\u002F\u002F SharedKernel\u002FAbstractions\u002FICommandHandler.cs — pure interface, no NuGet beyond System\npublic interface ICommandHandler\u003Cin TCommand, TResult>\n{\n    Task\u003CTResult> HandleAsync(TCommand command, CancellationToken ct = default);\n}\n\n\u002F\u002F Each context's Application layer implements it:\n\u002F\u002F Orders.Application\u002FFeatures\u002FPlaceOrder\u002FPlaceOrderCommandHandler.cs\nusing SharedKernel.Abstractions;\npublic sealed class PlaceOrderCommandHandler\n    : ICommandHandler\u003CPlaceOrderCommand, OrderId> { }\n```\n\n**What NEVER goes in SharedKernel:** concrete value objects like `Money`, `Address` (each context defines its own); aggregate logic; context-specific event types.\n\n## Domain Events\n\n**Rule:** Domain events are **declared in the Domain layer** and **dispatched in the Application layer** (from the handler, after the aggregate operation succeeds).\n\n```csharp\n\u002F\u002F Domain\u002FOrders\u002FEvents\u002FOrderPlacedEvent.cs — sealed, in Domain\npublic sealed class OrderPlacedEvent : DomainEvent  \u002F\u002F DomainEvent base from SharedKernel (or Domain if single-context)\n{\n    public OrderId OrderId { get; }\n    public OrderPlacedEvent(OrderId orderId) => OrderId = orderId;\n}\n\n\u002F\u002F Domain\u002FOrders\u002FOrder.cs — aggregate raises the event\npublic sealed class Order : AggregateRoot\n{\n    public static Order Create(OrderId id, CustomerId customerId)\n    {\n        var order = new Order(id, customerId);\n        order.AddDomainEvent(new OrderPlacedEvent(id)); \u002F\u002F ← raised in Domain\n        return order;\n    }\n}\n\n\u002F\u002F Application\u002FFeatures\u002FPlaceOrder\u002FPlaceOrderCommandHandler.cs — handler dispatches\npublic sealed class PlaceOrderCommandHandler : ICommandHandler\u003CPlaceOrderCommand, OrderId>\n{\n    private readonly IOrderRepository _repository;\n    private readonly IDomainEventDispatcher _dispatcher; \u002F\u002F interface in Application\u002FDomain\n\n    public async Task\u003COrderId> HandleAsync(PlaceOrderCommand cmd, CancellationToken ct)\n    {\n        var order = Order.Create(cmd.OrderId, cmd.CustomerId);\n        await _repository.AddAsync(order, ct);\n        await _dispatcher.DispatchAsync(order.DomainEvents, ct); \u002F\u002F ← dispatched in Application\n        return order.Id;\n    }\n}\n```\n\n**Anti-pattern:** Never dispatch events from inside a Domain aggregate method — Domain has no dependency on dispatch infrastructure.\n\n## The Dependency Chain (Transitive Access)\n\nThe architecture follows a strict outward-in dependency flow:\n**API** → **Infrastructure** → **Application** → **Domain**\n\n- **API** has access to everything below it (Infrastructure, Application, Domain).\n- **Infrastructure** has access to Application and Domain.\n- **Application** has access to Domain.\n- **Domain** remains pure with **zero** project dependencies.\n\n**CRITICAL**: Just because a layer *can* see another via transitive reference doesn't mean it *should* use its concrete types.\n- API should only use **Interfaces** from Application\u002FDomain.\n- Always follow the **Iron Law** and **Red Flags** below.\n\n## Rationalization Table\n\n| Excuse | Reality |\n|--------|---------|\n| \"Injecting ICommandHandler\u003C,> directly is simpler\" | Always use ICommandBus \u002F IQueryBus — consistent indirection, easier to intercept (logging, validation). |\n| \"It's just one small service\" | Small leaks become circular dependency nightmares. |\n| \"Referencing Application in API is faster\" | It bypasses the Bus\u002FHandler pattern and couples contract to implementation. |\n| \"Domain needs this NuGet package\" | If it's not a primitive\u002FSystem lib, it doesn't belong in Domain. |\n\n## Red Flags - STOP and Start Over\n\n- `using MyApp.Application;` inside API layer files\n- `using MyApp.Infrastructure;` inside Domain layer files\n- Injecting `ICommandHandler\u003C,>` or `IQueryHandler\u003C,>` directly in API endpoints — use `ICommandBus` \u002F `IQueryBus`\n- Non-sealed classes in Domain\n- Handlers performing HTTP calls directly (use an Infrastructure service via interface)\n\n## Common Mistakes\n\n| Mistake | Fix |\n|---------|-----|\n| Handler not found by DI | Handler must be listed explicitly in `AddInfrastructure()` via `AddHandler\u003CT>()` |\n| `using MyApp.Application;` in API | Remove it — inject `ICommandBus` \u002F `IQueryBus` via DI |\n| `Guid` used in handler return type | Use strongly typed ID (`OrderId`, `ProductId`) |\n| Read result named `ProductDto` | Name it `ProductViewModel` to distinguish from transfer objects |\n| `typeof(Product).Assembly` in tests | Use `typeof(IApplicationMarker).Assembly` for reliable discovery |\n| Non-sealed Domain classes | All Domain classes must be `sealed` (enforced by NetArchTest) |\n| SharedKernel references Domain | SharedKernel must depend on **nothing** — if it references Domain, invert: Domain references SharedKernel |\n| Handler contains `if`\u002Fbusiness logic | Delegate to Domain aggregate methods — handlers orchestrate only |\n\n---\n\n## References\n\n- [Architecture Layers](references\u002Farchitecture-layers.md) — Dependency rules, marker interfaces, layer tests, and layer validation with NetArchTest\n- [CQRS Patterns](references\u002Fcqrs-patterns.md) — Handler interfaces, examples, DI discovery, and complete CQRS implementation patterns\n- [Convention-Based DI](references\u002Fconvention-based-di.md) — Auto-discovery, Bus interfaces, full DI setup\n- [Layer Responsibilities](references\u002Flayer-responsibilities.md) — Full rules for each layer with DDD context\n- [Project Structure](references\u002Fproject-structure.md) — File\u002Ffolder conventions and layer organization guidance\n- [NetArchTest Rules](references\u002Fnetarchtest-rules.md) — Automated boundary enforcement\n- [DDD Patterns](references\u002Fddd.md) — Aggregates, factory methods, value objects, and domain events (optional)\n- [Shared Kernel](references\u002Fshared-kernel.md) — Shared abstractions for multi-context solutions (optional)\n- [Init Script](scripts\u002Finit-project.sh) — Bootstrap script for new project setup (`.\u002Finit-project.sh MyApp`)\n- [ArchitectureTests Template](templates\u002FIntegrationTests\u002FArchitectureTests.cs) — Drop-in architecture test template\n","# Clean Architecture in .NET\n\n## Overview\n\nClean Architecture organizes code into independent layers (Domain → Application → Infrastructure → API).\n\n**The Iron Law**: Violating layer boundaries is a failure. If API references Application or Domain references Infrastructure, delete the change and start over.\n\n## When to Use\n\n- Business logic is leaking into Controllers or Repositories\n- Circular dependencies occur between projects\n- Need to isolate core business rules from external frameworks (EF Core, APIs)\n- Autonomy is required: sealed Domain objects, strongly-typed IDs\n\n## DDD vs POCO — Quick Decision\n\n| Use | When |\n|-----|------|\n| `sealed class Foo : AggregateRoot` + factory method | The object has domain invariants, raises events, or owns child entities |\n| Plain `sealed record Foo(...)` (POCO) | Pure data carrier, no invariants, used only inside Application or API (DTOs, ViewModels) |\n| `sealed class Bar : ValueObject` | Immutable, identity-by-value, represents a domain concept (e.g., `PolicyNumber`, `Horsepower`) |\n\n**Rule of thumb:** if you're tempted to add an `if` or `throw` to protect the object's state — it's a Domain object (aggregate or value object), not a POCO.\n\n## Implementation Flow\n\n```dot\ndigraph clean_arch {\n    \"New Feature?\" [shape=diamond];\n    \"Define Logic in Domain\" [shape=box];\n    \"Create Handler in Application\" [shape=box];\n    \"Inject Handler in API\" [shape=box];\n\n    \"New Feature?\" -> \"Define Logic in Domain\" [label=\"Business Rule\"];\n    \"New Feature?\" -> \"Create Handler in Application\" [label=\"Orchestration Only\"];\n    \"Define Logic in Domain\" -> \"Create Handler in Application\";\n    \"Create Handler in Application\" -> \"Inject Handler in API\";\n}\n```\n\n## Core Pattern (CQRS)\n\nCommands (writes) and Queries (reads) separate side-effects:\n\n```csharp\n\u002F\u002F Application\u002FFeatures\u002FOrders\u002FPlaceOrderCommandHandler.cs\npublic sealed class PlaceOrderCommandHandler : ICommandHandler\u003CPlaceOrderCommand, OrderId>\n{\n    private readonly IOrderRepository _repository; \u002F\u002F Interface defined in Application\u002FDomain\n\n    public async Task\u003COrderId> HandleAsync(PlaceOrderCommand cmd, CancellationToken ct)\n    {\n        var order = Order.Create(cmd.OrderId, cmd.CustomerName);\n        await _repository.AddAsync(order, ct);\n        return order.Id;\n    }\n}\n\n\u002F\u002F API\u002FOrdersEndpoints.cs — inject ICommandBus (never ICommandHandler\u003C,> directly)\napp.MapPost(\"\u002Forders\", async (PlaceOrderCommand cmd, ICommandBus bus)\n    => Results.Created($\"\u002Forders\u002F{await bus.PublishAsync\u003CPlaceOrderCommand, OrderId>(cmd)}\"));\n\n\u002F\u002F Queries follow the same rule — inject IQueryBus\napp.MapGet(\"\u002Forders\u002F{id}\", async (Guid id, IQueryBus bus)\n    => Results.Ok(await bus.SendAsync\u003CGetOrderQuery, OrderViewModel>(new GetOrderQuery(new OrderId(id)))));\n\n\u002F\u002F Both buses resolve via Infrastructure DI. API never references Application assembly.\n```\n\n## Layer Responsibilities\n\n| Layer | Purpose | Allowed Dependencies |\n|-------|---------|----------------------|\n| **SharedKernel** *(multi-context only)* | Generic interfaces + base classes only — zero domain logic | None |\n| **Domain** | Pure business logic, aggregates | SharedKernel *(optional)* |\n| **Application** | Use cases, Handler orchestration | Domain, SharedKernel *(optional)* |\n| **Infrastructure** | Database, DI registration, CQRS Bus | Application, Domain |\n| **API** | Endpoints, JSON mapping | **Infrastructure** (Transitive: Application, Domain) |\n\n## Shared Kernel (Multi-Context Solutions)\n\nUse a `SharedKernel` project when **two or more Bounded Contexts** need to share handler interfaces or base classes. It must contain **zero domain logic**.\n\n```\nSharedKernel\u002F\n├── Abstractions\u002F\n│   ├── ICommandHandler.cs   ← generic interface only\n│   ├── IQueryHandler.cs\n│   ├── ValueObject.cs       ← base class, no business logic\n│   └── AggregateRoot.cs     ← base class, exposes DomainEvents collection\n└── Events\u002F\n    └── DomainEvent.cs       ← abstract base for all domain events\n```\n\n**Dependency rule for SharedKernel:** it depends on **nothing**. Domain and Application reference it, not the other way around.\n\n```csharp\n\u002F\u002F SharedKernel\u002FAbstractions\u002FICommandHandler.cs — pure interface, no NuGet beyond System\npublic interface ICommandHandler\u003Cin TCommand, TResult>\n{\n    Task\u003CTResult> HandleAsync(TCommand command, CancellationToken ct = default);\n}\n\n\u002F\u002F Each context's Application layer implements it:\n\u002F\u002F Orders.Application\u002FFeatures\u002FPlaceOrder\u002FPlaceOrderCommandHandler.cs\nusing SharedKernel.Abstractions;\npublic sealed class PlaceOrderCommandHandler\n    : ICommandHandler\u003CPlaceOrderCommand, OrderId> { }\n```\n\n**What NEVER goes in SharedKernel:** concrete value objects like `Money`, `Address` (each context defines its own); aggregate logic; context-specific event types.\n\n## Domain Events\n\n**Rule:** Domain events are **declared in the Domain layer** and **dispatched in the Application layer** (from the handler, after the aggregate operation succeeds).\n\n```csharp\n\u002F\u002F Domain\u002FOrders\u002FEvents\u002FOrderPlacedEvent.cs — sealed, in Domain\npublic sealed class OrderPlacedEvent : DomainEvent  \u002F\u002F DomainEvent base from SharedKernel (or Domain if single-context)\n{\n    public OrderId OrderId { get; }\n    public OrderPlacedEvent(OrderId orderId) => OrderId = orderId;\n}\n\n\u002F\u002F Domain\u002FOrders\u002FOrder.cs — aggregate raises the event\npublic sealed class Order : AggregateRoot\n{\n    public static Order Create(OrderId id, CustomerId customerId)\n    {\n        var order = new Order(id, customerId);\n        order.AddDomainEvent(new OrderPlacedEvent(id)); \u002F\u002F ← raised in Domain\n        return order;\n    }\n}\n\n\u002F\u002F Application\u002FFeatures\u002FPlaceOrder\u002FPlaceOrderCommandHandler.cs — handler dispatches\npublic sealed class PlaceOrderCommandHandler : ICommandHandler\u003CPlaceOrderCommand, OrderId>\n{\n    private readonly IOrderRepository _repository;\n    private readonly IDomainEventDispatcher _dispatcher; \u002F\u002F interface in Application\u002FDomain\n\n    public async Task\u003COrderId> HandleAsync(PlaceOrderCommand cmd, CancellationToken ct)\n    {\n        var order = Order.Create(cmd.OrderId, cmd.CustomerId);\n        await _repository.AddAsync(order, ct);\n        await _dispatcher.DispatchAsync(order.DomainEvents, ct); \u002F\u002F ← dispatched in Application\n        return order.Id;\n    }\n}\n```\n\n**Anti-pattern:** Never dispatch events from inside a Domain aggregate method — Domain has no dependency on dispatch infrastructure.\n\n## The Dependency Chain (Transitive Access)\n\nThe architecture follows a strict outward-in dependency flow:\n**API** → **Infrastructure** → **Application** → **Domain**\n\n- **API** has access to everything below it (Infrastructure, Application, Domain).\n- **Infrastructure** has access to Application and Domain.\n- **Application** has access to Domain.\n- **Domain** remains pure with **zero** project dependencies.\n\n**CRITICAL**: Just because a layer *can* see another via transitive reference doesn't mean it *should* use its concrete types.\n- API should only use **Interfaces** from Application\u002FDomain.\n- Always follow the **Iron Law** and **Red Flags** below.\n\n## Rationalization Table\n\n| Excuse | Reality |\n|--------|---------|\n| \"Injecting ICommandHandler\u003C,> directly is simpler\" | Always use ICommandBus \u002F IQueryBus — consistent indirection, easier to intercept (logging, validation). |\n| \"It's just one small service\" | Small leaks become circular dependency nightmares. |\n| \"Referencing Application in API is faster\" | It bypasses the Bus\u002FHandler pattern and couples contract to implementation. |\n| \"Domain needs this NuGet package\" | If it's not a primitive\u002FSystem lib, it doesn't belong in Domain. |\n\n## Red Flags - STOP and Start Over\n\n- `using MyApp.Application;` inside API layer files\n- `using MyApp.Infrastructure;` inside Domain layer files\n- Injecting `ICommandHandler\u003C,>` or `IQueryHandler\u003C,>` directly in API endpoints — use `ICommandBus` \u002F `IQueryBus`\n- Non-sealed classes in Domain\n- Handlers performing HTTP calls directly (use an Infrastructure service via interface)\n\n## Common Mistakes\n\n| Mistake | Fix |\n|---------|-----|\n| Handler not found by DI | Handler must be listed explicitly in `AddInfrastructure()` via `AddHandler\u003CT>()` |\n| `using MyApp.Application;` in API | Remove it — inject `ICommandBus` \u002F `IQueryBus` via DI |\n| `Guid` used in handler return type | Use strongly typed ID (`OrderId`, `ProductId`) |\n| Read result named `ProductDto` | Name it `ProductViewModel` to distinguish from transfer objects |\n| `typeof(Product).Assembly` in tests | Use `typeof(IApplicationMarker).Assembly` for reliable discovery |\n| Non-sealed Domain classes | All Domain classes must be `sealed` (enforced by NetArchTest) |\n| SharedKernel references Domain | SharedKernel must depend on **nothing** — if it references Domain, invert: Domain references SharedKernel |\n| Handler contains `if`\u002Fbusiness logic | Delegate to Domain aggregate methods — handlers orchestrate only |\n\n---\n\n## References\n\n- [Architecture Layers](references\u002Farchitecture-layers.md) — Dependency rules, marker interfaces, layer tests, and layer validation with NetArchTest\n- [CQRS Patterns](references\u002Fcqrs-patterns.md) — Handler interfaces, examples, DI discovery, and complete CQRS implementation patterns\n- [Convention-Based DI](references\u002Fconvention-based-di.md) — Auto-discovery, Bus interfaces, full DI setup\n- [Layer Responsibilities](references\u002Flayer-responsibilities.md) — Full rules for each layer with DDD context\n- [Project Structure](references\u002Fproject-structure.md) — File\u002Ffolder conventions and layer organization guidance\n- [NetArchTest Rules](references\u002Fnetarchtest-rules.md) — Automated boundary enforcement\n- [DDD Patterns](references\u002Fddd.md) — Aggregates, factory methods, value objects, and domain events (optional)\n- [Shared Kernel](references\u002Fshared-kernel.md) — Shared abstractions for multi-context solutions (optional)\n- [Init Script](scripts\u002Finit-project.sh) — Bootstrap script for new project setup (`.\u002Finit-project.sh MyApp`)\n- [ArchitectureTests Template](templates\u002FIntegrationTests\u002FArchitectureTests.cs) — Drop-in architecture test template\n",{"name":5,"metadata":41,"description":7},{"authors":42,"version":44},[43],"Sébastien DEGODEZ",2,"main","d8518247cb8ab8b2dac57a6be33543ffd23b97c5","code-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet",0,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry","https:\u002F\u002Fgithub.com\u002Fmattonweb","2026-05-29 08:42:23",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add mattonweb\u002Fai-assistant-foundry --skill clean-architecture-dotnet",{"tool":58,"command":59},"bunx","bunx skills add mattonweb\u002Fai-assistant-foundry --skill clean-architecture-dotnet",{"tool":61,"command":62},"pnpm","pnpm dlx skills add mattonweb\u002Fai-assistant-foundry --skill clean-architecture-dotnet","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002FSKILL.md",true,[66,72,76,80,84,88,92,96,100,106,110,116,120,124,128,132,136,140,144,148,152,156,160,164,168],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Farchitecture-layers.md","REFERENCE","参考文档",1642,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Freferences\u002Farchitecture-layers.md",{"path":73,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fconvention-based-di.md",10863,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Freferences\u002Fconvention-based-di.md",{"path":77,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fcqrs-patterns.md",3180,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Freferences\u002Fcqrs-patterns.md",{"path":81,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fddd.md",10512,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Freferences\u002Fddd.md",{"path":85,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Flayer-responsibilities.md",14571,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Freferences\u002Flayer-responsibilities.md",{"path":89,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002Fnetarchtest-rules.md",10673,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Freferences\u002Fnetarchtest-rules.md",{"path":93,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":94,"sourceHtmlUrl":95},"references\u002Fproject-structure.md",1739,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Freferences\u002Fproject-structure.md",{"path":97,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Fshared-kernel.md",5875,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Freferences\u002Fshared-kernel.md",{"path":101,"resourceType":102,"resourceTypeDesc":103,"sizeBytes":104,"sourceHtmlUrl":105},"scripts\u002Finit-project.ps1","SCRIPT","脚本",15628,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Fscripts\u002Finit-project.ps1",{"path":107,"resourceType":102,"resourceTypeDesc":103,"sizeBytes":108,"sourceHtmlUrl":109},"scripts\u002Finit-project.sh",7371,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Fscripts\u002Finit-project.sh",{"path":111,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":114,"sourceHtmlUrl":115},"templates\u002FApi\u002FIApiMarker.cs","OTHER","其他",182,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FApi\u002FIApiMarker.cs",{"path":117,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":118,"sourceHtmlUrl":119},"templates\u002FApplication\u002FIApplicationMarker.cs",214,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FApplication\u002FIApplicationMarker.cs",{"path":121,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":122,"sourceHtmlUrl":123},"templates\u002FApplication\u002FShared\u002FICommandBus.cs",378,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FApplication\u002FShared\u002FICommandBus.cs",{"path":125,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":126,"sourceHtmlUrl":127},"templates\u002FApplication\u002FShared\u002FICommandHandler.cs",517,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FApplication\u002FShared\u002FICommandHandler.cs",{"path":129,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":130,"sourceHtmlUrl":131},"templates\u002FApplication\u002FShared\u002FIQueryBus.cs",268,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FApplication\u002FShared\u002FIQueryBus.cs",{"path":133,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":134,"sourceHtmlUrl":135},"templates\u002FApplication\u002FShared\u002FIQueryHandler.cs",267,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FApplication\u002FShared\u002FIQueryHandler.cs",{"path":137,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":138,"sourceHtmlUrl":139},"templates\u002FDomain\u002FIDomainMarker.cs",194,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FDomain\u002FIDomainMarker.cs",{"path":141,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":142,"sourceHtmlUrl":143},"templates\u002FInfrastructure\u002FCQRS\u002FCommandBus.cs",1143,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FInfrastructure\u002FCQRS\u002FCommandBus.cs",{"path":145,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":146,"sourceHtmlUrl":147},"templates\u002FInfrastructure\u002FCQRS\u002FQueryBus.cs",792,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FInfrastructure\u002FCQRS\u002FQueryBus.cs",{"path":149,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":150,"sourceHtmlUrl":151},"templates\u002FInfrastructure\u002FDependencyInjection.cs",1863,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FInfrastructure\u002FDependencyInjection.cs",{"path":153,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":154,"sourceHtmlUrl":155},"templates\u002FInfrastructure\u002FIInfrastructureMarker.cs",226,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FInfrastructure\u002FIInfrastructureMarker.cs",{"path":157,"resourceType":112,"resourceTypeDesc":113,"sizeBytes":158,"sourceHtmlUrl":159},"templates\u002FIntegrationTests\u002FArchitectureTests.cs",4551,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftemplates\u002FIntegrationTests\u002FArchitectureTests.cs",{"path":161,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":162,"sourceHtmlUrl":163},"tests\u002Fbaseline-prompts.txt",2244,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftests\u002Fbaseline-prompts.txt",{"path":165,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":166,"sourceHtmlUrl":167},"tests\u002FREADME.md",3925,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftests\u002FREADME.md",{"path":169,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":170,"sourceHtmlUrl":171},"tests\u002Fvalidation.md",18432,"https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fcode-csharp-clean-arch\u002FSebastienDegodez\u002Fclean-architecture-dotnet\u002Ftests\u002Fvalidation.md",[173,209,222,242,263,288],{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":189,"publishedAt":36},"01M6P02DENRHN6KVGYC55FKASJ","writing-clearly-and-concisely","Use when writing prose humans will read—documentation, commit messages, error messages, explanations, reports, or UI text. Applies Strunk's timeless rules for clearer, stronger, more professional writing.","https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fwrite-technical\u002Fsoftaworks\u002Fwriting-clearly-and-concisely\u002FSKILL.md",[179,184],{"categoryNo":180,"categoryName":181,"taxonomyType":182,"taxonomyTypeDesc":183},"01JBSEEDCAT000000000000018","写作与文案","SCENARIO","使用场景",{"categoryNo":185,"categoryName":186,"taxonomyType":187,"taxonomyTypeDesc":188},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[190,191,192,193,194,195,196,197,198,199,200,24,201,202,203,204,205,206,207,208],"writing clearly and concisely","writing","concisely","text","for","more","timeless","error","professional","prose","reports","read","Rules","commit messages","messages","error messages","ui","documentation","commit",{"skillNo":210,"name":211,"nameZh":6,"description":212,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":213,"categories":214,"keywords":215,"publishedAt":36},"01M6P0286HZ8RWMFCCPC8HF7SC","crafting-effective-readmes","Use when writing or improving README files. Not all READMEs are the same — provides templates and guidance matched to your audience and project type.","https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fwrite-technical\u002Fsoftaworks\u002Fcrafting-effective-readmes\u002FSKILL.md",[],[216,217,191,218,219,24,32,220,221],"crafting effective readmes","README","templates","type","guidance","files",{"skillNo":223,"name":224,"nameZh":6,"description":225,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":226,"categories":227,"keywords":231,"publishedAt":36},"01M6P025A41BBTPWVTZ3GFQVG6","wiki-architect","You are a documentation architect that produces structured wiki catalogues and onboarding guides from codebases.","https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fwrite-technical\u002Fsickn33\u002Fwiki-architect\u002FSKILL.md",[228],{"categoryNo":229,"categoryName":230,"taxonomyType":187,"taxonomyTypeDesc":188},"01JBSEEDCAT000000000000038","人力资源",[232,233,234,235,236,237,238,239,240,241,207],"wiki","architect","wiki architect","unknown","you","documentation architect","guides","structured","community","onboarding",{"skillNo":243,"name":244,"nameZh":6,"description":245,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":246,"categories":247,"keywords":248,"publishedAt":36},"01M6P01NSKPXP77NWB4K0PXRK5","readme","You are an expert technical writer creating comprehensive project documentation. Your goal is to write a README.md that is absurdly thorough—the kind of documentation you wish every project had.","https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fwrite-technical\u002Fsickn33\u002Freadme\u002FSKILL.md",[],[217,249,250,251,236,252,253,32,254,255,45,256,257,258,259,260,207,261,262],"project documentation","tree","kind","expert","github","wish","writer","goal","write","technical writer","technical","https","write a readme","safe",{"skillNo":264,"name":265,"nameZh":6,"description":266,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":267,"categories":268,"keywords":269,"publishedAt":36},"01M6P01GP0NEN8KT3A3SA6ZFVE","ubiquitous-language","Extract a DDD-style ubiquitous language glossary from the current conversation, flagging ambiguities and proposing canonical terms. Saves to UBIQUITOUS_LANGUAGE.md. Use when user wants to define domain terms, build a glossary, harden terminology, create a ubiquitous language, or mentions \"domain model\" or \"DDD\".","https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fwrite-technical\u002Fmattpocock\u002Fubiquitous-language\u002FSKILL.md",[],[270,271,24,272,273,274,275,276,277,278,279,280,281,282,283,284,285,30,286,287],"ubiquitous language","language","extract","user","glossary","model","terms","ddd","create","build","true","canonical","style","define","harden","domain model","terminology","conversation",{"skillNo":289,"name":290,"nameZh":6,"description":291,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":292,"categories":293,"keywords":296,"publishedAt":36},"01M6P01BJBP9XP4TDRT7QD1ZVA","technical-writing-style","Enforce clear, direct writing in software development documents including OKRs, PRDs, tech specs, architecture decision records (ADRs), git commit messages, PR descriptions, READMEs, changelogs, runbooks, incident postmortems, API docs, and onboarding guides. Trigger whenever a user asks to write, edit, revise, or review any of these document types. Also trigger when the user says writing \"sounds like AI\", \"feels robotic\", \"needs polish\", or asks to \"make it sound more natural\" in the context of technical or professional prose. Do not trigger for fiction, poetry, creative writing, academic papers, or legal documents unless the user explicitly asks for a more natural tone.","https:\u002F\u002Fgithub.com\u002Fmattonweb\u002Fai-assistant-foundry\u002Fblob\u002Fmain\u002Fwrite-technical\u002Fmattnebr\u002Ftechnical-writing-style\u002FSKILL.md",[294,295],{"categoryNo":180,"categoryName":181,"taxonomyType":182,"taxonomyTypeDesc":183},{"categoryNo":185,"categoryName":186,"taxonomyType":187,"taxonomyTypeDesc":188},[297,298,282,259,191,299,198,300,301,302,303,304,305,306,28,204,307,23,208,308],"writing style","technical writing style","technical writing","papers","types","runbooks","software development","incident","Poetry","decision","documents","review"]