1---2name: conestoga-game-dev3description: Use for Conestoga game development, validation/fallback handling, UI headless toggle, and test workflow in this repo. Covers make/uv commands, Gemini fallback patterns, and Pygame headless settings.4---5
6# Conestoga Game Dev Skill
7
8## Quick Context
9- Code: `src/conestoga/game/` (`runner.py`, `gemini_gateway.py`, `events.py`, `state.py`, `ui.py`, `validators.py`, `fallback_monitor.py`).
10- Entry: `conestoga` script or `uv run python -m conestoga.main`.
11- Tests: `uv run pytest` (CI defaults headless), headless toggle via `UI_HEADLESS=1` or `CI=1`; set `UI_HEADLESS=0` for visible window.
12- Make targets: `make install-dev`, `make lint`, `make format`, `make test`, `make run`.
13
14## Gemini & Fallback Rules
15- Only Gemini 3 models via `GeminiGateway`; offline/quota sets `resource_exhausted`.
16- Validator enforces 2–3 choices, unique IDs/text, and effect targets (allowed resources, catalog items).
17- FallbackMonitor tracks fallback source/reason; UI logs fallback/timeout; `gemini_online` flag controls offline badge.
18- Modify resources only via `GameState.modify_resource` (raises on unknown fields).
19
20## Testing
21- Run `uv run pytest`; optional SHACL test skips if pyshacl missing.
22- Scripts: `scripts/test-pre.sh` / `scripts/test-post.sh` (Docker opt-in via `RUN_DOCKER=1`, compose file `docker-compose.test.yml`, temp dir `TEST_RUN_DIR`).
23- Headless UI tests set `UI_HEADLESS=1`; use `UI_HEADLESS=0` locally to view windows.
24
25## Key Files
26- Validation/fallback: `src/conestoga/game/validators.py`, `fallback_monitor.py`, `gemini_gateway.py`, `runner.py`.
27- UI: `src/conestoga/game/ui.py` (headless toggle, logging).
28- Tests: `tests/test_game.py`, `tests/test_ui_headless.py`, `tests/test_audit.py`, `tests/test_ontology.py`.
29- Docs: `README.md` headless note; ontology `ontology/conestoga.ttl`.
30
31## Patterns to Preserve
32- Prefetch-first events, on-demand resolutions.
33- Validate before mutation; fallback on validation/timeout/quota.
34- UI logs choices, outcomes, fallback usage.