PHPackages                             sandermuller/richter - 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. sandermuller/richter

ActiveLibrary

sandermuller/richter
====================

Measure the magnitude of impact of code changes in a Laravel codebase, built on Laravel Brain

v0.36.0(2w ago)33.5k—1.7%MITPHPPHP ^8.4CI passing

Since Jul 16Pushed 1w agoCompare

[ Source](https://github.com/SanderMuller/richter)[ Packagist](https://packagist.org/packages/sandermuller/richter)[ Docs](https://github.com/sandermuller/richter)[ RSS](/packages/sandermuller-richter/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (61)Versions (46)Used By (0)

[![Richter: measure the reach of a code change](richter.png)](https://sandermuller.github.io/richter/)

Richter
=======

[](#richter)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b4429ac16cb51b3b44f66b585bba6766d3b267a650507274e01f95eb869e3c83/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616e6465726d756c6c65722f726963687465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sandermuller/richter)[![Tests](https://camo.githubusercontent.com/6c0c4e1228fa116306b38b8803ba5c56a130dd332b774f12e9d9b7afae36edd9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f53616e6465724d756c6c65722f726963687465722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/SanderMuller/richter/actions/workflows/run-tests.yml)[![PHPStan](https://camo.githubusercontent.com/53d9d94895e4544e1be068b462bc643ba5d88b89f7b4893e4db253dd5081e96e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f53616e6465724d756c6c65722f726963687465722f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d7068707374616e267374796c653d666c61742d737175617265)](https://github.com/SanderMuller/richter/actions/workflows/phpstan.yml)[![Total Downloads](https://camo.githubusercontent.com/6e3fbde3bd0b652aa933fca303c9b21f4aa321c660cdc07002c53422cf77b7e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616e6465726d756c6c65722f726963687465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sandermuller/richter)[![License](https://camo.githubusercontent.com/687e59831e15a5f98f4c98b1d8ad7fdca535e21a601b12fd89b187ddaaf05b55/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73616e6465726d756c6c65722f726963687465722e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Laravel Compatibility](https://camo.githubusercontent.com/ebc8fd0a0589b13c71d513a444525faa38d8562f0db7f2d676a1301134a1733f/68747470733a2f2f62616467652e6c61726176656c2e636c6f75642f62616467652f73616e6465726d756c6c65722f726963687465723f7374796c653d666c6174)](https://packagist.org/packages/sandermuller/richter)

Measures the magnitude of impact of code changes in a Laravel codebase. Like the Richter scale, but for your PHP.

Run `php artisan richter:detect-changes` on a branch and Richter reports the HTTP and CLI entry points the diff can reach, flags the ones no test references, and names the hazards the change carries: a guard removed, a payload key a consumer still reads, a validation constraint dropped. Review then starts from what the change reaches, instead of from a cold diff.

```
Changed files:
  app/Models/Post.php (4 graph nodes)
  app/Services/CategoryImporter.php (0 graph nodes)  (UNRESOLVED: reach for this file could not be fully determined)

Entry points reached: 2 (some changed files could not be fully placed — see UNRESOLVED above)
  - command::categories:sync  (app/Console/Commands/SyncCategories.php)  [test-referenced]
  - route::PATCH::/api/posts/{post}  (routes/api.php:41)  [⚠ no test references this]  [authed]

Hazards (1):
  ! [tier 2 model CWE-915] App\Models\Post::$fillable — $fillable gained owner_id
      reach: gated (via its class)

Findings (in the changed source itself):
  ! app/Models/Post.php: eager-load string 'ownerprofile': segment 'ownerprofile' is not a method on any model — check the relation name

Risk:   MEDIUM (advisory) — tier 2 `model` hazard on App\Models\Post::$fillable, reach gated
Impact: 2 entry point(s) · 7 impacted node(s)

```

What makes it worth installing:

- **Member-level change impact.** A one-method change seeds that method in the code graph, not the whole class. The graph covers routes, controllers, jobs, listeners, policies, resources, Blade views, and the Eloquent relations your code walks, plus [edges a route-anchored analysis misses](https://sandermuller.github.io/richter/coverage).
- **Test-coverage prompts.** Every reached entry point is tagged `[test-referenced]` or `[⚠ no test references this]`, a heuristic prompt rather than a coverage verdict.
- **Blast radius and traces on demand.** `richter:impact` lists a symbol's callers, its dependencies, and the entry surfaces behind them. `richter:trace` answers "how does this even reach that?" with the shortest call chain.
- **Affected-test selection.** `richter:affected-tests` turns the diff's reach into a test selection, with an exit-code contract that fails toward running the full suite whenever the selection cannot be trusted.
- **Built for coding agents.** Richter registers a local MCP server exposing every analysis read-only, so an agent can work with the graph mid-review without shelling out. The `--markdown` report is ready to post as a pull-request comment.

Richter is advisory by default: `richter:detect-changes` exits 0, and a low or empty result is a signal, not a guarantee of no impact. Opt into a CI gate with `--fail-on`, `--fail-on-hazard` or `--fail-on-unresolved`.

The analysis is static, built on [Laravel Brain](https://github.com/laramint/laravel-brain), and fast enough to run on every branch: it never executes your application's routes, jobs, or commands. It does, however, autoload classes from the analyzed checkout, and autoloading runs a file's top-level code. Treat a checkout you would not `composer install` on as one you should not analyze either.

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

[](#installation)

```
composer require --dev sandermuller/richter
```

Requires PHP 8.4+ and Laravel 12 or 13. `laravel/mcp` is optional and, when present, must fall in the supported `^0.8||^0.9` range; see [Installation](https://sandermuller.github.io/richter/installation) for the `laravel/boost` v1 case.

Richter is accurate only once it knows your app's shape. Ask your agent to "set up Richter", or follow [Set up your project](https://sandermuller.github.io/richter/project-setup).

Usage
-----

[](#usage)

```
php artisan richter:detect-changes                     # advisory impact of the current diff
php artisan richter:detect-changes --explain           # show how each entry point reaches the change
php artisan richter:detect-changes --markdown          # PR-ready markdown
php artisan richter:impact "App\Services\PostPublisher"   # blast radius of one symbol
php artisan richter:trace PostController PostPublisher    # shortest call chain between two symbols
php artisan richter:affected-tests                        # the test selection the diff warrants
```

Each of these takes `--json` for machine-readable output. `richter:detect-changes` also takes `--html=` for a self-contained visual report.

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

[](#documentation)

Read the full documentation at **[sandermuller.github.io/richter](https://sandermuller.github.io/richter/)**.

**Getting started**

- [Why Richter?](https://sandermuller.github.io/richter/why-richter) — what a report tells you, what it refuses to guess at, and how the analysis runs
- [Installation](https://sandermuller.github.io/richter/installation) — requirements, the `laravel/mcp` constraint, publishing the config
- [Set up your project](https://sandermuller.github.io/richter/project-setup) — the setup skill, or two prompts you can paste to any agent

**Change impact**

- [Detecting change impact](https://sandermuller.github.io/richter/detect-changes) — the main command, which diff is analysed, reading the report, `--explain`
- [Report annotations](https://sandermuller.github.io/richter/report-annotations) — security exposure, Pennant gates, payload parity, middleware group membership
- [Output formats](https://sandermuller.github.io/richter/output-formats) — `--markdown`, `--html`, and the `--json` contract
- [Risk levels](https://sandermuller.github.io/richter/risk-levels) — the hazard tiers, the reach matrix, and the ladder that decides the level
- [Gating in CI](https://sandermuller.github.io/richter/ci-gating) — `--fail-on`, `--fail-on-unresolved`, and a pull-request workflow

**Commands**

- [Blast radius of a symbol](https://sandermuller.github.io/richter/impact) — `richter:impact`
- [Shortest path between symbols](https://sandermuller.github.io/richter/trace) — `richter:trace`
- [Affected-test selection](https://sandermuller.github.io/richter/affected-tests) — `richter:affected-tests`

**Digging deeper**

- [Frontend changes](https://sandermuller.github.io/richter/frontend) — the Wayfinder/Ziggy bridge in full
- [MCP server](https://sandermuller.github.io/richter/mcp-server) — the read-only tools and resources an agent can call
- [Graph cache](https://sandermuller.github.io/richter/graph-cache) — the fingerprinted cache, profiling, scoped rebuilds
- [Coverage beyond Laravel Brain](https://sandermuller.github.io/richter/coverage) — the edges a route-anchored analysis misses, and the known limits

**Reference**

- [Configuration reference](https://sandermuller.github.io/richter/configuration) — every key in `config/richter.php`
- [Benchmarking](https://sandermuller.github.io/richter/benchmark) — scoring accuracy against replayable history
- [Troubleshooting](https://sandermuller.github.io/richter/troubleshooting) — a symptom index: empty reports, UNRESOLVED files, a level that reads medium everywhere, exit 2

Testing
-------

[](#testing)

```
composer test        # test suite only
composer qa-check    # read-only pre-push gate: Rector + Pint dry-runs, PHPStan, tests (mirrors CI)
```

`composer qa` is the auto-fixing variant: it rewrites the working tree (Rector, Pint), so use `qa-check` when you only want to verify.

Changelog
---------

[](#changelog)

See [CHANGELOG](CHANGELOG.md) for what changed per release.

Security
--------

[](#security)

Found a vulnerability? Don't open an issue; see [SECURITY](SECURITY.md) for where to send it.

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance98

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.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 ~0 days

Total

45

Last Release

16d ago

### Community

Maintainers

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

---

Top Contributors

[![SanderMuller](https://avatars.githubusercontent.com/u/9074391?v=4)](https://github.com/SanderMuller "SanderMuller (431 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

laravelsandermullerrichter

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sandermuller-richter/health.svg)

```
[![Health](https://phpackages.com/badges/sandermuller-richter/health.svg)](https://phpackages.com/packages/sandermuller-richter)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

80732.6M270](/packages/laravel-mcp)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.6k31.1M880](/packages/laravel-boost)[laravel/surveyor

Static analysis tool for Laravel applications.

89228.4k17](/packages/laravel-surveyor)[spatie/laravel-backup

A Laravel package to backup your application

6.1k26.6M280](/packages/spatie-laravel-backup)[spatie/laravel-health

Monitor the health of a Laravel application

89313.5M195](/packages/spatie-laravel-health)

PHPackages © 2026

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