Imported from gdg3417/Dungeon-Lord (
dungeon-builder/AGENTS.md). Install upstream withnpx skills add gdg3417/Dungeon-Lord --skill dungeon-builder. Copyright stays with the author.
AGENTS.md
Project
Dungeon Builder is a Unity mobile idle dungeon management game.
The player is a living dungeon core. The MVP goal is to prove that building, observing, and optimizing a dungeon ecosystem is fun.
Mandatory development rules
Before coding, read the repo-root rules file:
docs/development/codex-development-rules.mdfrom the repository root../docs/development/codex-development-rules.mdwhen working fromdungeon-builder/
These rules control localization, data-driven tuning, feature flags, event configuration, scalable system boundaries, MVP scope control, and test evidence requirements.
Current development target
Build the MVP vertical slice only.
Do not implement post-MVP systems unless explicitly requested.
Sprint 2A implementation must not begin until Sprint 1 closeout evidence is complete and linked.
Authoritative docs
Read these before making changes:
docs/development/codex-development-rules.mdDocs/00 - All Design Specs_AUDITED_AND_LOCKED.mdDocs/Cross_Spec_Glossary_of_Invariants_UPDATED.mdDocs/What is the smallest version of Dungeon Builder that proves the fantasy is fun.mdDocs/37 - QA_Strategy_and_Test_Harness.mdDocs/Sprint1_Closeout_Checklist_2026-05-13.mddocs/planning/build-promotion-policy.mddocs/planning/test-stage-matrix.mddocs/planning/actionable-backlog.mddocs/planning/backlog-to-sprint-traceability-matrix.mddocs/planning/sprint-2-ticket-backlog.mddocs/planning/issues/sprint-2/execution-order.mddocs/planning/issues/sprint-2/risks-and-blockers.md
When working a specific sprint ticket, also read the relevant issue file under:
docs/planning/issues/sprint-2/
If a request conflicts with locked specs, sprint planning, or Codex development rules, stop and explain the conflict before making changes.
Engine
Unity.
Core MVP constraints
MVP includes:
- One main dungeon
- Up to five floors
- Undead and Goblinoid monster families
- Mana generation and spending
- Heat states: Peace, Notice, Concern
- Adventurer classes: Warrior, Rogue, Mage, Cleric, Ranger
- Loot tiers up to Steel
- One research slot
- Offline idle mana calculation
- One sub dungeon type: Mana Farm
MVP excludes:
- Prestige
- Seasonal events
- PvP
- Leaderboards
- Hero adventurers
- Advanced diplomacy
- More than one sub dungeon type
- Expanded boss sets
- Real monetization
- Social or competitive systems
- Player-facing live-ops systems unless explicitly approved in a later sprint
Sprint gate rules
- Sprint 1 testing must be completed before Sprint 2A implementation begins.
- Sprint 2A work must follow
docs/planning/issues/sprint-2/execution-order.md. - Sprint 2A starts with
S2-T00A-I01-dungeon-layout-and-placement-mvp-foundation.md. - Sprint 2B work must not be mixed into Sprint 2A unless explicitly requested.
- Build promotion must follow
docs/planning/build-promotion-policy.md. - Unit, SIT, UAT, and build gate evidence must follow
docs/planning/test-stage-matrix.md. - Sprint closeout must follow the relevant sprint closeout checklist.
Coding rules
- Prefer small, testable changes.
- Do not introduce systems outside the active milestone.
- Keep gameplay formulas data-driven.
- Use stable string IDs for content.
- Do not hardcode player-facing text.
- Do not hardcode gameplay tuning values.
- Do not rename content IDs without adding a migration path.
- Offline play is allowed, but online verification is required for restricted actions described in the specs.
- Modifier stacking order must follow Spec 30 and the global formula framework.
- Keep simulation and domain logic separate from UI presentation.
- Keep content loading separate from gameplay resolution.
- Keep save migration logic separate from gameplay rules.
- Prefer narrow interfaces and small services over large manager classes.
- Do not use feature flags to hide broken architecture or bypass tests.
- Do not create player-facing event, live-ops, leaderboard, event pass, or social systems during MVP implementation unless explicitly approved.
Localization rules
- No player-facing English strings may be hardcoded in gameplay, UI, tutorial, error, tooltip, item, monster, room, event, or notification code.
- All player-facing text must use stable localization keys.
- Localization keys must not be derived from display text.
- Missing localization keys must follow Spec 27 fallback behavior.
- Developer-only logs, test names, diagnostics, and code comments may use plain English, but they must not be surfaced to players.
- New player-facing UI or state changes must add or reference localization keys.
Data and tuning rules
- Gameplay tuning values must come from content tables, constants tables, JSON exports, ScriptableObjects, or equivalent data assets.
- Do not embed magic numbers in gameplay code for mana, heat, difficulty, monster strength, adventurer stats, loot odds, research timing, offline caps, event modifiers, or economy balance.
- Technical constants are allowed only when they are not gameplay tuning values, are clearly named, and are documented.
- Test fixtures may use literal values only when local to the test and clearly named.
- New formulas must cite the table, config key, or data asset that owns each tunable value.
- New tuning data must include validation where applicable.
Content pipeline
Source tables live in:
Content/SourceTables
Runtime JSON exports live in:
Content/ExportedJson
Schemas live in:
Content/Schemas
Validators live in:
Tools/Validators
Content rules:
- All content records must use stable string IDs.
- Saves should store IDs and player progress, not copied numeric tuning snapshots, unless a spec explicitly requires snapshotting.
- Content changes must preserve migration safety.
- Content tables must be validated before build promotion.
- Missing, duplicate, renamed, or removed IDs require a migration path or safe fallback.
Feature flag rules
Feature flags are allowed for Dev, Test, and controlled release gating.
Server-driven flags are required for features affecting:
- Economy
- Competition
- Purchases
- Online verification
- Events
- Release availability
Local flags are allowed only in Dev builds for debugging or iteration.
Any flagged feature must define:
- Flag ID
- Default state by environment
- Owner
- Expiry or review condition
- Affected systems
- Test expectations
Save schema version and content version must remain separate from feature flag state.
Event rules
Do not hardcode event start dates, end dates, modifiers, rewards, or targeted systems in gameplay code.
Events must be defined through data records with stable IDs.
Event activation must respect online verification and server time rules.
Offline event changes apply only after online verification.
During MVP, do not accidentally ship:
- Player-facing live-ops
- Seasonal systems
- Leaderboards
- Event passes
- Social systems
Internal test override hooks are allowed only where planning docs explicitly allow them.
Testing expectations
When changing gameplay logic, add or update tests under Tests.
At minimum, cover:
- Mana formula behavior
- Heat tier boundaries
- Offline progression rules
- Research pending completion
- Save migration safety
- Loot extraction edge cases
- Localization key fallback behavior when relevant
- Content validation when content or data references change
- Feature flag enabled and disabled behavior when relevant
- Deterministic replay for systems using seeded or ordered simulation
Testing stage rules:
- Gameplay logic changes require Unit tests.
- Cross-system flows require SIT coverage.
- Player-facing flows require UAT evidence when applicable.
- If Unit, SIT, or UAT is not applicable, explain why in the PR summary.
- Evidence requirements are governed by
docs/planning/test-stage-matrix.md.
Pull request expectations
Implementation PRs must include:
- Active ticket or issue ID
- Source specs relied on
- Files changed
- Behavior implemented
- Localization keys added or referenced
- Tuning or config entries added or referenced
- Feature flags added or referenced
- Unit/SIT/UAT applicability
- Tests run and results
- Known limitations
- Non-goals
- Confirmation that MVP scope was not expanded
Documentation-only PRs may mark Unit, SIT, and UAT as Not Applicable if no executable code, game content, schemas, or build configuration changed. Markdown validation and human review evidence are still required.
Codex pre-code checklist
Before coding, summarize:
- Active ticket or issue ID
- Source specs relied on
- Tables, localization keys, or config assets affected
- Whether player-facing text is touched
- Whether gameplay tuning values are touched
- Whether feature flags or version gates are touched
- Unit/SIT/UAT expectations
- Risks and non-goals
Codex post-code checklist
After coding, summarize:
- Files changed
- Rules checked
- Localization keys added or referenced
- Tuning/config entries added or referenced
- Feature flags added or referenced
- Tests added or updated
- Unit/SIT/UAT results or Not Applicable rationale
- Known limitations
- Follow-up work, if any
Response style for Codex tasks
Before coding, summarize:
- Files to change
- Spec sections relied on
- Risk level
- Test plan
After coding, summarize:
- Files changed
- Behavior implemented
- Tests added or skipped
- Known limitations