Token导航 LogoToken导航

Agent Skill · 研究检索

sync-fork(同步叉)

sync-fork 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

sync-fork 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 55,679。

总安装 470周安装 19GitHub Stars 公开资料未说明下载 147核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sync-fork(同步叉)
来源仓库:https://github.com/shhac/skills
仓库路径:skills/sync-fork
安装命令:
npx skills add https://github.com/shhac/skills --skill sync-fork
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/shhac/skills --skill sync-fork

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于在 Codex、Claude、Cursor、Gemini CLI 中查找和筛选相关信息。支持根据关键词、任务场景或来源线索快速定位候选结果。可结合原始 README 和仓库内容进一步核验具体用法。安装前建议确认权限范围和维护状态,避免触发不必要操作。安装方式:通过 GitHub 仓库使用 npx 命令添加。

来源仓库内路径:skills/sync-fork

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/shhac/skills --skill sync-fork;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

sync-fork 怎么安装?

在终端执行 npx skills add https://github.com/shhac/skills --skill sync-fork。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

sync-fork 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

sync-fork 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

sync-fork 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

sync-fork 用的人多吗?

公开数据是累计安装 470 次,近一周安装 19 次,下载 147 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

sync-fork 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
sync-fork

同步叉 · 本页

470—需要联网未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Sync Fork

Sync a forked repository with its upstream remote. The fork's shared branches (e.g., main) are maintained as the equivalent of upstream plus local patches re-merged on top — a "patched upstream" model. Each sync resets to upstream, rebases fork-only branches, and re-merges them.

If upstream hasn't advanced (i.e., upstream/main is already an ancestor of fork/main), the sync is a no-op.

Usage

/sync-fork [<fork-remote> <upstream-remote>]

  • With no arguments — auto-detect if exactly two remotes exist. If more than two, ask the user to specify.
  • With one argument — the provided name is ambiguous. Look up its URL with git remote get-url <name> and ask the user: *"<name> points to <url> — is this your fork, or the repo you forked from?"* Then ask for the other remote name.
  • With two arguments — first is the fork remote, second is the upstream remote.

When auto-detecting with exactly two remotes, use heuristics to guess which is the fork and which is upstream (e.g., a remote named origin is more likely the fork; a remote whose URL org differs from the other is more likely upstream). Present your guess and ask the user to confirm.

⚠️ Credential safety: Remote URLs may contain embedded credentials (e.g., https://user:token@github.com/...). Before displaying any URL to the user, redact the userinfo portion: replace user:token@ with ***@. Never output raw credentials from git remote -v or git remote get-url.

Diagram legend

Used in reference files adjacent to this skill:

───       flow (left-to-right = time)
├── X     branch X forks here
└── X     branch X forks here (last branch at this point)
──┘       merge point (branch merges into line above)
●         notable state on the line

Helper script

This skill includes scripts/sync_fork.py — a deterministic Python helper for branch analysis. It handles classification, divergence checking, and dependency graph building so these operations produce consistent results. Requires Python 3.9+ (stdlib only).

Locate the script relative to this skill file. Invoke it as:

python3 <skill-dir>/scripts/sync_fork.py <subcommand> [options]

Subcommands: classify, divergence, graph, plan. Run with --help for full usage. Default output is compact key-value (LLM-friendly). Add --json for structured output.

Instructions

You are syncing a fork with its upstream. Follow the phases below in order.

This skill uses incremental discovery — the main flow below covers the common case. When you encounter a specific situation (a topology, an edge case), you will be directed to read the relevant reference file at that point. Do not read all reference files upfront. Read them only when triggered.

Reference files live in two directories adjacent to this skill:

  • examples/ — branch topology diagrams and rebase strategies
  • edge-cases/ — handling for unusual situations

Phase 0: Pre-flight

  1. Check for interrupted previous run. Look for branches matching sync-fork/*. If found, a previous sync was interrupted. Show the user what backup branches exist and ask: restore from backups, or clean up (git for-each-ref --format='%(refname:short)' 'refs/heads/sync-fork/' | xargs git branch -D) and start fresh?
  2. Save current branch. Record git symbolic-ref --short HEAD (or the detached commit) so we can restore it at the end.
  3. Guard dirty working tree. Run git status --porcelain. If there are uncommitted changes, stash them: git stash push -m "sync-fork: uncommitted changes" This will be popped at the end. Stash is branch-independent, so it survives the checkout/reset operations that follow.
  4. Identify remotes. Run git remote -v and resolve which remote is the fork and which is upstream using the rules in the Usage section above. Confirm with the user if there was any ambiguity.

Phase 1: Assess Divergence

  1. Fetch both remotes.
  2. No-op check. For each shared branch, check git merge-base --is-ancestor <upstream>/<branch> <fork>/<branch>. If upstream is already an ancestor of fork for ALL shared branches, the sync is a no-op — upstream hasn't advanced. Tell the user and stop.
  3. Classify branches. Run the helper script: python3 <script> --fork <fork> --upstream <upstream> classify This identifies shared branches, fork-only branches (merged, promoted, partially promoted, active), and reports them in a compact format.

- ⚠️ If fork-only-partial entries appear → read edge-cases/partial-promotion.md. - ⚠️ If fork-only-promoted entries appear → read examples/promoted-branch.md for the full handling strategy.

  1. Check divergence. Run the helper script: python3 <script> --fork <fork> --upstream <upstream> divergence This shows per-branch commit counts and flags.

- ⚠️ If any branch shows rewrite=true AND fork_merges_only=false → STOP and read edge-cases/history-rewrite.md before proceeding. (When fork_merges_only=true, the fork-only commits are just merge commits from previous syncs — this is normal, not a history rewrite.) - ⚠️ If any branch shows reverts>0 → STOP and read edge-cases/upstream-reverts.md before proceeding.

  1. Dry-run plan. Run: python3 <script> --fork <fork> --upstream <upstream> plan Present the full plan to the user. Wait for confirmation before proceeding.

Phase 2: Create All Backups and Reset Shared Branches

Create all backups upfront (both pre-reset and pre-rebase) before any destructive operations. This consolidates recovery points into a single step.

2a. Create all backup branches
# Pre-reset backups for shared branches
for branch in <shared_branches>; do
  git branch sync-fork/pre-reset/$branch <fork>/$branch
done

# Pre-rebase backups for fork-only active branches
for branch in <fork_only_active>; do
  git branch sync-fork/pre-rebase/$branch <fork>/$branch
done

These backups serve triple duty:

  • Recovery points if anything goes wrong
  • Old-ref storage for --onto rebases (the sync-fork/pre-rebase/<parent> tip IS the old ref)
  • Correct ancestry refs for the dependency graph (shared branches are about to be reset)
2b. Reset shared branches

For each shared branch (in order: default branch first, then others):

  1. Check out the branch locally. (If no local tracking branch exists, git checkout will auto-create one.)
  2. git reset --hard <upstream>/<branch> to align with upstream.
  3. git push <fork> <branch> --force-with-lease to update the fork.

Phase 3: Rebase Fork-Only Branches

3a. Build the dependency graph

Run the helper script to build the dependency graph. It uses the sync-fork/pre-reset/* backup refs for shared branch ancestry checks (since shared branches now point to upstream):

python3 <script> --fork <fork> --upstream <upstream> graph \
  --branches <comma-separated-fork-only-active> \
  --shared <comma-separated-shared> \
  --backup-prefix sync-fork/pre-reset

The output provides: parent map, topological order, orphaned branches, and merge targets.

  • ⚠️ If orphaned is not (none) → read edge-cases/orphaned-branches.md.
3b. MANDATORY: Read the matching topology reference

You MUST read the applicable example file before continuing. Match the dependency graph you just built to the correct topology and read that file now:

Topology detectedRead this file
All branches root directly on a shared branch, no dependencies between themexamples/independent-branches.md
One branch depends on another (B based on A)examples/linear-chain.md
Multiple branches depend on the same parent (B and C both based on A)examples/fan-out.md
Three or more branches in a chain (A → B → C)examples/deep-chain.md
Branches root on different shared branchesexamples/multi-target.md
Mixed (combination of above)Read ALL applicable files

If the graph has any dependencies between fork-only branches, you must understand the --onto rebase strategy from the relevant file before proceeding. Getting this wrong causes duplicate commits and false conflicts.

3c. Rebase in topological order

For each fork-only branch (parents first, children last — use the order from the graph output):

  1. Check for merge commits: git log --merges sync-fork/pre-rebase/<parent>..<branch>

- ⚠️ If merge commits found → read edge-cases/merge-commits-in-branches.md before rebasing this branch.

  1. Rebase:

- If parent is a shared branch: git rebase --empty=drop <shared-branch> <branch> - If parent is another fork-only branch: git rebase --empty=drop --onto <parent> sync-fork/pre-rebase/<parent> <branch> - --empty=drop automatically discards commits already in upstream. If Git < 2.26, omit the flag and use git rebase --skip when prompted. - If rebase conflicts occur, resolve them. Show the user what you resolved and why.

  1. Check for empty result. If ALL commits were dropped (branch now points to same commit as its parent), warn the user: *"Branch <branch> appears fully absorbed by upstream. Consider deleting it."*
  2. git push <fork> <branch> --force-with-lease to update the fork.

Phase 4: Re-merge into Shared Branches

The fork's shared branches are maintained as "upstream + local patches." This phase replays merge commits on top, so fork/main = upstream/main + fork-only work.

For each shared branch that has fork-only branches targeting it (use the target map from the graph output):

  1. Check out the shared branch locally.
  2. Merge each rebased fork-only branch with --no-ff in topological order (parents before children). Use the message format: git merge --no-ff <branch> -m "sync-fork: merge <branch> into <shared-branch>"

- These merges should be clean since branches were just rebased. If a conflict occurs, resolve it and show the user what you resolved. - After merging a parent (e.g., A), merging its child (e.g., B) only brings in B's unique commits.

  1. git push <fork> <branch> --force-with-lease to update the fork.

Phase 5: Clean Up

  1. Delete remote branches (git push <fork> --delete <branch>) that are fully merged into upstream.
  2. Delete all backup branches: git for-each-ref --format='%(refname:short)' 'refs/heads/sync-fork/' | xargs git branch -D
  3. Restore the original branch saved in Phase 0: git checkout <saved-branch>.
  4. If changes were stashed in Phase 0, restore them: git stash pop.
  5. List any local tracking branches that can be pruned.
  6. Show the user a final summary of what was synced, rebased, merged, deleted, and what branches remain.

Rules

  • Always confirm the plan with the user before resetting or force-pushing.
  • Use --force-with-lease, never --force, when pushing reset branches.
  • Preserve local-only work — the point is to keep branches that upstream hasn't accepted while aligning with upstream's current state.
  • Don't delete branches that have unmerged work — only clean up branches whose content is already in upstream (even if commit SHAs differ due to squash-merging).
  • Don't touch branches unrelated to the fork sync — leave feature branches that aren't targeting a shared branch alone.
  • Backup branches use the sync-fork/ prefix — these are temporary and cleaned up at the end. If a sync is interrupted, they survive for recovery. Clean up manually with git for-each-ref --format='%(refname:short)' 'refs/heads/sync-fork/' | xargs git branch -D.

平台分布

Codex

33.26%
按下载量换算49

Claude

32.65%
按下载量换算48

Cursor

17.32%
按下载量换算25

Gemini CLI

9.83%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills