- Phaser 3 + bitECS 0.4 + TypeScript + Vite stack - BootScene with title screen - 6 cursor rules (project context, agent workflow, ECS, chemistry, Phaser, data) - Vitest configured with happy-dom - GDD, engine analysis, implementation plan, progress tracking Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.0 KiB
Plaintext
37 lines
1.0 KiB
Plaintext
---
|
||
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.
|