Conventions
The one-screen cheat-sheet. These are the patterns every slice follows — keep to them and your code reads like the rest of the codebase (which is also what lets an AI assistant extend it cleanly).
Naming
| Where | Convention |
|---|---|
| C# types/members | PascalCase; private fields _camelCase; records for DTOs |
| TS vars/functions | camelCase; components/types PascalCase |
| File names | kebab-case, except React components (PascalCase.tsx) |
| Folders | lowercase kebab-case |
| Permissions | feature.action (lowercase, dot-separated); wildcards feature.* |
| i18n keys | feature.subkey.subsubkey, mirroring folder structure |
| Settings | Feature.SettingName (PascalCase with dots) |
Backend
- A feature is six files under
Features/{Domain}/; it auto-registers — never editProgram.cs. - Errors are RFC 7807 ProblemDetails. Throw a
DomainExceptionsubclass (NotFoundException,ConflictException, …) — never a rawException. - Map with static methods, not AutoMapper. Use
DbContextdirectly, not a repository. - Cross-cutting work is the
IEndpointFilterpipeline (validation/audit/performance/transaction), not per-handler code.
Frontend
- Screens are files under
src/pages/; the path tree is the URL tree._-prefixed = ignored by the router. - Fetch data with TanStack Query, never
useEffect. - Never put auth tokens in
localStorage/sessionStorage. - Use logical CSS properties (
ms-/me-/ps-/pe-) so RTL works — neverml-/mr-/pl-/pr-for layout.
The quality bar
A feature isn't done until all six are true: designed loading, empty, and error states; verified mobile layout; dark-mode parity; and keyboard navigation. Fewer features at higher quality, not the reverse.
Comments
Explain why, not what — a non-obvious constraint, a workaround, a subtle invariant. The diff already says what.