Skip to content

Commit 5a83b13

Browse files
committed
Initial
1 parent 5a8e633 commit 5a83b13

110 files changed

Lines changed: 3403 additions & 32 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.config/dotnet-tools.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-ef": {
6+
"version": "10.0.7",
7+
"commands": [
8+
"dotnet-ef"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.editorconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = crlf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 2
9+
trim_trailing_whitespace = true
10+
11+
[*.cs]
12+
indent_size = 4
13+
dotnet_sort_system_directives_first = true
14+
dotnet_style_qualification_for_field = false:warning
15+
dotnet_style_qualification_for_property = false:warning
16+
dotnet_style_qualification_for_method = false:warning
17+
dotnet_style_qualification_for_event = false:warning
18+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
19+
csharp_style_namespace_declarations = file_scoped:warning
20+
csharp_style_var_when_type_is_apparent = true:suggestion
21+
csharp_style_var_elsewhere = false:suggestion
22+
23+
[**/Migrations/*.cs]
24+
dotnet_diagnostic.IDE0161.severity = none
25+
26+
[*.{yml,yaml,json,md,bicep,bicepparam}]
27+
indent_size = 2
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# API Builder Agent
2+
3+
Use this agent for adding real API feature slices.
4+
5+
Responsibilities:
6+
7+
- Plan controller, operation, domain, infrastructure, and tests.
8+
- Preserve Clean Architecture boundaries.
9+
- Keep controllers thin.
10+
- Use FluentValidation and `Result<T>`.
11+
- Add tests with the implementation.
12+
13+
Never add fake sample business domains.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# IaC Reviewer Agent
2+
3+
Use this agent for Bicep and deployment workflow review.
4+
5+
Responsibilities:
6+
7+
- Check parameterization, naming, tags, managed identity, Key Vault usage, private endpoints, diagnostic settings, and outputs.
8+
- Verify no secrets are checked in.
9+
- Confirm `az bicep build --file infra/main.bicep` can run.
10+
- Update deployment/runbook docs for operational changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Test Specialist Agent
2+
3+
Use this agent for test design and test fixes.
4+
5+
Responsibilities:
6+
7+
- Use xUnit v3, FluentAssertions 7.2.x, NSubstitute, Testcontainers.MsSql, Respawn, and `Microsoft.AspNetCore.Mvc.Testing`.
8+
- Cover validators, operation handlers, result/error mapping, domain invariants, controller wiring, auth behavior, health, readiness, persistence, and OpenAPI.
9+
- Use `TestContext.Current.CancellationToken` where supported.

.github/copilot-instructions.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copilot Instructions
2+
3+
You are working in `Devosmos.ApiStarter`, a domain-neutral ASP.NET Core 10 API starter.
4+
5+
## Core Rules
6+
7+
- Preserve Clean Architecture dependencies.
8+
- Do not add fake business domains.
9+
- Keep controllers thin and authorized by default.
10+
- Add use cases as operations in `Application`.
11+
- Put domain invariants in `Domain`.
12+
- Put EF Core and Azure implementations in `Infrastructure`.
13+
- Return expected failures with `Result<T>` and map them to `ProblemDetails`.
14+
- Use FluentValidation for request validation.
15+
- Use xUnit v3, FluentAssertions 7.2.x, NSubstitute, Testcontainers.MsSql, and Respawn.
16+
- Do not apply migrations on startup.
17+
- Generate idempotent SQL migration scripts for review.
18+
19+
## File Placement
20+
21+
- Controller: `src/Devosmos.ApiStarter.Api/Controllers`
22+
- Operation request/response/handler/validator: `src/Devosmos.ApiStarter.Application/<Feature>`
23+
- Domain model: `src/Devosmos.ApiStarter.Domain/<Feature>`
24+
- EF configuration: `src/Devosmos.ApiStarter.Infrastructure/Persistence/Configurations`
25+
- Migrations: `src/Devosmos.ApiStarter.Infrastructure/Persistence/Migrations`
26+
- Unit tests: `tests/Devosmos.ApiStarter.UnitTests`
27+
- Integration tests: `tests/Devosmos.ApiStarter.IntegrationTests`
28+
29+
## Style
30+
31+
- Prefer records for immutable DTOs.
32+
- Use cancellation tokens.
33+
- Avoid reflection unless the existing code already uses it.
34+
- Keep comments rare and useful.
35+
- Add tests with the change.

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: nuget
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
groups:
9+
dotnet:
10+
patterns:
11+
- "*"
12+
- package-ecosystem: github-actions
13+
directory: /
14+
schedule:
15+
interval: weekly
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "safety-and-context",
3+
"description": "Repository guardrails for AI-assisted changes.",
4+
"checks": [
5+
{
6+
"id": "clean-architecture",
7+
"description": "Do not add dependencies from Domain to other layers, or from Application to Infrastructure or Api."
8+
},
9+
{
10+
"id": "domain-neutrality",
11+
"description": "Do not add sample products, orders, todos, invoices, customers, or fake aggregates."
12+
},
13+
{
14+
"id": "migration-safety",
15+
"description": "Do not apply EF Core migrations on application startup. Generate reviewed idempotent SQL scripts."
16+
},
17+
{
18+
"id": "secret-safety",
19+
"description": "Do not commit connection strings, passwords, client secrets, certificates, or tokens."
20+
},
21+
{
22+
"id": "test-stack",
23+
"description": "Use xUnit v3, FluentAssertions 7.2.x, NSubstitute, Testcontainers.MsSql, Respawn, and coverlet."
24+
}
25+
]
26+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
applyTo: "src/Devosmos.ApiStarter.Api/**/*.cs"
3+
---
4+
5+
# API Layer Instructions
6+
7+
- Controllers must be thin and call `IOperationExecutor`.
8+
- Use `[ApiController]`, `[ApiVersion]`, and `api/v{version:apiVersion}/[controller]`.
9+
- Controllers are authorized by fallback policy; add `[AllowAnonymous]` only for deliberate public endpoints.
10+
- Return `IActionResult` through `Result<T>.ToActionResult(this)` for operation outcomes.
11+
- Add explicit `ProducesResponseType` attributes for success, validation, expected errors, 401, and 403.
12+
- Keep middleware registration in `Program.cs`.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
applyTo: "src/Devosmos.ApiStarter.Application/**/*.cs"
3+
---
4+
5+
# Application Layer Instructions
6+
7+
- Use `IOperationHandler<TRequest,TResponse>` for use cases.
8+
- Use FluentValidation validators next to request types.
9+
- Return `Result<T>` instead of throwing for expected business failures.
10+
- Depend only on `Domain` and abstractions.
11+
- Define interfaces for infrastructure capabilities here.
12+
- Keep DTOs independent from EF Core and ASP.NET Core.

0 commit comments

Comments
 (0)