Files
synthesis/.cursor/rules/data-files.mdc
Денис Шкабатур 10bd67c951 Phase 0: Project setup for agent-driven development
- 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>
2026-02-12 11:59:41 +03:00

37 lines
1.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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.