Walks `git log base..HEAD`, derives search keywords per commit from
subject + changed file paths, queries upstream issues + PRs via `gh`,
scores each commit against upstream collisions (EXACT_DUP / OVERLAP /
SIBLING / CLEAN) on a title-token + file-overlap Jaccard, and refuses
to proceed when EXACT_DUP found. Designed to slot into `/ship` as a
Step 0 hook (env `GSTACK_FROM_SHIP=1` switches to JSON output + skips
interactive prompts).
Motivating case (real, 2026-05-26): contributor's branch on
`garrytan/gbrain` had 8 commits ready for upstream PRs. Without
pr-prep, 4 of 4 unverified commits would have been duplicates:
- `e96332c5` (reindex CLI_ONLY one-char fix) collided with #913
OPEN 14 days, exact same fix
- `74819cec` (sourceId fallback) collided with #836 OPEN
- `787da2af` + `829099f9` (synopsis env-override) collided with
#1358 OPEN, same env-override pattern
- `e0133d8a` (LM Studio recipe) collided with #1051 + #1329
Cost avoided per branch: ~4 noise PRs, ~4 reviewer triage rounds,
contributor goodwill hit, ~4 branch closures. pr-prep catches all
in ~30-60s of `gh` queries.
v0.1.0 ships inline bash in SKILL.md (reviewable in one file). v0.2.0
should move Jaccard math + report rendering into `bin/gstack-pr-prep`
once tests exist. Out of scope: diff-content similarity, cross-repo
audit, LLM-judged semantic dup detection, auto-comment on upstream PR.
Skill check: `bun run skill:check pr-prep` clean (the warning about
"no \$B commands found" is informational — matches every other
non-browser skill like ship/review/plan-eng-review).