← ClaudeAtlas

pr-diff-verificationlisted

Use before pushing a branch or opening a PR to verify `git show --stat HEAD` matches what the commit message claims. Prevents the "commit log wrote but code didn't make it" class of accidents where the commit message describes changes that aren't in the diff (e.g. amend overwrote the previous commit's content, force-push lost commits, worktree wipe lost staged work). Invoke whenever Leader is about to `git push` a feature branch OR open a PR.
wei18/apple-dev-skills · ★ 0 · Code & Development · score 70
Install: claude install-skill wei18/apple-dev-skills
# PR Diff Verification ## When to invoke Before: - `git push` of a feature branch (especially after subagent return) - `gh pr create` - `gh pr merge` (final sanity) - Force-push (`--force-with-lease`) of a rebased branch Skip when: pushing a single trivial commit you authored line-by-line in the current session and didn't amend. ## The pattern (3-step verify) ### Step 1 — read the commit message claims For the HEAD commit (or all commits on the branch since base), extract concrete claims: - "modifies X" → look for X in the diff - "adds Y" → look for `create mode 100644 Y/` in stat - "deletes Z" → look for `delete mode 100644 Z` in stat - "renames A → B" → look for `rename A => B` in stat - "fixes N+M lines" → diff total should be in that ballpark ### Step 2 — compare against actual diff ```bash git show --stat HEAD # for single commit git diff --stat origin/main..HEAD # for branch cumulative git log --oneline origin/main..HEAD # for commit count ``` For each concrete claim, grep the stat output. If the claim mentions a path that doesn't appear in the stat, that's a discrepancy — investigate before push. ### Step 3 — surface discrepancies If found: - Did `git amend` or rebase squash the wrong content? - Did a worktree wipe lose commits before push? - Did a force-push from another branch overwrite this branch's commits (the "push wrong ref" footgun)? - Did the subagent return claim work that never got committed? Discrepancy resolution op