create-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecreate-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 — , agent rules, , . This skill sequences them, never restates them. Read them for full rules.
PULL_REQUESTS.md.github/BRANCHING.mdCOMMITS.md为jackin'仓库中的小型修复创建PR,包括拼写修正、依赖版本升级、单行bug修复、文档微调等无需纳入路线图的变更。这也是其他技能可复用的通用PR流程。提交操作直接内嵌执行,无需单独调用提交技能。
jackin'的规则文件会自动加载,包括、下的Agent规则、和。本技能仅按顺序执行这些规则,不会重复说明详细内容,如需完整规则请查阅上述文件。
PULL_REQUESTS.md.github/BRANCHING.mdCOMMITS.mdWhen 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
参数
- — explicit branch name.
--branch <name> - — pick the branch name yourself, no confirmation.
--auto-branch - — commit + PR title (else derive from the diff, Conventional Commits).
--title <msg>
- — 指定分支名称
--branch <name> - — 自动生成分支名称,无需确认
--auto-branch - — 指定提交记录及PR标题(未指定时将根据代码差异自动生成,遵循Conventional Commits规范)
--title <msg>
Process
操作流程
- Branch. Never commit to . If on
main, create amain/fix//chore//docs/-prefixed branch named from the change. Suggest and confirm unlessrefactor/or--auto-branchgiven.--branch - Commit. Uncommitted changes → commit inline per : Conventional Commits subject, DCO sign-off (
COMMITS.md). Already committed → skip. Thengit commit -s.git push - Build the body. Run
[bin]. 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 fromcargo xtask pr body --base origin/main > /tmp/pr-body.mdat 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.github/PULL_REQUEST_TEMPLATE.md; jackin-capsule smoke (withdocs/**before any--capsule/console) onload; schema migration smoke on a versioned-schema touch.crates/jackin-capsule/ - Fill + create. Edit
[agent]— write the prose sections (Summary, What ships, Behavior changes) from the digest + diff; drop the optional sections you do not need. Then/tmp/pr-body.md. The binary already wrote the body, so there is no heredoc to quote.gh pr create --body-file /tmp/pr-body.md - Verify render. — confirm the prose you added renders (no stray
gh pr view <PR> --json body -q .body$\`` orgh pr edit --body-file` if needed.from hand-editing). Fix with - Reply. Share the PR URL and repeat the Verify-locally commands in your final message.
- 创建分支:绝对禁止直接提交到分支。若当前处于
main分支,需根据变更类型创建以main、fix/、chore/或docs/为前缀的分支。除非指定refactor/或--auto-branch参数,否则需先建议分支名称并确认后再创建。--branch - 提交变更:若存在未提交的变更,需按照中的规则直接提交:遵循Conventional Commits规范编写提交主题,同时进行DCO签名(执行
COMMITS.md)。若变更已提交则跳过此步骤,随后执行git commit -s推送分支。git push - 生成PR正文:执行
[二进制工具]。分类后的变更摘要(Rust代码/文档/capsule/架构 + 文件列表)会输出到stderr,请查看该摘要;PR正文框架会写入指定文件:该框架基于运行时读取的cargo xtask pr body --base origin/main > /tmp/pr-body.md模板生成,已自动选中并精确插入verify-locally模块,仅保留说明性文字占位符。模块选择规则:所有变更均需包含“检出代码+隔离环境”模块;Rust代码变更需添加Rust测试模块;.github/PULL_REQUEST_TEMPLATE.md目录下的变更需添加文档检查及预览模块;docs/**目录下的变更需添加jackin-capsule冒烟测试模块(需在crates/jackin-capsule//console指令前添加load参数);涉及版本化架构的变更需添加架构迁移冒烟测试模块。--capsule - 填充并创建PR:编辑
[Agent]文件,根据变更摘要和代码差异填写说明性章节(摘要、交付内容、行为变更),删除不需要的可选章节。随后执行/tmp/pr-body.md创建PR。由于二进制工具已生成正文框架,无需处理 heredoc 引用问题。gh pr create --body-file /tmp/pr-body.md - 验证渲染效果:执行查看PR正文的渲染效果,确认手动添加的内容格式正确(无遗漏的
gh pr view <PR> --json body -q .body$\``或gh pr edit --body-file`指令修正。符号)。若存在格式问题,可使用 - 回复通知:在最终消息中分享PR链接,并重复verify-locally相关指令。
Common mistakes
常见错误
- Committing to instead of a branch.
main - Hand-building the body or template instead of — it reads the template and selects the verify blocks for you.
cargo xtask pr body - 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正文或模板,未使用工具(该工具会自动读取模板并选择合适的verify模块)
cargo xtask pr body - 提交未填充说明性文字的PR正文框架
- 在PR正文中使用已部署的文档URL(合并后会失效)——应使用文档名称进行引用
Tooling
工具说明
cargo xtask pr bodyproposecargo xtask pr bodypropose