fork-pr-operations
Skill517 starsChanged 3 days agoMITView on GitHub
Operational patterns for fork PRs (head repo differs from base repo). Covers GitHub workflow approval after push, force-push protocol, remote naming conventions, stale CI verification, and bot review multi-round awareness. Load when working with fork PRs, cross-repo contributions, or workflow approval issues.
- Deletes or force-pushes
- Commits and pushes
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
After pushing, there is a brief window (1-5 seconds) before GitHub creates the workflow run object.
- Very specific: line 71
Always use --force-with-lease, never bare --force:
- Distinctive: line 101
After rebase + force-push, the PR head SHA changes.
- Distinctive: line 105
After a rebase or force-push, verify CI check data belongs to the current PR head:
- Distinctive: line 115
If check data references an older SHA, the checks are stale.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fork PR Operations
Fork PRs — where the head repository differs from the base repository — have a distinct operational lifecycle. GitHub treats them with stricter security defaults that require additional steps not needed for same-repo PRs.
When to use this skill
- You are pushing to a branch on a forked repository
- CI checks are stuck in "waiting" status after a push
- You need to rebase a fork PR branch against upstream/main
- A bot reviewer posts after every push, creating multiple review rounds
Workflow approval after push
Critical: GitHub requires explicit workflow approval for fork PRs. After every push, CI jobs remain in "waiting" status until a user with write access to the base repository approves the workflow run.
Approval command
# List pending workflow runs for the PR
gh run list --repo <upstream-owner>/<upstream-repo> --branch <branch-name> --limit 5
# Approve a specific run
gh api -X POST repos/<upstream-owner>/<upstream-repo>/actions/runs/<run-id>/approveRace condition: run not yet created
After pushing, there is a brief window (1-5 seconds) before GitHub creates the workflow run object. If you try to approve too quickly, the run won't exist yet. Retry with a short delay:
# Wait for run to appear, then approve
sleep 5
gh run list --repo <upstream-owner>/<upstream-repo> --branch <branch-name> --limit 1 --json databaseId,status --jq '.[0]'
# If status is "waiting", approve:
gh api -X POST repos/<upstream-owner>/<upstream-repo>/actions/runs/<databaseId>/approvePermission requirements
The gh api -X POST .../approve call requires actions: write permission on the base (upstream) repository. This typically means your GitHub token needs the repo or public_repo scope, and you must have write access to the upstream repo. Fork owners without upstream write access cannot approve workflow runs — only upstream maintainers can.
gh auth status
# Verify you have repo/public_repo scope and write access to the upstream repoRemote naming conventions
Standard remote setup for fork-based contributions:
# origin = your fork
git remote add origin https://github.com/<your-username>/<repo>.git
# upstream = canonical repository
git remote add upstream https://github.com/<canonical-owner>/<repo>.git
# Additional forks by owner name (if collaborating across forks)
git remote add <collaborator> https://github.com/<collaborator>/<repo>.gitForce-push protocol
Always use --force-with-lease, never bare --force:
# Safe: verifies remote tracking branch matches expected SHA
git push --force-with-lease origin <branch-name>
# DANGEROUS: overwrites any remote changes, including work by collaborators
git push --force origin <branch-name> # NEVER DO THIS--force-with-lease checks that the remote tracking branch matches your local expectation. If someone else pushed between your last fetch and your force-push, the lease check fails safely instead of destroying their work.
Rebase workflow
To sync a fork PR branch with upstream/main:
# Fetch latest from upstream
git fetch upstream
# Rebase your branch onto upstream/main
git rebase upstream/main
# Resolve conflicts if any, then continue
git rebase --continue
# Force-push the rebased branch to your fork
git push --force-with-lease origin <branch-name>After rebase + force-push, the PR head SHA changes. All CI checks re-trigger (subject to workflow approval for fork PRs).
Stale CI verification
After a rebase or force-push, verify CI check data belongs to the current PR head:
# Get current PR head SHA
gh pr view <number> --repo <upstream-owner>/<upstream-repo> --json headRefOid --jq '.headRefOid'
# Check if CI checks match this SHA
gh pr checks <number> --repo <upstream-owner>/<upstream-repo> --json name,state,startedAt,completedAtIf check data references an older SHA, the checks are stale. Cancel obsolete runs only after confirming they are not the current head:
# Cancel a specific run (only if it's NOT the current head)
gh run cancel <run-id> --repo <upstream-owner>/<upstream-repo>Bot review multi-round awareness
Automated bot reviewers (e.g., hermes-pr-review) post a new review after every push. If you push N times, you get N bot reviews. This is expected behavior, not a bug.
Strategy
- Ignore APPROVE rounds from bots. A bot APPROVE after a trivial push adds no signal.
- Scan for new findings only. Compare the latest bot review against prior rounds to identify newly raised issues.
- Focus on human reviewer findings. Bot findings are advisory; human reviewer findings are binding.
- Do not attempt to silence the bot. The multi-round pattern is by design.
Cross-references
.claude/skills/commit-pr/SKILL.md— PR publication protocol, including--force-with-leaseguidance and remote check verification.opencode/skills/swarm-pr-feedback/SKILL.md— Feedback closure workflow for addressing review findings.agents/skills/subprocess-safety/SKILL.md— Subprocess safety forghCLI calls
Other versions1 project uses a version of this.
Word for word · 1
- zaxbysauce/opencode-swarm★ 517100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository66 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- ci-fix-monitorSkill
- codebase-review-swarmSkill
- commit-prSkill
- contributingSkill
- engineering-conventionsSkill
- guardrail-patternsSkill
- issue-tracerSkill
- mock-to-internals-migrationSkill
- pr-review-fixSkill
- qa-sweepSkill
- research-firstSkill
- running-testsSkill
- subprocess-safetySkill
- swarm-ci-monitorSkill
- swarm-implementSkill
- swarm-pr-feedbackSkill
- swarm-pr-reviewSkill
- swarm-pr-subscribeSkill
- swarmSkill
- tech-debt-ci-reviewSkill
- test-file-splitSkill
- unswarmSkill
- writing-testsSkill
- brainstormSkill
- clarifySkill
- clarify-specSkill
- codebase-review-swarmSkill
- commit-prSkill
- consultSkill
- councilSkill
- critic-gateSkill
- deep-diveSkill
- deep-researchSkill
- design-docsSkill
- discoverSkill
- durable-session-stateSkill
- editing-skillsSkill
- engineering-conventionsSkill
- executeSkill
- fork-pr-operationsSkill
- graphifySkill
- issue-ingestSkill
- issue-tracerSkill
- orchestrating-subagentsSkill
- phase-wrapSkill
- pre-phase-briefingSkill
- qa-sweepSkill
- research-firstSkill
- rust-crate-ciSkill
- specifySkill
- swarm-ci-monitorSkill
- swarm-implementSkill
- swarm-planSkill
- swarm-pr-feedbackSkill
- swarm-pr-reviewSkill
- swarm-pr-subscribeSkill
- swarm-resumeSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

