worktrees
ما الذي تفعله
تدير هذه المهارة 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 وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أنشئ worktree منفصلة لإعادة الهيكلة الخطرة هذه حتى لا تؤثر في فرعي الرئيسي.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تضع المهارة كل مسار في مجلد خاص داخل مجلد .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.
الأسئلة الشائعة
أين تُحفظ الـ worktrees؟
داخل مجلد .slim/worktrees في المشروع، لا بجانب المستودع الرئيسي.
هل تتابع المسارات؟
نعم. يمكن أن تحتفظ بملف manifest اختياري فيه فرع كل مسار وغرضه وحالته.
من يتحكم في المسارات؟
المنسّق يتولى التخطيط والتفويض والفحوص والتنظيف، ويمكن للمتخصصين العمل داخل المسار.
التفاصيل
الوصف الأصلي من المؤلف
Manage Git worktrees as OMO safe isolated coding lanes for complex, risky, or parallel work.
الشعبية
- نجوم GitHub
- 10k
- الترتيب
- #12020
- الترخيص
- MIT
- آخر تحديث
- 2/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يساعد وكيلك على فتح تطبيق وتشغيله على جهاز سحابي مؤقت، ثم عرض واجهته في الشريط الجانبي للدردشة.