{"owner":"ardalis","repo":"CleanArchitecture","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":[".github/copilot-instructions.md"],"skills":{".github/copilot-instructions.md":"# GitHub Copilot Instructions for Clean Architecture Template\n\n## Project Overview\nThis is a **Clean Architecture template** for .NET 9 that demonstrates Domain-Driven Design (DDD) patterns. It's a starter template, not a reference application - delete sample code once you understand the patterns.\n\n## Architecture & Project Structure\n\n### C# Conventions\n- Use standard Microsoft naming conventions\n- Use `PascalCase` for types and methods, `camelCase` for parameters and private fields\n- Use `I` prefix for interfaces (e.g., `IRepository`)\n- Use `Async` suffix for async methods (e.g., `GetByIdAsync`)\n- Prefix private fields with `_` (e.g., `_repository`)\n- Always use {} for blocks except single-line exits (e.g. `return`, `throw`)\n- Always keep single line blocks on one line (e.g., `if (x) return y;`)\n- Prefer primary constructors for required dependencies\n- Never use primary constructor parameters directly - always assign to private fields for clarity and testability\n\n### Core Dependencies Flow\n- **Core** ← UseCases ← Infrastructure \n- **Core** ← UseCases ← Web\n- Never allow Core to depend on outer layers\n\n### Key Projects\n- **Core**: Domain entities, aggregates, value objects, specifications, interfaces\n- **UseCases**: Commands/queries (CQRS), Mediator handlers, application logic  \n- **Infrastructure**: EF Core, external services, email, file access\n- **Web**: FastEndpoints API, REPR pattern, validation\n\n## Development Patterns\n\n### API Endpoints (FastEndpoints + REPR)\n- One endpoint per file: `Create.cs`, `Update.cs`, `Delete.cs`, `GetById.cs`\n- Separate request/response/validator files: `Create.CreateRequest.cs`, `Create.CreateValidator.cs`\n- Use `Endpoint<TRequest, TResponse>` base class\n- Example: `src/Clean.Architecture.Web/Contributors/Create.cs`\n\n### Domain Model (Core)\n- Entities use encapsulation - minimize public setters\n- Group related entities into Aggregates\n- Use Value Objects (e.g., `ContributorName.From()`)\n- Domain Events for cross-aggregate communication\n- Repository interfaces defined in Core, implemented in Infrastructure\n\n### Use Cases (CQRS)\n- Commands for mutations, Queries for reads\n- Queries can bypass repository pattern for performance\n- Use Mediator (source generator) for command/query handling\n- Chain of responsibility for cross-cutting concerns (logging, validation)\n\n### Validation Strategy\n- **API Level**: FluentValidation on request DTOs (FastEndpoints integration)\n- **Use Case Level**: Validate commands/queries (defensive coding)\n- **Domain Level**: Business invariants throw exceptions, assume pre-validated input\n\n## Essential Commands\n\n### Build & Test\n```bash\ndotnet build Clean.Architecture.slnx\ndotnet test Clean.Architecture.slnx\n```\n\n### Entity Framework Migrations\n```bash\n# From Web project directory\ndotnet ef migrations add MigrationName -c AppDbContext -p ../Clean.Architecture.Infrastructure/Clean.Architecture.Infrastructure.csproj -s Clean.Architecture.Web.csproj -o Data/Migrations\n\ndotnet ef database update -c AppDbContext -p ../Clean.Architecture.Infrastructure/Clean.Architecture.Infrastructure.csproj -s Clean.Architecture.Web.csproj\n```\n\n### Template Installation & Usage\n```bash\ndotnet new install Ardalis.CleanArchitecture.Template\ndotnet new clean-arch -o Your.ProjectName\n```\n\n## Key Dependencies & Patterns\n\n### Primary Libraries\n- **FastEndpoints**: API endpoints (replaced Controllers/Minimal APIs)\n- **Mediator**: Command/query handling in UseCases\n- **EF Core**: Data access (SQLite default, easily changed to SQL Server)\n- **Ardalis.Specification**: Repository query specifications\n- **Ardalis.Result**: Error handling pattern\n- **Serilog**: Structured logging\n\n### Central Package Management\n- All package versions in `Directory.Packages.props`\n- Use `<PackageReference Include=\"...\" />` without Version attribute\n\n### Test Organization\n- **UnitTests**: Core business logic, use cases\n- **IntegrationTests**: Database, infrastructure components  \n- **FunctionalTests**: API endpoints (subcutaneous testing)\n- Use `Microsoft.AspNetCore.Mvc.Testing` for API tests\n\n## File Organization Conventions\n\n### Web Project Structure\n```\nContributors/\n  Create.cs                    # Endpoint\n  Create.CreateRequest.cs      # Request DTO\n  Create.CreateResponse.cs     # Response DTO  \n  Create.CreateValidator.cs    # FluentValidation\n  Update.cs, Delete.cs, etc.\n```\n\n### Sample vs Template\n- `/sample` folder: Complete working example (NimblePros.SampleToDo)\n- `/src` folder: Clean template ready for your project\n- Study sample for patterns, use src for new projects\n\n## Common Gotchas\n\n- Don't include hyphens in project names (template limitation)\n- Replace `Ardalis.SharedKernel` with your own shared kernel\n- Database path in `appsettings.json` for SQLite\n- Use absolute paths in EF migration commands\n- FastEndpoints uses different validation approach than Controller-based APIs\n\n## VS Code Tasks\nUse the predefined tasks: `build`, `publish`, `watch` instead of manual `dotnet` commands when possible.\n"},"files":{".github/copilot-instructions.md":"# GitHub Copilot Instructions for Clean Architecture Template\n\n## Project Overview\nThis is a **Clean Architecture template** for .NET 9 that demonstrates Domain-Driven Design (DDD) patterns. It's a starter template, not a reference application - delete sample code once you understand the patterns.\n\n## Architecture & Project Structure\n\n### C# Conventions\n- Use standard Microsoft naming conventions\n- Use `PascalCase` for types and methods, `camelCase` for parameters and private fields\n- Use `I` prefix for interfaces (e.g., `IRepository`)\n- Use `Async` suffix for async methods (e.g., `GetByIdAsync`)\n- Prefix private fields with `_` (e.g., `_repository`)\n- Always use {} for blocks except single-line exits (e.g. `return`, `throw`)\n- Always keep single line blocks on one line (e.g., `if (x) return y;`)\n- Prefer primary constructors for required dependencies\n- Never use primary constructor parameters directly - always assign to private fields for clarity and testability\n\n### Core Dependencies Flow\n- **Core** ← UseCases ← Infrastructure \n- **Core** ← UseCases ← Web\n- Never allow Core to depend on outer layers\n\n### Key Projects\n- **Core**: Domain entities, aggregates, value objects, specifications, interfaces\n- **UseCases**: Commands/queries (CQRS), Mediator handlers, application logic  \n- **Infrastructure**: EF Core, external services, email, file access\n- **Web**: FastEndpoints API, REPR pattern, validation\n\n## Development Patterns\n\n### API Endpoints (FastEndpoints + REPR)\n- One endpoint per file: `Create.cs`, `Update.cs`, `Delete.cs`, `GetById.cs`\n- Separate request/response/validator files: `Create.CreateRequest.cs`, `Create.CreateValidator.cs`\n- Use `Endpoint<TRequest, TResponse>` base class\n- Example: `src/Clean.Architecture.Web/Contributors/Create.cs`\n\n### Domain Model (Core)\n- Entities use encapsulation - minimize public setters\n- Group related entities into Aggregates\n- Use Value Objects (e.g., `ContributorName.From()`)\n- Domain Events for cross-aggregate communication\n- Repository interfaces defined in Core, implemented in Infrastructure\n\n### Use Cases (CQRS)\n- Commands for mutations, Queries for reads\n- Queries can bypass repository pattern for performance\n- Use Mediator (source generator) for command/query handling\n- Chain of responsibility for cross-cutting concerns (logging, validation)\n\n### Validation Strategy\n- **API Level**: FluentValidation on request DTOs (FastEndpoints integration)\n- **Use Case Level**: Validate commands/queries (defensive coding)\n- **Domain Level**: Business invariants throw exceptions, assume pre-validated input\n\n## Essential Commands\n\n### Build & Test\n```bash\ndotnet build Clean.Architecture.slnx\ndotnet test Clean.Architecture.slnx\n```\n\n### Entity Framework Migrations\n```bash\n# From Web project directory\ndotnet ef migrations add MigrationName -c AppDbContext -p ../Clean.Architecture.Infrastructure/Clean.Architecture.Infrastructure.csproj -s Clean.Architecture.Web.csproj -o Data/Migrations\n\ndotnet ef database update -c AppDbContext -p ../Clean.Architecture.Infrastructure/Clean.Architecture.Infrastructure.csproj -s Clean.Architecture.Web.csproj\n```\n\n### Template Installation & Usage\n```bash\ndotnet new install Ardalis.CleanArchitecture.Template\ndotnet new clean-arch -o Your.ProjectName\n```\n\n## Key Dependencies & Patterns\n\n### Primary Libraries\n- **FastEndpoints**: API endpoints (replaced Controllers/Minimal APIs)\n- **Mediator**: Command/query handling in UseCases\n- **EF Core**: Data access (SQLite default, easily changed to SQL Server)\n- **Ardalis.Specification**: Repository query specifications\n- **Ardalis.Result**: Error handling pattern\n- **Serilog**: Structured logging\n\n### Central Package Management\n- All package versions in `Directory.Packages.props`\n- Use `<PackageReference Include=\"...\" />` without Version attribute\n\n### Test Organization\n- **UnitTests**: Core business logic, use cases\n- **IntegrationTests**: Database, infrastructure components  \n- **FunctionalTests**: API endpoints (subcutaneous testing)\n- Use `Microsoft.AspNetCore.Mvc.Testing` for API tests\n\n## File Organization Conventions\n\n### Web Project Structure\n```\nContributors/\n  Create.cs                    # Endpoint\n  Create.CreateRequest.cs      # Request DTO\n  Create.CreateResponse.cs     # Response DTO  \n  Create.CreateValidator.cs    # FluentValidation\n  Update.cs, Delete.cs, etc.\n```\n\n### Sample vs Template\n- `/sample` folder: Complete working example (NimblePros.SampleToDo)\n- `/src` folder: Clean template ready for your project\n- Study sample for patterns, use src for new projects\n\n## Common Gotchas\n\n- Don't include hyphens in project names (template limitation)\n- Replace `Ardalis.SharedKernel` with your own shared kernel\n- Database path in `appsettings.json` for SQLite\n- Use absolute paths in EF migration commands\n- FastEndpoints uses different validation approach than Controller-based APIs\n\n## VS Code Tasks\nUse the predefined tasks: `build`, `publish`, `watch` instead of manual `dotnet` commands when possible.\n"},"items":[{"name":"copilot-instructions.md","path":".github/copilot-instructions.md","title":"copilot-instructions.md","content":"# GitHub Copilot Instructions for Clean Architecture Template\n\n## Project Overview\nThis is a **Clean Architecture template** for .NET 9 that demonstrates Domain-Driven Design (DDD) patterns. It's a starter template, not a reference application - delete sample code once you understand the patterns.\n\n## Architecture & Project Structure\n\n### C# Conventions\n- Use standard Microsoft naming conventions\n- Use `PascalCase` for types and methods, `camelCase` for parameters and private fields\n- Use `I` prefix for interfaces (e.g., `IRepository`)\n- Use `Async` suffix for async methods (e.g., `GetByIdAsync`)\n- Prefix private fields with `_` (e.g., `_repository`)\n- Always use {} for blocks except single-line exits (e.g. `return`, `throw`)\n- Always keep single line blocks on one line (e.g., `if (x) return y;`)\n- Prefer primary constructors for required dependencies\n- Never use primary constructor parameters directly - always assign to private fields for clarity and testability\n\n### Core Dependencies Flow\n- **Core** ← UseCases ← Infrastructure \n- **Core** ← UseCases ← Web\n- Never allow Core to depend on outer layers\n\n### Key Projects\n- **Core**: Domain entities, aggregates, value objects, specifications, interfaces\n- **UseCases**: Commands/queries (CQRS), Mediator handlers, application logic  \n- **Infrastructure**: EF Core, external services, email, file access\n- **Web**: FastEndpoints API, REPR pattern, validation\n\n## Development Patterns\n\n### API Endpoints (FastEndpoints + REPR)\n- One endpoint per file: `Create.cs`, `Update.cs`, `Delete.cs`, `GetById.cs`\n- Separate request/response/validator files: `Create.CreateRequest.cs`, `Create.CreateValidator.cs`\n- Use `Endpoint<TRequest, TResponse>` base class\n- Example: `src/Clean.Architecture.Web/Contributors/Create.cs`\n\n### Domain Model (Core)\n- Entities use encapsulation - minimize public setters\n- Group related entities into Aggregates\n- Use Value Objects (e.g., `ContributorName.From()`)\n- Domain Events for cross-aggregate communication\n- Repository interfaces defined in Core, implemented in Infrastructure\n\n### Use Cases (CQRS)\n- Commands for mutations, Queries for reads\n- Queries can bypass repository pattern for performance\n- Use Mediator (source generator) for command/query handling\n- Chain of responsibility for cross-cutting concerns (logging, validation)\n\n### Validation Strategy\n- **API Level**: FluentValidation on request DTOs (FastEndpoints integration)\n- **Use Case Level**: Validate commands/queries (defensive coding)\n- **Domain Level**: Business invariants throw exceptions, assume pre-validated input\n\n## Essential Commands\n\n### Build & Test\n```bash\ndotnet build Clean.Architecture.slnx\ndotnet test Clean.Architecture.slnx\n```\n\n### Entity Framework Migrations\n```bash\n# From Web project directory\ndotnet ef migrations add MigrationName -c AppDbContext -p ../Clean.Architecture.Infrastructure/Clean.Architecture.Infrastructure.csproj -s Clean.Architecture.Web.csproj -o Data/Migrations\n\ndotnet ef database update -c AppDbContext -p ../Clean.Architecture.Infrastructure/Clean.Architecture.Infrastructure.csproj -s Clean.Architecture.Web.csproj\n```\n\n### Template Installation & Usage\n```bash\ndotnet new install Ardalis.CleanArchitecture.Template\ndotnet new clean-arch -o Your.ProjectName\n```\n\n## Key Dependencies & Patterns\n\n### Primary Libraries\n- **FastEndpoints**: API endpoints (replaced Controllers/Minimal APIs)\n- **Mediator**: Command/query handling in UseCases\n- **EF Core**: Data access (SQLite default, easily changed to SQL Server)\n- **Ardalis.Specification**: Repository query specifications\n- **Ardalis.Result**: Error handling pattern\n- **Serilog**: Structured logging\n\n### Central Package Management\n- All package versions in `Directory.Packages.props`\n- Use `<PackageReference Include=\"...\" />` without Version attribute\n\n### Test Organization\n- **UnitTests**: Core business logic, use cases\n- **IntegrationTests**: Database, infrastructure components  \n- **FunctionalTests**: API endpoints (subcutaneous testing)\n- Use `Microsoft.AspNetCore.Mvc.Testing` for API tests\n\n## File Organization Conventions\n\n### Web Project Structure\n```\nContributors/\n  Create.cs                    # Endpoint\n  Create.CreateRequest.cs      # Request DTO\n  Create.CreateResponse.cs     # Response DTO  \n  Create.CreateValidator.cs    # FluentValidation\n  Update.cs, Delete.cs, etc.\n```\n\n### Sample vs Template\n- `/sample` folder: Complete working example (NimblePros.SampleToDo)\n- `/src` folder: Clean template ready for your project\n- Study sample for patterns, use src for new projects\n\n## Common Gotchas\n\n- Don't include hyphens in project names (template limitation)\n- Replace `Ardalis.SharedKernel` with your own shared kernel\n- Database path in `appsettings.json` for SQLite\n- Use absolute paths in EF migration commands\n- FastEndpoints uses different validation approach than Controller-based APIs\n\n## VS Code Tasks\nUse the predefined tasks: `build`, `publish`, `watch` instead of manual `dotnet` commands when possible.\n","category":".github","tokens":1252}]}