cross-repo-pr-sweep

Detect pushed git branches across multiple repositories that have no pull request on GitHub.

5|1|Updated Aug 18, 2023
One-click install
npx skills add https://github.com/thpoll83/PolyKybdHost --skill cross-repo-pr-sweep-thpoll83
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cross-repo-pr-sweep
Source: https://github.com/thpoll83/PolyKybdHost/tree/main/.claude/skills/cross-repo-pr-sweep
Command: npx skills add https://github.com/thpoll83/PolyKybdHost --skill cross-repo-pr-sweep-thpoll83

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Multi-repo features routinely leave one repository with committed, pushed work that never got a pull request, and no local git command can detect it because the branch looks clean, in sync, and ahead. This Skill sweeps every attached repository and asks GitHub directly whether a PR exists for each pushed branch. ## Core Features & Use Cases - Cross-repo branch enumeration: Fetches and inspects each repository's checked-out branch, ahead count, and upstream state using an explicit repo-to-default-branch table. - GitHub PR existence check: Queries the GitHub API per branch with an owner-qualified head and state=all to distinguish a genuine gap from a merged PR. - Orphaned commit detection: Identifies commits pushed to a branch whose PR already merged, which silently land in no PR and no default branch. - Use Case: After finishing a feature spanning firmware, host, docs, and hardware repos, run the sweep before declaring the work done to catch the one repo where commits were pushed but the PR was never opened. ## Quick Start Ask the assistant to sweep all attached PolyKybd repositories for pushed branches that have no pull request before closing out the session.

Frequently Asked Questions about cross-repo-pr-sweep

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

FAQPage Schema
How do I find pushed branches with no pull request across multiple repos?

Fetch each repository, list branches with commits ahead of the default branch, then query the GitHub API for pull requests matching each branch head. Local git commands alone cannot answer this because they only see local state, not whether a PR exists.

Why does git status show a clean branch when a pull request is missing?

A branch that is committed, pushed, and in sync with its upstream reads as completely clean in git. The absence of a pull request is GitHub-side state, so only a GitHub API query can reveal the gap.

Can I use commits-ahead counts to detect missing pull requests?

No. Squash- or merge-merged branches read as ahead of the default branch forever, producing roughly a 95 percent false-positive rate. Only querying GitHub for PR existence gives a reliable answer.

What happens to commits pushed after a pull request has merged?

The push succeeds silently as an ordinary fast-forward, but the commits land in no PR and not in the default branch. Detect them with git merge-base --is-ancestor, then cherry-pick onto a fresh branch and open a new PR.

Why does the GitHub PR query need an owner-qualified branch head?

A bare branch name in the head filter matches nothing, returning an empty list that looks identical to a genuine missing PR. Using owner:branch format ensures the empty result actually means no PR exists.