--- description: Game data JSON schema and validation conventions globs: src/data/**/*.json alwaysApply: false --- # Data File Conventions ## General Rules - Every entity has a unique `id` field (string) - Cross-references use `id` strings, never array indices - Every entry has a `description` field (feeds the in-game Codex) - Data must be valid JSON — no comments, no trailing commas ## elements.json Array of Element objects. Keyed by `symbol`. All values from real periodic table. ```json { "symbol": "Na", "name": "Sodium", "nameRu": "Натрий", "atomicNumber": 11, "atomicMass": 22.99, "electronegativity": 0.93, "category": "alkali-metal", "state": "solid", "color": "#c8c8c8", "description": "Мягкий щелочной металл. Бурно реагирует с водой." } ``` ## reactions.json Array of Reaction objects. Include science explanation and failure reasons. ## Validation All JSON is loaded and type-checked at boot. Schema mismatches crash with clear errors — never silently ignore bad data.