Agent skill

Pre Commit Review

by openshift-eng in openshift-eng/ai-helpers

Review staged and unstaged changes before committing. An agent skill from openshift-eng/ai-helpers.

Apache-2.0Auto-check passedDevelopment

Install Pre Commit Review

skills CLI
$ npx skills add openshift-eng/ai-helpers --skill pre-commit-review -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install openshift-eng/ai-helpers pre-commit-review --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/openshift-eng/ai-helpers.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/code-review/skills/pre-commit-review .claude/skills/pre-commit-review && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pre-commit-review
GitHub stars
120
Token cost
~1.6k tokens
SKILL.md length
734 words
Files
1
Skills in repo
118
Repo updated
First seen
Licence
Apache-2.0

At a glance

Review staged and unstaged changes before committing. An agent skill from openshift-eng/ai-helpers.

  • Works in 5 steps: Resolve options and review guidance → Establish the diff → Review the changes → …
  • Asked for a pre-commit review
  • SKILL.md covers Name, Synopsis, Purpose and Workflow, plus 1 more section
  • Calls git, make and go

What it does

Pre Commit Review is an agent skill from openshift-eng/ai-helpers. Review staged and unstaged changes before committing. Use when asked for a pre-commit review, a code-quality review of the current diff, or when a solve workflow requests an independent review.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Code quality. The repository describes itself as: Developer productivity tools for Claude Code & other AI assistants. The licence is Apache-2.0.

When your agent uses it

  • Asked for a pre-commit review
  • A code-quality review of the current diff
  • A solve workflow requests an independent review

Example prompts

  • “/pre-commit-review”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Resolve options and review guidance
  2. Establish the diff
  3. Review the changes
  4. Verify the build
  5. Report findings

What it can do on your machine

Read from SKILL.md and the folder at commit a627176. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • make
    • go
    • cargo
    • npm
    • yarn
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, npm and yarn, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pre Commit Review loads about 1.6k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 734 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from openshift-eng/ai-helpers at commit a627176, republished under its Apache-2.0 licence (© openshift-eng). 734 words, ~1,557 tokens.

Download SKILL.mdSave it as .claude/skills/pre-commit-review/SKILL.md (or your agent's skills folder).
name
pre-commit-review
description
Review staged and unstaged changes before committing. Use when asked for a pre-commit review, a code-quality review of the current diff, or when a solve workflow requests an independent review.
argument-hint
[--language <lang>] [--profile <name>] [--skip-build] [--skip-tests]
user-invocable
true
slash
true

Name

code-review:pre-commit-review

Synopsis

text
/code-review:pre-commit-review [--language <lang>] [--profile <name>] [--skip-build] [--skip-tests]

Purpose

Review the current staged and unstaged changes before committing. Assess test coverage, idiomatic code, duplication, design, and build verification. Review only the current diff; do not report pre-existing issues in unchanged code.

The same-named skill replaces the former plugin command, so the /code-review:pre-commit-review invocation remains available in Claude Code. Install the plugin through APM to expose this skill to OpenCode and other supported clients.

Workflow

1. Resolve options and review guidance

Read options from the skill invocation or the user's request:

OptionBehavior
--language <lang>Apply language-specific review guidance. If omitted, detect from changed-file extensions.
--profile <name>Apply project-specific conventions and checks.
--skip-buildSkip build verification and report it as skipped.
--skip-testsSkip unit-test coverage review and report it as skipped.

Detect the primary language from changed-file extensions: .go → Go, .py → Python, .rs → Rust, .ts/.tsx → TypeScript, and .java → Java. If files are mixed or the language has no guidance, continue with a general review.

Load optional guidance from sibling skill directories, relative to this SKILL.md:

  • Language: ../<language>-code-review/SKILL.md (currently available: ../go-code-review/SKILL.md).
  • Profile: ../<name>-code-review/SKILL.md (for example, ../hypershift-code-review/SKILL.md).

If requested guidance is absent, say so and continue without it. Give loaded guidance to each relevant review pass.

Completion criterion: all supplied options are accounted for, and each available language/profile guide has been loaded before reviewing.

2. Establish the diff

Collect and deduplicate changed paths from both git diff --name-only and git diff --cached --name-only. Categorize them as source, tests, configuration, or documentation. If the diff is empty, report that and stop. If no source files changed, narrow the review accordingly.

Completion criterion: the complete staged and unstaged file list is recorded, with no unchanged files added to scope.

3. Review the changes

Run these independent review passes:

  1. Test coverage — unless --skip-tests was supplied, check for tests covering changed behavior, new public functions, edge cases, and error paths. A missing test for a new public function with non-trivial logic is blocking. Apply language and profile test conventions.
  2. Idiomatic code — apply language guidance when available; otherwise assess error handling, naming, clarity, and complexity. Follow relevant project guidance.
  3. DRY — find duplication, repeated patterns, copy-paste code, and values that should be named constants. Apply profile guidance about shared project utilities.
  4. Design — assess responsibilities, extensibility, interface contracts, interface size, and dependency direction in proportion to the change.
  5. Profile-specific review — apply extra checks and reviewer perspectives named by the profile.

Keep each pass independent until findings are collected. When the host supports agent delegation, delegate independent passes concurrently and provide each reviewer with the changed-file list and relevant guidance. Otherwise, perform the passes sequentially in this session. If the profile names specialist reviewers, use the host's available delegation mechanism; without delegation, apply each specialist perspective as a separate pass. Provide the full diff and available PR or issue context to profile-specific reviewers.

Completion criterion: every applicable pass has examined every in-scope change, and skipped passes are recorded with the supplied option that skipped them.

Show full SKILL.md (240 more words)Show less
4. Verify the build

Unless --skip-build was supplied, run the most specific available build/verification command in this order:

  1. Profile guidance.
  2. Language guidance.
  3. Project detection: make build (or the documented default make) when a Makefile is present; go build ./... for Go; cargo build for Rust; npm run build or yarn build for JavaScript/TypeScript; python -m py_compile on changed files for Python.

Run this alongside review passes when the host supports concurrent work. Record the command and result. On failure, include the relevant output and mark the overall review as FAIL. If explicitly skipped, report it as skipped; do not imply that the build was verified.

Completion criterion: build verification is recorded as passed, failed, or explicitly skipped; no result is implied.

5. Report findings

Return a structured report with:

  1. Files reviewed, categorized by type.
  2. Unit-test coverage findings, or that the pass was skipped.
  3. Idiomatic code findings, naming the language when applicable.
  4. DRY and design findings.
  5. Build command and result.
  6. Profile-specific findings, if applicable.
  7. Overall verdict: PASS, FAIL, or PASS WITH RECOMMENDATIONS.
  8. Required actions (blocking) and recommended improvements (non-blocking).

Make findings specific and actionable, with file:line references where possible. Match review depth to change risk. Offer to fix straightforward issues rather than silently expanding the review into implementation.

Completion criterion: every finding is tied to changed code, has an actionable recommendation, and the verdict reflects all review and build results.

Examples

text
/code-review:pre-commit-review
/code-review:pre-commit-review --language go --profile hypershift
/code-review:pre-commit-review --skip-build
/code-review:pre-commit-review --language python --skip-tests

© openshift-eng, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/code-review/skills/pre-commit-review of openshift-eng/ai-helpers.

Open the folder on GitHubat commit a627176

Compare with similar skills

Pre Commit Review next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pre Commit Review compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pre Commit Review this skillopenshift-eng/ai-helpers120—~1.6kAutomated safety check: PassApache-2.0
WooCommerce Code Reviewwoocommerce/woocommerce11k3 repos~1.1kAutomated safety check: PassCustom licence
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT
Install Anti-Slop Oxlint Rulesdmmulroy/anti-slop5.2k—~2.2kAutomated safety check: PassMIT
Constraint-Driven Developmentaddyosmani/agent-skills102k2 repos~5.2kAutomated safety check: PassMIT
Skill Doli Code ReviewDolibarr/dolibarr7.7k1 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • WooCommerce Code Review

    woocommerce/woocommerce

    Reviews WooCommerce code changes against the project's standards, flagging backend PHP architecture, naming, documentation, data integrity and testing violations.

    11k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Installs, updates or migrates the vendored anti-slop Oxlint plugin in a repository, keeping local rule changes and the plugin's license and provenance files.

    5.2k GitHub stars~2.2k tokensUpdated 27 days ago
    DevelopmentAuto-check passed
  • Constraint-Driven Development

    addyosmani/agent-skills

    Records a project's quality bar in CONSTRAINTS.md and watches diffs for signs an agent quietly weakened it, such as suppressions, skipped tests or lowered thresholds.

    102k GitHub starsUsed in 2 repos~5.2k tokens
    DevelopmentAuto-check passed
  • Skill Doli Code Review

    Dolibarr/dolibarr

    Reviews Dolibarr PHP code for compliance with coding standards and security best practices, and fixes identified issues.

    7.7k GitHub starsUsed in 1 repo~1.1k tokens
    DevelopmentAuto-check passed
  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    68k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from openshift-eng/ai-helpers

All 118 skills in this repo
  • Investigate CI Reliability

    openshift-eng/ai-helpers

    Find and independently validate actionable reliability defects across OpenShift release jobs and presubmits, then export portable issue handoffs.

    120 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Address Review PR

    openshift-eng/ai-helpers

    Fetch and address all PR review comments — categorize by priority, make code changes, post replies, and push.

    120 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Categorize Activity Types

    openshift-eng/ai-helpers

    Categorize Jira issues into Red Hat Sankey Activity Type categories using MCP Jira tools.

    120 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Has Review Work

    openshift-eng/ai-helpers

    Decide whether a GitHub PR has unanswered authorized review comments or new required CI failures worth a follow-up agent.

    120 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Must Gather Analyzer

    openshift-eng/ai-helpers

    Analyze OpenShift must-gather diagnostic data including cluster operators, pods, nodes, and network components.

    120 GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Payload Autodl JSON

    openshift-eng/ai-helpers

    Schema for the autodl JSON data file produced by payload-analysis for database ingestion — you must use this skill whenever generating the autodl JSON file

    120 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Categories

Questions about Pre Commit Review

What does Pre Commit Review do?

Review staged and unstaged changes before committing. An agent skill from openshift-eng/ai-helpers. Pre Commit Review is an agent skill from openshift-eng/ai-helpers. Review staged and unstaged changes before committing.

When should I use Pre Commit Review?

Pre Commit Review fits situations like: asked for a pre-commit review; A code-quality review of the current diff; A solve workflow requests an independent review.

How do I install Pre Commit Review in Claude Code?

Run `npx skills add openshift-eng/ai-helpers --skill pre-commit-review -a claude-code`. Or copy the skill folder (plugins/code-review/skills/pre-commit-review in openshift-eng/ai-helpers) into .claude/skills/pre-commit-review in your project. Claude Code loads it when a task matches its description.

How do I install Pre Commit Review in Codex?

Run `npx skills add openshift-eng/ai-helpers --skill pre-commit-review -a codex`. Or copy the skill folder (plugins/code-review/skills/pre-commit-review in openshift-eng/ai-helpers) into .agents/skills/pre-commit-review in your project. Codex loads it when a task matches its description.

Can I use Pre Commit Review in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add openshift-eng/ai-helpers --skill pre-commit-review -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pre-commit-review, .gemini/skills/pre-commit-review, .github/skills/pre-commit-review and .opencode/skills/pre-commit-review in your project.

What does Pre Commit Review need to run?

Going by SKILL.md and its folder, Pre Commit Review needs the command-line tools its instructions call (git, make, go, cargo, npm and yarn). Our summary lists: Python 3.

Does Pre Commit Review access the network?

SKILL.md contains no URLs. Its commands use git and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Pre Commit Review safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Pre Commit Review use?

Pre Commit Review is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pre Commit Review use?

About 1.6k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Pre Commit Review?

Skills that share tags, products or a category with Pre Commit Review: WooCommerce Code Review (woocommerce/woocommerce, 11k stars), Systematic Code Refactoring (luongnv89/claude-howto, 42k stars), Install Anti-Slop Oxlint Rules (dmmulroy/anti-slop, 5.2k stars) and Constraint-Driven Development (addyosmani/agent-skills, 102k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pre Commit Review?

openshift-eng (a GitHub organization) maintains it in openshift-eng/ai-helpers, which has 120 GitHub stars. The repository holds 118 skills in this directory. The repository was last updated on October 6, 2026.

Source: openshift-eng/ai-helpers on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.