Add Step 4.6: a per-commit conformance check that holds the branch's
commit messages to the UPSTREAM repo's convention, not the
contributor's own house style. A fork PR whose commits read in a
different voice than the project reads as a drive-by and burns reviewer
goodwill before the diff is read.
The authoritative style is resolved once (Step 1.4): the upstream
CONTRIBUTING.md commit rules if present, else the de-facto shape sampled
from `git log upstream/$BASE_BRANCH --no-merges`, else the
conventional-commits baseline. Step 4.6 then flags subject-shape drift,
a personal body template (emoji/bullets) where upstream uses prose, a
subject that promises content it lacks (e.g. "+ tests" with no tests),
and a missing-or-extra trailer relative to upstream (e.g. a
`Co-Authored-By:` line upstream carries on every commit). Surfaced as a
soft warning in the report, never a block — style is not a duplicate,
but it is the cheapest goodwill win in the audit and far cheaper to fix
before the PR exists.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The committed `pr-prep/SKILL.md` was generated against an older
preamble and had drifted from `bun run gen:skill-docs` output.
Regenerate it so it picks up the current shared resolvers: the
`SESSION_KIND` and `GSTACK_PLAN_MODE` preamble lines, the `/spec`
routing entry, the AskUserQuestion failure fallback, the 5+-option
split rule, and the Boil-the-Ocean rename.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Before filing each CLEAN commit (not bucketed EXACT_DUP / OVERLAP /
SIBLING), invoke `codex review` for an independent second opinion.
Codex CLI uses a different model family (OpenAI vs Claude), so the
signal is genuinely independent and catches structural bugs the author
missed during write-up.
Optional: if `codex` is not on PATH, emit a soft warning and continue;
never block on tool availability. Severity escalation: P0/P1 findings
bump the commit from CLEAN to OVERLAP (don't file until addressed); P2
stays CLEAN at author discretion (fix-before-file or note in PR body).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Step 1.4: fetch `CONTRIBUTING.md` (case-insensitive) via gh api from
the upstream repo, cache to /tmp, extract pre-push commands + test
layout conventions + branch naming rules + banned patterns. The agent
uses these inline when writing PR bodies.
Step 4.5: annotate each CLEAN/OVERLAP/SIBLING commit row with the
required pre-push gate (e.g. `bun run verify`), whether changed files
trigger special test paths (eval-replay for retrieval), and whether
the commit added tests. Soft warning on missing-tests when
not-required is unclear — don't block, let the human decide.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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): a contributor branch had 8 commits
ready for upstream PRs; 4 of 4 unverified commits would have duplicated
already-open upstream issues. pr-prep catches all in ~30-60s of `gh`
queries, before any noise PR or reviewer triage round.
v0.1.0 ships inline bash in SKILL.md (reviewable in one file). Out of
scope: diff-content similarity, cross-repo audit, LLM-judged semantic
dup detection, auto-comment on upstream PRs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>