worktrees

Orchestrates Git worktrees as isolated coding lanes for parallel and risky development work.

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/MDSIXONE/opencode-config --skill worktrees-mdsixone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: worktrees
Source: https://github.com/MDSIXONE/opencode-config/tree/main/skills/worktrees
Command: npx skills add https://github.com/MDSIXONE/opencode-config --skill worktrees-mdsixone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing risky refactors, parallel agent tasks, or experimental changes in a single Git checkout risks breaking the active working environment and mixing half-finished work. This Skill provides a safe, structured protocol for creating, tracking, integrating, and cleaning up Git worktrees as isolated coding lanes. ## Core Features & Use Cases - Isolated Lane Management: Creates worktrees under .slim/worktrees/<slug>/ with consistent branch naming (omos/<slug>) and tracks lane state in a .slim/worktrees.json manifest. - Safety Guardrails: Enforces pre-flight checks, mandatory user confirmation before destructive Git operations, and managed .gitignore/.ignore blocks to keep lane artifacts local. - Four-Phase Workflow: Covers planning and setup, delegated execution inside the lane, diff-based integration with validation, and confirmed cleanup and pruning. - Use Case: When running multiple background agents on separate bugfixes, assign each agent its own worktree lane so their changes never conflict with the main checkout, then review diffs and merge each lane after approval. ## Quick Start Ask the AI to create a new worktree lane for your refactoring task, for example: set up an isolated worktree for the authentication refactor based on the main branch.

Frequently Asked Questions about worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Git worktree for an isolated feature branch?▼

Run git worktree add -b <branch-name> .slim/worktrees/<slug> <base-branch> after confirming the repository state and branch name availability. The skill registers the lane in .slim/worktrees.json and sets up ignore rules so lane artifacts stay local.

When should I use Git worktrees instead of switching branches?▼

Use worktrees for risky refactors, parallel tasks, background agents, or exploratory spikes that would disrupt your active checkout. Avoid them for simple single-file changes, documentation updates, or minor bug fixes where branch switching is sufficient.

Can multiple AI agents work in separate Git worktrees in parallel?▼

Yes, each agent runs with its working directory set to its own worktree path, keeping builds, tests, and edits isolated. Track file or folder ownership per lane to prevent merge conflicts between parallel agents.

How do I safely remove a Git worktree after merging?▼

First confirm all changes are merged or archived and the worktree has no uncommitted changes, then get user approval and run git worktree remove .slim/worktrees/<slug>. Update .slim/worktrees.json to mark the lane as archived or remove its entry.

Why should worktrees not be created as sibling directories of the repository?▼

Placing worktrees under .slim/worktrees/ inside the repository keeps lanes organized and allows .gitignore and .ignore managed blocks to hide lane artifacts from Git while keeping them readable to tooling. Sibling directories scatter lanes and complicate cleanup.