/github-flow:pr [--dry-run] [image.png#alt ...] [what the reviewer should know]from github-flow
Opens or updates a pull request with a structured body (why, danger, where to start, one view, proof, decisions) after reviewing the branch. Supports dry-run, image attachments, and issue linking.
Ships in github-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Agents review the PR first. The body is for the reader who opens it afterwards, human or agent, and needs to act: why the change exists, what breaks if it is wrong, where to start reading, one view of it, and the proof. It leaves nothing open: every open point is something the next agent reads and loops on. Every view is text, so an agent reads the same facts. The body repeats no CI check, which the pull request shows; its proof shows the runs of the change.
$ARGUMENTS
--dry-run: no push, no publish; print the title, the base, the body and the attachments instead..png, .jpg, .gif, .mp4, .mov: files to attach. Alt text may follow the path after #.Branch. git branch --show-current. On dev, main, the repo's default branch, or no branch: stop, show git status --short, ask for a branch name; with no user to ask, report no branch and stop. Uncommitted changes: stop and say so; the commit comes first (/git:commit).
Base. dev when origin/dev exists, else gh repo view --json defaultBranchRef. gh takes that bare name; a git command or the script takes origin/<base>, since a local branch of that name may be missing or stale.
Evidence. Read before citing.
git log --oneline origin/<base>..HEAD and git diff --stat origin/<base>...HEAD: the size, the files, and whether the change crosses modules (a plugin, a package, a top-level directory of code).git diff --stat origin/<base>...HEAD -- '*test*' '*spec*'.Closes #N in a commit body, else the leading number of the branch name, else none. gh issue view <n> --json title,body when there is one. Its situations, a Done when table or list, are what Proof answers.git diff --name-only origin/<base>...HEAD that it names.AGENTS.md or CLAUDE.md names them. Its GLOSSARY.md or CONTEXT.md when one exists: the words that name the nodes of a view.View. One, the smallest that makes the key point clear, from the table under Views.
**Before** then **After**, first under Start at, ahead of any other view. A change that moves no flow gets no diagram: a picture that shows no change is noise.${CLAUDE_PLUGIN_ROOT}/scripts/tree-diff.ts origin/<base> prints the tree diff. A directory moved, added or deleted whole is one line, and a directory where more than three files changed, all of them only modified, is a count. Keep the lines the reader needs and comment each one with what it owns now. Where the skill runs outside its plugin, with no scripts/tree-diff.ts beside it, write that tree by hand from git diff --name-status origin/<base>...HEAD, by the same rules.references/mermaid.md first. GitHub's renderer has traps a terminal never shows.references/views.md.Proof. The issue's situations, before → after: a table, one row per situation, the before observed on the base and the after on the branch. Each before and after is a run, and the body shows its command and what it returned:
The repository's verify recipe, when it has one, gives the commands.
A change the reader sees (a page, a view, a component, a stylesheet) proves a state with two stills, Before then After, when $ARGUMENTS gave none. The browser tool of the session captures the base state (the live page, else the base branch served) and the branch, one state per file, outside the repo, in a directory from mktemp -d. No reachable base: After alone, and the caption says what it shows.
A transition two stills cannot show (an animation, a navigation, a sequence of gestures) is a still then a clip, three clips at most. Each clip comes with a protocol line, Protocol: <build>, <viewport>, <page>, <action>, and names the e2e test that asserts what it shows: a clip no test asserts proves one run. Playwright drives the recording, from a script that touches no file of the repo. Recipe, traps and publishing: references/video.md.
Decisions. The body asks nothing and leaves nothing open. A decision is a file of the diff that the issue puts Out of scope, a form the diff leaves open, or a behaviour read but not run whose answer would change the branch.
AskUserQuestion, the option the agent would take first. An answer that changes the code is committed (/git:commit)./loop run or a scheduled task: never call AskUserQuestion; decide. A file of the diff that the issue's Out of scope names goes back to its origin/<base> state in a commit (git restore --source origin/<base> -- <file>).Review. Only for a hot branch: a large diff (past about 400 changed lines), or a change to authentication, permissions, secrets, input parsing or a hook that guards tools. Any other branch leaves the review to the pull request's own, and the skill goes on to step 8. Before the body, so the body describes the final head; wait for each reviewer's report.
/code-review medium of the branch against origin/<base>: with no level the review runs at the level typed last. Each finding is fixed and committed, or settled as a fact of Decided.plugin-dev:skill-reviewer when the hot diff touches a SKILL.md or an agents/*.md, its findings under the same rule.Body. Write the shape of Body to a file in a directory of its own, from mktemp -d, outside the repo. The title follows the convention of git log --oneline -10. Then check it:
bun ${CLAUDE_SKILL_DIR}/scripts/check-pr.ts <tmp>/body.md
Each finding is <file>:<line>: <check>: <message>, exit 1. Fix the line and run it again until it exits 0; never publish a body it refuses. Exit 2: the file or the repository's settings could not be read, and the message says which.
Publish. No question about publishing: the skill is the guard, and a caller that wants a look first passes --dry-run. Without --dry-run, push with git push -u origin HEAD. A rejected push: report it verbatim and stop; never force. A PR already open on the branch (gh pr view --json number,body) is edited, else one is created:
gh pr create --base <base> --title "<title>" --body-file <tmp>/body.md --attach '<capture dir>/before.png#<alt>'
gh pr edit <n> --title "<title>" --body-file <tmp>/body.md --attach '<capture dir>/after.png#<alt>'
--body-file keeps the markdown intact. A  in the body is rewritten to the uploaded asset when <path> is the same string as in --attach, and the alt text in the body wins. The image files stay outside the repo, so both strings are the absolute path of the capture, <capture dir> that mktemp -d directory; --attach is their only path to GitHub.
Render check. A body with a Mermaid block, after a publish. Only GitHub shows the drawing: gh pr view returns the markdown. When the session's browser can open the PR (on a private repository, only the user's logged-in browser can), screenshot the diagram, fix what does not read, gh pr edit <n> --body-file <tmp>/body.md, and look again: two rounds at most. A diagram that still does not read after them is replaced by a text view of the same nodes.
Report. The title and the URL.
| The change | The view |
|---|---|
| Logic, an algorithm | pseudocode as a diff |
| A flow, a state, or who acts at a step | a Mermaid stateDiagram-v2 or sequenceDiagram, Before then After, ahead of any other view |
| Runtime control flow | a call tree, as a diff when it changes |
| Moved, added or deleted directories | the tree diff of step 4, in a diff block |
| UI structure | a component tree, with the state and module boundaries that matter |
| A topology: an architecture, a data flow, a data model | a Mermaid flowchart TB |
| Contrasts that share no shape | a Before / After table, one line per cell |
One view. A flow that moves is the exception: its two diagrams come first, and one other view may follow them. Use diff when the point is what changes and the surrounding shape already exists; match the diff shape to the topic: a tree, a call tree, a component tree, pseudocode. A topology whose shape changes is one Mermaid diagram, the delta marked by a classDef colour.
Place each visual next to the short text it supports. Keep only the calls, files, props, states, and boundaries needed to answer the reader's question; a table cell that runs past one line is prose in a grid. What a user sees is not the view: its stills and clips are the proof.
Borrowed text and its licences: CREDITS.md.
Each section is a bold lead-in at the start of its line, in this order, each once; no heading, no other section. Worked bodies, which the check passes: references/bodies/ (a fix, a feature, a flow, a UI change, a change across modules).
Closes #N.
**Why** one sentence: why the change exists.
**Danger** one-way door or two-way door · reach: what breaks if the change is wrong.
**Start at** the test or the contract the reader opens first; for a change across modules, "read in this order:" then the files.
<the flow before and after, when the change moves one; then the view of step 4>
**Proof** the situations, before → after; for a UI change, the stills, the clips with their protocol line and their e2e test.
**Decided** three facts at most, never a question. Omitted when empty.
<sub>Written by <the model that wrote the body></sub>
Closes #N. when there is an issue.**Before**, <where>: then , the same string as its --attach, the same for After. The alt text names what is in the picture, not the file. A clip is , with no alt text: GitHub renders it as a player, and the line above it says what to watch for.The check, scripts/check-pr.ts, reads the structure, not the prose: a required section missing, out of order or twice, a heading or a section the shape does not have (Ask, Left open, Checks...), no view under Start at, a Mermaid diagram under Start at after another view, a **Before** diagram with no **After** one under it, no footer, a question anywhere outside code, more than 120 words of prose outside views, tables and code, more than three facts under Decided, more than three clips, and a clip with no protocol line or no e2e test named under it. Whether the change moves a flow, and so needs its diagrams, is the skill's to judge: a body with no diagram is asked for none. What the prose says is the review's to judge. A repository sets its own caps in .github/github-flow.json, under the key pr: { "pr": { "proseWords": 120, "decided": 3, "clips": 3 } }; a cap it leaves out keeps its default.
Session line. Under the footer, rendered by GitHub as nothing:
<!-- opened_by: ${CLAUDE_SESSION_ID} -->
On an update, the opened_by line of the current body is kept as it is and <!-- updated_by: ${CLAUDE_SESSION_ID} --> goes under it, replacing an earlier updated_by. The id names the session to resume (claude --resume <id>); inside a subagent it is the parent session's, so a PR a subagent opens names the session that spawned it.
gh pr diff shows; paste the line a decision hangs on.CREDITS.md (opens in a new tab)references/bodies/cross-module.md (opens in a new tab)references/bodies/feature.md (opens in a new tab)references/bodies/fix.md (opens in a new tab)references/bodies/flow.md (opens in a new tab)references/bodies/ui.md (opens in a new tab)references/mermaid.md (opens in a new tab)references/video.md (opens in a new tab)references/views.md (opens in a new tab)scripts/check-pr.integration.test.ts (opens in a new tab)scripts/check-pr.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bengous/claude-code-plugins --plugin github-flow5 skills in this plugin
/commit-push-prCommit the current work, push the branch, then open or update its pull request./issueWrite or rewrite a GitHub issue as the goal and how to tell it is reached - a problem in two lines, a Done when visual of testable situations, Not this, and only when the session already holds context, the author's leads folded - checked by a script before it is published. Use when the user asks to file, write, draft, open, or rewrite an issue./stacked-prsRun a stack of pull requests on GitHub with `gh stack`: create, grow, submit, sync, land, repair, and cut a per-layer worktree with its handoff. Use when the user talks about stacked PRs, a stack or pile of PRs, `gh stack`, wants to split a large change into reviewable PRs that land together, or debugs a stack (empty PR "No commits between X and Y", "Needs rebase", local/GitHub divergence, a commit stuck under someone else's).Other plugins' skills for the same job