# Worktrees

Manage Git worktrees as OMO safe isolated coding lanes for complex, risky, or parallel...

- Repository: https://github.com/alvinunreal/oh-my-opencode-slim (10062 stars)
- Category: Git and review
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add alvinunreal/oh-my-opencode-slim --skill worktrees -g -a claude-code -y`
Codex: `npx skills add alvinunreal/oh-my-opencode-slim --skill worktrees -g -a codex -y`
Cursor: `npx skills add alvinunreal/oh-my-opencode-slim --skill worktrees -g -a cursor -y`
Gemini CLI: `npx skills add alvinunreal/oh-my-opencode-slim --skill worktrees -g -a gemini-cli -y`

## Description

Manage Git worktrees as OMO safe isolated coding lanes for complex, risky, or parallel work.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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:

```text
.slim/worktrees/<slug>/
```

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:

```json
{
  "version": "1.0.0",
  "updatedAt": "2026-06-14T00:00:00.000Z",
  "lanes": [
    {
      "slug": "feature-auth-v2",
      "branch": "omos/feature-auth-v2",
      "path": ".slim/worktrees/feature-auth-v2",
      "base": "main",
      "purpose": "refactor authentication flow to use OAuth2",
      "owner": "orchestrator",
      "status": "active",
      "areas": ["src/auth", "src/config"],
      "createdAt": "2026-06-14T12:00:00.000Z"
    }
  ]
}
```

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:

The rest: https://github.com/alvinunreal/oh-my-opencode-slim/blob/HEAD/src/skills/worktrees/SKILL.md
