worktrees
できること
このスキルは、複雑でリスクの高いコーディング作業のために、Gitのワークツリーを別々の隔離されたレーンとして管理します。同時に複数の作業を扱う開発者やAIのオーケストレーター向けです。
使う場面
- ✓同じファイルに触れずに、複数のコーディングの作業を並行して実行する必要があるとき。
- ✓リスクの高い実験を、メインのプロジェクトから分けておきたいとき。
- ✓別々のレーンの作業をレビューし、1つのブランチに戻す必要があるとき。
スキルのリンク
https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/worktrees/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このリスクの高いリファクタリングのために、メインのブランチを乱さないように、別のワークツリーを設定してください。”
毎週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
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
cli-review
10kエージェントが、プルリクエストを開く前に、現在のブランチでGreptileのコードレビューを実行し、結果を平易な言葉でまとめられるよう支援します。
ai-estimates
10kエージェントが、人がAIと一緒に作業するときに、作業にどのくらい時間がかかるかを見積もり、速いAIの作業と、人や外部による遅れを分けられるよう支援します。
clonedeps
10kエージェントが、プロジェクトの主要な依存関係のソースコードをローカルのフォルダにコピーし、それらのライブラリの内部の仕組みを読めるよう支援します。
codemap
10kエージェントが、なじみのないコードプロジェクトの構造化された地図を作り、その主要な部分を素早く見つけられるよう支援します。コードベースの地図を頼んだときに最適です。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。