From 52c487265043ca4575276700ad403d01747bdfe6 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sat, 14 Feb 2026 15:15:45 +0100 Subject: [PATCH] chore(config): add worktree boundary rules to CLAUDE.md and plan-sprint skill Agents were navigating outside the git root into sibling worktrees. Added explicit boundary rules: all work stays within the git root unless directly instructed otherwise. Updated plan-sprint to enforce worktree-relative paths in generated briefings. Co-Authored-By: Claude Opus 4.6 --- .claude/skills/plan-sprint/SKILL.md | 12 ++++++++++-- CLAUDE.md | 12 ++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.claude/skills/plan-sprint/SKILL.md b/.claude/skills/plan-sprint/SKILL.md index 1597a75f6..2c2afdf85 100644 --- a/.claude/skills/plan-sprint/SKILL.md +++ b/.claude/skills/plan-sprint/SKILL.md @@ -124,10 +124,18 @@ Create `docs/sprints/sprint-N/` and write one file per team. Read the template at `references/briefing-template.md` in this skill directory for the exact file structure. +**IMPORTANT — worktree-relative paths:** This project uses git worktrees. +Each team branch is checked out in its own worktree, and each worktree +contains the full repo (`server/`, `client/`, `docs/`, etc.). All file +paths in briefings must be relative to the worktree/git root. Example: +`server/src/bridge/types.rs`, not `/absolute/path/to/server/src/...` or +paths that navigate outside the git root (`../sibling-worktree/...`). +Agents must stay within the git root they are running in. + Key requirements per file: - **server.md**: Carry-overs, new tickets, dependency chain, key decisions, notes - referencing existing Rust modules by path -- **client.md**: Same structure, notes referencing existing GDScript files by path + referencing existing Rust modules by path from worktree root (e.g. `server/src/simulation/movement.rs`) +- **client.md**: Same structure, notes referencing existing GDScript files by path from worktree root (e.g. `client/scripts/rendering/fog.gd`) - **copy.md**: In-game text tasks — dialogue, UI copy, tooltips, flavor text, lore - **audio.md**: Sound design, music, audio integration tasks - **visual.md**: Art direction, asset creation, visual consistency tasks diff --git a/CLAUDE.md b/CLAUDE.md index 73fbf6951..364a9866e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -50,6 +50,18 @@ See [docs/DEVOPS.md](docs/DEVOPS.md) for build, test, lint, and CI procedures. A ## Agent Instructions +### Worktree boundaries + +This project uses **git worktrees** in a shared parent directory (`settled-reach/`). Each team branch (`server`, `client`, `copy`, `audio`, `visual`, `ci`) is checked out in its own worktree under that parent. The parent directory also contains shared resources like the ticketing database. + +Each worktree contains the full repository: `server/` (Rust backend), `client/` (Godot client), `docs/`, `decisions/`, etc. The worktree root IS the git root — use `git rev-parse --show-toplevel` if in doubt. + +Unless there is a direct instruction or a functional need (e.g. accessing the shared database in the parent directory), **all work must remain within the scope of the git root Claude is running in.** + +- All file paths are relative to the worktree/git root (e.g. `server/src/bridge/types.rs`, `client/scripts/rendering/fog.gd`). +- Do not navigate to or access sibling worktrees in the parent directory (`../client/`, `../copy/`, etc.) unless explicitly instructed. +- Do not navigate above the git root unless explicitly instructed. + ### Database The ticketing database (`settledreach.db`) lives in the **parent directory** shared across all worktrees — it is not tracked in git. A backup is committed to `docs/backups/settledreach.db.backup` via main only.