ワンクリックで
pre-push-review
Review unpushed commits before pushing to remote repository
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Review unpushed commits before pushing to remote repository
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Batch-fix all open bugs in parallel, iterate on PR reviews until clean, then squash-merge each PR sequentially. Extends bug-blitz with automated review cycles and merge. Fetches bug-type tasks from Transit, creates worktrees, spawns parallel fix agents, runs /pr-review-fixer in a loop until no blockers/critical/major issues remain, then merges PRs one by one with squash-and-merge.
Initialize Claude Code project settings with standard language-specific permissions. Use when setting up a new project for Claude Code or adding standard configuration to an existing project.
Capture reusable cross-project technical knowledge into the user's Obsidian vault as a markdown note. Use whenever the user wants to save a learning, pattern, recipe, or how-to that would help future projects — phrases like "save this to my vault", "write this up as a note", "capture this for future reference", "document how X works", "remember this pattern", "add to my knowledge base", or any time after solving something non-obvious in their current repo. Examples are "how to set up an MCP server in a Swift app", "the GraphQL pagination pattern we used here", "how Transit wires up its dependency injection". Use this skill PROACTIVELY whenever the user finishes investigating something they'd plausibly want to reuse on a different project, even if they don't say "save it" explicitly — offer to capture it. Do NOT use for project-specific notes that only make sense inside one repo (those belong in that project's own notes), and do NOT use for daily/journal entries.
Fix Go unit tests to comply to best practices. Use this when you're asked to modernise tests.
Push a branch, open a change request, iterate on reviews until clean, then squash-merge. Runs /pr-review-fixer in a loop until no blockers/critical/major issues remain, rebases onto latest origin/main, and squash-merges. Works on both GitHub (gh) and GitLab (glab) — it detects the forge from the git remote. Works with or without Transit tickets. Use when you want to shepherd a PR/MR from push to merge, e.g. "push and merge this", "get this merged", "review-fix-merge loop".
Fetch unresolved change-request review threads (both diff-anchored and CR-level), validate issues, and fix them. Also checks CI status and fixes failing tests, lint errors, and build issues. Works on both GitHub (gh) and GitLab (glab) — it detects the forge from the git remote. Use when reviewing and addressing PR/MR feedback. Filters out resolved threads, keeps only the last Claude review comment per thread (matching the `<!-- claude-local-review -->` sentinel from the local-review agent), validates issues, posts a review report as a CR comment, then fixes validated issues.
| name | pre-push-review |
| description | Review unpushed commits before pushing to remote repository |
Review and fix unpushed commits before they reach the remote repository.
Determine which commits haven't been pushed to the remote repository. Use git diff origin/<branch>..HEAD to get the full diff of unpushed changes. Show the user which commits will be reviewed.
If there is no remote tracking branch yet, diff against origin/main.
Check if there's a spec for the feature being worked on:
Use the Agent tool to launch all agents concurrently in a single message. Pass each agent the full diff so it has the complete context.
For each change:
Review the same changes for hacky patterns:
Review the same changes for efficiency:
Wait for all agents to complete. Aggregate their findings and fix each issue directly.
Constraints:
After all fixes are applied:
Use the explain-like skill (invoke the Skill tool with skill="explain-like") to generate explanations of the implementation at all three expertise levels (beginner, intermediate, expert). If a spec was found in Phase 2, write the explanation to specs/{feature_name}/implementation.md; otherwise keep it in memory for the HTML output only.
Use the explanation as a validation mechanism:
In addition to the three-level explanation, extract the following content from the diff, commit messages, and (if present) the decision log. This material feeds Phase 7 and should be saved into memory even when no spec exists:
inferred so the reviewer knows the rationale wasn't stated by the author.If a decision is non-trivial but no rationale can be found anywhere, list it under "Open questions for the author" rather than fabricating a reason.
Render a self-contained HTML page using the bundled renderer script. Do not hand-write the HTML — assemble a JSON description and invoke the script. The script owns the Prism Dark theme, the overview grid, the three-level explanation tabs, the important-change cards (with Takeaway / Rationale / Open-question callouts), and the diff rendering. Your job is to populate the JSON.
Script: ~/.claude/scripts/build_review_html.py. The same renderer powers pr-review-html — keep changes to the template/palette in the script itself, not duplicated across skills.
Output location (in priority order, use the first that applies):
specs/{feature_name}/pre-push-review.html if a matching spec was found in Phase 2{repo-root}/.claude/pre-push-review.html if .claude/ exists/tmp/pre-push-review-{branch-name}.htmlOverwrite any existing file.
For each changed file, dump the unified diff (git diff $BASE -- <path> or equivalent) to a separate .txt file. Pick a working directory next to where the JSON will live, e.g. {repo-root}/.claude/review-diffs/ or $CLAUDE_JOB_DIR. Keep the filenames simple (e.g. diff-main.go.txt); the JSON references them by name.
review.jsonWrite a JSON file with this shape. Every top-level key is optional except repo and files — empty sections are omitted from both the body and the TOC.
{
"repo": {"name": "myrepo", "path": "/abs/path", "branch": "main", "remote": "origin/main"},
"title": "Pre-push review: myrepo",
"subtitle": "<html> short blurb under the H1 — pass-through HTML",
"metrics": [{"label": "branch", "value": "main"},
{"label": "commits", "value": "3"},
{"label": "files", "value": "21 touched"},
{"label": "lines", "value": "+2700 / -50"}],
"verdict": {"label": "Ready to push",
"tone": "success", // success | warning | error
"detail": "<html> one-paragraph justification"},
"at_a_glance": ["<html> bullet 1", "<html> bullet 2"],
"explanation": { // from the explain-like skill (Phase 6)
"beginner": "<html> What Changed / Why It Matters / Key Concepts",
"intermediate": "<html> Architecture / Patterns / Trade-offs",
"expert": "<html> Deep dive / Architecture impact / Edge cases"
},
"commits": [{"sha": "725ae99", "subject": "feat: ...", "author": "Name", "date": "2026-05-16"},
{"sha": "working-tree", "subject": "Fixes applied in this review", "meta": "free-form trailer"}],
"important_changes": [ // from Phase 6, 3-7 items
{
"title": "publish: atomic move with prior-version cleanup",
"file": "publish.go", // used to build the diff anchor link
"why": "Why this matters for the reviewer.",
"what": "publish.go:31-108",
"takeaway": "What a reader can learn from this — reusable insight.",
"rationale": "Why this approach was chosen.",
"rationale_inferred": true // optional; appends a muted disclaimer
// OR: "rationale_unknown": true // renders an Open Question callout instead
}
],
"decisions": [ // every non-trivial decision, not just important-change ones
{"title": "Regex over full HTML parser.",
"body": "<html> body, may include <code>…</code>",
"inferred": false}
],
"findings": [ // from Phase 3 / Phase 4
{"severity": "major", "area": "serve.go traversal",
"finding": "...", "resolution": "...", "status": "fixed"} // status: fixed | skipped
],
"double_check": [{"title": "Concurrent publish.", "body": "<html> body"}],
"files": [
{"path": "publish.go", "badge": "Modified", "stat": "+140 / -0",
"diff_file": "diff-publish.go.txt"} // OR "diff": "<inline diff text>"
],
"publish_metadata": { // always populate (see Phase 8).
"title": "Pre-push review: <branch>",
"repoUrl": "https://github.com/owner/repo",
"branch": "<branch-name>", // use `branch` here — no PR exists pre-push.
"severity": "lgtm", // lgtm | suggestions | needs-changes | blocking
"summary": "1-3 sentence headline finding shown in the feed reader."
}
}
Rendering contract the script implements (you don't have to):
subtitle, at_a_glance items, verdict.detail, every explanation panel, decisions[].body, double_check[].body. Write actual HTML here (e.g. <p>, <ul>, <code>).<pre><code class="language-diff">…</code></pre>; highlight.js paints them and the stylesheet overrides additions/deletions to the Prism Dark green/red tokens.rationale_unknown: true swaps the Rationale for a warning-bordered "Open question" callout. rationale_inferred: true appends a muted (inferred — not stated by the author).status field.publish_metadata is emitted as a <script type="application/json" id="review-meta"> block in <head>, JSON-encoded with </ escaped. Required by pulsar publish (see docs/agent-contract.md in the pulsar repo); harmless in browsers when present, ignored when absent.python3 ~/.claude/scripts/build_review_html.py \
--data /path/to/review.json \
--output /path/to/pre-push-review.html \
--diff-dir /path/to/diff-fragments # defaults to the JSON file's directory
The script prints the output path on success. Surface that path to the user so they can open it in a browser. If the JSON is malformed or a referenced diff fragment is missing, the script still renders the page — missing diffs become a (diff fragment 'name.txt' missing) placeholder so the rest of the review remains usable.
CSS constant inside the script.publish_metadataAlways populate this field. Mapping rules:
title: human-readable, mirror the H1 (e.g. Pre-push review: <branch>).repoUrl: from git remote get-url origin; the binary normalises SSH → HTTPS and strips .git.branch: the current branch name. Do not set pr for a pre-push review — no PR exists yet.severity: derive from the verdict tone and findings — success/no major findings → lgtm; warning with only nits → suggestions; major findings raised → needs-changes; blocking/security/correctness issues → blocking.summary: 1–3 sentences leading with the headline finding (not "I reviewed X"). This is what shows up in the user's feed reader.Check whether the pulsar binary is on PATH (command -v pulsar). If it is, invoke pulsar publish <path-to-html> — the binary validates the metadata block, normalises the repo URL, moves the file into $HOME/CodeReviews/YYYY-MM/, and deletes the source. Treat a non-zero exit code as a hard error and surface the stderr message verbatim. If pulsar is not on PATH, skip this phase silently.
Provide a clear verdict: Ready to push, Needs fixes (with must-fix list), or Requires discussion (with architectural concerns).
List what was fixed automatically and what still needs attention. Include the path to the review HTML from Phase 7 (or the archived path returned by Phase 8 if publish ran).