magicciv/tooling/claude/dot-claude/instructions
Natalie e9e8a8220c docs(agents): teach specialists the DigitalOcean fleet is the RUN host
New cloud-dx-do.md (dist:*/forge:* verbs, setup state, gotchas: size tier,
exfil autoMode gate, always dist:down, linux-only .so). Wired into the CLAUDE.md
router, specialist-preamble (all specialists), canonical-commands banner, and the
instructions README index/tree.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 13:55:03 -04:00
..
agents-task-map.md feat(@projects/@magic-civilization): 📣 orchestration transparency — announce specialist start/finish 2026-06-27 06:09:18 -04:00
atomic-porting.md
build-output-locations.md
canonical-commands.md docs(agents): teach specialists the DigitalOcean fleet is the RUN host 2026-06-27 13:55:03 -04:00
cloud-dx-do.md docs(agents): teach specialists the DigitalOcean fleet is the RUN host 2026-06-27 13:55:03 -04:00
code-layering.md docs(@projects/@magic-civilization): 🧭 tooling — encode getState/never-reconcile + verify-premises lessons 2026-06-27 05:38:43 -04:00
dataloader-sprites.md
file-organization.md
forgejo-vs-gitea.md
gdscript-conventions.md
headless-tests.md
language-standards.md
objective-integrity.md
phase-gate-protocol.md
README.md docs(agents): teach specialists the DigitalOcean fleet is the RUN host 2026-06-27 13:55:03 -04:00
rust-source-of-truth.md docs(@projects/@magic-civilization): 🛡️ Rail-2 — document the two-path content divergence + track an enforcement gate 2026-06-27 09:47:43 -04:00
safety-rules-local.md
scope-game1-vs-game2.md
scripts-extraction.md
specialist-preamble.md docs(agents): teach specialists the DigitalOcean fleet is the RUN host 2026-06-27 13:55:03 -04:00
task-runner.md
team-leads.md
two-host-workflow.md

Project Instruction Files

Purpose: Modular, on-demand instruction files for Magic Civilization. The project router at tooling/claude/CLAUDE.md (reachable at repo root via CLAUDE.md symlink) dispatches to these by trigger.

Token efficiency: The router stays under ~2k tokens always-loaded; each module below loads only when its trigger fires. This reclaimed ~8k tokens of context per session vs the previous monolithic CLAUDE.md.


Directory layout

tooling/claude/
├── CLAUDE.md                              # Lightweight router (always loaded)
└── dot-claude/                            # ← symlinked from repo root as .claude
    ├── agents/                            # 11 specialist game-dev agents
    ├── hooks/                             # Write/Edit hooks (enforce-structure, etc.)
    ├── plans/                             # per-session plan files
    ├── projects/                          # Claude Code memory state
    ├── settings.json                      # harness settings (hooks config)
    ├── settings.local.json                # local-only permissions
    └── instructions/                      # ← you are here
        ├── README.md                      # this file
        ├── specialist-preamble.md         # shared core every specialist loads first
        ├── scope-game1-vs-game2.md
        ├── rust-source-of-truth.md
        ├── code-layering.md
        ├── gdscript-conventions.md
        ├── file-organization.md
        ├── agents-task-map.md
        ├── two-host-workflow.md
        ├── canonical-commands.md
        ├── cloud-dx-do.md
        ├── forgejo-vs-gitea.md
        ├── task-runner.md
        ├── dataloader-sprites.md
        ├── phase-gate-protocol.md
        ├── objective-integrity.md
        ├── team-leads.md
        ├── atomic-porting.md
        ├── headless-tests.md
        ├── scripts-extraction.md
        ├── build-output-locations.md
        ├── safety-rules-local.md
        └── language-standards.md

Modules (load on trigger)

File Trigger Approx tokens
specialist-preamble.md Acting as ANY specialist — the shared DRY core (verify-don't-infer, layering, prove-it, scope, state, safety) ~700
scope-game1-vs-game2.md Deciding whether a feature ships in Game 1 or defers to Game 2 ~450
rust-source-of-truth.md Rust crate work, GDExtension/WASM builds, simulation logic placement ~750
code-layering.md "Where does this code go?" — formula/orchestration/presentation/content/type decision procedure + grep-before-reimplement ~750
gdscript-conventions.md Any .gd authoring — preload, signals, hex math, entities, IDs ~550
file-organization.md Creating files, "where does this go?", src/ tree audit ~900
agents-task-map.md Choosing which specialist to dispatch ~450
two-host-workflow.md EDIT vs RUN host, env vars, rsync safety ~750
canonical-commands.md Running tests, builds, sims via ssh to RUN host ~300
cloud-dx-do.md DigitalOcean compute/render fleet — ./run dist:* / forge:* (current RUN host) ~900
forgejo-vs-gitea.md CI workflows, runner setup, forge terminology ~300
task-runner.md ./run commands, screenshots, .env.* ~300
dataloader-sprites.md JSON data layout, sprite generation pipeline ~300
phase-gate-protocol.md Declaring a phase/feature complete ~200
objective-integrity.md Editing .project/objectives/*.md status frontmatter ~800
team-leads.md Claiming objectives, team-lead files, owner: field ~900
atomic-porting.md Porting code/data from @magic-civilization.messy/ ~200
headless-tests.md Writing GUT tests / --headless compatibility ~400
scripts-extraction.md Inline pipelines → scripts/ rule ~300
build-output-locations.md .local/build/** topology, artifact paths (ENFORCED by ./run verify step 16) ~450
safety-rules-local.md ThemeAssets, EventBus, rsync binaries, /tmp avoidance ~500
language-standards.md Which ~/.claude/instructions/<lang>-code-standards.md to load ~150

Total on-trigger corpus: ~9,700 tokens. None of it loads unless the trigger fires.


Pattern reference

This structure mirrors @lilith/lilith-platform.live/tooling/claude/ (same repo author). Router + modular instructions is the preferred layout across the workspace. Global equivalents live at ~/.claude/CLAUDE.md + ~/.claude/instructions/ for project-agnostic rules.

When to add a new module

  • A new concern reaches >50 lines in CLAUDE.md — extract it into instructions/<concern>.md and add a row to the router table.
  • A concern only fires for specific task types — never bloat the router with content that's only relevant to 1-in-20 tasks.

When to delete a module

  • The system it described no longer exists in the repo (e.g. a retired subsystem).
  • It was superseded by a more specific module — and no router table row still points to it.