docs: add Global LLM Worktree Rule to operating rules (#272)

Require mutations only from branches/ worktrees after proving project
root, cwd, branch, stable main-checkout branch, and session worktree
path. Surface in portable skill, runbooks, wiki, operator guide, and
start-issue template.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
2026-07-06 14:09:44 -04:00
co-authored by Claude Opus 4.8
parent 7a28d09b5d
commit 216fa5cf46
8 changed files with 87 additions and 4 deletions
+13
View File
@@ -3473,6 +3473,16 @@ _GUIDE_RULES = {
"'work already claimed'). Never create a parallel branch/PR unless "
"the old branch is proven abandoned and takeover is recorded. "
"gitea_lock_issue is the fail-closed author lease gate."),
"global_worktree": (
"Main checkout is a stable control checkout on master/main/dev only. "
"All LLM task work happens under branches/. Before any mutation, prove "
"project root, cwd, branch, main-checkout stable branch, and "
"session-owned branches/ worktree path. If cwd is not under "
"branches/, stop — no edit/create/delete/format/test-write/commit/"
"merge/rebase/checkout/cleanup, with no exceptions (docs, tests, "
"small fixes, review fixes, conflicts, emergencies). Main checkout: "
"read-only inspect, fetch, create worktrees, post-merge stable "
"update, explicit repair only."),
}
_COMMON_WORKFLOWS = [
@@ -3481,6 +3491,9 @@ _COMMON_WORKFLOWS = [
"work selection: acquire or verify a work lease before any issue/PR work "
"(open PRs, linked PRs, branches, worktrees, dirty worktrees, leases, "
"merged completion); stop if another session owns the lease.",
"global worktree: main checkout on master/main/dev only; mutate only "
"from a branches/ worktree after proving root, cwd, branch, stable "
"main-checkout branch, and session worktree path.",
"issue authoring: verify identity, create/claim the issue, keep scope "
"explicit (remote/org/repo).",
"implementation: claim issue, branch from fresh master, implement only "