Files
Claude-Code-Game-Studios/.claude/rules/data-files.md
T
DonchitosandClaude Opus 5 d05699707f Release 1.1.0 — one config file, and a process weight you choose
`project.yaml` at the repo root is now the single source of truth for a
project's configuration, replacing `production/stage.txt`,
`production/review-mode.txt` and `.claude/docs/technical-preferences.md` (all
three still read as a fallback; nothing is force-deleted).

**`modes.rigor` — one question instead of six.** `minimal`, `standard` or
`full` fronts six knobs: `modes.workflow`, `docs.density`, `qa.level`,
`modes.story_granularity`, `modes.review_mode` and `team.size`. It defaults to
`minimal`, which is a change from 1.0's behaviour: the heavier tier was
measured costing several times more to reach working code without producing a
better result, and returning nothing when a fresh developer inherited the
project. Pin `modes.rigor: standard` to keep 1.0's process level.

Also in this release:

- `/settings` to view or change any setting, and `project.local.yaml` for
  per-developer preferences that should not be committed.
- `system_overrides` to hold one system to a higher standard than the rest of
  the project, and `testing.strict` to set per test type whether missing
  evidence blocks a story or warns.
- A story that changes anything the player sees is not closed until the game
  has been launched, observed, and a screenshot retained in
  `production/qa/evidence/`. A parse check is not a run. This holds at every
  rigor level, including `minimal`, where automated tests are waived but the
  look is not.
- The code root is engine-specific and enforced as such: Godot `src/`, Unity
  `Assets/`, Unreal `Source/<Module>/`. Two of the three will not build a
  project laid out any other way.
- Migration tooling for existing projects: `.claude/scripts/migrate-v1-config.sh`
  converts a 1.0 layout, non-destructively by default, with a report to review
  before `--finalize` deletes anything.
- Ask-before-write holds regardless of personal automation settings.

Upgrading from 1.0 or earlier: see UPGRADING.md. Full list of changes:
CHANGELOG.md.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016xvzG3i7pWQg4LjyDwWMXd
2026-09-23 12:25:11 +10:00

59 lines
2.0 KiB
Markdown

---
paths:
- "assets/data/**"
---
# Data File Rules
- All JSON files must be valid JSON — broken JSON blocks the entire build pipeline
- File naming: lowercase with underscores only, following `[system]_[name].json` pattern
- Every data file must have a documented schema (either JSON Schema or documented in the corresponding design doc)
- Numeric values must include comments or companion docs explaining what the numbers mean
- Use consistent key naming: **`snake_case` for keys within JSON files**, matching
the `[system]_[name].json` file convention one line above and the engine idiom
every other standard in this repo uses.
> **On Unity and Unreal this costs you a mapping layer — budget for it rather
> than changing the keys.** `JsonUtility` binds by *exact field name*, and C#
> fields are `camelCase` per `naming.variables`, so a snake_case file cannot bind
> directly to the type that consumes it. Use a private nested DTO whose fields
> are the wire format and which maps once into your real type, or take a
> dependency that supports a naming policy (Newtonsoft `SnakeCaseNamingStrategy`,
> `System.Text.Json` `JsonNamingPolicy`). Do **not** switch the file to camelCase
> to avoid the DTO: keys are the cross-engine contract. Write the DTO and
> document it as a wire-format boundary — that is the intended shape.
- No orphaned data entries — every entry must be referenced by code or another data file
- Version data files when making breaking schema changes
- Include sensible defaults for all optional fields
## Examples
**Correct** naming and structure (`combat_enemies.json`):
```json
{
"goblin": {
"base_health": 50,
"base_damage": 8,
"move_speed": 3.5,
"loot_table": "loot_goblin_common"
},
"goblin_chief": {
"base_health": 150,
"base_damage": 20,
"move_speed": 2.8,
"loot_table": "loot_goblin_rare"
}
}
```
**Incorrect** (`EnemyData.json`):
```json
{
"Goblin": { "hp": 50 }
}
```
Violations: uppercase filename, uppercase key, no `[system]_[name]` pattern, missing required fields.