/pre-push-review:pre-push-reviewfrom pre-push-review
Reviews git diff before push across code smells, architecture, security, scalability, and performance. Fixes issues found, re-verifies, then pushes clean code.
Ships in pre-push-review. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A gated review run against the commits about to be pushed. It does not just report — it fixes the findings so the pushed code is free of code smells and of security / scalability / performance problems.
git rev-parse --show-toplevel 2>/dev/null || { echo "not a git repo"; exit 0; }
The gate applies to EVERY project on EVERY branch. Only skip when there is nothing to review (not a git repo, or an empty push diff in Step 2).
Read the engineering-standards skill. It is the same list the code is written
from, so these findings are ones the author could have avoided rather than rules
invented at push time. It also defines the scope rule and the one-pass discipline.
Review what will be pushed, and the code it lives in:
git diff @{upstream}..HEAD # if an upstream exists
git diff origin/main...HEAD 2>/dev/null || git diff main...HEAD # new branch fallback
git diff --name-only <same range> # scope to changed files
If the diff is empty, report "nothing to review" and allow the push.
Then widen once: read each changed file in full and find the direct callers and callees. Findings split into in this change (fix all of them) and pre-existing, found while reading (fix the small and safe ones; report the rest with a suggested fix and let the author decide). Stop at callers and callees.
Go through every changed hunk and find real issues (with file:line):
Promise.allSettled rejection / external-call error that exits without a
log, metric, or caller-visible signal. A "nothing happened" path that an
operator can't see in logs and a user can't see in the UI is a bug, even
when the types compile. Prefer: log at the right level (warn/error for
unexpected, debug for benign), and surface terminal failures to the caller
instead of leaving them hanging.Fan the five dimensions out as parallel subagents, in a single message with five tool calls — one lens each, then merge and dedup. Firing them one at a time makes the review take the sum of the five instead of the slowest one; that is the difference between about a minute and about five. Only skip the fan-out when the diff is a handful of lines in one file, and then do all five inline in one pass.
You may corroborate with /code-review and /security-review, but this skill
owns all five dimensions and the fixing.
For every confirmed finding, apply the fix in the working tree:
After fixing, verify once: build, tests, linter and formatter, plus a re-read of the hunks you changed.
This is one pass, not a loop. Collect the scope once, analyse every dimension over it once, dedup and verify, fix everything confirmed, then run the gate. Re-analysis only if the gate fails, and only over what it flagged. Findings that appear while fixing join the list rather than restarting the analysis — a review that keeps finding one more thing is a review nobody trusts to be finished.
The measured cost of this review is dominated by waiting, not by analysis. Three rules, in order of how much they save:
Command hygiene, which is pure overhead: use git -C <root> and absolute paths
instead of chains of cd, and put independent commands in one call rather than
one call each.
Then fold the fixes into the push: either git commit --amend (if fixing your
last commit is appropriate) or add a new commit (e.g. fix: address pre-push review findings). The push must contain the cleaned code, not a follow-up.
Show a short summary: what was found, what was fixed, and anything escalated.
When clean, record the one-shot approval and push. The approval script resolves HEAD on its own — never type, echo, or ask anyone for a commit hash:
~/.claude/scripts/prepush-approve.sh # path is also printed by the gate message
git push # the gate sees the approval and allows it once
Run it AFTER the final fix commit, so the approval covers the commit being pushed.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub kulykivska/claude-plugins --plugin pre-push-review