worktree-per-agentlisted
Install: claude install-skill JakeSelby/agent-harness
# One worktree per agent
The shared checkout belongs to the human. An agent that edits it directly races every other
agent and every uncommitted human change. So: branch a worktree off the default branch, work
there, land the result through the repo's normal path, remove the worktree.
## Create
```bash
REPO=$(git rev-parse --show-toplevel)
NAME=<task-slug>
DEST=$(harness worktree create "$NAME" "$REPO")
cd "$DEST"
```
The dedicated root keeps temporary task checkouts separate from permanent clones. It defaults to
`~/worktrees/<repo>/<task>`; `HARNESS_WORKTREE_ROOT` may replace `~/worktrees`. The helper fetches
`origin` and branches from `origin/main`, so it starts from what is actually merged. If the repo's
instructions name a different base, pass `--base`; if they name a different location, follow them.
Never create a task worktree as a sibling under the directory holding permanent repositories.
## Work
- Install dependencies in the worktree if the repo needs them per checkout; do not assume the
shared checkout's `node_modules` or virtualenv is reachable.
- Run the repo's quality gate in the worktree before pushing, per `verification.md`.
- Never `cd` back into the shared checkout to run something "quickly".
## Land
Push the branch and open a PR, or push to `main` if the repo's instructions allow it. Then:
```bash
harness worktree remove "$NAME" "$REPO" --merged
```
`--merged` deletes the local branch as well, and only once `gh` reports a merged pull request
whos