jackin-create-pr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

jackin-create-pr

jackin-create-pr

Open a PR for a small fix in the jackin❯ repo — typo, dependency bump, one-line bugfix, doc tweak — that needs no roadmap item. Also the shared PR-mechanics path other skills reuse. Commits inline; no separate commit skill.
jackin❯ rule files auto-load —
PULL_REQUESTS.md
,
.github/
agent rules,
BRANCHING.md
,
COMMITS.md
. This skill sequences them, never restates them. Read them for full rules.
为jackin❯仓库中的小型修复创建PR——如错别字修正、依赖版本更新、单行bug修复、文档调整等——无需纳入路线图事项。这也是其他技能可复用的通用PR流程。变更直接提交,无需单独的提交技能。
jackin❯规则文件会自动加载——
PULL_REQUESTS.md
.github/
下的Agent规则、
BRANCHING.md
COMMITS.md
。本技能会按顺序执行这些规则,不会重复说明。如需完整规则,请阅读上述文件。

When to use

使用场景

  • Operator runs
    jackin-create-pr
    .
  • Small, self-contained change (no design, no roadmap item).
  • 操作人员执行
    jackin-create-pr
    命令。
  • 小型、独立的变更(无需设计,无需纳入路线图事项)。

When NOT to use

禁用场景

  • Feature/idea worth a roadmap item →
    jackin-propose
    .
  • Implementing a finalized roadmap item →
    /goal Implement <slug>.md
    .
  • 值得纳入路线图的功能/想法 → 使用
    jackin-propose
  • 实现已确定的路线图事项 → 使用
    /goal Implement <slug>.md

Arguments

参数

  • --branch <name>
    — explicit branch name.
  • --auto-branch
    — pick the branch name yourself, no confirmation.
  • --title <msg>
    — commit + PR title (else derive from the diff, Conventional Commits).
  • --branch <name>
    — 指定分支名称。
  • --auto-branch
    — 自动选择分支名称,无需确认。
  • --title <msg>
    — 提交记录及PR标题(若未指定,则从差异内容中推导,遵循Conventional Commits规范)。

Process

流程

  1. Branch. Never commit to
    main
    . If on
    main
    , create a
    fix/
    /
    chore/
    /
    docs/
    /
    refactor/
    -prefixed branch named from the change. Suggest and confirm unless
    --auto-branch
    or
    --branch
    given.
  2. Commit. Uncommitted changes → commit inline per
    COMMITS.md
    : Conventional Commits subject, DCO sign-off (
    git commit -s
    ). Already committed → skip. Then
    git push
    .
  3. Build the body.
    [bin]
    Run
    cargo xtask pr body --base origin/main > /tmp/pr-body.md
    . The classified change digest (rust / docs / capsule / schema + file list) prints to stderr — read it; the body skeleton goes to the file: the PR template (read from
    .github/PULL_REQUEST_TEMPLATE.md
    at runtime) with the verify-locally blocks already selected and byte-exact, prose left as placeholders. Block selection: Checkout + isolation env always; Rust tests on a Rust change; Docs checks + walk on
    docs/**
    ; jackin-capsule smoke (with
    --capsule
    before any
    console
    /
    load
    ) on
    crates/jackin-capsule/
    ; schema migration smoke on a versioned-schema touch.
  4. Fill + create.
    [agent]
    Edit
    /tmp/pr-body.md
    — write the prose sections (Summary, What ships, Behavior changes) from the digest + diff; drop the optional sections you do not need. Then
    gh pr create --body-file /tmp/pr-body.md
    . The binary already wrote the body, so there is no heredoc to quote.
  5. Verify render.
    gh pr view <PR> --json body -q .body
    — confirm the prose you added renders (no stray
    \`` or 
    $
    from hand-editing). Fix with
    gh pr edit --body-file` if needed.
  6. Reply. Share the PR URL and repeat the Verify-locally commands in your final message.
  1. 创建分支。绝对不要直接提交到
    main
    分支。若当前处于
    main
    分支,需创建以
    fix/
    /
    chore/
    /
    docs/
    /
    refactor/
    为前缀的分支,分支名称与变更内容相关。除非指定了
    --auto-branch
    --branch
    ,否则需先建议分支名称并确认。
  2. 提交变更。若存在未提交的变更 → 按照
    COMMITS.md
    的规范直接提交:遵循Conventional Commits主题格式,添加DCO签名(使用
    git commit -s
    命令)。若已提交变更 → 跳过此步骤。然后执行
    git push
  3. 生成正文骨架
    [bin]
    执行
    cargo xtask pr body --base origin/main > /tmp/pr-body.md
    。分类后的变更摘要(rust / 文档 / capsule / 架构 + 文件列表)会输出到stderr——请查看该摘要;正文骨架会写入文件:PR模板(运行时从
    .github/PULL_REQUEST_TEMPLATE.md
    读取)已自动预选本地验证模块,内容完全匹配,仅留 prose 部分作为占位符。模块选择规则:始终包含检出+隔离环境;若为Rust变更,则包含Rust测试;若涉及
    docs/**
    目录,则包含文档检查+预览;若涉及
    crates/jackin-capsule/
    目录,则包含jackin-capsule冒烟测试(需在
    console
    /
    load
    之前添加
    --capsule
    参数);若涉及版本化架构修改,则包含架构迁移冒烟测试。
  4. 填充内容并创建PR
    [agent]
    编辑
    /tmp/pr-body.md
    ——根据变更摘要和差异内容填写prose部分(摘要、交付内容、行为变更);删除不需要的可选部分。然后执行
    gh pr create --body-file /tmp/pr-body.md
    。二进制文件已生成正文,无需处理 heredoc 引用问题。
  5. 验证渲染效果。执行
    gh pr view <PR> --json body -q .body
    ——确认添加的prose内容渲染正常(无手动编辑导致的多余
    \``或
    $
    符号)。如有问题,使用
    gh pr edit --body-file`命令修复。
  6. 回复通知。分享PR链接,并在最终消息中重复本地验证命令。

Common mistakes

常见错误

  • Committing to
    main
    instead of a branch.
  • Hand-building the body or template instead of
    cargo xtask pr body
    — it reads the template and selects the verify blocks for you.
  • Posting the skeleton with the prose placeholders left unfilled.
  • Deployed docs URLs in the body (break post-merge) — refer to docs by name.
  • 直接提交到
    main
    分支而非创建新分支。
  • 手动编写正文或模板,而非使用
    cargo xtask pr body
    ——该命令会读取模板并根据差异自动选择验证模块。
  • 提交保留prose占位符的骨架内容。
  • 正文中使用已部署的文档URL(合并后会失效)——应通过文档名称引用。

Tooling

工具支持

cargo xtask pr body
(jackin❯ repo) emits the change digest + the template skeleton with verify-locally blocks auto-selected from the diff. Shared with
propose
. The binary guarantees the mechanical parts (block selection, capsule ordering, exact command text, heredoc quoting); the agent writes the prose.
cargo xtask pr body
(jackin❯仓库)会输出变更摘要,以及根据差异自动预选本地验证模块的模板骨架。该工具与
propose
技能共享。二进制文件确保机械部分的正确性(模块选择、capsule排序、命令文本准确性、heredoc引用);Agent负责编写prose内容。