create-pr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

create-pr

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-dev:create-pr
    .
  • Small, self-contained change (no design, no roadmap item).
  • 操作员执行
    /jackin-dev:create-pr
    指令时
  • 小型、独立的变更(无需设计评审、无需纳入路线图)

When NOT to use

禁用场景

  • Feature/idea worth a roadmap item →
    /jackin-dev:propose
    .
  • Implementing a finalized roadmap item →
    /goal Implement <slug>.md
    .
  • 需纳入路线图的功能/想法 → 使用
    /jackin-dev: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. 生成PR正文
    [二进制工具]
    执行
    cargo xtask pr body --base origin/main > /tmp/pr-body.md
    。分类后的变更摘要(Rust代码/文档/capsule/架构 + 文件列表)会输出到stderr,请查看该摘要;PR正文框架会写入指定文件:该框架基于运行时读取的
    .github/PULL_REQUEST_TEMPLATE.md
    模板生成,已自动选中并精确插入verify-locally模块,仅保留说明性文字占位符。模块选择规则:所有变更均需包含“检出代码+隔离环境”模块;Rust代码变更需添加Rust测试模块;
    docs/**
    目录下的变更需添加文档检查及预览模块;
    crates/jackin-capsule/
    目录下的变更需添加jackin-capsule冒烟测试模块(需在
    console
    /
    load
    指令前添加
    --capsule
    参数);涉及版本化架构的变更需添加架构迁移冒烟测试模块。
  4. 填充并创建PR
    [Agent]
    编辑
    /tmp/pr-body.md
    文件,根据变更摘要和代码差异填写说明性章节(摘要、交付内容、行为变更),删除不需要的可选章节。随后执行
    gh pr create --body-file /tmp/pr-body.md
    创建PR。由于二进制工具已生成正文框架,无需处理 heredoc 引用问题。
  5. 验证渲染效果:执行
    gh pr view <PR> --json body -q .body
    查看PR正文的渲染效果,确认手动添加的内容格式正确(无遗漏的
    \``或
    $
    符号)。若存在格式问题,可使用
    gh pr edit --body-file`指令修正。
  6. 回复通知:在最终消息中分享PR链接,并重复verify-locally相关指令。

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
    分支而非创建独立分支
  • 手动编写PR正文或模板,未使用
    cargo xtask pr body
    工具(该工具会自动读取模板并选择合适的verify模块)
  • 提交未填充说明性文字的PR正文框架
  • 在PR正文中使用已部署的文档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'仓库工具)会根据代码差异生成变更摘要及已自动选中verify-locally模块的PR模板框架。该工具与
propose
技能共享。二进制工具负责处理机械性内容(模块选择、capsule排序、精确指令文本、heredoc引用),Agent负责编写说明性文字。