external-pr-trust
БесплатноБез исполняемых скриптовНе проверенAuthorship as a precondition of merging — bot vs stranger classification, what a merge executes, the merge-guard hook. Use when bulk-merging PRs, or when a…
от laurigates★ 61 звезда на GitHubОб этом скилле
External-Contributor PRs — Authorship Is a Precondition of Merging
Promoted from the always-loaded external-contributor-prs.md portfolio rule,
whose stub keeps the gate lines.
Public repos accept PRs from anyone. Merge tooling, though, is usually built
for bulk-merging your own and bots' PRs: a picker such as ghsq → ^a
(select all) → a (all remaining) lands a queue of release-please and feature
PRs in one pass. A stranger's PR riding that reflex is merged code nobody read.
The law: before merging, know who wrote it.
author.login == youor a bot is the fast path. Anything else is a review, not a merge.
When to Use This Skill
| Use this skill when... | Use something else when... |
|---|---|
| Clearing a queue of PRs in one pass | Checking whether a merge did what you think → git-merge-hazards |
The external-PR merge guard denied a gh pr merge |
Opening a PR against someone else's repo → upstream-pr-contribution |
| A PR adds a GitHub Action, hook, or dependency | Writing CI that runs on fork PRs → github-actions-plugin:claude-code-github-workflows |
Why it is not merely "review your PRs"
A PR is not inert text — merging can execute code:
| Path touched | What merging does |
|---|---|
.github/workflows/**, .github/actions/** |
Runs in CI, with whatever permissions: the workflow grants itself |
**/hooks/**, *.sh |
Runs on your machine (Claude Code hooks, git hooks, justfile recipes) |
.claude/** |
Changes agent permissions, rules, or settings |
package.json, pyproject.toml, mise.toml, .pre-commit-config.yaml |
Changes what gets installed and run |
Two things make a third-party CI addition worse than it looks — check them explicitly on any PR that adds an action:
- A floating tag is mutable.
uses: owner/action@v0resolves at dispatch time, so the publisher (or whoever takes over their account) can retarget the tag after you merge and change what runs, with no diff on your side. runs.usingdoes not tell you what it does. Anode20orcompositeaction can download and execute a remote binary — and often does: the canonical case (claude-plugins#2231) was anode24action whose entire job was to resolve thelatestrelease of a different repo at run time, fetch a native binary from it,chmod 0755, and execute it. Pinning the action to a SHA does not pin that second fetch. Read the action'ssrc/action.ymlat the pinned SHA rather than trusting its declared type.
Classify the author correctly — bots render three different ways
Getting this wrong in either direction breaks the guard: flag the bots and it
becomes noise you train yourself to click through; miss a stranger and it does
nothing. The trap is that a bot author looks different depending on which gh
subcommand produced it:
| Source | login |
is_bot |
type |
|---|---|---|---|
gh pr list / gh pr view |
app/laurigates-release-please |
true |
— |
gh search prs |
laurigates-release-please[bot] |
false |
Bot |
So is_bot alone silently misclassifies every App bot in search results as a
stranger. Accept any of: is_bot == true, type == "Bot", a *[bot] login,
or an app/* login. (authorAssociation is not a field on gh pr list/gh pr view --json — read it from gh api repos/O/R/pulls/N --jq .author_association.)
The two guards
| Actor | Mechanism | Behavior |
|---|---|---|
| The human, in the shell | _gh_trust_gate / _gh_confirm_external in the dotfiles dot_zshrc.tmpl, used by the ghsq / ghrb / ghrp pickers |
External PRs are hidden from the picker (a stderr banner counts them; ghsq -x includes them, marked ⚠ white-on-red). Merging one prints author + association + which touched paths execute, is never swept up by a=all, and requires typing merge — not a keypress. |
| Claude, in any repo | hooks-plugin/hooks/external-pr-merge-guard.sh (PreToolUse) |
Denies gh pr merge, gh api .../pulls/N/merge, and MCP merge_pull_request for a non-self, non-bot author. Also denies when authorship can't be established. |
Both fail closed: if the author cannot be read, the merge is refused rather than allowed. "Cannot verify" is not "safe."
What Claude does when the guard fires
Do not look for another merge route — the hook covers gh pr merge in every
flag order, the gh api path, and the MCP tool, and --admin does not bypass
it. Instead:
- Report what the PR actually changes. Read the diff. For an added action or dependency, say where the code comes from, whether the ref is a commit SHA or a mutable tag, and what it downloads or transmits at runtime.
- Hand the merge back.
ghsq -x(which will demand the typed confirmation), orgh pr merge <n> --squash --delete-branchrun by the human. Bot PRs squash under the merge-method rule (github-pr-title→ [merge-strategies.md](../github-pr-title/merge-strategi
Установить external-pr-trust в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobBash(gh pr view *)Bash(gh pr list *)Bash(gh pr diff *)Bash(gh api *)Bash(gh search *)TodoWriteFAQ
Что делает скилл external-pr-trust?
Authorship as a precondition of merging — bot vs stranger classification, what a merge executes, the merge-guard hook. Use when bulk-merging PRs, or when a merge is denied for a non-self author.
Как установить скилл external-pr-trust?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл external-pr-trust запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic