From ywc-agent-toolkit
Generates a merged PR list grouped by author for a release PR (e.g., develop→main) and updates the PR description. Optionally includes per-PR summaries.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ywc-agent-toolkit:ywc-release-pr-listThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Announce at start:** "I'm using the ywc-release-pr-list skill to compile the merged PR list for the release PR."
Announce at start: "I'm using the ywc-release-pr-list skill to compile the merged PR list for the release PR."
Generate the PR list for a release PR and update the PR description.
When tempted to skip a step, check this table first:
| Excuse | Reality |
|---|---|
| "Some commit headlines lack PR numbers, skip those" | Stop and report missing PR numbers. They likely indicate squashed-without-link or direct pushes that need attention. |
| "Author resolution failed for one PR, leave it blank" | Always retry author lookup via gh pr view <num> --json author. Blank author breaks grouping. |
| "Author summaries make the list verbose, skip them" | Summary inclusion is interactively asked at the start. Honor that user choice exactly. |
| "Updating the target PR description requires force, skip on conflict" | Use gh pr edit --body-file -. If concurrent edit detected, fetch latest and re-apply, do not overwrite. |
| "Group by date instead of author for variety" | Author grouping is the spec. Date grouping defeats the goal of attribution. |
| "Release PR has 100+ PRs, truncate with '... and more'" | Never truncate. Long lists are fine; missing entries break audit trail. |
Violating the letter of these rules is violating the spirit. Release PR descriptions are an audit artifact.
git branch --show-currentgit log --oneline -5$ARGUMENTS must contain the target release PR number301Follow the steps below.
$ARGUMENTSBefore doing any GitHub API work, ask the user exactly one question and wait for a response:
Would you like to include a short summary of what each PR applied alongside the author? (yes / no)
yes, y, or equivalent affirmative: set summary_mode = trueno, n, or equivalent negative: set summary_mode = falsesummary_mode = false and explicitly note the default in the final report.Persist summary_mode in memory for the remaining steps. Do not re-prompt later.
Run:
gh pr view <PR_NUMBER> --json commits --jq '.commits[].messageHeadline'
Merge pull request #(\d+) — standard merge commit format(#\d+) — squash merge format (e.g., feat: add login (#123))#<number> from arbitrary positions (e.g., fix #123 is an Issue reference, see #456 is a cross-reference — these are not merged PRs)gh pr view <number> --json state --jq .state to confirm it is a merged PR. Skip any that return OPEN, CLOSED (not merged), or errorFetch author, title, summary, and MERGED state for all extracted PR numbers in one script call:
bash claude-code/skills/ywc-release-pr-list/scripts/fetch-pr-metadata.sh \
<pr-number-1> <pr-number-2> ...
# exit 0 → NDJSON on stdout (one JSON object per line); exit 2 → usage error
Each output line is one of:
{"number":123,"author":"alice","title":"feat: add login","summary":"Add login flow","skipped":false} — merged PR; use author for grouping and summary for summary mode{"number":124,"skipped":true,"reason":"not_merged: OPEN"} — PR is not merged; skip it{"number":125,"skipped":true,"reason":"fetch_error"} — could not fetch; report in final reportThe script applies the summary derivation rules (strip conventional commit prefixes, truncate at 80 chars, fall back to first non-empty body line for vague titles) regardless of summary_mode. In classic mode, ignore the summary field and use only author.
Build entries in this format:
- #<PR_NUMBER> @<AUTHOR>- #<PR_NUMBER> @<AUTHOR> — <SUMMARY>First, save the current PR description and the new PR list to temporary files:
gh pr view <PR_NUMBER> --json body --jq '.body' > /tmp/pr_body_original.txt
Write the new PR LIST content (entries only, no heading) to /tmp/pr_list_new.txt.
Classic mode example (summary_mode = false):
- #123 @alice
- #145 @alice
- #130 @bob
Summary mode example (summary_mode = true):
- #123 @alice — Add OAuth login flow with Google provider
- #145 @alice — Fix pagination off-by-one on user list
- #130 @bob — Refactor database connection pool for reuse
Then run this script to produce the updated body. This script replaces ONLY the ## PR LIST section and preserves everything else byte-for-byte:
python3 - /tmp/pr_body_original.txt /tmp/pr_list_new.txt /tmp/pr_body_updated.txt <<'PYEOF'
import sys, re
original = open(sys.argv[1], "r").read()
new_list = open(sys.argv[2], "r").read().strip()
section = f"## PR LIST\n\n{new_list}\n"
# Pattern: match from "## PR LIST" to the next "## " heading or end of string
pattern = r"(## PR LIST)\s*\n[\s\S]*?(?=\n## |\Z)"
if re.search(pattern, original):
updated = re.sub(pattern, section, original, count=1)
else:
# No existing PR LIST section — append at end
updated = original.rstrip() + "\n\n" + section + "\n"
open(sys.argv[3], "w").write(updated)
PYEOF
Finally, update the PR description from the file:
gh pr edit <PR_NUMBER> --body-file /tmp/pr_body_updated.txt
Important: Do NOT construct the full body string manually. Always use the Python script above to ensure only the ## PR LIST section is modified.
{owner}/{repo} dynamically: gh repo view --json nameWithOwner --jq .nameWithOwnergh is unavailable or unauthenticated, stop and report the blocker.## PR LIST section. Maintain the original section order.## PR LIST section already exists, replace only that section with the new PR list. Leave everything else intact.summary_mode silently and never re-prompt mid-run.Use $release-pr-list 301 to update the release PR description.Use $release-pr-list 301 and keep the existing sections untouched except for PR LIST.Use $release-pr-list 301 — I'll choose whether to add per-PR summaries when prompted.npx claudepluginhub yongwoon/ywc-agent-toolkitGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.