merge-pr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

merge-pr

merge-pr

Sequence the jackin' pre-merge gates fail-closed, retire the roadmap item into docs, then squash-merge. Reuses the
.github/
agent rules (auto-loaded) and
PULL_REQUESTS.md
— sequences them, never restates them.
执行jackin的预合并检查(失败即终止),将路线图项归档到文档中,然后进行压缩合并。复用
.github/
下的Agent规则(自动加载)和
PULL_REQUESTS.md
——按流程执行,不重复说明内容。

When to use

使用场景

  • Operator runs
    /jackin-dev:merge-pr [<PR>]
    to merge a jackin' PR (defaults to the current branch's PR).
  • 操作员运行
    /jackin-dev:merge-pr [<PR>]
    以合并jackin相关PR(默认使用当前分支对应的PR)。

When NOT to use

不适用场景

  • Opening or iterating a PR →
    /jackin-dev:create-pr
    /
    /jackin-dev:propose
    .
  • 创建或迭代PR → 使用
    /jackin-dev:create-pr
    /
    /jackin-dev:propose

Arguments

参数

  • --no-poll
    — do not wait on pending CI; stop and report instead.
  • --admin <check>
    — authorize bypassing one named failing check (still needs the high-blast-radius confirm).
  • --no-poll
    — 不等待待处理的CI任务;直接停止并报告状态。
  • --admin <check>
    — 授权绕过指定的一项失败检查(仍需高影响范围确认)。

Red flags — STOP

危险信号——立即停止

  • No clear authorization for this PR and it is high-blast-radius → STOP, confirm first.
  • Any required CI check failing → STOP (no
    --admin
    bypass without
    --admin <check>
    + confirm).
  • Roadmap item not retired / not status-moved when the PR ships or advances it → STOP, fix first.
  • 针对此PR无明确授权且属于高影响范围 → 停止,先确认。
  • 任何必需的CI检查失败 → 停止(若无
    --admin <check>
    +确认,不可使用
    --admin
    绕过)。
  • PR交付或推进路线图项时,路线图项未归档/未更新状态 → 停止,先修复。

Process

流程

  1. Resolve PR. Current branch's PR or the arg. Read
    gh pr view
    and
    gh pr diff
    .
  2. Blast-radius classify. High if the diff touches a versioned schema, auth/security surface,
    .github/workflows/**
    , or needs a force-push /
    --admin
    . High → pause for one explicit confirm. Normal → proceed (invoking the skill is the go).
  3. CI gate.
    gh pr checks <PR>
    : if pending, poll until green (unless
    --no-poll
    ); if any check fails, STOP. Trust CI — which runs
    cargo xtask schema-check
    plus the test/clippy/fmt jobs — no local re-run.
  4. Roadmap retirement. Does this PR ship the last piece of its roadmap item?
    • Yes
      [bin]
      cargo xtask roadmap retire <slug> --plan
      prints the worklist: the page content, every inbound link (
      grep <slug>
      ), and the
      meta.json
      entry.
      [agent]
      Do the judgment moves — operator detail →
      guides/
      /
      commands/
      , design detail →
      reference/
      , write the
      ## Completed
      bullet in
      roadmap/index.mdx
      , repoint inbound links; commit
      docs:
      .
      [bin]
      cargo xtask roadmap retire <slug> --apply
      removes the
      meta.json
      entry, deletes the
      .mdx
      , runs the audit, and fails if any inbound link still points at the dead slug. Run the
      bun
      docs gate; push.
    • Partial
      cargo xtask roadmap retire <slug> --partial
      sets
      **Status**: Partially implemented
      and keeps the page; name the remaining phases; commit; push.
  5. Metadata reconcile. Title/body match the final diff? Squash writes the title verbatim into history. Fix via
    gh pr edit
    if stale; surface the change in your reply.
  6. Squash-merge. Build a body file (prose summary, no checklists), append trailers via
    cargo run -p jackin-pr-trailers -- --body-file
    , then
    gh pr merge <PR> --squash --body-file
    . Confirm the title carries
    (#N)
    .
  7. Report. Merged SHA and what retirement did.
  1. 确定PR:当前分支对应的PR或指定参数中的PR。读取
    gh pr view
    gh pr diff
    的结果。
  2. 影响范围分类:若代码变更涉及版本化 schema、认证/安全层面、
    .github/workflows/**
    ,或需要强制推送/使用
    --admin
    ,则属于高影响范围。高影响范围→暂停并等待明确确认。普通影响范围→继续执行(调用此技能即表示同意)。
  3. CI检查:执行
    gh pr checks <PR>
    :若任务待处理,轮询直到状态为绿色(除非使用
    --no-poll
    );若任何检查失败,立即停止。信任CI结果——CI会运行
    cargo xtask schema-check
    以及测试/clippy/fmt任务——无需本地重新运行。
  4. 路线图归档:此PR是否完成了路线图项的最后一部分
    • [bin]
      执行
      cargo xtask roadmap retire <slug> --plan
      生成工作清单:页面内容、所有入站链接(
      grep <slug>
      )和
      meta.json
      条目。
      [agent]
      执行判断性操作——操作员相关细节迁移至
      guides/
      /
      commands/
      ,设计细节迁移至
      reference/
      ,在
      roadmap/index.mdx
      中添加
      ## 已完成
      项目符号,重定向入站链接;提交
      docs:
      类型的提交。
      [bin]
      执行
      cargo xtask roadmap retire <slug> --apply
      移除
      meta.json
      条目、删除
      .mdx
      文件、执行审计,若仍有入站链接指向已删除的slug则失败。运行
      bun
      文档检查;推送提交。
    • 部分完成 → 执行
      cargo xtask roadmap retire <slug> --partial
      将状态设置为
      **状态**: 部分已实现
      并保留页面;命名剩余阶段;提交;推送。
  5. 元数据协调:标题/正文是否与最终代码变更匹配?压缩合并会将标题直接写入历史记录。若内容过时,通过
    gh pr edit
    修复;在回复中说明变更内容。
  6. 压缩合并:生成正文文件( prose 摘要,无检查清单),通过
    cargo run -p jackin-pr-trailers -- --body-file
    添加尾部信息,然后执行
    gh pr merge <PR> --squash --body-file
    。确认标题包含
    (#N)
  7. 报告:输出合并后的SHA值以及归档操作的内容。

Common mistakes

常见错误

  • Carrying a prior session's "just merge everything" as authorization — it does not carry forward.
  • Merging on pending/failing CI, or
    --admin
    -bypassing without explicit per-check opt-in.
  • Leaving a
    Status: Resolved
    roadmap page instead of retiring it into docs.
  • Squash title missing the
    (#N)
    suffix or the DCO / Co-authored-by trailers.
  • 将之前会话中的“全部合并”授权沿用至当前PR——此授权不具有延续性。
  • 在CI任务待处理/失败时合并,或未针对具体检查项明确选择就使用
    --admin
    绕过。
  • 保留
    状态: 已解决
    的路线图页面,未将其归档到文档中。
  • 压缩合并的标题缺少
    (#N)
    后缀或DCO / Co-authored-by尾部信息。

Tooling

工具集

Bundles
jackin-pr-trailers
.
cargo xtask roadmap retire <slug> --plan
gives the agent the retirement worklist;
--apply
does the mechanical removal + audit and fails on a dangling link;
--partial
sets the Status. The content moves themselves are the agent's judgment. CI runs
cargo xtask schema-check
(the 5-artifact gate); this skill only reads its result.
包含
jackin-pr-trailers
cargo xtask roadmap retire <slug> --plan
为Agent提供归档工作清单;
--apply
执行机械移除+审计,若存在悬空链接则失败;
--partial
设置状态。内容迁移操作由Agent自行判断。CI运行
cargo xtask schema-check
(5项产物检查);此技能仅读取其结果。