Phase 3 — Architecture & Engineering
Engineering Constitution
The coding standards your AI agent will actually follow
2 min read · Document 8 of 30
What is this document?
The Engineering Constitution fixes the coding standards for the whole codebase: language settings, naming, error handling, logging, testing and how configuration and secrets are read.
It is written as short, enforceable rules — the kind a linter, a type-checker or a reviewer can check.
Why does it matter?
- Without it, every AI agent session drifts — different naming, different error handling, different file structures.
- The codebase stays coherent no matter how many sessions or tools build it.
- Security-sensitive patterns are decided once, not per file.
What's inside?
- Language and tooling — Strict mode, formatting, linting.
- Error handling and logging — Structured logs, user-facing error shapes.
- Configuration and secrets — One way to read environment and config values.
RuleLint / type checkReviewMerge
How CREAH generates it
CREAH builds this document from your Stage 0 answers and interview. Questions that shape it include:
- Which language and framework versions are pinned?
- How should errors be shown to users?
- Where are secrets stored in production?
Example excerpt
## EC-1: TypeScript Strict Mode
All files use TypeScript strict mode. `any` is forbidden.
Every exported function has an explicit return type.
## EC-4: Error Handling
Every async boundary handles failure explicitly.
Errors are logged as structured JSON.
User-facing errors use field-level messages — never raw exceptions.