BlueGit

blue-star tribegen

Files

tribegen / web / .github / copilot-instructions.md

copilot-instructions.md

test
timfa Tim Falken · pushed by timfa · 9 months ago
8d0ee02f History
copilot-instructions.md 12.7 KiB Download Raw
# TribeGen - AI Coding Agent Instructions

## Architecture Overview

**TribeGen** is a browser-based strategy game where players manage a Kobold tribe. The codebase uses **file-based JSON storage** (refactored from SQLite) with PHP backends and vanilla JavaScript frontend.

### Storage Architecture
- **Authentication**: SQLite database (users table only) — see [src/Database/Database.php](src/Database/Database.php)
- **Game State**: JSON files organized by user → save → entities (tribe, kobolds, items, NPCs)
- **SaveManager**: Single abstraction for all file I/O — see [src/System/SaveManager.php](src/System/SaveManager.php)
  - Path pattern: `data/saves/{userId}/{saveId}/` containing `save.json`, `kobolds.json`, `items.json`, `npcs.json`

**Critical Pattern**: All game classes use `fromArray()/toArray()` for JSON serialization. Changes to class properties require updating both methods.

### Core Entity Classes
1. **Tribe** ([src/Classes/Tribe.php](src/Classes/Tribe.php#L1-L100)): Manages kobolds, food/storage, month/season progression, loads/saves via SaveManager
2. **Kobold** ([src/Classes/Kobold.php](src/Classes/Kobold.php#L1-L100)): Individual stats (vitality, intelligence, fighting, medicine, crafting, personality, will), injuries, items, genetic lineage
3. **Item** ([src/Classes/Item.php](src/Classes/Item.php)): Named items with stat modifications (each mod is -5 to +5 per stat)
4. **NPC** ([src/Classes/NPC.php](src/Classes/NPC.php)): Non-player characters/tribes (extensible via JSON `data` field)
5. **Injury** ([src/Classes/Injury.php](src/Classes/Injury.php)): Injury type, category (wound/fracture), severity 0-10

### Event System
- **Base Class**: `Event` — abstract execute() method that modifies tribe state and sets `$this->story`
- **EventManager** ([src/Events/EventManager.php](src/Events/EventManager.php)): Loads enabled events per save, executes them
- **Implementations**: [HuntingEvent](src/Events/HuntingEvent.php), [ExplorationEvent](src/Events/ExplorationEvent.php), [FarmingEvent](src/Events/FarmingEvent.php)
- **Creating New Events**: Extend `Event`, implement `execute()`, return narrative story via `$this->story`
- **Example**: [ExplorationEvent](src/Events/ExplorationEvent.php) — shows stat-based mechanics (intelligence affects food discovery, vitality reduces injury chance), food addition via `$tribe->addFood()`, and injury creation as array appended to kobold's injuries list

### Event Requirements And Scheduling
- **Month-end selection**: `Tribe::getEndOfMonthEvents()` filters by `isEndOfMonth()`, `isAvailable()`, `getMinAge()`, and `getMinParticipants()` before selecting events. `isAvailable()` must return false when an event cannot execute to avoid consuming cost budget.
- **Participant counts**: `getMinParticipants()` and `getMaxParticipants()` must reflect actual required participants for the event.
- **Participant bounds**: `getMaxParticipants()` must always be greater than or equal to `getMinParticipants()`.
- **Age gating**: `getMinAge()` should reflect the minimum required age for any kobold involved.
- **Monthly weather flags**: `endMonth()` resets `dataStore->heatWaveActive` and `dataStore->floodedThisMonth` at month start. Flood events set `floodedThisMonth = true`. Heat waves set `heatWaveActive = true`.
- **Drought rule**: Drought is summer-only and must not occur if `floodedThisMonth` is true.
- **Heat wave rule**: Heat wave is summer-only and causes all kobolds to gain 25% of vitality as fatigue. Food gathered in exploration, hunting, farming, and walk discovery is halved when `heatWaveActive` is true.
- **Event-specific availability**:
  - Childcare bond: requires at least one adult and at least one baby/young, min participants 2.
  - Jealous item: requires at least two eligible kobolds and at least one with an item, min participants 2.
  - Incompetence frustration: requires at least two eligible kobolds and a target whose highest stat is 50-60, min participants 2.
  - Small flood: spring or autumn only.
  - Large flood: autumn only.
  - Big storm: any season.

## API Endpoints

All endpoints in [src/api/game.php](src/api/game.php) require `userId` and `saveId` in POST body:

- **POST `/api/game/generation`**: Create new tribe with 20 random kobolds
- **POST `/api/game/load?saveId=X`**: Load tribe state
- **POST `/api/game/save`**: Save tribe setup (currently a TODO)
- **POST `/api/game/event`**: Execute single event
- **POST `/api/game/endMonth`**: Progress month, age kobolds, apply injuries, execute month events

**Pattern**: All responses use `{ success: boolean, error?: string, ...data }`

## Key Conventions

### IDs and Naming
- **User IDs**: Database `user.id` (integer)
- **Save IDs**: Numeric string generated by `SaveManager::generateSaveId()`
- **Kobold IDs**: Prefixed with `kob_` + uniqid (example: `kob_678abc123`)
- **Method Names**: Use camelCase, boolean getters are `is*()` or `get*()` followed by value

### Stats System
- All stats are 0-100 internally, displayed as text ranges (0-10: "terrible", 90-100: "godlike")
- Stat checks: Get base value → apply item modifications → check result
- Items can boost/reduce any stat independently

### Kobold Lifecycle
- **Age Tiers**: egg → baby → adult → old → very_old (affects food consumption and sprite)
- **Sprite Morphs**: Loaded from `assets/sprites/{morph}/` directory, copied to save folder on generation
- **Genetic Inheritance**: Each kobold tracks `fatherId`, `motherId` for generation tracking

### Food System
- `Tribe::foodCount` tracks stored food
- Age tiers have food requirements (egg: 0, baby: 0.5, adult: 1.0, old: 0.6, very_old: 0.4 units)
- `endMonth()` deducts food and reports shortage via story

## Development Workflow

1. **Loading Data**: `$tribe = Tribe::load($userId, $saveId);` — automatically loads kobolds, storage, items
2. **Modifying Tribe**: Add kobolds with `$tribe->addKobold($kobold)`, modify state, then `$tribe->save()` writes all JSON
3. **Adding Features**: Update entity class → add `fromArray()/toArray()` support → update API endpoint
4. **Testing Events**: Create event class extending `Event`, test via EventManager or direct instantiation

## Common File Locations

| Purpose | File |
|---------|------|
| Database setup | [src/Database/Database.php](src/Database/Database.php) |
| User auth | [src/Classes/User.php](src/Classes/User.php), [src/api/auth.php](src/api/auth.php) |
| Game state | [src/Classes/Tribe.php](src/Classes/Tribe.php) |
| Kobold logic | [src/Classes/Kobold.php](src/Classes/Kobold.php) |
| Storage abstraction | [src/System/SaveManager.php](src/System/SaveManager.php) |
| Game routes | [src/api/game.php](src/api/game.php) |
| Frontend | [public/js/app.js](public/js/app.js), [public/index.html](public/index.html) |

## Documentation References

- **Architecture Details**: [ARCHITECTURE.md](ARCHITECTURE.md) — database schema, class hierarchy, API flow
- **Quick Reference**: [QUICK_REFERENCE.md](QUICK_REFERENCE.md) — refactoring summary, file changes
- **Getting Started**: [README.md](README.md) — installation, features, event creation guide

## Important Storage Policy

- **Only user accounts are stored in the database.** All other game data (saves, kobolds, items, NPCs, injuries, etc.) MUST be stored as JSON files under `data/saves/{userId}/{saveId}`. If any code creates or attempts to use database tables other than `users`, that is a bug and should be changed to use the file-based JSON storage.

TribeGen - AI Coding Agent Instructions

Architecture Overview

TribeGen is a browser-based strategy game where players manage a Kobold tribe. The codebase uses file-based JSON storage (refactored from SQLite) with PHP backends and vanilla JavaScript frontend.

Storage Architecture

  • Authentication: SQLite database (users table only) — see src/Database/Database.php
  • Game State: JSON files organized by user → save → entities (tribe, kobolds, items, NPCs)
  • SaveManager: Single abstraction for all file I/O — see src/System/SaveManager.php
  • Path pattern: data/saves/{userId}/{saveId}/ containing save.json, kobolds.json, items.json, npcs.json

Critical Pattern: All game classes use fromArray()/toArray() for JSON serialization. Changes to class properties require updating both methods.

Core Entity Classes

1. Tribe (src/Classes/Tribe.php): Manages kobolds, food/storage, month/season progression, loads/saves via SaveManager 2. Kobold (src/Classes/Kobold.php): Individual stats (vitality, intelligence, fighting, medicine, crafting, personality, will), injuries, items, genetic lineage 3. Item (src/Classes/Item.php): Named items with stat modifications (each mod is -5 to +5 per stat) 4. NPC (src/Classes/NPC.php): Non-player characters/tribes (extensible via JSON data field) 5. Injury (src/Classes/Injury.php): Injury type, category (wound/fracture), severity 0-10

Event System

  • Base Class: Event — abstract execute() method that modifies tribe state and sets $this->story
  • EventManager (src/Events/EventManager.php): Loads enabled events per save, executes them
  • Implementations: HuntingEvent, ExplorationEvent, FarmingEvent
  • Creating New Events: Extend Event, implement execute(), return narrative story via $this->story
  • Example: ExplorationEvent — shows stat-based mechanics (intelligence affects food discovery, vitality reduces injury chance), food addition via $tribe->addFood(), and injury creation as array appended to kobold's injuries list

API Endpoints

All endpoints in src/api/game.php require userId and saveId in POST body:

  • POST /api/game/generation: Create new tribe with 20 random kobolds
  • POST /api/game/load?saveId=X: Load tribe state
  • POST /api/game/save: Save tribe setup (currently a TODO)
  • POST /api/game/event: Execute single event
  • POST /api/game/endMonth: Progress month, age kobolds, apply injuries, execute month events

Pattern: All responses use { success: boolean, error?: string, ...data }

Key Conventions

IDs and Naming

  • User IDs: Database user.id (integer)
  • Save IDs: Numeric string generated by SaveManager::generateSaveId()
  • Kobold IDs: Prefixed with kob_ + uniqid (example: kob_678abc123)
  • Method Names: Use camelCase, boolean getters are is*() or get*() followed by value

Stats System

  • All stats are 0-100 internally, displayed as text ranges (0-10: "terrible", 90-100: "godlike")
  • Stat checks: Get base value → apply item modifications → check result
  • Items can boost/reduce any stat independently

Kobold Lifecycle

  • Age Tiers: egg → baby → adult → old → very_old (affects food consumption and sprite)
  • Sprite Morphs: Loaded from assets/sprites/{morph}/ directory, copied to save folder on generation
  • Genetic Inheritance: Each kobold tracks fatherId, motherId for generation tracking

Food System

  • Tribe::foodCount tracks stored food
  • Age tiers have food requirements (egg: 0, baby: 0.5, adult: 1.0, old: 0.6, very_old: 0.4 units)
  • endMonth() deducts food and reports shortage via story

Development Workflow

1. Loading Data: $tribe = Tribe::load($userId, $saveId); — automatically loads kobolds, storage, items 2. Modifying Tribe: Add kobolds with $tribe->addKobold($kobold), modify state, then $tribe->save() writes all JSON 3. Adding Features: Update entity class → add fromArray()/toArray() support → update API endpoint 4. Testing Events: Create event class extending Event, test via EventManager or direct instantiation

Common File Locations

PurposeFile
Database setupsrc/Database/Database.php
User authsrc/Classes/User.php, src/api/auth.php
Game statesrc/Classes/Tribe.php
Kobold logicsrc/Classes/Kobold.php
Storage abstractionsrc/System/SaveManager.php
Game routessrc/api/game.php
Frontendpublic/js/app.js, public/index.html

Documentation References

  • Architecture Details: ARCHITECTURE.md — database schema, class hierarchy, API flow
  • Quick Reference: QUICK_REFERENCE.md — refactoring summary, file changes
  • Getting Started: README.md — installation, features, event creation guide
Source
1```instructions
2# TribeGen - AI Coding Agent Instructions
3
4## Architecture Overview
5
6**TribeGen** is a browser-based strategy game where players manage a Kobold tribe. The codebase uses **file-based JSON storage** (refactored from SQLite) with PHP backends and vanilla JavaScript frontend.
7
8### Storage Architecture
9- **Authentication**: SQLite database (users table only) — see [src/Database/Database.php](src/Database/Database.php)
10- **Game State**: JSON files organized by user → save → entities (tribe, kobolds, items, NPCs)
11- **SaveManager**: Single abstraction for all file I/O — see [src/System/SaveManager.php](src/System/SaveManager.php)
12 - Path pattern: `data/saves/{userId}/{saveId}/` containing `save.json`, `kobolds.json`, `items.json`, `npcs.json`
13
14**Critical Pattern**: All game classes use `fromArray()/toArray()` for JSON serialization. Changes to class properties require updating both methods.
15
16### Core Entity Classes
171. **Tribe** ([src/Classes/Tribe.php](src/Classes/Tribe.php#L1-L100)): Manages kobolds, food/storage, month/season progression, loads/saves via SaveManager
182. **Kobold** ([src/Classes/Kobold.php](src/Classes/Kobold.php#L1-L100)): Individual stats (vitality, intelligence, fighting, medicine, crafting, personality, will), injuries, items, genetic lineage
193. **Item** ([src/Classes/Item.php](src/Classes/Item.php)): Named items with stat modifications (each mod is -5 to +5 per stat)
204. **NPC** ([src/Classes/NPC.php](src/Classes/NPC.php)): Non-player characters/tribes (extensible via JSON `data` field)
215. **Injury** ([src/Classes/Injury.php](src/Classes/Injury.php)): Injury type, category (wound/fracture), severity 0-10
22
23### Event System
24- **Base Class**: `Event` — abstract execute() method that modifies tribe state and sets `$this->story`
25- **EventManager** ([src/Events/EventManager.php](src/Events/EventManager.php)): Loads enabled events per save, executes them
26- **Implementations**: [HuntingEvent](src/Events/HuntingEvent.php), [ExplorationEvent](src/Events/ExplorationEvent.php), [FarmingEvent](src/Events/FarmingEvent.php)
27- **Creating New Events**: Extend `Event`, implement `execute()`, return narrative story via `$this->story`
28- **Example**: [ExplorationEvent](src/Events/ExplorationEvent.php) — shows stat-based mechanics (intelligence affects food discovery, vitality reduces injury chance), food addition via `$tribe->addFood()`, and injury creation as array appended to kobold's injuries list
29
30### Event Requirements And Scheduling
31- **Month-end selection**: `Tribe::getEndOfMonthEvents()` filters by `isEndOfMonth()`, `isAvailable()`, `getMinAge()`, and `getMinParticipants()` before selecting events. `isAvailable()` must return false when an event cannot execute to avoid consuming cost budget.
32- **Participant counts**: `getMinParticipants()` and `getMaxParticipants()` must reflect actual required participants for the event.
33- **Participant bounds**: `getMaxParticipants()` must always be greater than or equal to `getMinParticipants()`.
34- **Age gating**: `getMinAge()` should reflect the minimum required age for any kobold involved.
35- **Monthly weather flags**: `endMonth()` resets `dataStore->heatWaveActive` and `dataStore->floodedThisMonth` at month start. Flood events set `floodedThisMonth = true`. Heat waves set `heatWaveActive = true`.
36- **Drought rule**: Drought is summer-only and must not occur if `floodedThisMonth` is true.
37- **Heat wave rule**: Heat wave is summer-only and causes all kobolds to gain 25% of vitality as fatigue. Food gathered in exploration, hunting, farming, and walk discovery is halved when `heatWaveActive` is true.
38- **Event-specific availability**:
39 - Childcare bond: requires at least one adult and at least one baby/young, min participants 2.
40 - Jealous item: requires at least two eligible kobolds and at least one with an item, min participants 2.
41 - Incompetence frustration: requires at least two eligible kobolds and a target whose highest stat is 50-60, min participants 2.
42 - Small flood: spring or autumn only.
43 - Large flood: autumn only.
44 - Big storm: any season.
45
46## API Endpoints
47
48All endpoints in [src/api/game.php](src/api/game.php) require `userId` and `saveId` in POST body:
49
50- **POST `/api/game/generation`**: Create new tribe with 20 random kobolds
51- **POST `/api/game/load?saveId=X`**: Load tribe state
52- **POST `/api/game/save`**: Save tribe setup (currently a TODO)
53- **POST `/api/game/event`**: Execute single event
54- **POST `/api/game/endMonth`**: Progress month, age kobolds, apply injuries, execute month events
55
56**Pattern**: All responses use `{ success: boolean, error?: string, ...data }`
57
58## Key Conventions
59
60### IDs and Naming
61- **User IDs**: Database `user.id` (integer)
62- **Save IDs**: Numeric string generated by `SaveManager::generateSaveId()`
63- **Kobold IDs**: Prefixed with `kob_` + uniqid (example: `kob_678abc123`)
64- **Method Names**: Use camelCase, boolean getters are `is*()` or `get*()` followed by value
65
66### Stats System
67- All stats are 0-100 internally, displayed as text ranges (0-10: "terrible", 90-100: "godlike")
68- Stat checks: Get base value → apply item modifications → check result
69- Items can boost/reduce any stat independently
70
71### Kobold Lifecycle
72- **Age Tiers**: egg → baby → adult → old → very_old (affects food consumption and sprite)
73- **Sprite Morphs**: Loaded from `assets/sprites/{morph}/` directory, copied to save folder on generation
74- **Genetic Inheritance**: Each kobold tracks `fatherId`, `motherId` for generation tracking
75
76### Food System
77- `Tribe::foodCount` tracks stored food
78- Age tiers have food requirements (egg: 0, baby: 0.5, adult: 1.0, old: 0.6, very_old: 0.4 units)
79- `endMonth()` deducts food and reports shortage via story
80
81## Development Workflow
82
831. **Loading Data**: `$tribe = Tribe::load($userId, $saveId);` — automatically loads kobolds, storage, items
842. **Modifying Tribe**: Add kobolds with `$tribe->addKobold($kobold)`, modify state, then `$tribe->save()` writes all JSON
853. **Adding Features**: Update entity class → add `fromArray()/toArray()` support → update API endpoint
864. **Testing Events**: Create event class extending `Event`, test via EventManager or direct instantiation
87
88## Common File Locations
89
90| Purpose | File |
91|---------|------|
92| Database setup | [src/Database/Database.php](src/Database/Database.php) |
93| User auth | [src/Classes/User.php](src/Classes/User.php), [src/api/auth.php](src/api/auth.php) |
94| Game state | [src/Classes/Tribe.php](src/Classes/Tribe.php) |
95| Kobold logic | [src/Classes/Kobold.php](src/Classes/Kobold.php) |
96| Storage abstraction | [src/System/SaveManager.php](src/System/SaveManager.php) |
97| Game routes | [src/api/game.php](src/api/game.php) |
98| Frontend | [public/js/app.js](public/js/app.js), [public/index.html](public/index.html) |
99
100## Documentation References
101
102- **Architecture Details**: [ARCHITECTURE.md](ARCHITECTURE.md) — database schema, class hierarchy, API flow
103- **Quick Reference**: [QUICK_REFERENCE.md](QUICK_REFERENCE.md) — refactoring summary, file changes
104- **Getting Started**: [README.md](README.md) — installation, features, event creation guide
105
106## Important Storage Policy
107
108- **Only user accounts are stored in the database.** All other game data (saves, kobolds, items, NPCs, injuries, etc.) MUST be stored as JSON files under `data/saves/{userId}/{saveId}`. If any code creates or attempts to use database tables other than `users`, that is a bug and should be changed to use the file-based JSON storage.
109
110```
111# TribeGen - AI Coding Agent Instructions
112
113## Architecture Overview
114
115**TribeGen** is a browser-based strategy game where players manage a Kobold tribe. The codebase uses **file-based JSON storage** (refactored from SQLite) with PHP backends and vanilla JavaScript frontend.
116
117### Storage Architecture
118- **Authentication**: SQLite database (users table only) — see [src/Database/Database.php](src/Database/Database.php)
119- **Game State**: JSON files organized by user → save → entities (tribe, kobolds, items, NPCs)
120- **SaveManager**: Single abstraction for all file I/O — see [src/System/SaveManager.php](src/System/SaveManager.php)
121 - Path pattern: `data/saves/{userId}/{saveId}/` containing `save.json`, `kobolds.json`, `items.json`, `npcs.json`
122
123**Critical Pattern**: All game classes use `fromArray()/toArray()` for JSON serialization. Changes to class properties require updating both methods.
124
125### Core Entity Classes
1261. **Tribe** ([src/Classes/Tribe.php](src/Classes/Tribe.php#L1-L100)): Manages kobolds, food/storage, month/season progression, loads/saves via SaveManager
1272. **Kobold** ([src/Classes/Kobold.php](src/Classes/Kobold.php#L1-L100)): Individual stats (vitality, intelligence, fighting, medicine, crafting, personality, will), injuries, items, genetic lineage
1283. **Item** ([src/Classes/Item.php](src/Classes/Item.php)): Named items with stat modifications (each mod is -5 to +5 per stat)
1294. **NPC** ([src/Classes/NPC.php](src/Classes/NPC.php)): Non-player characters/tribes (extensible via JSON `data` field)
1305. **Injury** ([src/Classes/Injury.php](src/Classes/Injury.php)): Injury type, category (wound/fracture), severity 0-10
131
132### Event System
133- **Base Class**: `Event` — abstract execute() method that modifies tribe state and sets `$this->story`
134- **EventManager** ([src/Events/EventManager.php](src/Events/EventManager.php)): Loads enabled events per save, executes them
135- **Implementations**: [HuntingEvent](src/Events/HuntingEvent.php), [ExplorationEvent](src/Events/ExplorationEvent.php), [FarmingEvent](src/Events/FarmingEvent.php)
136- **Creating New Events**: Extend `Event`, implement `execute()`, return narrative story via `$this->story`
137- **Example**: [ExplorationEvent](src/Events/ExplorationEvent.php) — shows stat-based mechanics (intelligence affects food discovery, vitality reduces injury chance), food addition via `$tribe->addFood()`, and injury creation as array appended to kobold's injuries list
138
139## API Endpoints
140
141All endpoints in [src/api/game.php](src/api/game.php) require `userId` and `saveId` in POST body:
142
143- **POST `/api/game/generation`**: Create new tribe with 20 random kobolds
144- **POST `/api/game/load?saveId=X`**: Load tribe state
145- **POST `/api/game/save`**: Save tribe setup (currently a TODO)
146- **POST `/api/game/event`**: Execute single event
147- **POST `/api/game/endMonth`**: Progress month, age kobolds, apply injuries, execute month events
148
149**Pattern**: All responses use `{ success: boolean, error?: string, ...data }`
150
151## Key Conventions
152
153### IDs and Naming
154- **User IDs**: Database `user.id` (integer)
155- **Save IDs**: Numeric string generated by `SaveManager::generateSaveId()`
156- **Kobold IDs**: Prefixed with `kob_` + uniqid (example: `kob_678abc123`)
157- **Method Names**: Use camelCase, boolean getters are `is*()` or `get*()` followed by value
158
159### Stats System
160- All stats are 0-100 internally, displayed as text ranges (0-10: "terrible", 90-100: "godlike")
161- Stat checks: Get base value → apply item modifications → check result
162- Items can boost/reduce any stat independently
163
164### Kobold Lifecycle
165- **Age Tiers**: egg → baby → adult → old → very_old (affects food consumption and sprite)
166- **Sprite Morphs**: Loaded from `assets/sprites/{morph}/` directory, copied to save folder on generation
167- **Genetic Inheritance**: Each kobold tracks `fatherId`, `motherId` for generation tracking
168
169### Food System
170- `Tribe::foodCount` tracks stored food
171- Age tiers have food requirements (egg: 0, baby: 0.5, adult: 1.0, old: 0.6, very_old: 0.4 units)
172- `endMonth()` deducts food and reports shortage via story
173
174## Development Workflow
175
1761. **Loading Data**: `$tribe = Tribe::load($userId, $saveId);` — automatically loads kobolds, storage, items
1772. **Modifying Tribe**: Add kobolds with `$tribe->addKobold($kobold)`, modify state, then `$tribe->save()` writes all JSON
1783. **Adding Features**: Update entity class → add `fromArray()/toArray()` support → update API endpoint
1794. **Testing Events**: Create event class extending `Event`, test via EventManager or direct instantiation
180
181## Common File Locations
182
183| Purpose | File |
184|---------|------|
185| Database setup | [src/Database/Database.php](src/Database/Database.php) |
186| User auth | [src/Classes/User.php](src/Classes/User.php), [src/api/auth.php](src/api/auth.php) |
187| Game state | [src/Classes/Tribe.php](src/Classes/Tribe.php) |
188| Kobold logic | [src/Classes/Kobold.php](src/Classes/Kobold.php) |
189| Storage abstraction | [src/System/SaveManager.php](src/System/SaveManager.php) |
190| Game routes | [src/api/game.php](src/api/game.php) |
191| Frontend | [public/js/app.js](public/js/app.js), [public/index.html](public/index.html) |
192
193## Documentation References
194
195- **Architecture Details**: [ARCHITECTURE.md](ARCHITECTURE.md) — database schema, class hierarchy, API flow
196- **Quick Reference**: [QUICK_REFERENCE.md](QUICK_REFERENCE.md) — refactoring summary, file changes
197- **Getting Started**: [README.md](README.md) — installation, features, event creation guide