gbdraw-worktree
Skill162 starsChanged 15 days agoMITView on GitHub
Set up, use, and remove a gbdraw git worktree for one task - create it from origin/dev, keep temporary files and logs outside the repository, run tests against the worktree's own package without reinstalling, push finished branches, and clean up after the PR merges. Use when starting work that needs its own branch or worktree, and when finishing it.
- Installs packages
- Commits and pushes
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Keep logs, probes, screenshots, and virtual environments out of .worktrees/.
- Distinctive: line 28
Do not run git stash. Every worktree of the clone shares one stash list.
- Very specific: line 32
Do not run pip install from a worktree, editable or not.
- Distinctive: line 41
Use the port range assigned to the task for local Web servers and Playwright, so parallel tasks do not collide.
- Very specific: line 43
Run long suites through .claude/scripts/run_quiet.py so the full log stays in a file.
- Very specific: line 51
After the PR merges (GitHub deletes the remote branch), run git status in the worktree, then git worktree remove <path> and git branch -D …
- Distinctive: line 53
Remove only worktrees you created.
- Distinctive: line 54
When the task ends, delete its remaining worktrees, local branches, virtual environments, caches, and backups.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
gbdraw worktree lifecycle
This skill covers mechanics only. It does not decide what the task includes.
The concrete paths for this machine come from the local instructions
(CLAUDE.local.md or ~/.claude/CLAUDE.md). The steps below name them:
$WORK_ROOT: the repository clone that holds.worktrees/.$TASK_DIR: the task's folder outside the repository, for logs, evidence, scripts, screenshots, andSTATE.md.
Create
git -C "$WORK_ROOT" fetch origin
git -C "$WORK_ROOT" worktree add --detach ".worktrees/<name>" origin/dev
cd "$WORK_ROOT/.worktrees/<name>"
git switch --no-track -c <prefix>/<topic> origin/dev # fix, feat, refactor, docs, test
export TMPDIR="$TASK_DIR/tmp"; mkdir -p "$TMPDIR"- Keep logs, probes, screenshots, and virtual environments out of
.worktrees/. - Do not run
git stash. Every worktree of the clone shares one stash list.
Run code from the worktree
- Do not run
pip installfrom a worktree, editable or not. The Python environment is shared by every session, and an editable install that points at a worktree breaks once the worktree is removed. python -m pytestrun from the worktree root imports the worktree'sgbdraw. For other Python entry points, setPYTHONPATH="$PWD".- Tests that call the
gbdrawcommand need the worktree's CLI first onPATH: a shim script namedgbdrawthat runsPYTHONPATH="$GBDRAW_SRC" python -c 'from gbdraw.cli import main; main()' "$@", withGBDRAW_SRCset to the worktree root. - Use the port range assigned to the task for local Web servers and Playwright, so parallel tasks do not collide.
- Run long suites through
.claude/scripts/run_quiet.pyso the full log stays in a file.
Push and finish
- Push each verified commit at once:
git push -u origin <branch>; after a rebase,--force-with-lease. A push to a work branch starts no CI and is the off-machine backup. "Do not open the PR yet" never means "do not push". - After the PR merges (GitHub deletes the remote branch), run
git statusin the worktree, thengit worktree remove <path>andgit branch -D <branch>. Remove only worktrees you created; ask the owner of any other one first. - When the task ends, delete its remaining worktrees, local branches, virtual environments, caches, and backups. Keep the report and the handoff files.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- avoid-ai-writingSkill
- gbdraw-campaignSkill
- gbdraw-promotionSkill
- gbdraw-ship-prSkill
- gbdraw-videoSkill
- love-me-love-my-docsSkill
- translate-web-uiSkill
- web-gallery-screenshot-maintenanceSkill
- write-clear-pull-requestSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

