-
Notifications
You must be signed in to change notification settings - Fork 1
add fork-pr-workflow skill — factory-portable fork→upstream contribution flow #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,370 @@ | ||||||||||
| --- | ||||||||||
| name: fork-pr-workflow | ||||||||||
| description: Capability skill ("hat") — fork-based contribution workflow where contributors (human or agent) develop on a personal fork and open PRs against a canonical upstream repo. Use when the working copy is a fork, when opening a contribution PR from a fork, when setting up a new contributor's local environment, or when diagnosing why merge-queue / auto-merge UI isn't showing up on a cross-repo PR. Covers three-remote setup (origin=fork, upstream=canonical), feature-branch daily loop, per-PR upstream submission as the default rhythm, merge-queue + auto-merge compatibility with cross-repo PRs, and the common anti-patterns. Describes an optional "batched upstream" overlay for cost-constrained projects — the skill defers that rhythm choice to project-specific configuration rather than hardcoding one. | ||||||||||
| --- | ||||||||||
|
|
||||||||||
| # Fork PR Workflow — Procedure | ||||||||||
|
|
||||||||||
| Capability skill. No persona. Wear this hat when the | ||||||||||
| contribution flow is **fork → upstream** rather than | ||||||||||
| **branch → main within a single repo**. | ||||||||||
|
|
||||||||||
| ## When to wear | ||||||||||
|
|
||||||||||
| - Setting up a local clone for a project where you will | ||||||||||
| contribute via personal fork. | ||||||||||
| - Opening a PR from a fork branch to the canonical repo. | ||||||||||
| - Diagnosing why a merge-queue / auto-merge button isn't | ||||||||||
| showing up on a fork PR. | ||||||||||
| - Explaining the flow to a new contributor (human or | ||||||||||
| agent) who has only worked on single-repo branch-to- | ||||||||||
| main workflows. | ||||||||||
|
|
||||||||||
| ## The fork-based model | ||||||||||
|
|
||||||||||
| ``` | ||||||||||
| upstream (canonical) o---o---o---o----- (squash-merged PRs) | ||||||||||
| \ ^ | ||||||||||
| \ | PR targets upstream | ||||||||||
| origin (your fork) o---o---o-----+ | ||||||||||
| ^ | ||||||||||
| | you push here | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Three named remotes in your local clone: | ||||||||||
|
|
||||||||||
| - **`origin`** — your personal fork (read/write you own). | ||||||||||
| - **`upstream`** — the canonical repo (read-only for | ||||||||||
| non-maintainers; maintainers can push but usually | ||||||||||
| don't). | ||||||||||
| - No third remote unless you're syncing across multiple | ||||||||||
| forks (rare). | ||||||||||
|
|
||||||||||
| PRs are opened **from** `origin` **to** `upstream` via | ||||||||||
| the GitHub "Compare & pull request" flow or | ||||||||||
| `gh pr create --repo <upstream> --base <default-branch> | ||||||||||
| --head <fork-owner>:<branch>`. | ||||||||||
|
Comment on lines
+44
to
+46
|
||||||||||
| the GitHub "Compare & pull request" flow or | |
| `gh pr create --repo <upstream> --base <default-branch> | |
| --head <fork-owner>:<branch>`. | |
| the GitHub "Compare & pull request" flow or `gh pr create --repo <upstream> --base <default-branch> --head <fork-owner>:<branch>`. |
Copilot
AI
Apr 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This skill is described as factory-portable, but the daily loop hardcodes the default branch name as main in multiple commands (checkout main, merge upstream/main, --base main). Repos still commonly use master or another default; consider using a <default-branch> placeholder consistently (as in the earlier gh pr create mention) or using upstream/HEAD after setting the remote head.
Copilot
AI
Apr 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --force-with-lease guidance is good, but the reference to “BP-24” here appears incorrect: BP-24 in docs/AGENT-BEST-PRACTICES.md is a consent/emulation rule, not a git history safety rule. Please remove the BP-24 reference or replace it with an accurate pointer.
| a different working copy). That's the kind of | |
| history-destruction event BP-24 warns against. | |
| a different working copy). That prevents the kind of | |
| history-destruction event this workflow is avoiding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section says “Three named remotes in your local clone” but then only defines
originandupstream(and explicitly says no third remote). This reads like a factual inconsistency; either change it to “Two named remotes” or define what the third remote is meant to be.