pre-push-review
БесплатноБез исполняемых скриптовНе проверенReview unpushed commits before pushing to remote repository
от ArjenSchwarz★ 20 звёзд на GitHubОб этом скилле
Pre-Push Code Review
Review and fix unpushed commits before they reach the remote repository.
Phase 1: Identify Changes
Determine which commits haven't been pushed to the remote repository. Record the base as the merge base, BASE=$(git merge-base origin/<branch> HEAD), and use git diff $BASE..HEAD to get the full diff of unpushed changes; a two-dot diff straight against origin/<branch> shows reverse changes when the branch is behind it. Show the user which commits will be reviewed.
If there is no remote tracking branch yet, use origin/main in place of origin/<branch>. Phase 7 compares the working tree against BASE.
Working directory. Every generated input — diff fragments, JUnit and coverage files, the diagram, the review JSON itself — lives in $INPUTS, outside the working tree so nothing lands in git status:
INPUTS="${CLAUDE_JOB_DIR:-$(mktemp -d)}/review-inputs"; mkdir -p "$INPUTS"
Both $CLAUDE_JOB_DIR and mktemp -d yield absolute paths; never use a relative one.
Phase 2: Locate Relevant Specifications
Check if there's a spec for the feature being worked on:
- Examine the current branch name for feature indicators
- Look in the specs directory for matching feature folders
- Review all documents in the feature folder: requirements, design, tasks, and decision log
- If no spec exists, proceed with general review only
Phase 3: Launch Review Agents in Parallel
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.
Agent 1: Code Reuse Review
For each change:
- Search for existing utilities and helpers that could replace newly written code. Use Grep to find similar patterns elsewhere in the codebase — common locations are utility directories, shared modules, and files adjacent to the changed ones.
- Flag any new function that duplicates existing functionality. Suggest the existing function to use instead.
- Flag any inline logic that could use an existing utility — hand-rolled string manipulation, manual path handling, custom environment checks, ad-hoc type guards, and similar patterns are common candidates.
Agent 2: Code Quality Review
Review the same changes for hacky patterns:
- Redundant state: state that duplicates existing state, cached values that could be derived, observers/effects that could be direct calls
- Parameter sprawl: adding new parameters to a function instead of generalizing or restructuring existing ones
- Copy-paste with slight variation: near-duplicate code blocks that should be unified with a shared abstraction
- Leaky abstractions: exposing internal details that should be encapsulated, or breaking existing abstraction boundaries
- Stringly-typed code: using raw strings where constants, enums (string unions), or branded types already exist in the codebase
Agent 3: Efficiency Review
Review the same changes for efficiency:
- Unnecessary work: redundant computations, repeated file reads, duplicate network/API calls, N+1 patterns
- Missed concurrency: independent operations run sequentially when they could run in parallel
- Hot-path bloat: new blocking work added to startup or per-request/per-render hot paths
- Unnecessary existence checks: pre-checking file/resource existence before operating (TOCTOU anti-pattern) — operate directly and handle the error
- Memory: unbounded data structures, missing cleanup, event listener leaks
- Overly broad operations: reading entire files when only a portion is needed, loading all items when filtering for one
Agent 4: Spec & Documentation Review (only if spec exists)
- Spec adherence: Verify implementation matches requirements and design. Identify divergences. Ensure divergences are documented in the decision log.
- Documentation: Check if README, CLAUDE.md, or other docs need updates to reflect the changes.
- Testing gaps: Verify presence of appropriate tests for new/modified code. Check that tests test behavior, not implementation.
Phase 4: Fix Issues
Wait for all agents to complete. Aggregate their findings and fix each issue directly.
Constraints:
- Do not modify test files unless fixing an actual bug (e.g., a test that tests the wrong thing or has a genuine error). Refactoring production code must not require test changes — if it would, reconsider the refactoring approach.
- If a finding is a false positive or not worth addressing, skip it without debate.
Phase 5: Verify
The verification run is also the source of the page's test results, so choose a command that emits JUnit XML before running anything, and run it once.
Choose the command
Read ~/.claude/scripts/ecosystems.json. The language row is the one whose extensions cover the most changed files; the runner within it is the first whose detect rule matches (files globs at the repo root, or top-level `package_json_keys
Установить pre-push-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл pre-push-review?
Review unpushed commits before pushing to remote repository
Как установить скилл pre-push-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pre-push-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic