跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

pr-voice

Rewrite a thin or missing pull-request description (title + body) in the repo's own PR voice, learned from its merged-PR history — title convention, section shape, length for the diff size, how issues get closed. Grounded in the actual diff; never invents testing claims or motivation. Shows a before/after and applies with `gh pr edit` only on explicit confirmation. Use when the user asks to write, rewrite, fill in, or clean up a PR description, or to draft one for the current branch before opening a PR.

livlign · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add livlign/claude-skills --skill pr-voice

技能说明


name: pr-voice description: Rewrite a thin or missing pull-request description (title + body) in the repo's own PR voice, learned from its merged-PR history — title convention, section shape, length for the diff size, how issues get closed. Grounded in the actual diff; never invents testing claims or motivation. Shows a before/after and applies with gh pr edit only on explicit confirmation. Use when the user asks to write, rewrite, fill in, or clean up a PR description, or to draft one for the current branch before opening a PR.

pr-voice

Solo maintainers ship fast and PR bodies suffer: "fix stuff", an empty template, a title that's the branch name. A generic rewrite makes it worse in a different way — every assistant-written PR comes out as Summary / Changes / Testing with a bullet per file and a confident "All tests pass", which reads as foreign in a repo whose PRs are two plain sentences, and is wrong when nobody ran the tests.

This skill writes the description the way this repo already writes them, measured from what it actually merged, and says only what the diff, commits, and linked issues support.

Two things carry the quality, in this order:

  1. Facts from the change, not from imagination. The diff is the source of truth. Motivation the diff can't show is asked for or left out, never made up.
  2. Voice from the measured history, not from taste. scripts/pr-corpus.py turns merged PRs into numbers (title shape, length per diff size, recurring headings). The draft is checked against them before anyone sees it.

Phases

  1. Target — pick operating mode, resolve which PR (or branch) is being described, collect its facts.
  2. Voice — profile the repo's merged history, read the exemplars and the PR template.
  3. Draft — write title + body, then self-check against the profile and the fact ledger.
  4. Apply — show before/after; write it to GitHub only on explicit confirmation.

Phase 1 — Target

1.1 Operating mode (ask first)

Same three modes as repo-visuals and readme-doctor, via AskUserQuestion. Mode changes how many decisions are surfaced; it never skips the fact check (§3.3) or the apply confirmation (§4.2).

ModeWhat the user decidesTypical back-and-forths
Autonothing until the final apply confirmation1
Semi-auto (default)answers to open "why" questions (§1.4), the apply~2
Manualvoice scope, which exemplars to model, each open question, the draft, the apply4–6

If the user's request already says "just do it" or names a mode, don't ask.

1.2 Resolve the target

User givesTargetHow
PR number / URLthat PRgh pr view <n> --json number,title,body,author,baseRefName,headRefName,url,isDraft,state,closingIssuesReferences,commits,files,additions,deletions
nothing, branch has an open PRthe current branch's PRgh pr view --json … (same fields)
nothing, no PR yeta draft for gh pr createbase = repo default branch; facts from git log <base>..HEAD and git diff <base>...HEAD
pasted body onlyrewrite in placeask for the repo (or PR) — without a diff and history this skill has nothing to ground on; say so rather than guess

If the PR is merged or closed, say so and confirm before going further — editing a merged PR's body rewrites history people may have linked to.

If the PR's author isn't the current gh user, note it. Editing someone else's PR description is allowed on repos you maintain but it's their words; in every mode, the apply step (§4.2) names the author.

1.3 Fact ledger

Build a short internal list of what is known, each line tied to its source. Everything in the final body must trace back to a line here.

  • What changed — from the diff. Read it, don't just list file names: which behavior differs before vs after. For large diffs (> ~1500 changed lines) read the commit messages and the stat first, then the hunks of the files that carry the behavior change; skip lockfiles, generated code, snapshots, vendored dirs.
  • Why — only from: the existing body, commit messages, linked issues (closingIssuesReferences, #n refs in commits/body → gh issue view <n> --json title,body), or the user. Not from inference about what the author "probably" wanted.
  • Verification — only from: the existing body, commit messages, tests added/changed in the diff (state as "adds tests for X", not "tested"), CI status if the user asks to include it (gh pr checks). Never write "tested locally", "all tests pass", or "verified" unless one of those sources says so.
  • Breaking / migration — removed or renamed public API, changed CLI flags, config keys, defaults, schema/migration files. Flag these; they get named explicitly in the body regardless of voice.
  • Existing body content to preserve — see §3.2.

1.4 Open questions

If the ledger has a hole that the description genuinely needs — usually the why for a non-obvious change — ask once, batched, short:

The diff switches retry backoff from linear to exponential. Was there an incident or issue behind this? (Skip and I'll describe what changed without a why.)

Auto mode: don't ask; write the description without the missing piece. A short accurate body beats a padded invented one.


Phase 2 — Voice

2.1 Fetch history and profile it

gh pr list --repo <owner/name> --state merged --limit 100 \
  --json number,title,body,author,mergedAt,additions,deletions,changedFiles,url > "$TMP/merged.json"
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/pr-corpus.py" "$TMP/merged.json" --author <pr-author-login>

$TMP = a scratch directory, not the repo. Fetch 100 because busy repos are often majority-bot (dependabot, renovate); the script drops bots, prefers the target author's own history when they have ≥ 5 merged PRs, and caps at the newest 40.

The profile gives: sample.confidence, title convention (conventio

阅读完整来源 ↗