hbollon/opencode-config/worktrees
- community
Checking that the SKILL.md file is still in the repository.
Manage Git worktrees as OMO safe isolated coding lanes for complex, risky, or parallel work.
Install
npx vskill@latest install hbollon/opencode-config/worktreesSKILL.md
Worktrees Orchestration Protocol
The worktrees skill provides an opinionated, safe orchestration protocol for managing Git worktrees as isolated coding lanes. Its value is giving the Orchestrator a consistent OMO workflow for parallel agents, risky experiments, integration review, and cleanup.
Core Contract
This is an orchestrator-only workflow. Other specialists such as @fixer or @designer can be assigned tasks inside a worktree lane, but the Orchestrator owns lane planning, branch/path selection, file ownership, delegation, diff validation, integration, and cleanup.
All worktrees reside under the default path:
Do not create worktrees as sibling directories of the main repository.
State Tracking (.slim/worktrees.json)
Use the optional local metadata manifest .slim/worktrees.json to maintain structural tracking:
If .slim/worktrees.json does not exist, create it when initializing a lane, and keep it updated as lanes are transitioned, integrated, or pruned. Treat it as local workflow metadata by default; ask before making it part of a committed project convention.
Safety Guidelines
Before executing any Git mutation command, the Orchestrator must observe the following guards:
1. Pre-Flight Checklist
- Confirm the current directory is inside a Git repository.
- Check the current branch, base branch, and dirty/uncommitted state.
- Inspect the output of
git worktree listto avoid path or branch conflicts. - Ensure the branch name (e.g.
omos/<slug>or custom project convention) does not already exist locally or on remote. - Ensure
.slim/worktrees/is ignored by Git before creating nested worktrees.
2. Mandatory User Confirmation
You must seek explicit user confirmation before executing:
git worktree addorgit worktree remove- Branch creation, deletion, or renaming
- Merges, rebases, or cherry-picks
git pruneorgit worktree prune- Destructive commands (e.g.,
git reset --hard,git clean,git push --force, or removing a dirty worktree directory).
Never execute destructive commands, delete branches, remove dirty worktrees, or clean uncommitted changes without explicit user confirmation for that exact operation.
3. Ignore File Setup
Before creating lanes, add or update managed marker blocks only.
.gitignore:
.ignore:
Workflow Guide
Phase 1: Planning & Setup
- Identify the task scope and determine a short
<slug>for the worktree. - Formulate a branch name. Default to
omos/<slug>unless project/user conventions dictate otherwise. - Validate repository safety. Ask the user for confirmation to initialize the lane.
- Ensure the managed ignore blocks are present.
- Run:
``bash git worktree add -b <branch-name> .slim/worktrees/<slug> <base-commit/branch> ``
- Register the metadata in
.slim/worktrees.json.
Phase 2: Execution & Delegation
- Run all sub-agents with their working directory set strictly to the worktree
path, such as .slim/worktrees/<slug>.
- Do not modify the main checkout for lane work. Keep build, test, and edit
operations isolated inside the lane.
- Track file or folder ownership per lane to avoid merge conflicts between
parallel agents.
- Commit progress within the worktree only when the user asked for commits or
approved local checkpoint commits.
Phase 3: Integration & Validation
Before merging or integrating the worktree branch:
- Run lint, build, formatting, and unit tests inside the worktree directory.
- Generate and display a clear diff comparing the worktree branch to the
integration base branch.
- Ask the user for confirmation to integrate.
- Perform the approved integration, such as merge or cherry-pick, from the main
checkout or the user-approved integration checkout.
Phase 4: Cleanup & Pruning
- Ensure all changes are safely merged or archived.
- Confirm the worktree has no uncommitted changes.
- Request user approval to remove the worktree.
- Safely remove the worktree using:
``bash git worktree remove .slim/worktrees/<slug> ``
- Update
.slim/worktrees.jsonto mark the lane asarchivedor remove it.
When to Use vs. Not Use
Use When:
- Performing risky or destructive refactoring that could break the active working environment.
- Working on parallel tasks/bugfixes that require switching contexts without committing half-finished work.
- Running independent background agents on separate branches.
- Conducting exploratory spikes or prototyping that may be discarded.
- Isolating third-party packages or complex upgrades.
- Explicitly asked to use worktrees for a specific task.
Do NOT Use When:
- Making simple single-file changes, documentation updates, or minor bug fixes.
- Working in a git repository that is not fully initialized or has complex multi-submodule states not supported easily by worktrees.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/worktrees/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hbollon/opencode-config/worktrees)