pr-rewritelisted
Install: claude install-skill tony/skills
# Rewrite PR Description
Regenerate an existing PR's description from scratch. Where
the `pr-refresh` skill patches stale content inside the existing structure,
this skill discards the old structure and drafts a fresh gold-standard
description of the branch's current net change — after mining the old
description for context worth carrying forward.
User input: $ARGUMENTS
## Context
Current branch — run this command and read the output:
```bash
git branch --show-current
```
PR for current branch (if any) — run this command and read the output:
```bash
gh pr view --json number,title,url,baseRefName 2>/dev/null || echo "(no PR for current branch — expect a PR number/URL in the argument)"
```
---
## Procedure
### 1. Resolve the PR and its target
- If `$ARGUMENTS` contains a PR number or URL, use it; otherwise use
the current branch's PR. No PR found → report that and stop
(`/pr` handles branches without a PR).
- Fetch the full PR:
```
gh pr view <number> --json number,title,body,url,baseRefName,headRefName,state
```
- The diff base is the PR's **`baseRefName`** — stack-aware, never an
assumed trunk. Gather the net change:
```
git fetch origin <baseRefName>
```
```
git log origin/<baseRefName>..HEAD --oneline
```
```
git diff origin/<baseRefName>...HEAD --stat
```
```
git diff origin/<baseRefName>...HEAD
```
### 2. Back up the current description
Save the existing body and title verbatim before drafting:
```
mkdir -p .git/pr-backups