worktrees
Skill3 starsChanged 4 months agoMITView on GitHub
Use when starting feature work that needs isolation from current workspace or before executing implementation plans — ensures an isolated workspace exists via native tools or git worktree fallback
- Installs packages
12 other projects use a version of this.
Adopted by
Most recently taken up by
- mifunedev/skillstheir own version, first seen Oct 3, 2026
- delorenj/skillstheir own version, first seen Oct 2, 2026
- domengabrovsek/agent-configtheir own version, first seen Oct 2, 2026
- akitaonrails/my-skillstheir own version, first seen Sep 17, 2026
- divanc/skillstheir own version, first seen Aug 5, 2026
- theyoungastronauts/polaristheir own version, first seen Aug 3, 2026
Used with
Projects with it also use reflect.
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.
Microsoft AzureSkillreflect
Learning capture system that extracts HIGH/MED/LOW confidence patterns from conversations to prevent repeating mistakes. Use after user corrections ("no", "wrong"), praise ("perfect", "exactly"), or when discovering edge cases. Complements .squad/agents/{agent}/history.md and .squad/decisions.md.
Also in 3 projects that use this
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- akitaonrails/my-skills★ 205same name
- maragudk/skills★ 49same name
- nilecui/SkillsBase★ 27same name
- domengabrovsek/agent-config★ 17same name
- delorenj/skills★ 15same name
- theyoungastronauts/polaris★ 4same name
- divanc/skills★ 3same name
- Joshua-Palamuttam/workbench-template★ 3same name
- darinh/copilot-tools★ 1same name
- hbollon/opencode-config★ 1same name
2 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 repository27 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
- imlazySkill
- imlazy-api-designSkill
- imlazy-backendSkill
- imlazy-bootstrapSkill
- brainstormingSkill
- code-reviewSkill
- debuggingSkill
- imlazy-evalSkill
- imlazy-finish-branchSkill
- imlazy-frontendSkill
- learnSkill
- parallel-agentsSkill
- imlazy-planningSkill
- imlazy-receive-reviewSkill
- imlazy-request-reviewSkill
- imlazy-routerSkill
- imlazy-securitySkill
- imlazy-standardsSkill
- imlazy-strategic-saveSkill
- imlazy-subagentsSkill
- tddSkill
- imlazy-verifySkill
- imlazy-wordpressSkill
- imlazy-write-plansSkill
- imlazy-write-skillsSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Ensure work happens in an isolated workspace.
- Distinctive: line 28
If that returns a path, you are in a submodule — treat as normal repo.
- Very specific: line 40
Check if your harness provides a native worktree tool (names like EnterWorktree, WorktreeCreate, /worktree, or a --worktree flag).
- Very specific: line 48
Default: .worktrees/ at project root
- Very specific: line 54
If NOT ignored: add to .gitignore, commit, then proceed.
- Distinctive: line 63
If git worktree add fails with a permission error (sandbox denial), tell the user and work in the current directory instead.
- Distinctive: line 78
Run the project test suite.
- Distinctive: line 96
Create a worktree when Step 0 detects existing isolation
- Distinctive: line 97
Use git worktree add when you have a native worktree tool
- Distinctive: line 98
Create project-local worktree without verifying it is gitignored
“Common” is measured: kept by at least 6 in 10 of the 12 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
worktrees
Overview
Ensure work happens in an isolated workspace. Prefer your platform's native worktree tools. Fall back to manual git worktrees only when no native tool is available.
Core principle: Detect existing isolation first. Then use native tools. Then fall back to git. Never fight the harness.
Step 0: Detect existing isolation
Before creating anything, check if you are already in an isolated workspace.
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)Submodule guard: GIT_DIR != GIT_COMMON is also true inside git submodules. Verify you're not in one:
git rev-parse --show-superproject-working-tree 2>/dev/nullIf that returns a path, you are in a submodule — treat as normal repo.
If GIT_DIR != GIT_COMMON (and not a submodule): Already in a linked worktree. Skip to Step 3 (Project Setup). Do NOT create another worktree.
If GIT_DIR == GIT_COMMON: Normal repo checkout. Ask for consent before creating a worktree: "Would you like me to set up an isolated worktree? It protects your current branch from changes." If declined, work in place.
Step 1: Create isolated workspace
Try in this order:
1a. Native worktree tools (preferred)
Check if your harness provides a native worktree tool (names like EnterWorktree, WorktreeCreate, /worktree, or a --worktree flag). If yes, use it and skip to Step 3. Native tools handle directory placement, branch creation, and cleanup automatically.
1b. Git worktree fallback (only if 1a does not apply)
Directory selection (priority order):
- Declared user preference in your instructions
- Existing project-local
.worktrees/orworktrees/directory - Existing global
~/.config/imlazy/worktrees/<project>/ - Default:
.worktrees/at project root
Safety verification (project-local directories only):
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/nullIf NOT ignored: add to .gitignore, commit, then proceed.
Create the worktree:
project=$(basename "$(git rev-parse --show-toplevel)")
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"If git worktree add fails with a permission error (sandbox denial), tell the user and work in the current directory instead.
Step 3: Project setup
Auto-detect and run appropriate setup:
if [ -f package.json ]; then npm install; fi
if [ -f Cargo.toml ]; then cargo build; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
if [ -f go.mod ]; then go mod download; fiStep 4: Verify clean baseline
Run the project test suite. If tests fail, report failures and ask whether to proceed or investigate. If tests pass, report ready.
Quick reference
| Situation | Action |
| Already in linked worktree | Skip creation (Step 0) |
| In a submodule | Treat as normal repo |
| Native worktree tool available | Use it (Step 1a) |
| No native tool | Git worktree fallback (Step 1b) |
.worktrees/ exists | Use it (verify ignored) |
| Neither exists | Default .worktrees/ at project root |
| Directory not ignored | Add to .gitignore + commit |
| Permission error on create | Work in place, tell user |
| Tests fail on baseline | Report + ask before proceeding |
Red flags — never
- Create a worktree when Step 0 detects existing isolation
- Use
git worktree addwhen you have a native worktree tool - Create project-local worktree without verifying it is gitignored
- Skip baseline test verification
- Proceed with failing tests without asking
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.

