worktree-discipline
Installation
SKILL.md
worktree-discipline
One global hook, every repo on the machine, no duplication. Companion to worktree-devproxy (which provides the wt new <branch> remedy the hook points at).
The policy
| Who | Where | Result |
|---|---|---|
| anyone | main / master |
blocked |
agent (CLAUDECODE=1) |
any branch in the main checkout | blocked — work in a worktree |
| agent | linked worktree, feature branch | allowed |
| human | feature branch in the main checkout | allowed |
| human | ALLOW_MAIN_COMMIT=1 git commit or --no-verify |
escape hatch |
Scope is automatic: the guard only fires in repos carrying a committed .envrc with export DEV_HOST= — the marker every worktree-devproxy onboarded repo already has. Other repos on the machine are untouched (the hook silently delegates), and every future onboarded repo is covered with no extra step.