worktree
Skill2 starsChanged 2 months agoMITView on GitHub
Create or reuse an isolated worktree for one mutating task, protect dirty or shared checkouts, and hand off safe cleanup requirements. Use before any non-trivial code change that may run in parallel with other work.
59 other projects use a version of this.
Adopted by
Most recently taken up by
- venhdev/skillstheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
- kortix-ai/sunatheir own version, first seen Nov 8, 2026
- tardigrde/obsidian-agentic-chattheir own version, first seen Nov 8, 2026
- kortix-ai/CompanyOStheir own version, first seen Nov 8, 2026
Used with
Projects with it also use worktree-merge, resolve-conflicts and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
leessjuSkillworktree-merge
Squash-merge the current worktree branch into the main branch (or a specified target). Analyzes git history and source code to craft a comprehensive commit message.
Also in 3 projects that use this
ralphkraussSkillresolve-conflicts
Resolve git merge conflicts or re-apply changes from a stale branch onto current main. Use when user says "resolve conflicts", "merge conflicts", "rebase branch", "branch is behind", "re-apply changes", "port branch", or a branch is too far behind main to merge cleanly.
Also in 5 projects that use this
SentrySkille2e
Run E2E tests for Sentry JavaScript SDK test applications
Also in 5 projects that use this
hdcolaSkillpr-comments
Fetch unresolved review comments from a GitHub PR or mark comments as resolved. Use this when managing PR review feedback, checking pending comments, or marking review threads as resolved. Supports GitHub URLs or explicit owner/repo/PR-number from anywhere, or PR number auto-detection from within a git repository.
Also in 3 projects that use this
Google CloudSkillcontributing
Guides the developer workflow for contributing to Race Condition. Use when setting up pre-commit hooks, running tests before a PR, understanding code style requirements, or preparing a contribution.
Also in 3 projects that use this
PydanticSkillcoverage
Fetch coverage diff from Codecov for the current branch or a specific PR. Shows uncovered lines, patch coverage, and overall coverage change.
Also in 3 projects that use this
Other versions59 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 59
- Significant-Gravitas/AutoGPT★ 188ksame name
- kortix-ai/suna★ 21ksame name
- kortix-ai/CompanyOS★ 21ksame name
- gitkraken/vscode-gitlens★ 10ksame name
- Zipstack/unstract★ 7.4ksame name
- mistralai/mistral-vibe★ 5.3ksame name
- nubjs/nub★ 4.4ksame name
- raine/workmux★ 3ksame name
- astashov/liftosaur★ 775same name
- nudgebee/nudgebee★ 520same name
49 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- access-checkSkill
- babysit-prsSkill
- browser-proofSkill
- bugfixSkill
- bug-reproSkill
- cleanupSkill
- contextSkill
- dev-flowSkill
- docs-managerSkill
- hot-reloadSkill
- jira-managerSkill
- polishSkill
- pr-managerSkill
- release-proofSkill
- status-reportSkill
- sync-projectSkill
- watch-loopSkill
- whatsapp-meSkill
- workflowSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 47 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Before creating or reusing a worktree, check:
- Distinctive: line 33
Never start mutable work in a dirty shared checkout.
- Distinctive: line 34
Never reuse main, master, or another shared base checkout for task edits.
- Distinctive: line 35
If the canonical base checkout is dirty, find another clean checkout that owns the same base branch and fast-forward that one instead.
- Distinctive: line 37
If no clean base exists, stop and report that the task needs a clean base before code changes begin.
- Distinctive: line 39
Do not guess branch ownership from folder names alone.
- Distinctive: line 46
Create one task branch from that base.
- Distinctive: line 47
Create one worktree for that branch.
- Distinctive: line 49
Verify that the new worktree is clean before implementation starts.
- Distinctive: line 60
no other active task claims the same mutable surface
“Common” is measured: kept by at least 6 in 10 of the 47 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Worktree
This skill protects the repo from the easiest parallel-work failure: two mutating threads touching the same checkout.
What This Skill Guarantees
Each mutable task gets:
- one exact base
- one branch
- one worktree
- one ownership record
- one cleanup handoff
Preflight
Before creating or reusing a worktree, check:
git status --shortgit worktree list --porcelain- the branch that currently owns the intended base
- whether the main or default checkout is dirty
- whether another active task already owns the target branch or worktree
Rules
- Never start mutable work in a dirty shared checkout.
- Never reuse
main,master, or another shared base checkout for task edits. - If the canonical base checkout is dirty, find another clean checkout that owns the same base branch and fast-forward that one instead.
- If no clean base exists, stop and report that the task needs a clean base before code changes begin.
- Do not guess branch ownership from folder names alone. Check git state.
Workflow
- Resolve the exact base branch for the task.
- Find a clean checkout that owns that base.
- Fast-forward the clean base checkout.
- Create one task branch from that base.
- Create one worktree for that branch.
- Record the worktree path, branch name, base SHA, and owner task label.
- Verify that the new worktree is clean before implementation starts.
- Hand off the cleanup requirements.
Verification
A new worktree is ready only when all of these are true:
- the base SHA is known
- the branch points at that base
- the worktree is attached to that branch
git status --shortis clean inside the worktree- no other active task claims the same mutable surface
Cleanup Handoff
This skill does not remove the worktree automatically. It hands cleanup to
cleanup, with these checks attached:
- was the branch merged or intentionally preserved?
- is the worktree still dirty?
- does any slot, browser session, or loop still depend on it?
Output Contract
WORKTREE | task=<label> | branch=<name> | path=<path>
BASE | branch=<base-branch> | sha=<base-sha>
OWNER | status=<new|reused> | mutable_surface=<summary>
READY | yes|no
CLEANUP HANDOFF | cleanupDoes 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.

