Files
initiative/docs/conventions.md
Lukas a89fac5c23 Slim CLAUDE.md with progressive disclosure, add project purpose
Move niche conventions (component props, export compat) to
docs/conventions.md, trim Speckit/Constitution sections to link to
source files, and add a one-line project description.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:07:18 +02:00

1.1 KiB

Conventions (detailed)

These conventions supplement the overview in CLAUDE.md. Load this file when working in the relevant areas.

Component Props

Max 8 explicitly declared props per component interface, enforced by scripts/check-component-props.mjs (uses the TypeScript compiler API). Run pnpm check:props to verify.

  • Use React context for shared state
  • Reserve props for per-instance config (data items, layout variants, refs)

Export Format Compatibility

When changing Encounter, Combatant, PlayerCharacter, or UndoRedoState types, verify that previously exported JSON files (version 1) still import correctly. If not, bump the ExportBundle version and add migration logic in validateImportBundle().

Domain Patterns

  • Branded types for identity values (e.g., CombatantId). Prefer immutability/readonly where practical. See ADR-003.
  • Domain events are plain data objects with a type discriminant — no classes. See ADR-002.
  • Errors as values (DomainError), never thrown. See ADR-001.