worktree-isolation
Skill2 starsChanged 6 months agoMITView on GitHub
Git worktree branch isolation for feature development and bugfixes — branch naming, worktree setup, branch verification, and safe cleanup. Use when developing features or fixing bugs in isolated branches via git worktree.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- sentimony/skillstheir own version, first seen Nov 15, 2026
- niksavis/basiclytheir own version, first seen Nov 15, 2026
- mikejhill/agent-skillstheir own version, first seen Nov 15, 2026
- 0SxD/agent-skills-plugin-v01their own version, first seen Nov 15, 2026
- niksavis/handilytheir own version, first seen Nov 8, 2026
- ccoalm/ccl-skillstheir own version, first seen Nov 8, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- sentimony/skills★ 8same name
- ccoalm/ccl-skills★ 6same name
- niksavis/basicly★ 2same name
- niksavis/handily★ 2same name
- cill-i-am/skills★ 1same name
- orkait/hyperstack★ 1same name
- 0SxD/agent-skills-plugin-v01★ 0same name
- aditya-deokar/software-factory★ 0same name
- mikejhill/agent-skills★ 0same name
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 repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-skillsSkill
- analyze-localSkill
- analyze-prodSkill
- analyzeSkill
- architectureSkill
- asset-validationSkill
- blog-postSkill
- bugfixSkill
- cloud-platformsSkill
- code-reviewSkill
- content-creationSkill
- context-engineeringSkill
- create-prSkill
- deployment-proceduresSkill
- deploy-productionSkill
- deploy-stagingSkill
- docsSkill
- feature-devSkill
- geo-writerSkill
- humanizerSkill
- infra-changeSkill
- marketing-operationsSkill
- marketingSkill
- ml-pipelineSkill
- planSkill
- pre-commitSkill
- productSkill
- project-initSkill
- prompt-engineeringSkill
- qaSkill
- releaseSkill
- run-testsSkill
- security-scanSkill
- seo-reviewSkill
- social-media-managerSkill
- test-localSkill
- test-strategySkill
- ui-ux-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 12 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 26
Keep the description portion under 40 characters
- Very specific: line 27
Never use generic names like dev, temp, wip, or my-branch
- Distinctive: line 49
If the branch exists locally — use it
- Distinctive: line 50
If the branch exists only on remote — fetch and track it
- Distinctive: line 51
If the branch does not exist anywhere — create it from the current main branch
- Distinctive: line 71
After entering the worktree, always confirm:
- Distinctive: line 83
Before every commit, verify the current branch:
- Distinctive: line 93
Never switch branches inside the worktree.
- Distinctive: line 97
Commit only to the designated branch
- Distinctive: line 98
Follow the project's commit message conventions
- Distinctive: line 99
Do not merge main into the feature branch inside the worktree — rebase if needed
- Distinctive: line 103
After the feature is merged or the work is complete:
- Distinctive: line 113
Do not delete the worktree while it has uncommitted changes.
“Common” is measured: kept by at least 6 in 10 of the 8 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 Isolation
Procedure for isolating feature and bugfix work on dedicated branches using git worktree. Prevents accidental commits to the wrong branch and keeps the main working tree clean.
Branch Naming
Derive the branch name from the task context. Use the git-conventions branch naming format:
| Source | Branch name |
| Bug ticket with ID | fix/<ID>-<short-description> — e.g. fix/BUG-044-null-payment-response |
| Feature PRD | feature/<feature-name> — use the feature folder name or the title from the PRD, kebab-cased |
| Feature folder | feature/<folder-name> — match the directory that holds the feature spec |
| Hotfix | hotfix/<ID>-<short-description> |
| Refactor | refactor/<short-description> |
Rules:
- Always lowercase, hyphen-separated
- Include the ticket/bug ID when one exists
- Keep the description portion under 40 characters
- Never use generic names like
dev,temp,wip, ormy-branch
Setup Procedure
Execute these steps in order before writing any code:
1. Determine Branch Name
BRANCH_NAME = derive from task context (see table above)2. Check if Branch Already Exists
# Check local branches
git branch --list "$BRANCH_NAME"
# Check remote branches
git branch -r --list "origin/$BRANCH_NAME"- If the branch exists locally — use it
- If the branch exists only on remote — fetch and track it
- If the branch does not exist anywhere — create it from the current main branch
3. Create or Enter the Worktree
# If branch does not exist — create worktree with new branch
git worktree add ../worktree-$BRANCH_NAME -b "$BRANCH_NAME"
# If branch already exists locally
git worktree add ../worktree-$BRANCH_NAME "$BRANCH_NAME"
# If branch exists only on remote
git fetch origin "$BRANCH_NAME"
git worktree add ../worktree-$BRANCH_NAME "$BRANCH_NAME"The worktree path sits alongside the main repo directory. Adjust the path if the environment requires a different location.
4. Verify Branch
After entering the worktree, always confirm:
git branch --show-currentHard rule: the output MUST match $BRANCH_NAME. If it does not — stop and fix before writing any code. Do not proceed on the wrong branch.
During Development
Branch Guard
Before every commit, verify the current branch:
current=$(git branch --show-current)
if [ "$current" != "$BRANCH_NAME" ]; then
echo "ERROR: on branch '$current', expected '$BRANCH_NAME'" >&2
exit 1
fiNever switch branches inside the worktree. The worktree is locked to its branch. If you need a different branch, create a separate worktree.
Commit Rules
- Commit only to the designated branch
- Follow the project's commit message conventions
- Do not merge main into the feature branch inside the worktree — rebase if needed
Cleanup
After the feature is merged or the work is complete:
# From the main working tree (not from inside the worktree)
git worktree remove ../worktree-$BRANCH_NAME
# If the branch was merged, delete it
git branch -d "$BRANCH_NAME"Do not delete the worktree while it has uncommitted changes. Commit or stash first.
Error Recovery
| Problem | Action |
| Worktree path already exists | Check if it belongs to this branch. If yes, reuse. If stale, run git worktree prune then retry |
| Branch exists but worktree does not | Create worktree pointing to the existing branch |
| Detached HEAD in worktree | Run git checkout "$BRANCH_NAME" inside the worktree |
| Worktree locked | Run git worktree unlock ../worktree-$BRANCH_NAME then retry |
Integration
- Used by:
feature-devskill,bugfixskill - Follows:
git-conventionsrule (branch naming, commit messages)
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.

