Repository navigation
fix(prepare-pr): check the PR body against the repo template before push - #14401
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify a script run writing no Suggestions
[DESIGN-REVIEWED] 804ed39 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The no-bash WARN branch is the one untested path — confirm on a bash-less host it prints the warning and exits 0. What this change shipsInventory (7 items) — 7 justifiedIntent: an author running prepare-pr learns before pushing that the PR body misses required template headings — a FIX (PR #14173 passed locally, failed CI's PR Hygiene).
[FIRST-PRINCIPLES-REVIEWED] 804ed39 |
c326ca9 to
8ca2e49
Compare
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
8ca2e49 to
6a1931b
Compare
|
|
6a1931b to
804ed39
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed on behalf of the maintainers (sweep 2026-09-27): readiness passed, required checks green on 804ed39, no blocking review threads, security posture unchanged. Approving and merging.
Problem / Motivation
Goal: prepare-pr catches a PR body that does not follow the repo's template before the push, not after it.
diff_signals.py --check-bodychecks only that every changed area is named and thatWhat changedis short. It never checks the template headings. And the skill says tocatthe template only in Phase 3 step 2, after Phase 1 step 5 has already written and passed the body. So agents read "check-body passed" as "follows the template". PR #14173 shipped that way. CI's PR Hygiene then fails it, one round trip too late.Why it matters
Every agent-opened PR that misses a heading costs a push, a red PR Hygiene / Fork PR Description check, and a body edit. The check already exists in the repo; the local loop just never ran it.
Not a goal
pr_status.pyor the CI workflows.What changed (motivation → approach → change)
The body check and the template lived in different phases, so a body could pass one and never meet the other. The fix runs CI's own rule where the body is first checked.
--check-bodyinsrc/kiro_crew/builtin_skills/kirocrew-dev/prepare-pr/scripts/diff_signals.pynow also runs.github/scripts/pr-description-check.shon the body. It reads the script fromorigin/<base>, never from the checkout, so a branch cannot weaken its own check. A missing section prints the script's own list and exits a new code, 22. A base without that script (another repo) skips it; so does a host with nobashon PATH, with a warning. All findings print; the lowest code wins.prepare-pr/SKILL.mdmoves "cat the template and use it as the literal scaffold" into Phase 1 step 5, where the body is first written. Phase 3 step 2 now points back to it. The scripts table and Two checks, two strengths document exit 22.Backwards compatibility
Compatible: a body that already follows the template passes as before; a repo without the script sees no change. Only a body CI would already reject now also fails locally.
Tests
test/test_prepare_pr_diff_signals.pyadds three end-to-end runs on a throwaway repo:## Not a goalexits 22 and names it, even though the branch replaced the script with one that always passes (proves the base-ref read);Red-before: on
origin/main's script the first two fail. Mutating the read toHEAD:fails the first. The 29 test files that read prepare-pr skills pass (2404 tests).Manual verification
Ran
--check-bodyin this worktree on a one-section body: exit 22 listing the four missing headings. This body passes it.Related Issues
No linked issue: the real case is #14173, a PR that passed the local check and failed PR Hygiene.
Pattern harvest
Not generalizable: the one-off is a local check that skipped a rule CI already enforced; the fix is to call CI's script, not a new rule.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)