gh-pr-generator
Draft a structured pull request body from the branch diff and open the pull request with the gh CLI.
Skill by ahandsel
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ahandsel-gh-pr-generator
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/gh-pr-generator
What's inside
- Skill name
gh-pr-generator- Description
- Draft a structured pull request body from the branch diff and open the pull request with the gh CLI. Use when a user asks to open, create, raise, or draft a pull request, or to refresh the body of the pull request that is already open for the current branch. Lists pending tasks and folds background detail into a collapsed section.
- License
- MIT
- Instructions
- 185 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# GitHub PR generator skill
Draft a pull request body from the branch diff, then open the pull request with the `gh` CLI.
This skill writes a general pull request for content, tooling, skill, style guide, and mixed changes.
Use [`gh-cli`](../gh-cli/SKILL.md) for general `gh` command reference, [`gh-pr-reporter`](../gh-pr-reporter/SKILL.md) to collect the review comments afterward, and [`ai-commit`](../ai-commit/SKILL.md) to write the commits first.
## Prerequisites
* `gh` is installed and authenticated. Verify with `gh auth status`, and ask the user to run `gh auth login` if it fails.
* The current branch is not `main`. In this repository the working branch is `dev` and pull requests target `main`. If the user is on `main`, stop and ask them to switch to `dev` or a feature branch first.
* The branch is up to date with `main`. Offer [`gh-sync-with-main`](../gh-sync-with-main/SKILL.md) with `--verify` when the branch may be behind.
* Every change the pull request should contain is committed. Uncommitted work is invisible to the diff, so offer `ai-commit` if the tree is dirty.
## Workflow flags
### Default workflow (no flags)
1. **Verify the environment.** Run `gh auth status`, `git branch --show-current`, and `git status --porcelain`. Stop on a failed check rather than guessing.
2. **Have the user push the branch if needed.** Compare the branch with its upstream using `git rev-list --left-right --count @{u}...HEAD`. If the branch has no upstream or is ahead, tell the user what needs pushing and ask them to run the push themselves, for example by typing `! git push` (or `! git push -u origin <branch>` when there is no upstream). This repository's agent permissions deny `git push`, so never attempt the push yourself.
3. **Gather branch context.** Determine the merge base with `git merge-base main HEAD`, then collect the commit list with `git log --oneline <base>..HEAD` and the changed files with `git diff --name-status <base>..HEAD`.
4. **Classify the pull request.** Decide whether it is a content change under `contents/en/` or `contents/ja/`, a style guide change under `docs/`, a skill or prompt change, a script or tooling change, a site configuration or theme change under `contents/.vitepress/`, or a mix. The classification selects which conditional sections apply.
5. **Run the pre-flight checks.** See the "Pre-flight checks" section. Report failures to the user and fix them before drafting.
6. **Confirm scope and collect notes.** Show the commits and the changed files. In the same prompt, ask for the pull request title, the intended reviewers, any pending questions, and anything the diff cannot reveal, such as a ticket ID or the reason a section is out of scope. Wait for the response.
7. **Draft the body.** Follow the "Pull request body structure" section. Include a conditional section only when the branch supplies evidence for it.
8. **Confirm the draft.** Show the full title and body. Revise on request, and confirm again before opening.
9. **Open the pull request.** Write the body to a temporary file and run `gh pr create --title "<title>" --body-file <file> --base main`. Never pass a long body through `--body` on the command line. Report the pull request URL to the user, and note that the lint autofix workflow may push a formatting auto-commit to the branch, so run `git pull` before adding more commits.
### `--auto` workflow flag
1. **No intermediate questions.** Do not ask about scope, notes, or ambiguity before drafting.
2. **Infer the title.** Use the branch's single commit title when there is exactly one commit, otherwise summarize the commits in the repository commit style, including the leading emoji.
3. **Still hand the push to the user** when the branch is ahead of or missing its upstream. `--auto` skips questions, not the push permission: report the exact `git push` command for the user to run.
4. **Still run the pre-flight checks.** Stop and report if any check fails; do not open a pull request on a red branch.
5. **Skip the draft confirmation** and open the pull request directly.
6. **Leave a placeholder** in the form `<!-- TODO: confirm -->` wherever a required section needs a human answer that the diff cannot supply, and list every placeholder in the final report.
### `--update` workflow flag
Refresh the body of the pull request that is already open for the current branch instead of opening a new one.
Use this after pushing commits that make the existing body stale.
1. **Find the pull request** with `gh pr view --json number,title,body,url`. Stop if the branch has no open pull request.
2. **Read the existing body** and preserve every human edit, including checkbox states, reviewer notes, and added sections. This is an edit, not a regeneration.
3. **Recompute the changed files and the checks** from the current branch state.
4. **Show a before-and-after diff of the body** and confirm before writing, unless `--auto` is also present.
5. **Write the update** with `gh pr edit <number> --body-file <file>`.
Do not tick a checkbox on the user's behalf.
Task state belongs to the reviewers.
### `--draft` workflow flag
Add `--draft` to `gh pr create` so the pull request opens as a draft.
Note in the final report that the PR check and lint autofix workflows still run on draft pull requests, so a formatting auto-commit can land on the branch even while it is a draft.
## Pull request body structure
Two sections are always present.
Every other section appears only when the branch supplies evidence for it.
An empty ceremonial section is worse than an absent one.
### Required sections
**Opening summary.**
One or two lines naming what the pull request contains and what is being asked of the reader.
Lead with a `> [!IMPORTANT]` callout above the summary when something must happen before merge, such as a follow-up task the change depends on.
**Pending tasks.**
Checkboxes listing what still has to happen before or after merge, such as a review pass, a follow-up translation, or a deploy check.
Write "None." when nothing is pending.
### Conditional sections
| Section | Include it when | Purpose |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Localization note | The pull request touches pages under `contents/en/` or `contents/ja/` | Names whether each pair is still `sync`, was translated in the same branch, or is now flagged `TODO: drifted` for a follow-up. |
| Files changed | The pull request touches more than about three files, or a file's role is not obvious from its path | Explains what each file is for, not that it changed. |
| Why the diff looks unusual | The diff misrepresents the work, for example a formatting auto-commit or a regenerated `docs/contents-structure.md` inflates it | Prevents a reviewer from misreading the change size. |
| What to look at | The pull request wants review of specific decisions rather than a general pass | Directs attention to the parts where the author is unsure. |
| Out of scope | Related work was deliberately deferred, or a sibling pull request covers part of it | Stops reviewers from filing what the author already knows. |
| Checks | Any validation ran | Records what passed. Name the commands and their results. |
Put "Files changed" and everything after it inside a collapsed block so the top of the body stays short:
```markdown
<details>
<summary>Additional information</summary>
### Files changed
...
</details>
```
### Body skeleton
Adapt this to the pull request.
Drop any section the table above does not justify.
```markdown
> [!IMPORTANT]
> <blocker that must be resolved before merge>
<one or two lines: what this contains and what is being asked for>
## Pending tasksFrom ahandsel/tokyo-geek, MIT.
More from ahandsel/tokyo-geek
- 0.603score
gh-sync-with-main
ahandsel
Bring the current git branch up to date with commits from the main branch, or check whether it needs syncing without changing it.
SkillAFreshness: A★ 2Claude Code +9 - 0.603score
audit-gh-branches
ahandsel
Audit local and remote Git branches, classify each as safe to delete, deletion candidate, needs rebase, ice, or keep active, and extract unique work as dated…
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
blog-md-linter
ahandsel
Lint and polish Markdown files in this repo - run the repo auto-fixers, refresh any table of contents, convert inline and autolink links to reference-style…
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
blog-content-auditor
ahandsel
Audit a blog post for content quality - verify facts are correct and up-to-date, check style-guide compliance, and confirm the content is logically sound and…
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
pr-auditor
ahandsel
Blunt merge audit of a code branch or pull request written by an AI coding agent, treating its description, comments, and green checks as claims to verify…
SkillAFreshness: A★ 2Claude Code +9 - 0.558score
script-auditor
ahandsel
Audit and enforce the AGENTS.md "Scripts" guidelines for helper scripts in this repo - banning Python, preferring Node.js `.mjs` modules or zsh, requiring…
SkillBFreshness: B★ 2Claude Code +9 - 0.557score
audit-pr-comments
ahandsel
Audit a user-specified PR review file with extreme scrutiny, then annotate that same file in place with a verdict for every comment (keep, rewrite, remove…
SkillBFreshness: B★ 2Claude Code +9 - 0.521score
handoff
ahandsel
Compact the current conversation into a handoff document for another agent to pick up.
SkillBFreshness: B★ 2Claude Code +9 - 0.518score
grill-me
ahandsel
A relentless interview to sharpen a plan or design.
SkillBFreshness: B★ 2Claude Code +9 - 0.512score
file-folder-name-linter
ahandsel
Lint repository file and folder names for format compliance.
SkillCFreshness: C★ 2Claude Code +9 - 0.512score
gh-pr-reporter
ahandsel
Fetch all comments on a GitHub pull request (reviews, inline review comments, and general issue comments) and emit a single consolidated Markdown report.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
general-en-polisher
ahandsel
Polish one or more Markdown files so the repo core writing rules are enforced - straight quotes (not curly), no contractions, the Oxford comma, sentence case…
SkillCFreshness: C★ 2Claude Code +9
Signals
- Stars
- 2
- Forks
- 0
- Open issues
- 1
- Last commit (this folder)
- Sep 29, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/ahandsel/tokyo-geek
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from ahandsel
- 0.603score
gh-sync-with-main
ahandsel
Bring the current git branch up to date with commits from the main branch, or check whether it needs syncing without changing it.
SkillAFreshness: A★ 2Claude Code +9 - 0.603score
audit-gh-branches
ahandsel
Audit local and remote Git branches, classify each as safe to delete, deletion candidate, needs rebase, ice, or keep active, and extract unique work as dated…
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
pr-auditor
ahandsel
Blunt merge audit of a code branch or pull request written by an AI coding agent, treating its description, comments, and green checks as claims to verify…
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
blog-content-auditor
ahandsel
Audit a blog post for content quality - verify facts are correct and up-to-date, check style-guide compliance, and confirm the content is logically sound and…
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
blog-md-linter
ahandsel
Lint and polish Markdown files in this repo - run the repo auto-fixers, refresh any table of contents, convert inline and autolink links to reference-style…
SkillAFreshness: A★ 2Claude Code +9 - 0.598score
gh-pr-generator
ahandsel
Draft a structured pull request body from the branch diff and open the pull request with the gh CLI.
SkillAFreshness: A★ 2Claude Code +9
Cite this page
gh-pr-generator skill. Agent Mart. https://agentmart.dev/skills/ahandsel-gh-pr-generator (last updated 2026-10-24)