Download the PHP package jcergolj/ai-pair-review without Composer

On this page you can find all versions of the php package jcergolj/ai-pair-review. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ai-pair-review

AI Review

🤖 AI-powered code review for Laravel projects using Claude Code CLI.

Automatically reviews your code for SOLID principles, design patterns, and code quality via composer commands.

Features

Quick Start

Install and Setup

Usage

How It Works

Simple Code Review Process

  1. Run: composer ai-review (or composer ai-review-staged)
  2. AI Analysis: Claude AI analyzes your uncommitted PHP changes
  3. Automatic Save: Complete analysis saved to .ai/code-reviews/YYYY-MM-DD-HH-MM-SS/review.md
  4. Review Issues: Open the file to see detailed issues with File, Problem, and Fix information
  5. Copy & Apply: Use the included "Ready-to-Use Claude Command" to implement fixes
  6. Manual Control: You choose which issues to fix by copying them to Claude

File Outputs

What You Get

Each review includes:

Implementing Fixes

You get two files for maximum convenience:

1. Review File (review.md)

Contains detailed analysis for your decision-making:

2. Claude Command File (claude-command.txt)

Ready-to-use command with complete issue context:

Using Claude Web Interface

  1. Open: .ai/code-reviews/YYYY-MM-DD-HH-MM-SS/claude-command.txt
  2. Copy the entire file contents
  3. Paste into Claude web interface at https://claude.ai
  4. Review and apply the suggested changes

Customizing Before Use

Edit the claude-command.txt file to:

Example Files Structure

claude-command.txt example:

Integration with Existing Workflow

Basic Integration

Advanced Integration

Add to your composer.json:

Then run: composer analyse-with-ai

Code Review Storage

All AI-generated code reviews are automatically stored in the .ai/code-reviews/ folder in your project root. Each review is saved as a markdown file with a timestamp:

Interactive Triage System

When issues are found, you'll be prompted for each one:

Options:

Smart Ignore System

Issues you ignore are stored in .ai/ignore.yml:

Key features:

This folder is automatically created on the first review and contains:

After Committing

Managing Ignore List

Example Review

Generated review file:

What Gets Reviewed

🎯 SOLID Principles

🏗️ Architecture & Patterns

🔧 Code Quality

✅ Laravel Best Practices

📝 Type Safety

Configuration

Basic Configuration

Edit .pre-commit-config in your project root:

Disable AI Review

Ignore System Configuration

The ignore system automatically creates .ai/ignore.yml to track issues you don't want to see again.

Structure:

Key behaviors:

Manual management:

Large Changes & Token Limits

Claude has token limits (~200k tokens, roughly 800k characters). The hook automatically handles large changes:

Best practices for large changes:

Commands

Install

Installs the AI review system and creates:

Options:

Uninstall

Removes the pre-commit hooks.

Requirements

Note: Currently uses Claude Code CLI, but can be easily modified to use other AI providers (OpenAI, Gemini, Ollama, etc.). See EXTEND_TO_OTHER_AI.md for instructions.

Install Claude Code from https://claude.ai/code

Team Setup

Option 1: Commit config to repository

Team members run:

Option 2: Auto-install on composer install

Add to your project's composer.json:

Non-Laravel Projects

The hooks work with any PHP project! To install manually:

Support Other Languages

Edit .git/hooks/ai-reviewer.sh line 17:

Troubleshooting

"Claude CLI not found"

Install Claude Code from https://claude.ai/code

The hook will skip gracefully if Claude is not installed.

Hook not running

Review file not opening

Install VS Code CLI or the review is still saved to .ai/code-reviews/YYYY-MM-DD-HH-MM-SS/review.md

Slow reviews

For large commits (10+ files), reviews may take 20-30 seconds. Consider:

Examples

Before Review

After AI Suggestions

Why Use This?

📚 Educational

Learn SOLID principles by seeing them applied to your actual code

🔍 Quality

Catch architectural issues before code review

⚡ Fast

Get instant expert feedback on every commit

🎯 Actionable

Edit the review to keep what matters, submit to Claude for automatic fixes

Publishing to Packagist

To share this package publicly:

1. Create GitHub repository

2. Tag a release

3. Submit to Packagist

  1. Go to https://packagist.org/packages/submit
  2. Enter your GitHub URL: https://github.com/jcergolj/ai-pair-review
  3. Click Submit

4. Install in any project

Customization

Customize What Gets Reviewed

The AI review prompt is fully customizable! See CUSTOMIZE_PROMPT.md for the complete guide with examples.

Quick start:

Popular customizations:

See CUSTOMIZE_PROMPT.md for copy-paste templates and examples.

Save Reviews to Custom Location

Edit .ai/scripts/ai-reviewer.sh around line 210:

Extending to Other AI Providers

While this package uses Claude Code CLI by default, it's built on standard Git hooks and can be easily modified to use:

The pre-commit hook is just a bash script - modify .git/hooks/ai-reviewer.sh to call your preferred AI provider.

Full guide with examples: EXTEND_TO_OTHER_AI.md

Quick example for OpenAI:

Contributing

Contributions welcome!

Especially wanted:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT License - see LICENSE file

Credits

Built with Claude Code CLI by Anthropic

Support



All versions of ai-pair-review with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jcergolj/ai-pair-review contains the following files

Loading the files please wait ...