Coding Standards
Coding standards
Practical implementation guidance for code generated from and written around Modeller domains.
Coding standards guide how Modeller domains are realised in implementation. They complement the canonical ubiquitous language and architecture decisions, but do not redefine their semantic meaning.
Use these standards when designing generated output, handwritten extensions, tests, and application code. Each page follows the same shape: the standard, why, a before/after code comparison, and a compact list of rules for LLMs / agents intended to be turned into skills or instructions that constrain how AI assistants write code in this codebase.
Standards are grouped by category below; open a category for its full list of pages.
- Domain Modeling — shaping entities, aggregates, and value objects so invalid states can't exist.
- EF Core and Data — persisting rich domain types and querying/serializing at scale.
- Functional Patterns, Results, and Errors — expressing failure as a value and composing behaviour functionally.
- General — cross-cutting habits that don't fit elsewhere.
- Performance — choosing the right data structure and measuring before optimizing.
- Security and Identity — authentication, authorization, and defensive coding.
- Types, Records, and Modern C# — choosing
class/record/structand using modern language features cleanly. - Web APIs and Services — Minimal APIs, DI, caching, and service-to-service calls.
- Working with AI Assistants — writing AI-facing instructions and verifying AI-generated code.