This file defines non-negotiable working rules for Dao.
- Clarity over cleverness
- Semantics over novelty theater
- Explicit structure over hidden magic
- Minimal syntax with strong visual taxonomy
- Spec-first changes before implementation-first changes
Agents must not:
- invent subsystems beyond the declared repository layout
- redesign syntax casually or opportunistically
- add build tools, CI, or language backends without explicit request
- create new top-level directories without updating
CLAUDE.mdanddocs/ARCH_INDEX.md - blur normative docs and explanatory docs
The current frozen surface assumptions are:
- indentation-significant blocks
if/while/foruse:- block-bodied functions use no token after the return type
- expression-bodied functions use
-> extern fndeclares externally-provided functions with no body- lambdas use
-> mode <name> =>enters an execution/safety moderesource <kind> <name> =>binds a scoped resource domain|>is a first-class pipeline operatormodule a::bdeclares a file's module identityimport a::bbinds the last segmentbas a local module nameenumdeclares fieldless closed variants (classification only)enum classdeclares closed structured variants with named fields (seedocs/contracts/ADR_ENUM_CLASS.md)
Agents must not introduce alternate spellings for these without an explicit syntax revision task.
- All dependencies are managed via Conan 2.x in manifest mode
(
conanfile.txtorconanfile.py). - Agents must never install, suggest, or attempt to install system
packages (e.g. via
zypper,apt,dnf,brew, or any other system package manager). No exceptions. - If a dependency is not available in Conan, escalate — do not work around it with system packages.
docs/contracts/contains binding contracts onlydocs/normal-case prose is explanatory onlyspec/holds grammar fragments, reference examples, and syntax probesexamples/holds human-readable Dao snippets, not normative lawtestdata/holds fixtures for future parser/compiler testsai/skills/holds Bonsai skills only
Every diff must be evaluated in context of the larger project, not in isolation. Passing tests is necessary but not sufficient.
Before committing, verify:
- Readability without history — a stranger must understand the
code without reading the PR description, task tracker, or commit
log. No task numbers in comments (
D1a,D3,D5are opaque). Names describe what things are, not which ticket introduced them. - DRY — if the same pattern appears a third time, stop and extract a helper before writing the third copy. Check whether the pattern already exists elsewhere in the codebase.
- Data structure fitness — adding a field to a class is a
signal to evaluate the design, not a solution. If a struct has
8 fields, the design is wrong. If positional constructors exceed 6 arguments, introduce named initialization, a builder, or sub-structs.
- Style consistency — look at how neighboring code handles the same problem before inventing a new pattern. Match the existing conventions for naming, error handling, and control flow.
- Workarounds require escalation — if writing a comment that says "workaround" or "temporary," that is a flag to escalate to the user, not a license to ship it. Document the root cause, the workaround, and the conditions under which it can be removed — all in one place, not scattered across files.
- No silent regressions — every function that can fail must have an observable failure path (diagnostic, error return, or assert). Returning a valid-looking default (0, nullptr, empty) on failure is a bug, not error handling.
- Algorithmic awareness — O(n²) in a loop over symbols is not acceptable when O(n) or O(1) alternatives exist. Linear scans are fine for small n with a documented size bound; they are not fine as the default lookup strategy.
- Variables describe what they hold, not their type or scope depth
- Functions describe what they do, not which pass calls them
- Test fixtures describe the scenario, not their sequential number
- Comments explain why, not what — the code shows what
- Every abstraction must earn its keep: if removing it would require copy-pasting code in ≥3 places, it belongs; otherwise it does not
- Do not introduce wrappers that add no semantic value
- Do not duplicate type definitions across subsystems — promote shared types to the appropriate substrate layer
Agents must review their own output as if they were the reviewer, not the author. The question is not "does this work" but "would I approve this PR if someone else wrote it."
- Correctness of contracts
- Structural coherence
- Readability
- Convenience
- Extensibility