PR Update (open or refresh)
One skill for create and update. Make the title + body match the branch
as it is now. Do not strip media from an existing description.
Steps
git status / git diff / git log / git diff <default>...HEAD (and
remote tracking) so you know the full change set — not just the latest
commit.
- Detect an existing PR/MR for this branch (
gh pr view / glab mr view).
- None → create (push upstream with
-u if needed).
- Exists → edit title + body in place. Do not open a duplicate.
- Draft a title and body from all commits/files in the PR, not one commit.
- If updating: fetch the current body first. Preserve every media item
exactly (see below). Then rewrite text so Summary / Test plan (or the
repo's usual sections) stay accurate.
- Apply with
gh pr create / gh pr edit (or glab equivalents).
- End with the PR/MR as a markdown link — the number and the full forge
URL (
[#123](https://github.com/org/repo/pull/123), GitLab ! equivalent).
Never a bare #123. This is the one place the rule is written down; the
other skills just follow it.
Title + body
- Title: concise, why-focused; match repo PR style when obvious.
- Body: use the repo's template when one exists; otherwise:
## Summary
<1-3 bullets of what changed and why>
## Test plan
- [ ] <concrete checks>
- Run the prose through
no-tropes before publishing.
- Do not invent reviewers, labels, or milestone unless asked.
Commits
Shape the branch's commits as part of opening/refreshing the PR.
- One concern per commit. Default to a topical split (2–5 is typical) even if
not asked; don't dump everything into one blob unless the user wants it.
- Match the repo's recent commit style (
git log --oneline -15); subject = why.
No "WIP" / "fix stuff".
- Rebuild with soft reset + path-staged commits (no
git rebase -i — needs a
TTY). Show the final git log --oneline <default>..HEAD before force-push.
Two traps in that recipe:
- Soft-reset to the branch's real base SHA (
git merge-base HEAD origin/<default>),
never to origin/<default> itself — it moves mid-task and will stage other
people's commits as yours.
git reset <base> -- <path> leaves that path unstaged, so the next
git commit silently captures its pre-edit version. Verify the content
landed (git show <sha>:<path> | grep <new symbol>) before force-push.
- Keep authorship when reshaping others' work (
Co-authored-by / cherry-pick),
especially during pr-triage salvage.
- Don't mix pure formatting with logic, commit secrets/
.env, or rewrite
commits already on the default branch without asking.
Preserve media (hard rule)
When a PR/MR already has a body, never delete media.
Treat as media (keep verbatim, same URLs/markup/order when possible):
- Markdown images / links to images or video (
, [...](...) to
media)
- HTML
<img>, <video>, <source>, <br> used between media blocks
- GitHub/GitLab upload / user-attachments / moved-image URLs
- Image/video-only paragraphs or HTML comments wrapping media
Update flow:
- Read the existing body.
- Extract and keep the media blocks.
- Rewrite textual sections so they match the current diff.
- Re-attach the preserved media (same block(s), typically at the end unless
they were interleaved on purpose — then keep interleaving).
- Before submit, diff old body vs new: every media URL/markup from the old
body must still be present.
If a refresh would drop media, stop and keep the old body (or only edit the
title) rather than publishing a media-stripped description.
Scope
- In: open PR/MR, push if needed for create, shape commits, retitle, rewrite
description, preserve media, print URL.
- Out: rebase, CI, and review threads (
pr-ready), triage/salvage
(pr-triage), merging.
Forge cheatsheet
# GitHub — read
gh pr view --json url,title,body,baseRefName,headRefName
# GitHub — create
gh pr create --title "…" --body "$(cat <<'EOF'
…
EOF
)"
# GitHub — update (body from file avoids shell-eating newlines/media)
gh pr view --json body -q .body > /tmp/pr-body.md
# …edit /tmp/pr-body.md carefully…
gh pr edit --title "…" --body-file /tmp/pr-body.md
# GitLab
glab mr view
glab mr create
glab mr update <N> --title "…" --description-file /tmp/pr-body.md
1---2name: pr-update3description: Open a PR/MR if missing, or refresh an existing one's title and description so they match the current diff. Preserves any media already in the body. Use when the user says /pr-update, open a PR, update the PR, refresh the PR title/description, or wants the PR opener/manager flow.4---56# PR Update (open or refresh)78One skill for **create** and **update**. Make the title + body match the branch9as it is now. Do not strip media from an existing description.1011## Steps12131. `git status` / `git diff` / `git log` / `git diff <default>...HEAD` (and14 remote tracking) so you know the full change set — not just the latest15 commit.162. Detect an existing PR/MR for this branch (`gh pr view` / `glab mr view`).17 - **None** → create (push upstream with `-u` if needed).18 - **Exists** → edit title + body in place. Do not open a duplicate.193. Draft a title and body from **all** commits/files in the PR, not one commit.204. If updating: fetch the current body **first**. Preserve every media item21 exactly (see below). Then rewrite text so Summary / Test plan (or the22 repo's usual sections) stay accurate.235. Apply with `gh pr create` / `gh pr edit` (or `glab` equivalents).246. End with the PR/MR as a markdown link — the number **and** the full forge25 URL (`[#123](https://github.com/org/repo/pull/123)`, GitLab `!` equivalent).26 Never a bare `#123`. This is the one place the rule is written down; the27 other skills just follow it.2829## Title + body3031- Title: concise, why-focused; match repo PR style when obvious.32- Body: use the repo's template when one exists; otherwise:3334```markdown35## Summary36<1-3 bullets of what changed and why>3738## Test plan39- [ ] <concrete checks>40```4142- Run the prose through `no-tropes` before publishing.43- Do not invent reviewers, labels, or milestone unless asked.4445## Commits4647Shape the branch's commits as part of opening/refreshing the PR.4849- One concern per commit. Default to a topical split (2–5 is typical) even if50 not asked; don't dump everything into one blob unless the user wants it.51- Match the repo's recent commit style (`git log --oneline -15`); subject = why.52 No "WIP" / "fix stuff".53- Rebuild with soft reset + path-staged commits (no `git rebase -i` — needs a54 TTY). Show the final `git log --oneline <default>..HEAD` before force-push.55 Two traps in that recipe:56 - Soft-reset to the branch's **real base SHA** (`git merge-base HEAD origin/<default>`),57 never to `origin/<default>` itself — it moves mid-task and will stage other58 people's commits as yours.59 - `git reset <base> -- <path>` leaves that path **unstaged**, so the next60 `git commit` silently captures its pre-edit version. Verify the content61 landed (`git show <sha>:<path> | grep <new symbol>`) before force-push.62- Keep authorship when reshaping others' work (`Co-authored-by` / cherry-pick),63 especially during `pr-triage` salvage.64- Don't mix pure formatting with logic, commit secrets/`.env`, or rewrite65 commits already on the default branch without asking.6667## Preserve media (hard rule)6869When a PR/MR already has a body, **never delete media**.7071Treat as media (keep verbatim, same URLs/markup/order when possible):7273- Markdown images / links to images or video (``, `[...](...)` to74 media)75- HTML `<img>`, `<video>`, `<source>`, `<br>` used between media blocks76- GitHub/GitLab upload / user-attachments / moved-image URLs77- Image/video-only paragraphs or HTML comments wrapping media7879Update flow:80811. Read the existing body.822. Extract and keep the media blocks.833. Rewrite textual sections so they match the current diff.844. Re-attach the preserved media (same block(s), typically at the end unless85 they were interleaved on purpose — then keep interleaving).865. Before submit, diff old body vs new: every media URL/markup from the old87 body must still be present.8889If a refresh would drop media, stop and keep the old body (or only edit the90title) rather than publishing a media-stripped description.9192## Scope9394- **In:** open PR/MR, push if needed for create, shape commits, retitle, rewrite95 description, preserve media, print URL.96- **Out:** rebase, CI, and review threads (`pr-ready`), triage/salvage97 (`pr-triage`), merging.9899## Forge cheatsheet100101```bash102# GitHub — read103gh pr view --json url,title,body,baseRefName,headRefName104105# GitHub — create106gh pr create --title "…" --body "$(cat <<'EOF'107…108EOF109)"110111# GitHub — update (body from file avoids shell-eating newlines/media)112gh pr view --json body -q .body > /tmp/pr-body.md113# …edit /tmp/pr-body.md carefully…114gh pr edit --title "…" --body-file /tmp/pr-body.md115116# GitLab117glab mr view118glab mr create119glab mr update <N> --title "…" --description-file /tmp/pr-body.md120```