一键导入
pr
Use when the user wants to create a new pull request, update an existing PR's body, open a draft PR, or preview a PR body locally before pushing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when the user wants to create a new pull request, update an existing PR's body, open a draft PR, or preview a PR body locally before pushing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when executing implementation plans with independent tasks in the current Pi session using fresh subagents and review loops
Create a new Pi task folder for a specific task or feature development. Use when the user wants to start a new task, plan a feature, or asks to create a task file.
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Use when you have a written implementation plan to execute with review checkpoints
Use when you have an approved design or requirements for a multi-step task, before touching code
Use when you notice something to fix later while working on another task - captures context without breaking flow (~10 seconds)
| name | pr |
| description | Use when the user wants to create a new pull request, update an existing PR's body, open a draft PR, or preview a PR body locally before pushing. |
| arguments | create|draft|update|preview base=<branch> |
Dispatch on the first argument:
create → see Create belowdraft → same as Create but create a draft PR instead of a regular PRupdate → see Update belowpreview → see Preview belowAn optional base=<branch> argument (any position) sets the target branch. If omitted, default to the repo's default branch. Pass via --base <branch> to gh pr create. Ignored for update and preview.
Before drafting any PR body (create/draft/update/preview): Read references/content-guidelines.md AND references/blocks.md in full. Do not draft from memory.
Run this first, before selecting blocks. Classify the change on two axes:
fix:/revert: lean fix; feat: leans feature.Then:
Detected: feature + complex.fix/feat commits, or a diff on the simple/complex borderline. Otherwise proceed.The body is assembled from the block library, not a single fixed template.
○ blocks using the include-when rules there.Do not add sections outside the block library. Keep all language succinct and concise.
Before gh pr create, gh pr edit, or printing a Preview body, verify the drafted body:
## heading appears in the block library in references/blocks.md (no ## Test plan, ## Testing, ## Test coverage, ## Summary, or other ad-hoc headings).which/so/and, or leads with mechanism instead of the change. Split flagged sentences into what-then-why. Additionally, Key Changes sub-bullets over ~2 sentences / ~25 words (the cap in references/blocks.md) split into two bullets.—) anywhere in the body, including link/label separators. Grep the drafted body for —; if any appear, replace with a colon, comma, parentheses, or separate sentence before applying.If any check fails, revise before applying. Do not ship a body you haven't checked.
For gh pr create and gh pr edit, always use --body-file with mktemp. Never --body (its subshell mangles backticks and $). No exceptions — inconsistency invites the next agent to rationalize their way back to --body.
tmp=$(mktemp -t pr-body.XXXXXX) && trap 'rm -f "$tmp"' EXIT && cat > "$tmp" <<'EOF' && gh pr create --body-file "$tmp" [flags]
[body]
EOF
Run in a single Bash call — the trap only protects the shell it's set in.
git log --oneline -- <changed-files> for convention patterns).<type>(<scope>)?<!>?: <title>. Title starts lowercase. No trailing period. Omit scope when no single area dominates.--draft for draft PRs).Steps:
/pr create instead.gh pr edit per Applying the Body above.Scope: body only. Do not change title or draft state unless the user asks.
| Thought | Reality |
|---|---|
| "The body update is the main action, push is incidental" | Push is a precondition. The body is meaningless if the commits aren't visible to reviewers. |
"User said /pr update, not /pr update and push" | The skill defines update as inclusive of the push question. Asking is in scope. |
| "I can mention pushing in my closing summary" | Too late. The PR is already updated against stale remote state. |
Generate the PR body and print it inline without creating, updating, or pushing anything.
Inspect branch state (same as Create).
Print a preview summary first, then the body. The summary is a fixed set of key/value lines so it's scannable, not prose:
**Title:** <generated title>
**Detected:** <type> + <complexity>
**Blocks:** <comma-separated blocks included, in emit order>
**Dropped:** <comma-separated ○ blocks omitted + one-word reason each, or "none">
**Status:** Preview only: nothing created or pushed
After the summary, output the PR body.
Close with a one-line next step, e.g. "Run /pr create to open it."
Do NOT write to any file.
Do NOT run gh pr create, gh pr edit, git push, or any remote-mutating command.