Skip to content
Back to skills

Github Pr Flow

ASecurity

Help make a GitHub pull request ready to merge, or split a large branch into smaller pull requests. Use when asked to prepare, review, split, or land GitHub PRs. Requires Git, authenticated gh, Bash, and Python 3 for the helper scripts.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added October 7, 2026
ai-agentspythonbashgitapi

Works with

  • api

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add mgerdov-igt/ai-cookbook --skill github-pr-flow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Github Pr Flow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Github Pr Flow
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mgerdov-igt-github-pr-flow/badge)](https://www.skillsdirectory.com/skills/mgerdov-igt-github-pr-flow)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: github-pr-flow
description: Help make a GitHub pull request ready to merge, or split a large branch into smaller pull requests. Use when asked to prepare, review, split, or land GitHub PRs. Requires Git, authenticated gh, Bash, and Python 3 for the helper scripts.
---

# GitHub Pull Request Flow

- One PR already exists: follow [Merge readiness](references/MERGE-READINESS.md).
- A large branch needs several PRs: follow [Split a large branch](references/SPLIT-LARGE-BRANCH.md).

Read the repo's `AGENTS.md`, contribution guide, CI workflow and any PR playbook first. Its test commands, protected files, required reviewers and merge rules win over this skill.

## Rules

- Never switch branches, force-push or discard changes in the user's current worktree while a PR is in flight. Work in a separate worktree (see the `pr-to-main` skill, or the snapshot steps in the split guide). Do not use `git stash push` to move the user's changes.
- Never approve your own PR (GitHub blocks it). Never merge without the CI-green and zero-open-threads bar; `--admin` skips an approval gate only where the user authorized it.
- Use the scripts, not hand-written `gh`/GraphQL: they paginate, print both id spaces, and encode the polling rules.

## Scripts

Run from inside the repo: `bash "<skill-folder>/scripts/<name>"`. On Windows use Git Bash (not WSL). Need `gh` and Python 3 (`pr-watch.sh`, `pr-update-branch.sh` need only `gh`).

| Script | Use |
|---|---|
| `pr-watch.sh --loop <n>` | The only wait loop. Threads first, then branch state, then CI; quiet until something needs action; exit 10 = threads open, 16 = park, 17 = call again. |
| `pr-threads.sh <n> --text` | Open threads with ids and full text, one call. |
| `pr-reply.sh`, `pr-resolve.sh` | Reply (REST comment id) then resolve (GraphQL thread id). |
| `pr-merge.sh <n> [--admin]` | Two clean polls, merge, verify MERGED. |
| `pr-update-branch.sh <n>` or `--all` | Bring a BEHIND branch up to date (API, no checkout). |
| `pr-cleanup.sh <worktree> <branch> [--fold]` | After merge: remove the worktree, delete the branch, prove the parent tree's dirty files are already on the default branch. Does NOT merge the default branch into the parent's branch unless `--fold` (squash-only repos must use `pr-sync-branch.sh`). Never discards a file it cannot prove is already merged. |
| `pr-sync-branch.sh <pr-number \| commit> [--branch B] [--dry-run] [--push]` | After a squash-merge: move the working branch (reset, or `rebase --onto` past the shipped commits) so it matches the default branch with no merge commit. `--push` = `--force-with-lease` pinned to the remote tip, only with the owner's OK. `test-pr-sync-branch.sh` is its self-test (39 checks). |
| `pr-ready.sh <n>` | One-shot readiness check (not part of the normal flow). |

Each script's header comment is its usage doc.

## Efficiency rules (each saves a CI cycle or many tokens)

1. Request the review bot the moment the PR opens; self-review the diff before the first push (the [pre-push](../pre-push/SKILL.md) skill does this and runs the checks).
2. Do not wait for CI: findings land mid-run. `pr-watch.sh --loop` handles it.
3. Fix every open thread, then push once per round. Cancel superseded CI first; CI restarts by itself.
4. The 4th bot review is parked, not fixed (`PR_ROUND_LIMIT`, default 4).
5. A review bot can be invisible in `reviewRequests`; check `gh api repos/<owner>/<repo>/pulls/<n>/reviews`.
6. Keep logs and large outputs out of the conversation: read only the failing step.

Files in this skill

  • README.md1.2 KB
  • SKILL.md2.7 KB
  • references/MERGE-READINESS.md5.5 KB
  • references/SPLIT-LARGE-BRANCH.md2.9 KB
  • scripts/_common.sh1.4 KB
  • scripts/pr-cleanup.sh3.7 KB
  • scripts/pr-ready.sh2.9 KB
  • scripts/pr-reply.sh1.1 KB
  • scripts/pr-resolve.sh910 B
  • scripts/pr-threads.sh2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.