Manage forks with open PRs - sync upstream, rebase branches, track PR status, and maintain production branches with pending contributions. Supports automatic...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install fork-manager或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install fork-manager⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/fork-manager/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: fork-manager description: Manage forks with open PRs - sync upstream, rebase branches, track PR status, and maintain production branches with pending contributions. Supports automatic conflict resolution via --auto-resolve flag (spawns AI subagents to resolve rebase conflicts). Use when syncing forks, rebasing PR branches, building production branches that combine all open PRs, reviewing closed/rejected PRs, or managing local patches kept outside upstream. Requires Git and GitHub CLI (gh). metadata: {"openclaw": {"requires": {"bins": ["git", "gh"]}}} ---
Manage forks where you contribute PRs but also use improvements before they're merged upstream. Includes support for local patches — fixes kept in the production branch even when the upstream PR was closed/rejected.
github skill insteadissue-prioritizer skill insteadpr-review skill insteadgh pr create directlyA skill NUNCA deve ser executada inline pelo agente principal. Sempre usar o padrão orchestrator/worker:
``` sessions_spawn( task: "
sessions_list / sessions_history: - Se o worker estiver ativo e progredindo → aguarda - Se o worker estiver parado/travado (sem output novo por 2 checks consecutivos) → subagents kill + spawna novo worker - Se o worker completou → lê o resultado e reporta ao usuário
- Orchestrator verifica o estado do repo (git status, último checkpoint) - Spawna novo worker com contexto atualizado incluindo o ponto onde parou - Máximo de 2 retries antes de reportar falha ao usuário
O orchestrator deve incluir no prompt do worker:
When invoked by a cron job (automated recurring sync), follow these guidelines for efficient execution:
- Rebases: attempt automatically, report failures - Closed PRs: report but defer decision (don't drop or keep without human input) - Audit findings: report but don't act
``` 🍴 Fork Sync Complete —
repos//checkpoint.json so the next run (or manual invocation) can resumeConfigs are organized per repository in repos/ relative to the skill directory:
fork-manager/
├── SKILL.md
└── repos/
├── project-a/
│ └── config.json
└── project-b/
└── config.json
Formato do config.json:
{
"repo": "owner/repo",
"fork": "your-user/repo",
"localPath": "/path/to/local/clone",
"mainBranch": "main",
"productionBranch": "main-with-all-prs",
"upstreamRemote": "upstream",
"forkRemote": "origin",
"autoResolveConflicts": false,
"openPRs": [123, 456],
"prBranches": {
"123": "fix/issue-123",
"456": "feat/feature-456"
},
"localPatches": {
"local/my-custom-fix": {
"description": "Breve descrição do que o patch faz",
"originalPR": 789,
"closedReason": "rejected|superseded|duplicate|wontfix",
"keepReason": "Motivo pelo qual mantemos localmente",
"addedAt": "2026-02-07T00:00:00Z",
"reviewDate": "2026-03-07T00:00:00Z"
}
},
"lastSync": "2026-01-28T12:00:00Z",
"notes": {
"mergedUpstream": {},
"closedWithoutMerge": {},
"droppedPatches": {}
}
}
autoResolveConflicts)A resolução automática pode ser ativada de duas formas (qualquer uma basta):
``` /fork-manager --auto-resolve /fork-manager full-sync --auto-resolve ```
```json { "autoResolveConflicts": true } ```
| Fonte | Comportamento | |-------|---------------| | Nenhuma (default) | Conflitos são reportados mas não resolvidos. Relatório inclui "⚠️ Conflitos requerem aval do desenvolvedor." | | --auto-resolve OU config.autoResolveConflicts: true | Spawna subagentes Opus para resolver conflitos. Resultados classificados como trivial/semântico/irresolvível. |
Precedência: --auto-resolve na invocação ativa a resolução mesmo se o config diz false. Não existe --no-auto-resolve — se o config diz true e o usuário não quer resolver, basta não rodar o passo manualmente.
Para usuários do ClawHub: basta passar --auto-resolve no comando. Nenhuma configuração de repo necessária.
localPatchesCada entry em localPatches é uma branch local mantida na production branch mas sem PR aberto no upstream.
| Campo | Descrição | |-------|-----------| | description | O que o patch faz | | originalPR | Número do PR original que foi fechado (opcional se criado direto como patch) | | closedReason | Por que o PR foi fechado: rejected (mantenedor recusou), superseded (outro PR resolve parcialmente mas não totalmente), duplicate (fechamos nós mesmos), wontfix (upstream não vai resolver) | | keepReason | Por que precisamos manter localmente | | addedAt | Data em que foi convertido para local patch | | reviewDate | Data para reavaliar se ainda é necessário (upstream pode ter resolvido) |
Cada repositório gerenciado tem um arquivo history.md que registra todas as execuções da skill como um livro de registro append-only:
fork-manager/
└── repos/
├── project-a/
│ ├── config.json
│ └── history.md
└── project-b/
├── config.json
└── history.md
Antes de qualquer operação, ler o history.md do repositório alvo e extrair a última entrada (último bloco ---). Isso dá contexto sobre:
...
安装 Fork Manager 后,可以对 AI 说这些话来触发它
Help me get started with Fork Manager
Explains what Fork Manager does, walks through the setup, and runs a quick demo based on your current project
Use Fork Manager to manage forks with open PRs - sync upstream, rebase branches, track ...
Invokes Fork Manager with the right parameters and returns the result directly in the conversation
What can I do with Fork Manager in my documents & notes workflow?
Lists the top use cases for Fork Manager, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/fork-manager/ 目录(个人级,所有项目可用),或 .claude/skills/fork-manager/(项目级)。重启 AI 客户端后,用 /fork-manager 主动调用,或让 AI 根据上下文自动发现并使用。
Fork Manager 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Fork Manager 可免费安装使用。请查阅仓库了解许可证信息。
Manage forks with open PRs - sync upstream, rebase branches, track PR status, and maintain production branches with pending contributions. Supports automatic...
Fork Manager 属于「Documents & Notes」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my documents & notes tasks using Fork Manager
Identifies repetitive steps in your workflow and sets up Fork Manager to handle them automatically