Apply these opinionated .NET 8 architecture conventions whenever structuring or reviewing a backend service: clean architecture layering and which direction dependencies point, when CQRS with MediatR is worth it, cross-cutting concerns as pipeline behaviours, minimal APIs grouped by feature, keeping DbContext in Infrastructure, health checks and structured logging, WebApplicationFactory integration tests, and when AOT pays off.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# .NET Core Architecture
House architecture conventions for .NET 8 backend services. This covers how a service is _structured_; for language-level conventions see the `csharp` skill.
## Layering
Dependencies point inward only. Domain knows nothing about anything else, and Infrastructure is the one layer allowed to reference a database or an SDK — which is what lets the inner layers be tested without either.
```text
Domain entities, value objects, domain events, interfaces → no dependencies
Application use cases, CQRS handlers, DTOs, validators → Domain
Infrastructure EF Core, external APIs, implementations of Domain interfaces → Domain + Application
Api endpoints, DI wiring, middleware → all of the above
```
The test that keeps this honest: if `Domain` compiles with no package references beyond the BCL, the boundary is intact.
Entities enforce their own invariants: private setters, a private parameterless constructor for EF Core's materialiser, and a static factory that validates. Public setters mean any layer can put the entity into an invalid state, and then "the domain guarantees X" is just a comment.
```csharp
…
The line at the top of this page pins the label git:20261013.ecfffa1, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_rwwb5znzh6ycg4tm
GET https://markdownregistry.com/api/v1/resolve?ref=alexander-danilenko/cortex-ai-skills/clean-architecture
GET https://markdownregistry.com/api/v1/blob/6cd3e04a524788448d66a21b0f03d549d086f3a5aa46da18396dd301c5c14fc4
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
alexander-danilenko/cortex-ai-skills · plugins/common/cortex-communication/skills/answer-buzzkill/SKILL.md · Write a short, fact-checked reply that answers a colleague's question in one meaning only, ready to copy and paste. The…
alexander-danilenko/cortex-ai-skills · plugins/common/cortex-communication/skills/humanize-text/SKILL.md · Remove signs of AI-generated writing from text. Use after drafting to make copy sound more natural and human-written…
alexander-danilenko/cortex-ai-skills · plugins/common/cortex-communication/skills/simple-english/SKILL.md · Write or audit technical text against ASD-STE100 Simplified Technical English so a tired, non-native reader understands…
alexander-danilenko/cortex-ai-skills · plugins/engineering/cortex-coderabbit/skills/resolve-feedback/SKILL.md · Resolve CodeRabbit review feedback on a GitHub pull request. Collects every open CodeRabbit finding (inline threads…
alexander-danilenko/cortex-ai-skills · plugins/engineering/cortex-jira/skills/qa-scope/SKILL.md · Draft the QA scope and plain-language test scenarios for a Jira ticket — brief one-liners with automated test…
alexander-danilenko/cortex-ai-skills · plugins/engineering/cortex-jira/skills/report-comment/SKILL.md · Turn the git commits for a Jira ticket into a short, business-friendly implementation report and save it as local…
alexander-danilenko/cortex-ai-skills · plugins/engineering/cortex-knowledge/skills/documentation/SKILL.md · ALWAYS invoke for any task involving docstrings, JSDoc/TSDoc, or REST API documentation — even when the request seems…
alexander-danilenko/cortex-ai-skills · plugins/engineering/cortex-knowledge/skills/learn-with-docs-refresh/SKILL.md · Audit and maintain the learnings in `docs/solutions/` against the current codebase — fix drifted paths and links, merge…
alexander-danilenko/cortex-ai-skills · plugins/engineering/cortex-knowledge/skills/learn-with-docs/SKILL.md · Capture a solved, verified problem as a durable learning in `docs/solutions/` so the next agent or engineer does not…
ciembor/agent-rules-books · clean-architecture/SKILL.md · Apply Robert C. Martin-inspired architecture rules when separating business policy from frameworks, databases, UI, or…
wondelai/skills · plugins/systems-architecture/skills/clean-architecture/SKILL.md · Structure software around the Dependency Rule: source code dependencies point inward from frameworks to use cases to…
wondelai/skills · clean-architecture/SKILL.md · Structure software around the Dependency Rule: source code dependencies point inward from frameworks to use cases to…
wondelai/skills · plugins/wondelai-skills/skills/clean-architecture/SKILL.md · Structure software around the Dependency Rule: source code dependencies point inward from frameworks to use cases to…