重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
backport-pr-assistant by cockroachdb/cockroach
npx skills add https://github.com/cockroachdb/cockroach --skill backport-pr-assistant帮助用户将拉取请求后向移植到较旧的发布分支,特别是在需要解决冲突时。
始终传递 --no-browser 以防止后向移植工具打开浏览器窗口。如果 --no-browser 不被识别,说明用户使用的是旧版本工具——请通过运行 go install github.com/cockroachdb/backport@latest 升级工具后重试。
基本用法:
backport --no-browser <pull-request>... # 后向移植整个 PR
backport --no-browser <pr> -r <release> # 指定目标发布版本 (例如,-r 23.2)
backport --no-browser <pr> -b <branch> # 指定目标分支 (例如,-b release-23.1.10-rc)
backport --no-browser <pr> -j "justification" # 添加发布理由
backport --no-browser <pr> -c <commit> -c <commit> # 仅挑选特定提交
backport --no-browser <pr> -f # 强制操作
冲突解决:
backport --continue # 解决冲突后继续
backport --abort # 取消进行中的后向移植
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
常见示例:
backport --no-browser 23437 # 简单的后向移植
backport --no-browser 23437 -r 23.2 # 到 release-23.2 分支
backport --no-browser 23437 -j "test-only changes" # 附带理由
backport --no-browser 23437 -b release-23.1.10-rc # 到特定的发布候选分支
当用户指定确切的分支时,直接使用这些分支。当用户说类似"后向移植到所有分支"或"后向移植到所有受支持的发布版本"但没有列出具体版本时,通过获取 CockroachDB 发布支持策略页面来确定哪些分支仍受支持:
https://www.cockroachlabs.com/docs/releases/release-support-policy
该页面包含两个表格:受支持的版本 和 不受支持的版本。仅后向移植到 维护支持结束日期 尚未过去的版本——处于协助支持阶段的版本仅接收关键安全修复,而非通用的错误修复后向移植。跳过出现在 不受支持的版本 表格中的任何版本(它已终止生命周期)。注意创新版本——它们有较短的支持窗口且没有协助支持阶段,因此可能最近已终止生命周期。
在开始第一次后向移植之前,提示用户提供发布理由(例如,"潜在数据丢失的错误修复"、"仅测试更改"、"安全补丁")。在所有后向移植 PR 中使用相同的理由。通过 -j 将其传递给每个 backport 调用。
backport --no-browser <pr> -r <release> -j "<justification>"git add 已解决的文件backport --continue 以恢复gh pr create(参见下面的"创建后向移植 PR")仅当用户明确请求时才创建 PR。使用 gh pr create 并遵循以下约定:
PR 标题格式:
release-XX.X: <原始 PR 标题>
标题是发布分支前缀、冒号、空格,然后是原始 PR 标题的逐字复制。例如,如果原始 PR 标题是 "keys: handle case where keys targeted by GC request straddle header" 且目标分支是 release-24.3,则后向移植 PR 标题应为:
release-24.3: keys: handle case where keys targeted by GC request straddle header
PR 正文格式:
匹配后向移植工具使用的标准正文格式:
Backport N/N commits from #<original-pr> on behalf of @<user>.
----
<原始 PR 提交消息或正文>
----
Release justification: <justification>
示例 gh pr create 调用:
gh pr create \
--repo cockroachdb/cockroach \
--base release-24.3 \
--head <user>:backport24.3-<pr-number> \
--title "release-24.3: <original title>" \
--body "<body following the format above>"
你可以直接解决的简单冲突:
复杂冲突 - 向用户寻求指导:
git add <files> 然后 backport --continue每周安装次数
64
代码库
GitHub 星标数
32.1K
首次出现
2026年1月21日
安全审计
安装于
claude-code60
gemini-cli60
opencode59
cursor58
codex57
antigravity57
Help the user backport pull requests to older release branches, especially when conflicts need resolution.
Always pass--no-browser to prevent the backport tool from opening browser windows. If --no-browser is not recognized, the user has an old version of the tool — upgrade it by running go install github.com/cockroachdb/backport@latest and retry.
Basic Usage:
backport --no-browser <pull-request>... # Backport entire PR(s)
backport --no-browser <pr> -r <release> # Target specific release (e.g., -r 23.2)
backport --no-browser <pr> -b <branch> # Target specific branch (e.g., -b release-23.1.10-rc)
backport --no-browser <pr> -j "justification" # Add release justification
backport --no-browser <pr> -c <commit> -c <commit> # Cherry-pick specific commits only
backport --no-browser <pr> -f # Force operation
Conflict Resolution:
backport --continue # Resume after resolving conflicts
backport --abort # Cancel in-progress backport
Common Examples:
backport --no-browser 23437 # Simple backport
backport --no-browser 23437 -r 23.2 # To release-23.2 branch
backport --no-browser 23437 -j "test-only changes" # With justification
backport --no-browser 23437 -b release-23.1.10-rc # To specific release candidate branch
When the user specifies exact release branches, use those directly. When the user says something like "backport to all branches" or "backport to all supported releases" without listing specific versions, determine which branches are still supported by fetching the CockroachDB release support policy page:
https://www.cockroachlabs.com/docs/releases/release-support-policy
The page contains two tables: Supported versions and Unsupported versions. Only backport to versions whose Maintenance Support end date has not yet passed — versions in the Assistance Support phase only receive critical security fixes, not general bug-fix backports. Skip any version that appears in the Unsupported versions table (it is EOL). Pay attention to Innovation releases — they have shorter support windows and no Assistance Support phase, so they may have recently gone EOL.
Before starting the first backport, prompt the user for a release justification (e.g., "bug fix for potential data loss", "test-only changes", "security patch"). Use the same justification across all backport PRs. Pass it to every backport invocation via -j.
backport --no-browser <pr> -r <release> -j "<justification>" for the target branchgit add the resolved filesbackport --continue to resumegh pr create (see "Creating Backport PRs" below)Only create PRs when the user explicitly requests it. Use gh pr create with the following conventions:
PR Title Format:
release-XX.X: <original PR title>
The title is the release branch prefix, a colon, a space, and then the original PR title verbatim. For example, if the original PR title is "keys: handle case where keys targeted by GC request straddle header" and the target branch is release-24.3, the backport PR title should be:
release-24.3: keys: handle case where keys targeted by GC request straddle header
PR Body Format:
Match the standard body format used by the backport tool:
Backport N/N commits from #<original-pr> on behalf of @<user>.
----
<original PR commit messages or body>
----
Release justification: <justification>
Examplegh pr create invocation:
gh pr create \
--repo cockroachdb/cockroach \
--base release-24.3 \
--head <user>:backport24.3-<pr-number> \
--title "release-24.3: <original title>" \
--body "<body following the format above>"
Simple conflicts you can resolve directly:
Complex conflicts - ask the user for guidance:
git add <files> then backport --continueWeekly Installs
64
Repository
GitHub Stars
32.1K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
claude-code60
gemini-cli60
opencode59
cursor58
codex57
antigravity57
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
111,700 周安装