worktrees
Что он делает
Этот скилл управляет рабочими деревьями Git как отдельными изолированными линиями для сложной или рискованной работы. Он нужен разработчикам и ИИ-оркестраторам, которые ведут несколько задач одновременно.
Когда использовать
- ✓Когда несколько задач по программированию должны идти параллельно, не затрагивая одни и те же файлы.
- ✓Когда рискованный эксперимент нужно держать отдельно от основного проекта.
- ✓Когда нужно проверить работу из отдельных линий и вернуть ее в одну ветку.
Ссылка на скилл
https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/worktrees/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Настрой отдельное рабочее дерево для этого рискованного рефакторинга, чтобы не мешать моей основной ветке.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Скилл помещает каждую линию в собственную папку внутри каталога .slim проекта, с собственной веткой и понятным владельцем. Он отслеживает статус линий и выполняет очистку в конце.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
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:
.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:
{
"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:
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 or cleaning lanes, inspect existing .gitignore and .ignore.
Update the managed block in place when present; otherwise append it. Add only
the missing exact lines below, never duplicate entries or modify unrelated
rules. These blocks keep lane artifacts git-local while the .ignore allowlist
keeps them readable to OpenCode.
.gitignore:
# BEGIN oh-my-opencode-slim worktrees
.slim/worktrees/
.slim/worktrees.json
# END oh-my-opencode-slim worktrees
.ignore:
# BEGIN oh-my-opencode-slim worktrees
!.slim/
!.slim/worktrees.json
!.slim/worktrees/
!.slim/worktrees/**
# END oh-my-opencode-slim worktrees
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.
- Before creating the lane, ensure the managed ignore blocks are present using the Ignore File Setup rules above.
- Run:
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.
Частые вопросы
Где хранятся рабочие деревья?
В папке .slim/worktrees внутри проекта, а не рядом с основным репозиторием.
Отслеживает ли он линии?
Да. Он может вести необязательный файл манифеста с веткой, назначением и статусом каждой линии.
Кто управляет линиями?
Оркестратор отвечает за планирование, делегирование, проверки и очистку, а специалисты могут работать внутри линии.
Подробности
Оригинальное описание автора
Manage Git worktrees as OMO safe isolated coding lanes for complex, risky, or parallel work.
Популярность
- Звёзды на GitHub
- 10k
- Место в рейтинге
- #12020
- Лицензия
- MIT
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
cli-review
10kПозволяет агенту запустить код-ревью Greptile для текущей ветки перед открытием запроса на слияние, а затем кратко описать результаты простыми словами.
ai-estimates
10kПомогает агенту оценить, сколько времени займет работа, которую человек выполняет с помощью ИИ, разделяя быструю работу ИИ и задержки людей или внешних сторон.
clonedeps
10kПозволяет агенту скопировать исходный код ключевых зависимостей проекта в локальную папку, чтобы он мог читать, как эти библиотеки устроены внутри.
codemap
10kСоздает структурированную карту незнакомого проекта с кодом, чтобы агент быстро находил его основные части. Лучше всего использовать, когда вы просите карту кодовой базы.
Похожие скиллы
openclaw-update
394kПомогает агенту обновить уже работающий OpenClaw Gateway, выбрав способ обновления по тому, как он был установлен, и сохранив вашу сессию.
diagnose-gateway
394kПомогает агенту выяснить, почему ваш OpenClaw Gateway не работает, проверяя настройки, каналы и порты, но ничего не меняя.
crabbox-apps
394kПомогает агенту открыть и запустить приложение на временной облачной машине, а затем показать его вид на боковой панели чата.