Short, opinionated rules optimized for future agent runs. Prefer encoding
these into validators (tools/moui/*, checks/) over restating them in prose.
When a principle is mechanical, point docs/invariants.md Detection at the
script. When it is still taste, keep it here and clear AI residue in small PRs.
- One owning package per capability — extend the owner; do not fork helpers into examples or sibling packages.
- Parse at boundaries — host payloads, manifests, and FFI results are validated or typed at the edge; no YOLO field poking deep in app logic.
- App packages stay app-safe — only
wzzc-dev/moui, domain facades, andviews(see P8/P9). - Platform entrypoints are wiring — no product state machines in
*_skia/web_wasm. - Renderers consume
DrawCommand— no view-constructor dependency in reverse.
- Native Skia is mainline; native WGPU is experimental (engineering gate
diagnostic) — do not soft-reclassify in docs or examples; do not present WGPU as product-capable. - Mobile claims need evidence grades —
passed/partial/failedonly via manifests; packaging ≠ runtime proof. - Embedded runtime backends are canonical for Android/iOS/HarmonyOS —
wzzc-dev/windowowns platform lifecycle, surface, and input; examples keep only thin MoonBit entrypoints.
- Maps over manuals —
AGENTS.mdstays a directory; depth lives underdocs/withINDEX.mdlinks. - Single source of truth — invariants, validation policy, and package boundary each have one canonical file; other files link.
- Smallest useful check first — path-local
moon test/ validators beforedaily/platform. - Fix hints in tools — validator failures should name the invariant and the fix doc anchor.
- Plans for multi-package work —
docs/plans/active/before large coding loops. - Promote discoveries — session logs →
memories/repo/(short) or ADR (decisions); do not leave critical rules only in chat.
- Prefer shared utilities already in-tree over new one-off helpers.
- No compatibility shims for removed APIs unless explicitly requested.
- Garbage-collect weekly patterns — duplicated helpers, stale docs, forbidden imports: small automated or agent-driven PRs, not quarterly rewrites.
- Constraints table:
docs/invariants.md - Mechanization batch1:
docs/plans/done/harness-mechanize-invariants-batch1.md - Agent workflow:
docs/ai-collaboration.md