Skip to content

Sabbir345/code-reviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Reviewer

Powerful local pre-PR code review for your current git checkout.

code-reviewer reviews branch, staged, or file-scoped changes before you open a PR. It combines fast heuristics, Codex-backed review, pluggable rule packs, richer context loading, and recheck-aware reports.

What It Does

  • Reviews local changes against a base branch or staged diff
  • Detects project signals for PHP, WordPress, JavaScript, React, Vue, and Laravel
  • Applies built-in and custom rule packs
  • Loads related context such as manifests, tool configs, nearby files, and likely tests
  • Shows which changed files were model-reviewed and which were not
  • Produces text, markdown, GitHub-style, or JSON reports
  • Stores local recheck state so a second run can show cleared, remaining, and new findings

Install

npm install
npm link

Then run from any git repository:

code-reviewer --help

The old codex-review command is kept as an alias for compatibility.

Pre-PR Review

Run this before creating or updating a GitHub pull request:

code-reviewer --base origin/development --engine codex --thorough

If a repository uses another target branch, pass that branch explicitly:

code-reviewer --base origin/main --engine codex --thorough

Recommended workflow:

  1. Make your code changes
  2. Run the pre-PR review command
  3. Fix the findings
  4. Run the command again
  5. Open the GitHub PR when the report is clean enough

Common Commands

code-reviewer --base origin/development
code-reviewer --base origin/development --engine codex --thorough
code-reviewer --staged
code-reviewer --base origin/development --mode security --format markdown --report code-review.md
code-reviewer --base origin/development --review-depth exhaustive --engine codex
code-reviewer --fail-on medium

Review Depth

  • balanced: model-review the top 12 changed files
  • thorough: model-review the top 24 changed files
  • exhaustive: attempt to model-review every non-generated changed file

When a review is narrowed, the report includes a Not Model-Reviewed This Run section so coverage is visible instead of silent.

Custom Rule Packs

Create .codex/reviewer.yml in the repository being reviewed:

base: origin/development
engine: auto
review_depth: thorough
max_findings: 15

rule_packs:
  - id: payments
    name: Payments
    focus:
      - payment amount, currency, webhook, and refund consistency
      - idempotency and replay protection
    checks:
      - gateway callbacks must verify signatures before mutation
      - payment totals must be checked against stored order totals
    high_risk_paths:
      - app/Payments/
      - src/Payments/
    related_globs:
      - composer.json
      - package.json

focus_areas:
  - security
  - regression
  - compatibility

Built-in rule packs are auto-detected from changed files and project manifests. Custom rule packs let you teach code-reviewer your product-specific risks without editing the tool itself.

Requirements

  • Node.js 18+
  • git
  • Codex CLI installed and authenticated for model-backed review

Heuristic mode works without Codex:

code-reviewer --engine heuristic

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors