worktrees
यह क्या करती है
यह स्किल जटिल या जोखिम भरे कोडिंग काम के लिए Git worktrees को अलग-अलग, पृथक लेन के रूप में संभालती है। यह एक साथ कई कार्य संभालने वाले डेवलपरों और AI orchestrators के लिए है।
कब इस्तेमाल करें
- ✓जब कई कोडिंग कार्य एक-दूसरे की फ़ाइलें छुए बिना समानांतर चलने हों।
- ✓जब कोई जोखिम भरा प्रयोग मुख्य प्रोजेक्ट से अलग रखना हो।
- ✓जब आपको अलग लेन के काम की समीक्षा करके उसे एक branch में वापस लाना हो।
Skill का लिंक
https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/src/skills/worktrees/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस जोखिम भरे refactor के लिए अलग worktree सेट कीजिए, ताकि मेरी मुख्य branch खराब न हो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल हर लेन को प्रोजेक्ट के .slim फ़ोल्डर के अंदर अपने फ़ोल्डर में, अपनी branch और एक साफ़ मालिक के साथ रखती है। वह लेन की स्थिति ट्रैक करती है और अंत में सफ़ाई संभालती है।
तकनीकी सामग्री (मूल 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.
अक्सर पूछे जाने वाले सवाल
worktrees कहाँ रखे जाते हैं?
प्रोजेक्ट के अंदर .slim/worktrees फ़ोल्डर में, मुख्य repository के बगल में नहीं।
क्या यह लेन ट्रैक करती है?
हाँ। यह एक वैकल्पिक manifest फ़ाइल में हर लेन की branch, उद्देश्य और स्थिति रख सकती है।
लेन किसके नियंत्रण में हैं?
orchestrator योजना, काम सौंपना, जाँच और सफ़ाई संभालता है, जबकि विशेषज्ञ लेन के अंदर काम कर सकते हैं।
जानकारी
लेखक का मूल विवरण
Manage Git worktrees as OMO safe isolated coding lanes for complex, risky, or parallel work.
लोकप्रियता
- GitHub स्टार
- 10k
- रैंकिंग में स्थान
- #12020
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
cli-review
10kआपके एजेंट को pull request खोलने से पहले मौजूदा branch पर Greptile कोड समीक्षा चलाने देती है, फिर नतीजों का सादी भाषा में सार देती है।
ai-estimates
10kआपके एजेंट को यह अनुमान लगाने में मदद करती है कि AI के साथ काम करने पर काम कितना समय लेगा, तेज़ AI काम को इंसानी और बाहरी देरी से अलग करते हुए।
clonedeps
10kआपके एजेंट को मुख्य प्रोजेक्ट dependencies का स्रोत कोड स्थानीय फ़ोल्डर में कॉपी करने देती है, ताकि वह समझ सके कि वे लाइब्रेरी अंदर से कैसे काम करती हैं।
codemap
10kकिसी अनजान कोड प्रोजेक्ट का संरचित नक्शा बनाती है, ताकि आपका एजेंट उसके मुख्य हिस्से जल्दी ढूँढ सके। कोडबेस का नक्शा माँगने पर सबसे अच्छा।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।