pr-author
Use when creating a GitHub pull request, or when updating an existing PR's title or body so it matches what the code actually does.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when creating a GitHub pull request, or when updating an existing PR's title or body so it matches what the code actually does.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when ingesting, refreshing, listing, searching, or deleting a local corpus with Blackbird code search and `gh blackbird search --fileset`.
Use when reaching for `gh blackbird` (Blackbird code search) for cross-repo lexical, symbol, or semantic search on GitHub — finding callers, ownership, or how systems work without cloning.
Use when authoring or substantially editing a design doc, architecture doc, or subsystem explanation — the "here's what's there and why" companion to an ADR's terse decision record.
Use when creating a repo-tracked multi-agent planning PR for a large project, especially when phases, living docs, parallel agent prompts, and cross-PR coordination are needed.
Use when about to call a library, crate, or framework API you haven't verified, when a dependency's behavior is surprising, when training-data memory might be stale, or when investigating how a dependency actually behaves.
Use when investigating an alert, monitor, incident, error spike, degraded service, or production anomaly, and the repository has no incident-investigation skill of its own.
| name | pr-author |
| description | Use when creating a GitHub pull request, or when updating an existing PR's title or body so it matches what the code actually does. |
| user-invocable | true |
Author or refresh a PR's title and body so they describe the final diff — same rules whether creating a new PR or rewriting one that drifted from the code.
Iterate on the live PR body, not on draft text in chat. Create or update it, then refine in place — a real PR is easier to react to than loose text in a conversation. Don't stage the body for yes/no sign-off before posting.
A PR body answers one question: why does this diff exist? The reviewer learns what changed from the code; the body supplies the why they can't — the bug, the constraint, the decision. Test every sentence against it: explains why → keep; otherwise cut. When the why is one sentence, the body is one sentence.
#1234 or a trailing "Related PRs" line.From the branch, run gh pr view --json number,title,body,baseRefName 2>/dev/null. If it returns a PR, this is an update — skip to Update an existing PR. Otherwise follow Create.
Assess state. git rev-parse --abbrev-ref HEAD && git status --short && git remote get-url origin. Extract owner/repo; get the default branch via gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'. If on the default branch, create a feature branch first.
Commit. Group changes into logical, atomic commits — one is fine if the change is cohesive. Subject lines under 72 chars, specific.
Push. git push -u origin HEAD. Don't merge or rebase the base branch just because it moved; update from base only on conflicts, failing checks, branch protection, or explicit request.
Use the template if one exists. Check for it, and if found you MUST use its structure — fill every section, no placeholders. If unsure how to fill a section, ask rather than guess.
for f in .github/pull_request_template.md .github/PULL_REQUEST_TEMPLATE.md \
docs/pull_request_template.md pull_request_template.md PULL_REQUEST_TEMPLATE.md \
.github/PULL_REQUEST_TEMPLATE/*.md; do [ -f "$f" ] && echo "Found: $f"; done
Detect chain-stacking. When a project ships as a stack of dependent PRs, base PR k+1 on PR k's head branch, not the default branch, so the reviewer sees only what k+1 adds. Retarget to default only when PR k merges.
default_branch=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')
if ! git merge-base --is-ancestor "origin/$default_branch" HEAD; then
for ref in $(gh pr list --state open --json headRefName --jq '.[].headRefName'); do
git merge-base --is-ancestor "origin/$ref" HEAD 2>/dev/null && echo "stacked on: $ref"
done
fi
If stacked, surface it ("Stacked on <branch> (PR #N). Base on it or on <default>?"), default to the stacked base, and add a blockquote near the top of the body noting it's stacked on the prior PR and will be retargeted to the default branch when that merges. Pass --base <stacked-branch> to gh pr create; retarget after the upstream merges via an API edit.
Draft. Title: concise, following repo conventions (feat:, fix:). Body: apply the content test above. Reference an issue if context suggests one (Fixes #123). Don't add boilerplate "Non-goals"/"Follow-ups" sections — call a non-goal out only when its absence would mislead. Append the GitHub Posting Protocol signature; keep Co-authored-by: out of the body (commit messages only).
Create as a draft via an API edit: an app-native tool, or gh pr create --draft --title … --body-file … --base <default>. Mark ready for review when I ask. Display the PR URL.
Use when an agent has iterated and the title/body no longer matches the code. Rewrite both to describe the current diff.
Re-ground in the diff. Never rewrite from memory or the old body.
num=$(gh pr view --json number --jq .number)
base=$(gh pr view --json baseRefName --jq .baseRefName)
git fetch origin "$base"
git diff --stat "origin/$base"...HEAD && git log --oneline "origin/$base"..HEAD
git diff "origin/$base"...HEAD # full diff; skim for surprises
Skim the old body only for durable keepers (stacked-on note, requested validation); treat the rest as untrusted.
Draft. Apply the content test; the body reads as a fresh answer to why the diff exists today, not a changelog. Drop stale and dev-journey prose, keep template structure and durable context, and retitle if the diff has shifted from the original intent.
Apply via an API edit.
Don't touch unrelated state — no new commits, rebase, base change, re-requested reviews, or close/reopen just because you're editing the body.
Prefer an app-native PR tool if the session exposes one (GitHub MCP update_pull_request, or a host equivalent) — REST PATCH under the hood, no SAML or read:org scope. Write bodies to a git-local scratch file (git rev-parse --git-path copilot-pr-body.md) to dodge shell escaping, and include the signature block.
If there's no app-native tool, gh pr create / gh pr edit --body-file work — but gh pr edit routinely fails on the local token with an opaque read:org scope error. On that failure, PATCH directly (no extra scope):
jq -Rs '{body: .}' < body.md | gh api -X PATCH /repos/<owner>/<repo>/pulls/<num> --input -
The same pattern works for title, base, and state.
The Pull Request Authoring Gate fires on any PR mutation done this way — gh pr edit/create, gh api …/pulls/…, curl — even through bash. This skill must be loaded first; don't type the command and hope.