fork-pr-flow

Guides opening and targeting pull requests across fork and owned-repository Git workflows.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/t-step/bindle-archive --skill fork-pr-flow-t-step
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fork-pr-flow
Source: https://github.com/t-step/bindle-archive/tree/main/skills/fork-pr-flow
Command: npx skills add https://github.com/t-step/bindle-archive --skill fork-pr-flow-t-step

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Contributing to a forked repository is error-prone: PRs get opened with head and base both pointing at upstream, branches get pushed to the wrong remote, and agents self-merge their own PRs under deadline pressure. This Skill enforces the correct fork topology — origin is your copy, upstream is the source — and keeps every change on a feature branch that lands via a properly targeted cross-fork PR. ## Core Features & Use Cases - Cross-fork PR targeting: Ensures gh pr create uses --repo <upstream-owner>/<repo> --base main --head <your-user>:feature/x, preventing the "upstream into upstream" mistake. - Branch discipline: Keeps main as a clean mirror of upstream, branches all work off fresh main, and rebases before opening the PR; optionally enforced with a no-commit-to-branch pre-commit hook. - Self-merge guardrail: The job ends at the open PR — never merge a PR you authored into upstream, including gh pr merge --auto, unless the operator explicitly names the merge. - Owned-repo variant: Covers the single-remote case where you are the upstream, with the same branch discipline but PRs targeting your own origin/main. - Use Case: You finished a feature on your fork of an open-source project. The Skill pushes the branch to origin only, opens the PR against upstream's base branch with a why-led description, and stops — leaving the merge to the maintainers. ## Quick Start Ask the agent to open a pull request from your fork's feature branch back to the upstream repository and confirm the head and base before creating it.

Frequently Asked Questions about fork-pr-flow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I open a pull request from my fork to the upstream repository?▼

Push your feature branch to origin, then run gh pr create with --repo <upstream-owner>/<repo>, --base main, and --head <your-username>:<branch>. Always print and confirm the head and base before creating, since gh often defaults --repo to upstream.

Why does my PR show upstream:main merging into upstream:main?▼

This happens when the PR head points at upstream's own branch instead of your fork's branch. Fix it by setting --head to <your-username>:<branch> so the PR goes from your fork's branch to upstream's base branch.

Should I ever push directly to the upstream remote?▼

No. Push to origin only, and only when a PR is actually requested. You usually lack rights to upstream, and pushing there is never wanted; the default action is to commit locally and stop unless explicitly asked.

Can I merge my own PR if I have commit access to upstream?▼

No. Commit access is not review — gh pr merge, gh pr merge --auto, and pushing a merge commit to upstream are all self-approval. Open the PR, report it, and stop; only an operator instruction that explicitly names the merge authorizes it.

How do I keep my fork's main branch clean for future PRs?▼

Never commit to main directly; keep it as a mirror of upstream/main via git fetch upstream and git merge --ff-only. Branch every unit of work off fresh main, and optionally enforce this with a no-commit-to-branch pre-commit hook.

Does this workflow apply when I own the repository myself?▼

Yes, with one change: the PR base is your own origin/main instead of upstream/main. Head and base both being origin is correct here — the upstream-into-upstream mistake only applies to forks.