PHPackages                             nowo-tech/code-review-guardian - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. nowo-tech/code-review-guardian

ActiveComposer-plugin[DevOps &amp; Deployment](/categories/devops)

nowo-tech/code-review-guardian
==============================

Provider-agnostic code review guardian for PHP projects. Works with any PHP project (Symfony, Laravel, Yii, CodeIgniter, etc.) and any Git provider (GitHub, GitLab, Bitbucket, etc.)

v1.0.1(4mo ago)01.1k↓46.9%[3 PRs](https://github.com/nowo-tech/CodeReviewGuardian/pulls)MITPHPPHP &gt;=7.4CI passing

Since Dec 26Pushed 1mo agoCompare

[ Source](https://github.com/nowo-tech/CodeReviewGuardian)[ Packagist](https://packagist.org/packages/nowo-tech/code-review-guardian)[ Docs](https://github.com/nowo-tech/CodeReviewGuardian)[ GitHub Sponsors](https://github.com/HecFranco)[ RSS](/packages/nowo-tech-code-review-guardian/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (11)Used By (0)

Code Review Guardian
====================

[](#code-review-guardian)

[![CI](https://github.com/nowo-tech/CodeReviewGuardian/actions/workflows/ci.yml/badge.svg)](https://github.com/nowo-tech/CodeReviewGuardian/actions/workflows/ci.yml) [![Packagist Version](https://camo.githubusercontent.com/74bd563ff7bce61141c325a82b794379df21fb838d6f9149d22630c2e3ec3413/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f776f2d746563682f636f64652d7265766965772d677561726469616e2e7376673f7374796c653d666c6174)](https://packagist.org/packages/nowo-tech/code-review-guardian) [![Packagist Downloads](https://camo.githubusercontent.com/f86043e260a16fa8d85e1d1f3487695614096c8b2f14c9fd9fce4331b018432d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f776f2d746563682f636f64652d7265766965772d677561726469616e2e737667)](https://packagist.org/packages/nowo-tech/code-review-guardian) [![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE) [![PHP](https://camo.githubusercontent.com/8e58b490725ac49cc8e463c473173681b324c9d92d7854275a785db013ca3de7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737374242343f6c6f676f3d706870)](https://php.net) [![Symfony](https://camo.githubusercontent.com/8fe7de83f11ab7ca74742794be56f9291632c8351a9ae5baea0bc1e9c4eb5a35/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d3625323025374325323037253230253743253230382d3030303030303f6c6f676f3d73796d666f6e79)](https://symfony.com) [![GitHub stars](https://camo.githubusercontent.com/e2c4a5784d147f50b342845ceb7ad0efb53de9838a4a7f52036a65d226fa7ca3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f776f2d746563682f636f64652d7265766965772d677561726469616e2e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/nowo-tech/CodeReviewGuardian) [![Coverage](https://camo.githubusercontent.com/cd0704b56f1d56def350b6d0164316307bb2f47834225fd85443b6fb0059bc73/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f7665726167652d3130302532352d627269676874677265656e)](#tests-and-coverage)

> ⭐ **Found this useful?** Install from [Packagist](https://packagist.org/packages/nowo-tech/code-review-guardian) and give the repository a star on [GitHub](https://github.com/nowo-tech/CodeReviewGuardian) if it helps your workflow.

Documentation
-------------

[](#documentation)

- [Installation](docs/INSTALLATION.md)
- [Configuration](docs/CONFIGURATION.md)
- [Usage](docs/USAGE.md)
- [Contributing](docs/CONTRIBUTING.md)
- [Changelog](docs/CHANGELOG.md)
- [Upgrading](docs/UPGRADING.md)
- [Release](docs/RELEASE.md)
- [Security](docs/SECURITY.md)
- [Engram](docs/ENGRAM.md)

### Additional documentation

[](#additional-documentation)

- [Token setup](docs/TOKEN_SETUP.md)
- [Git Guardian Angel (GGA)](docs/GGA.md)
- [AI agents configuration](docs/AGENTS_CONFIG.md)
- [Branching strategy](docs/BRANCHING.md)

Provider-agnostic code review guardian for PHP projects. Works with any PHP project: **Symfony**, **Laravel**, **Yii**, **CodeIgniter**, **Slim**, **Laminas**, etc. and any Git provider: **GitHub**, **GitLab**, **Bitbucket**, etc.

Features
--------

[](#features)

- ✅ Works with any PHP project
- ✅ Works with any Git provider (GitHub, GitLab, Bitbucket, etc.)
- ✅ **Multi-framework support** with automatic framework detection:
- **Symfony**: Optimized configuration for Symfony projects
- **Laravel**: Optimized configuration for Laravel projects
- **Generic**: Works with any PHP framework
- ✅ **Automatic configuration**: Installs framework-specific configuration files
- ✅ **Git Guardian Angel (GGA)**: Provider-agnostic code review system
- ✅ **AI Agents support**: Configure AI-powered code review agents (OpenAI, Anthropic, GitHub Copilot)
- ✅ **Provider-agnostic**: Works with GitHub, GitLab, Bitbucket, and any Git hosting service
- ✅ Automatic installation via Composer plugin
- ✅ **Configurable**: Easy configuration via YAML file

Installation
------------

[](#installation)

```
composer require --dev nowo-tech/code-review-guardian
```

After installation, the following files will be copied to your project:

- `code-review-guardian.sh` - Minimal entry point script (project root; about **40** lines — exact count may change between releases)
- **Automatically updated** on every `composer install` and `composer update`
- Acts as a lightweight wrapper that delegates to the implementation in `vendor/`
- Automatically detects vendor directory and executes the main script
- `code-review-guardian.yaml` - Configuration file (framework-specific, project root)
- Only installed if it doesn't exist (to preserve your customizations)
- `docs/AGENTS.md` - Code review rules file (framework-specific, used by GGA)
- `docs/GGA.md` - Git Guardian Angel setup guide

**Note:** The actual implementation code runs from `vendor/nowo-tech/code-review-guardian/bin/`, keeping your project root clean and minimal.

**Note:** The wrapper script and `code-review-guardian.yaml` are added to your `.gitignore` during installation (files under `docs/` installed by the plugin are not ignored automatically).

### Removing the package

[](#removing-the-package)

When you run `composer remove nowo-tech/code-review-guardian`, the plugin removes `code-review-guardian.sh`, `code-review-guardian.yaml`, and `docs/AGENTS.md`, and cleans the Code Review Guardian block from `.gitignore`. **`docs/GGA.md` is not removed** — delete it manually if you no longer need it.

### Environment Configuration

[](#environment-configuration)

Code Review Guardian requires a Git provider API token for posting review comments. Add it to your `.env` file:

```
# Git Provider API Token (required for PR/MR comments)
GIT_TOKEN=your_github_or_gitlab_token_here
```

See [`docs/TOKEN_SETUP.md`](docs/TOKEN_SETUP.md) for detailed step-by-step instructions on creating accounts and obtaining tokens for GitHub, GitLab, and Bitbucket.

Current Status
--------------

[](#current-status)

Code Review Guardian provides a complete infrastructure for code review automation:

- ✅ **Fully Implemented:**
- Composer plugin (automatic installation)
- Automatic framework detection
- Configuration file installation
- Dependency validation script
- YAML configuration parsing and loading
- File filtering according to configured patterns
- Rules file reading (AGENTS.md)
- 🚧 **In Development:**
- Full integration with AI APIs (OpenAI, Anthropic, GitHub Copilot)
- Actual code review execution using AI models
- Automatic comment posting to PR/MR
- Automatic Git provider detection from URL

The script currently validates configuration, filters files correctly, and is ready for AI API integration. Full review functionality is under active development.

Usage
-----

[](#usage)

### Run code review

[](#run-code-review)

```
./code-review-guardian.sh
```

This will validate configuration, filter files according to your settings, and prepare for code review. Full AI-powered review integration is in active development.

### Post review comment to PR/MR

[](#post-review-comment-to-prmr)

```
./code-review-guardian.sh --post-comment
```

This functionality is currently in development. It will post review comments to your pull request or merge request using the Git provider API once fully implemented.

### Show help

[](#show-help)

```
./code-review-guardian.sh --help
```

Framework Detection
-------------------

[](#framework-detection)

The package **automatically detects** your framework and installs the appropriate configuration:

FrameworkDetectionConfiguration**Symfony**`symfony/framework-bundle`✅ Symfony-specific**Laravel**`laravel/framework`✅ Laravel-specific**Yii**`yiisoft/yii2` or `yiisoft/yii`✅ Generic**CakePHP**`cakephp/cakephp`✅ Generic**Laminas**`laminas/laminas-mvc`✅ Generic**CodeIgniter**`codeigniter4/framework`✅ Generic**Slim**`slim/slim`✅ Generic**Other**Not detected✅ GenericConfiguration
-------------

[](#configuration)

Configuration is stored in `code-review-guardian.yaml`. The file is automatically generated based on your detected framework.

### Symfony Configuration Example

[](#symfony-configuration-example)

```
framework: symfony

git:
 provider: auto
 api_token_env: GIT_TOKEN

gga:
 enabled: true
 auto_review: true
 post_comments: true

agents:
 enabled: false
 provider: openai
 model: gpt-4
```

### Laravel Configuration Example

[](#laravel-configuration-example)

```
framework: laravel

git:
 provider: auto
 api_token_env: GIT_TOKEN

gga:
 enabled: true
 auto_review: true
 post_comments: true

agents:
 enabled: false
 provider: openai
 model: gpt-4
```

### Git Provider Token Configuration

[](#git-provider-token-configuration)

The configuration file references a token from your `.env` file:

```
git:
 api_token_env: GIT_TOKEN # Reads from .env file
```

Make sure to add your token to `.env`:

```
GIT_TOKEN=your_token_here
```

See `docs/GGA.md` for provider-specific setup instructions.

### Customizing Configuration

[](#customizing-configuration)

You can edit `code-review-guardian.yaml` to customize Git Guardian Angel settings, AI agents configuration, and review rules according to your project needs.

### AI Agents and Git Guardian Angel

[](#ai-agents-and-git-guardian-angel)

Code Review Guardian supports AI-powered code review agents:

- **`docs/AGENTS.md`** - Code review rules file (framework-specific, automatically installed based on detected framework)
- **`docs/GGA.md`** - Complete setup guide for Git Guardian Angel (provider-agnostic code review system)

For detailed AI agent configuration instructions, see the package documentation in `vendor/nowo-tech/code-review-guardian/docs/AGENTS_CONFIG.md` or check the [Configuration Guide](docs/CONFIGURATION.md) in the repository.

Git Provider Support
--------------------

[](#git-provider-support)

Code Review Guardian is **provider-agnostic** and works with:

- **GitHub** (GitHub Actions, Pull Requests)
- **GitLab** (GitLab CI, Merge Requests)
- **Bitbucket** (Bitbucket Pipelines, Pull Requests)
- **Any Git hosting service** with standard Git operations

Git provider detection is planned for a future release. Currently, you can configure the provider manually in the configuration file.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1 (see `composer.json` for the exact range)
- Composer 2.x
- Git

Version information
-------------------

[](#version-information)

Supported PHP ranges and dependencies are defined in [`composer.json`](composer.json). Release history and migration notes are in [`docs/CHANGELOG.md`](docs/CHANGELOG.md).

Development
-----------

[](#development)

### Using Docker (Recommended)

[](#using-docker-recommended)

The project includes Docker configuration for easy development:

```
# Start the container
make up

# Install dependencies
make install

# Run tests
make test

# Run tests with coverage
make test-coverage

# Check code style
make cs-check

# Fix code style
make cs-fix

# Run all QA checks
make qa

# Open shell in container
make shell

# Stop container
make down

# Clean build artifacts
make clean
```

### Without Docker

[](#without-docker)

If you have PHP and Composer installed locally:

```
# Clone repository
git clone https://github.com/nowo-tech/CodeReviewGuardian.git
cd CodeReviewGuardian

# Install dependencies
composer install

# Run tests
composer test

# Run tests with coverage
composer test-coverage

# Check code style
composer cs-check

# Fix code style
composer cs-fix

# Run all QA checks
composer qa
```

### Available Make Commands

[](#available-make-commands)

CommandDescription`make up`Start Docker container`make down`Stop Docker container`make shell`Open shell in container`make install`Install Composer dependencies`make test`Run PHPUnit tests`make test-coverage`Run tests with coverage and print the PHP Lines coverage line`make cs-check`Check code style (PHP-CS-Fixer)`make cs-fix`Fix code style`make rector` / `make rector-dry`Run Rector (apply or dry-run)`make phpstan`Run PHPStan`make qa`Run `cs-check` and tests`make release-check`Full pre-release pipeline (see Makefile)`make composer-sync`Validate `composer.json` and install dependencies in the container`make clean`Remove vendor, cache, and coverage artifacts`make setup-hooks`Install git pre-commit hooksContinuous Integration
----------------------

[](#continuous-integration)

The package can be integrated into your CI/CD pipeline. Example for GitHub Actions:

```
name: Code Review

on: [pull_request]

jobs:
 code-review:
  runs-on: ubuntu-latest
  steps:
   - uses: actions/checkout@v3
   - uses: php-actions/composer@v6
   - run: composer require --dev nowo-tech/code-review-guardian
   - run: ./code-review-guardian.sh
```

Related Packages
----------------

[](#related-packages)

### Composer Update Helper

[](#composer-update-helper)

Want to keep your dependencies up to date? Check out **[Composer Update Helper](https://github.com/nowo-tech/composer-update-helper)** - a perfect complement to Code Review Guardian:

- ✅ **Works with any PHP project**: Symfony, Laravel, Yii, CodeIgniter, etc.
- ✅ **Multi-framework support**: Automatic framework detection and version constraints
- ✅ **Smart updates**: Generates `composer require` commands from outdated dependencies
- ✅ **Release information**: Shows GitHub release links and changelogs
- ✅ **YAML configuration**: Easy-to-use configuration format

```
composer require --dev nowo-tech/composer-update-helper
```

Together with Code Review Guardian, you get a complete development workflow:

1. **Composer Update Helper** keeps your dependencies up to date
2. **Code Review Guardian** ensures code quality in your pull requests

Author
------

[](#author)

Created by [Héctor Franco Aceituno](https://github.com/HecFranco) at [Nowo.tech](https://nowo.tech)

Tests and coverage
------------------

[](#tests-and-coverage)

- Tests: PHPUnit (unit and integration suites)
- PHP: 100%
- TS/JS: N/A
- Python: N/A

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance84

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

9

Last Release

127d ago

Major Versions

v0.0.7 → v1.0.02026-01-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7947bfc3f2ce9574a18a2c60f3d95b5d1b0740e65dc929332c92f1df21f75ab?d=identicon)[HecFranco](/maintainers/HecFranco)

---

Top Contributors

[![HecFranco](https://avatars.githubusercontent.com/u/24323276?v=4)](https://github.com/HecFranco "HecFranco (23 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (3 commits)")

---

Tags

phpcode reviewsymfonylaravelcode qualitybitbucketgithubgitlabciquality assuranceguardian

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/nowo-tech-code-review-guardian/health.svg)

```
[![Health](https://phpackages.com/badges/nowo-tech-code-review-guardian/health.svg)](https://phpackages.com/packages/nowo-tech-code-review-guardian)
```

###  Alternatives

[ondram/ci-detector

Detect continuous integration environment and provide unified access to properties of current build

22249.4M33](/packages/ondram-ci-detector)[renoki-co/laravel-php-k8s

Just a simple port of renoki-co/php-k8s for easier access in Laravel.

88218.2k](/packages/renoki-co-laravel-php-k8s)[event4u/data-helpers

Framework-agnostic PHP library for data mapping, DTOs and utilities. Includes DataMapper, SimpleDto/LiteDto, DataAccessor/Mutator/Filter and helper classes (MathHelper, EnvHelper, etc.). Works with Laravel, Symfony/Doctrine or standalone PHP.

1421.5k](/packages/event4u-data-helpers)[laravelplus/laravel-updater

A Laravel package for syncing with upstream repositories (GitHub, GitLab, Bitbucket, etc.)

201.7k](/packages/laravelplus-laravel-updater)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
