شعار Dev.Worktrees

Dev.Worktrees

المجتمع
kevinslin
dev.worktrees

Create, inspect, remove, or transactionally clean landed Git worktrees.

نظرة عامة

الناشرkevinslin
المستودعagstack
اسم المهارةdev.worktrees
النجوم
26
التفريعات
1
الملفات المرفقة
2
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 2

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها kevinslin على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Dev.Worktrees في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/kevinslin/agstack/tree/main/active/dev.worktrees
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kevinslin/agstack.git /tmp/agstack
mkdir -p .claude/skills
cp -r /tmp/agstack/active/dev.worktrees .claude/skills/dev.worktrees
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Dev.Worktrees في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Dev.Worktrees تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Dev.Worktrees بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

dev.worktrees

Overview

Create and manage Git worktrees under ~/.worktrees. Use cleanup-landed only after a caller has independently proved that the work landed and may be discarded.

Conventions

  • Resolve the repo name from the main repo directory basename (folder containing .git), unless the user provides an override.
  • Always store worktrees under ~/.worktrees/<repo>/<branch-name>.
  • Keep the branch name as-is; if it contains /, it naturally becomes nested folders.
  • Run worktree commands from the main repo unless the user specifies a different worktree.
  • If the user requests a different location, confirm the deviation before proceeding.
  • Use absolute paths for removal and cleanup targets.
  • Never remove the current, primary, locked, or dirty worktree through the ordinary removal path.

Quick Tasks

Create worktree for an existing branch

bash
mkdir -p ~/.worktrees/<repo>
git worktree add ~/.worktrees/<repo>/<branch-name> <branch-name>

Create worktree for a new branch

bash
mkdir -p ~/.worktrees/<repo>
git worktree add -b <branch-name> ~/.worktrees/<repo>/<branch-name> [start-point]

List worktrees

bash
git worktree list --porcelain

Ordinary Removal

Use ordinary removal only when the worktree is already clean and unlocked. Inspect tracked and untracked state immediately before removal. If it is dirty, stop and preserve it; do not force removal or infer that its contents landed.

bash
git -C <worktree> status --short
git -C <repo> worktree remove <absolute-worktree-path>

Delete the local branch only when the caller separately established that it is no longer needed:

bash
git -C <repo> branch -d -- <branch-name>

cleanup-landed

Use ./scripts/cleanup_worktree.py to remove one exact worktree and its local branch after the caller has proved the change landed. This path is destructive: it resets tracked changes and deletes untracked and ignored files before removing the worktree.

Before invoking it, record:

  • a retained repository checkout outside the target worktree;
  • the exact absolute target path, or --no-worktree for a branch checked out nowhere;
  • the expected local branch or detached state;
  • the full expected HEAD object ID;
  • a refreshed local base branch;
  • the full landed commit object ID contained by that base; and
  • the actual merge mode: merge, squash, or rebase.

Run a dry run first and require JSON status ready or noop:

bash
python3 ./scripts/cleanup_worktree.py \
  --repo <retained-checkout> \
  --worktree <absolute-worktree-path> \
  --expected-branch <branch> \
  --expected-head <full-object-id> \
  --base-ref <refreshed-local-base-branch> \
  --landed-commit <full-landed-object-id> \
  --merge-mode <merge|squash|rebase>

Rerun the exact command with --execute. Require final JSON status complete or noop, with the path, registration, and local branch absent and the base still containing the landed commit.

  • Replace --expected-branch <branch> with --detached for a detached target.
  • Replace --worktree <path> with --no-worktree for branch-only cleanup; detached cleanup is invalid in that mode.
  • Treat blocked, partial, a nonzero exit, identity drift, or failed postconditions as a cleanup blocker.
  • Preserve the reported journal after partial execution and rerun the exact command after resolving the blocker.
  • If matching legacy and current journals both exist, stop and reconcile them; the executor fails closed rather than choosing one.
  • Do not reproduce the reset, clean, removal, orphan recovery, or branch deletion steps manually.

The script serializes each target, revalidates identity under the lock, and journals new transactions under the Git common directory's worktree-cleanup/ directory. It resumes matching legacy fin-cleanup/ journals in place. It never refreshes the base, proves external finalization, runs repository hooks, prunes unrelated registrations, or mutates remote branches; callers own those policies.

Prune Stale Metadata

Prune only when the user explicitly requests repository-wide stale metadata cleanup. Preview first and do not use pruning as a substitute for targeted removal or journal recovery.

bash
git -C <repo> worktree prune --dry-run
git -C <repo> worktree prune

Notes

  • Never place worktrees inside the main repo or other worktrees.
  • Prefer explicit paths and branch names in responses to avoid ambiguity.
  • Keep bulk Codex worktree garbage collection in codex-clean-worktrees; cleanup-landed owns one exact, proof-locked transaction.

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة أثناء تحميل المهارة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Dev.Worktrees؟

Create, inspect, remove, or transactionally clean landed Git worktrees.

لماذا تستخدم Dev.Worktrees على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Dev.Worktrees عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Dev.Worktrees في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/kevinslin/agstack/tree/main/active/dev.worktrees. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Dev.Worktrees؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Dev.Worktrees؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Dev.Worktrees معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Dev.Worktrees مجانية؟

نشرها kevinslin على GitHub. راجع المستودع للاطلاع على شروط الترخيص. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇