worktree-discipline
Worktree Discipline
Section titled “Worktree Discipline”The Iron Law
Section titled “The Iron Law”ALL FEATURE WORK USES DILLOTREE. NO EXCEPTIONS.The armadillo repo dogfoods its own tooling. Every feature branch, parallel agent, and isolated workspace MUST go through worktree.
What’s Blocked
Section titled “What’s Blocked”Raw branch creation commands are intercepted by enforce-worktree.sh hook:
| Blocked Command | Use Instead |
|---|---|
git checkout -b feat/x | worktree create feat/x |
git switch -c feat/x | worktree create feat/x |
git switch --create feat/x | worktree create feat/x |
git branch feat/x | worktree create feat/x |
What’s Allowed
Section titled “What’s Allowed”These git operations are NOT blocked — they don’t create branches:
git checkout main— switching to existing branchgit switch main— switching to existing branchgit branch -d feat/x— deleting a branchgit branch --list— listing branchesgit branch -D feat/x— force-deleting a branchgit branch --merged— listing merged branches
Bypass
Section titled “Bypass”Dillotree itself sets /tmp/.armadillo-worktree-bypass when it needs to run internal git operations. The hook consumes (deletes) the flag after one use.
- Dogfooding — we build worktree, we use worktree
- Isolation — worktrees prevent parallel agents from clobbering each other
- Consistency — one workflow for branch creation, no ad-hoc git commands
Integration
Section titled “Integration”| Component | Role |
|---|---|
enforce-worktree.sh | PreToolUse hook — intercepts and blocks |
worktree skill | The approved way to create branches |
dispatching-parallel-agents | Must use worktree launch for all agents |
git-workflow rule | Documents mandatory worktree usage |