/pr-queue-gate
Inspect fleet-authored GitHub PR queues and enforce the one-shot Claude Stop gate. Triggers: PR queue, open-PR blindness, pr-queue gate. NOT for cmuxlayer status-claim enforcement.
$ golems-cli skills install pr-queue-gateUpdated 2 weeks ago
Hook-carried skill for the deterministic PR-queue primitive and Claude Code
session-end gate. The enforcing artifacts are scripts/pr-queue.sh and
scripts/pr-queue-gate-hook.mjs.
Boundary
This skill owns:
- one-call GitHub queue inspection for a repository;
- the fleet-authored PR filter;
- CI/age normalization into stable JSON;
- one Stop-hook block per Claude session;
- fail-open ledger evidence for non-actionable or infrastructure states.
It does not own cmuxlayer set_status/lane-closure enforcement (the separate
status-claim lane), merge policy, review execution, or live installation.
Primitive contract
skills/golem-powers/pr-queue-gate/scripts/pr-queue.sh [repo-path]The default repo path is the current directory. Stdout is one compact JSON object:
{"repo":"golems","open":1,"oldest_days":3,"prs":[{"n":101,"title":"fix: example","age_d":3,"reviewDecision":"REVIEW_REQUIRED","ci":"passing"}]}Exit codes:
0: no open fleet PRs;3: one or more open fleet PRs;2: git/remote/gh/JSON infrastructure error, printed to stderr.
The primitive makes exactly one gh pr list call. jq filters, sorts, escapes
titles, computes whole-day ages, and classifies rollups as passing,
failing, or pending.
Fleet-authored filter
The 2026-08-04 live inventory across brainlayer, cmuxlayer, and golems showed
that every open PR was authored by the repository owner; the observed branch
prefixes were fix/, feat/, and hygiene/. The filter therefore includes a
PR when either condition is true:
author.loginequals the GitHub remote owner; orheadRefNamematches^(feat|fix|hygiene)/case-insensitively and the head branch is owned by the repository owner and is not cross-repository.
The second clause keeps same-repository fleet automation while preventing an external fork from becoming a fleet PR merely by choosing a conventional branch name. Titles are treated as metadata: the Stop reason strips terminal and bidirectional display controls, collapses whitespace, truncates to 120 Unicode code points, and JSON-delimits the result before it enters model context.
Do not widen the branch regex from memory. Re-measure live fleet PRs and update the fixture plus this contract in the same reviewed PR.
Full SKILL.md source — includes LLM directives, anti-patterns, and technical instructions stripped from the Overview tab.
Hook-carried skill for the deterministic PR-queue primitive and Claude Code
session-end gate. The enforcing artifacts are scripts/pr-queue.sh and
scripts/pr-queue-gate-hook.mjs.
Boundary
This skill owns:
- one-call GitHub queue inspection for a repository;
- the fleet-authored PR filter;
- CI/age normalization into stable JSON;
- one Stop-hook block per Claude session;
- fail-open ledger evidence for non-actionable or infrastructure states.
It does not own cmuxlayer set_status/lane-closure enforcement (the separate
status-claim lane), merge policy, review execution, or live installation.
Primitive contract
skills/golem-powers/pr-queue-gate/scripts/pr-queue.sh [repo-path]The default repo path is the current directory. Stdout is one compact JSON object:
{"repo":"golems","open":1,"oldest_days":3,"prs":[{"n":101,"title":"fix: example","age_d":3,"reviewDecision":"REVIEW_REQUIRED","ci":"passing"}]}Exit codes:
0: no open fleet PRs;3: one or more open fleet PRs;2: git/remote/gh/JSON infrastructure error, printed to stderr.
The primitive makes exactly one gh pr list call. jq filters, sorts, escapes
titles, computes whole-day ages, and classifies rollups as passing,
failing, or pending.
Fleet-authored filter
The 2026-08-04 live inventory across brainlayer, cmuxlayer, and golems showed
that every open PR was authored by the repository owner; the observed branch
prefixes were fix/, feat/, and hygiene/. The filter therefore includes a
PR when either condition is true:
author.loginequals the GitHub remote owner; orheadRefNamematches^(feat|fix|hygiene)/case-insensitively and the head branch is owned by the repository owner and is not cross-repository.
The second clause keeps same-repository fleet automation while preventing an external fork from becoming a fleet PR merely by choosing a conventional branch name. Titles are treated as metadata: the Stop reason strips terminal and bidirectional display controls, collapses whitespace, truncates to 120 Unicode code points, and JSON-delimits the result before it enters model context.
Do not widen the branch regex from memory. Re-measure live fleet PRs and update the fixture plus this contract in the same reviewed PR.
Stop-hook contract
The hook accepts Claude Code Stop JSON on stdin and reads cwd plus
session_id. It checks only the repository containing cwd, and acts only when
that repository's origin is a github.com/EtanHey/* remote.
When the primitive exits 3, the hook atomically writes a SHA-256-keyed latch
under state/, blocks once, lists every PR, and gives exactly three allowed
dispositions:
merge per /pr-loop --admin;review-routed:<who>;blocked:<real-blocker>.
The reason ends by directing the lane to post the disposition to its collab, then stop. Once the latch exists, later Stops in that session allow immediately without another GitHub call, including if new PRs appear later in the session. That session-wide one-shot trade-off is deliberate: preventing a Stop loop takes priority over repeated enforcement.
The latch is written before the block payload. If the process dies in the narrow gap between those writes, that session's one block is consumed without delivery. This deliberate fail-open ordering avoids the worse failure mode: emitting a block, failing to latch it, and trapping the seat in repeated Stop blocks.
All ambiguity and infrastructure failures fail open. The hook appends JSONL
evidence to state/ledger.jsonl when possible; a ledger or latch error must
never loop a seat.
Test and install
bun test skills/golem-powers/pr-queue-gate/evals/pr-queue-gate.test.mjsThe test suite initializes real fixture git repositories and mocks only the
external gh process via PATH. It performs no live GitHub calls.
See INSTALL.md for the post-merge installed-copy procedure and
install-snippet.json for the Stop-hook entry. Never self-install this gate
from an unmerged branch.
Integration
/pr-loopowns review, merge, and--adminauthority./never-fabricaterequires fresh queue/test/PR evidence before claims.pr-queue-gateonly removes session-end blindness; the cmuxlayer lane owns cross-engine status-claim refusal.
Best Pass Rate
95%
Opus 4.6
Assertions
21
5 models tested
Avg Cost / Run
$0.1357
across models
Fastest (p50)
2.5s
Gemini 2.5
Behavior Evals
Phase 2 baseline — skill quality on ClaudeBehavior Baseline
Adapter Evals
Phase 2C — cross-AI portabilityAdapter Portability
| Assertion | Opus 4.6 | Sonnet 4.6 | Haiku 4.5 | Gemini 2.5 | Kiro | Consensus |
|---|---|---|---|---|---|---|
| one-gh-call | 4/5 | |||||
| two-filtered | 2/5 | |||||
| exit-three | 4/5 | |||||
| block | 5/5 | |||||
| queue-listed | 5/5 | |||||
| dispositions | 4/5 | |||||
| allow-shape | 5/5 | |||||
| primitive-zero | 5/5 | |||||
| no-latch | 2/5 | |||||
| first-blocks | 5/5 | |||||
| second-allows | 3/5 | |||||
| no-second-gh | 4/5 | |||||
| allow | 4/5 | |||||
| ledger | 5/5 | |||||
| no-block | 5/5 | |||||
| admin-merge | 5/5 | |||||
| no-permission-wait | 4/5 | |||||
| collab-post | 3/5 | |||||
| no-controls | 5/5 | |||||
| bounded | 4/5 | |||||
| delimited | 2/5 |
Token Usage
Cost per Run
| Model | Input Tokens | Output Tokens | Cost / Run | Cost / 1K Runs |
|---|---|---|---|---|
| Opus 4.6 | 7,654 | 5,425 | $0.5217 | $521.70 |
| Sonnet 4.6 | 4,030 | 4,365 | $0.0776 | $77.60 |
| Haiku 4.5 | 2,079 | 1,846 | $0.0028 | $2.80 |
| Gemini 2.5 | 1,331 | 1,439 | $0.0177 | $17.70 |
| Kiro | 3,255 | 4,065 | $0.0585 | $58.50 |
Response Time (p50)
Response Time (p95)
| Model | p50 | p95 | Overhead |
|---|---|---|---|
| Opus 4.6 | 9.2s | 15.0s | +62% |
| Sonnet 4.6 | 3.4s | 6.0s | +75% |
| Haiku 4.5 | 2.6s | 3.9s | +51% |
| Gemini 2.5 | 2.5s | 3.9s | +55% |
| Kiro | 5.5s | 8.6s | +58% |
Last evaluated: 2026-03-12 · Data is generated from skill assertions (real cross-model benchmarks coming soon)
Changelog entries are derived from eval runs and skill version updates. Full cascading changelog (Phase 4D) coming soon.
Best Pass Rate
95%
Assertions
21
Models Tested
5
Evals Run
7
- +Initial release to Golems skill library
- +21 assertions across 7 eval scenarios