شعار Fork Upstream Sync

Fork Upstream Sync

المجتمع
luongnv89
fork-upstream-sync

Sync a GitHub fork with upstream while keeping unmerged feature branches and open PRs mergeable. Use for rebase on upstream, PR conflicts, integration main. Don't use for git init, releases, or non-fork repos.

نظرة عامة

الناشرluongnv89
المستودعskills
اسم المهارةfork-upstream-sync
النجوم
124
التفريعات
18
الملفات المرفقة
2
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

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

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

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

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

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

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

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

التثبيت

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

1

التثبيت في TypingMind

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

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

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

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

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

استخدمها في TypingMind

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

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

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

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

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

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

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

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

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

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

Fork Upstream Sync

Integration main means fork main = upstream/main plus your unmerged commits in linear history (not a merge commit that duplicates feature work).

Prerequisites

Before selecting a path, validate all requirements:

  • Tools: require Git 2.30+; require gh only for PR-state checks.
  • Access: confirm authenticated fetch and push access to origin, plus fetch access to upstream.
  • State: check that the working tree is clean or stashable and that the target branches are not checked out in another worktree.
  • Recovery: record the current branch and SHA. If fetch, stash, rebase, reset, or push fails, stop at that command; never continue with stale assumptions.

Branch selector

Pick one path per user request:

PathWhen
A — BootstrapNo upstream remote yet, or first-time fork sync
B — PR branchOpen PR is CONFLICTING or DIRTY; rebase feature branch on upstream/main
C — Integration mainFork main should match upstream plus same tip as feature branch
D — Post-mergeUpstream merged your PR; drop duplicate commits on fork main

Paths B then C is the usual full sync (PR mergeable, fork main carries your WIP).

Repo sync before edits (mandatory)

Before any rebase, reset, or force push:

bash
git fetch upstream
git fetch origin

If the working tree is dirty:

bash
git stash push -u -m "pre-sync: $(git rev-parse --abbrev-ref HEAD)"
# ...run the fetch/rebase/reset steps for the chosen path...
git stash pop

On git stash pop conflict, stop — the stash is preserved (git stash list); resolve manually before continuing.

If upstream is missing, origin is missing, or the user has not said which upstream org/repo to use, stop and ask. Never force-push main without --force-with-lease.

Step completion reports

After each major phase, emit a short report with checks for upstream remote, commits behind upstream, PR mergeable status, conflicts resolved, and whether integration main matches the feature branch tip. End with Result PASS, FAIL, or PARTIAL.


Path A — Bootstrap upstream remote

  1. Confirm parent repo (for example gh repo view --json parent,isFork).
  2. Add remote if absent: git remote add upstream git@github.com:ORG/REPO.git, then git fetch upstream.

Done when: git rev-parse upstream/main succeeds and git remote -v lists upstream.


Path B — Rebase feature branch on upstream

  1. Identify PR head branch and upstream base (main).
  2. git checkout <feature-branch> then git rebase upstream/main.
  3. On each conflict, resolve files. When upstream and your feature both added valid code, keep both (union), not either/or. If a conflict can't be confidently resolved, git rebase --abort and stop to ask the user rather than guessing.
  4. git add resolved files, then GIT_EDITOR=true git rebase --continue.
  5. For locale JSON conflicts, keep the rebased side then run the repo catalog fix if documented (for example pnpm run sync:localization-catalog --fix).
  6. git push origin <feature-branch> --force-with-lease.
  7. Verify with gh pr view <n> --repo ORG/REPO --json mergeable,mergeStateStatus (expect MERGEABLE; CI may lag).

Done when: rebase completes, no conflict markers in tree, PR is MERGEABLE or user accepts waiting on CI.


Path C — Rebuild fork integration main

After Path B:

bash
git checkout main
git reset --hard upstream/main
git merge --ff-only <feature-branch> && git push origin main --force-with-lease

If --ff-only fails, main is already reset to bare upstream/main — do not push. The feature branch is behind the new upstream/main; re-run Path B to rebase it, then retry this merge. Pushing here without the fast-forward would force-publish plain upstream/main, silently dropping your integration WIP from origin/main.

Done when: upstream/main is ancestor of main, main SHA equals feature branch SHA, and ahead count matches your feature commits.


Path D — Post-merge cleanup

When upstream main already contains your merged PR:

bash
git fetch upstream
git checkout main
git reset --hard upstream/main
git push origin main --force-with-lease

Done when: main SHA equals upstream/main SHA.


Verify with the command reference

Protect the context budget: read references/command-checks.md only when executing or diagnosing a path. See that reference for the routine command sequence and exact SHA, ancestry, ahead-count, and clean-tree checks.

What not to do

  • Do not merge upstream/main into fork main with a merge commit while also keeping a parallel rebased feature branch.
  • Do not force-push without --force-with-lease.
  • Do not treat origin as upstream; origin is your fork, upstream is the parent.

Acceptance criteria

Verify the selected path before reporting success:

  • Required remotes resolve and the working tree has no unresolved conflicts.
  • The expected branch ancestry or equality check for the selected path passes.
  • Every push used --force-with-lease; no destructive push targeted the wrong branch.
  • For Path B, the PR response is MERGEABLE, or CI delay is explicitly reported as partial.

Run:

bash
git log --oneline -1 upstream/main main <feature-branch>
git rev-list --count upstream/main..main
git merge-base --is-ancestor upstream/main main

Expected output: the log identifies the intended tips, the ahead count equals the retained feature commits, and the ancestry command exits 0. For Paths C and D, also assert the exact SHA equality required by that path.

Edge cases

  • Renamed default branch: discover it with gh repo view --json defaultBranchRef; do not assume main.
  • Protected fork branch: if GitHub rejects a lease-protected push, stop and report the protection rule; do not weaken it.
  • Deleted PR branch: recreate only from a verified local or remote SHA after user confirmation.
  • Upstream rewrote history: fetch, compare old and new tips, and ask before rebasing or resetting across the rewrite.

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

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

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

ماذا تفعل مهارة الذكاء الاصطناعي Fork Upstream Sync؟

Sync a GitHub fork with upstream while keeping unmerged feature branches and open PRs mergeable. Use for rebase on upstream, PR conflicts, integration main. Don't use for git init, releases, or non-fork repos.

لماذا تستخدم Fork Upstream Sync على TypingMind؟

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

كيف أثبّت Fork Upstream Sync في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/luongnv89/skills/tree/main/skills/fork-upstream-sync. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Fork Upstream Sync؟

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

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Fork Upstream Sync؟

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

هل مهارة الذكاء الاصطناعي Fork Upstream Sync مجانية؟

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

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

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

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

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

عرض الكل

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

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