worktree-agent

Featured

Mandatory rules for agents in git worktree isolation.

AI & Automation 425 stars 46 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
88
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Worktree Agent Rules Mandatory rules for any agent dispatched with `isolation: "worktree"`. ## Rule 1: Verify Your Working Directory On start, run `pwd`. Your path MUST contain `.claude/worktrees/`. If your CWD is the main repo path, **STOP** and report the error. ## Rule 2: Create Feature Branch First ```bash git checkout -b <branch-name> ``` Never commit on the default `worktree-agent-*` branch. Create your feature branch FIRST. If `git checkout -b <branch-name>` fails with "a branch named X already exists": ```bash # Option A: the branch has no commits beyond main — safe to reset and reuse git branch -D <branch-name> git checkout -b <branch-name> # Option B: the branch is checked out in another active worktree — use a unique name git checkout -b <branch-name>-2 # or append timestamp: $(date +%s) ``` If `git checkout -b <branch-name>` fails with "X is already used by worktree at Y": ```bash # Branch is live in another worktree — use a unique suffix git checkout -b <branch-name>-$(date +%s) ``` To update a branch held by another worktree (e.g. an existing PR branch): work detached from `origin/<branch>` and push with `git push origin HEAD:<branch>`. `gh pr merge`'s post-merge local-checkout errors are harmless. ## Rule 3: Use Worktree-Relative Paths Never hardcode absolute paths from the main repo. Use `$(git rev-parse --show-toplevel)/path`. **Exception**: Reading gitignored ADR files requires the main repo absolute path. ## Rule 4: Ignore Auto-Plan Hooks...

Details

Author
notque
Repository
notque/vexjoy-agent
Created
6 months ago
Last Updated
yesterday
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category