All jobs

Review Pull Requests on an Inertia.js App

Yes. An agent checks out the pull request, runs the PHP and TypeScript checks, compares each Inertia page's props on both sides and posts one review.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

An Inertia change usually spans two languages, and the bug sits where they meet: a controller sends a prop the page no longer reads, or a page expects one the controller stopped sending. The agent checks out the pull request's branch and brings the app up the way its CI does. In a repository laid out like laravel/react-starter-kit, .github/workflows/tests.yml runs composer setup and then composer ci:check on PHP 8.3 and Node 22, and composer.json spells out what that means: npm run check, npm run types:check, then composer test, which runs pint --parallel --test, phpstan analyse and php artisan test. The agent runs the same two commands in its sandbox and keeps each result for the review.

The order matters for a reason specific to this stack. .gitignore lists /resources/js/actions, /resources/js/routes and /resources/js/wayfinder: the typed route helpers that pages import, such as ProfileController.update.form() in settings/profile.tsx, are generated by the Wayfinder plugin in vite.config.ts and never committed. composer setup ends with npm run build, which regenerates them, so tsc --noEmit afterwards fails on a page that still calls a controller method the pull request renamed or a route it removed. The agent reports that failure with the import that broke, which a reader of the diff alone would not see because the generated file is not in it.

Then it reads the diff against the contract between server and page. For every Inertia::render or Route::inertia the pull request touches, it opens the matching file under resources/js/pages and compares the array of props with the component's Props type. In the kit, SecurityController::edit adds twoFactorEnabled and requiresConfirmation only when the Fortify feature is on, so a page type that makes them required is a finding. For shared data it compares HandleInertiaRequests::share, which returns name, auth and sidebarOpen, with the sharedPageProps declaration in resources/js/types/global.d.ts. That type carries an index signature of unknown, so a new shared key compiles without being declared and reaches pages untyped. The agent flags the missing declaration because the compiler will not.

It reviews what reaches the browser as data exposure, since every prop is readable in the page source. auth.user is the whole User model and depends on the #[Hidden] attribute naming password, two_factor_secret, two_factor_recovery_codes and remember_token. The passkeys prop shows the safer pattern: the query selects credential, but the map returns only id, name, authenticator and two formatted dates. A pull request that passes a model or a collection straight into a prop is held to that standard, and so is a migration that adds a sensitive column without extending #[Hidden]. The agent also checks the route's middleware against its neighbours in routes/settings.php (auth, verified, RequirePassword, throttle:6,1), whether a page in a new directory falls through to the default AppLayout in the layout switch of resources/js/app.tsx, and whether a test asserts the new props with assertInertia. It posts one review with file and line for each finding and pushes nothing.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "codex",
  "input": "Review this pull request on a Laravel and Inertia React app. Check out its branch, install PHP and Composer if the sandbox lacks them, and run composer setup followed by composer ci:check, the two commands the tests workflow runs. Keep the result of each part: npm run check, tsc --noEmit, Pint, PHPStan and php artisan test. Read the diff together with routes/web.php, routes/settings.php, app/Http/Middleware/HandleInertiaRequests.php, resources/js/types/global.d.ts, resources/js/app.tsx, config/inertia.php and the page files and controllers the diff touches. For each Inertia page the pull request adds or changes, compare the props the server passes with the component's Props type and report any prop that is sent but unused, read but not sent, or optional on one side and required on the other. Compare shared props with the sharedPageProps declaration. Report any model, collection or sensitive column that reaches a prop without being narrowed, any route missing the auth, verified, password-confirmation or throttle middleware its neighbours have, any new page with no feature test asserting its component and props, and any unbalanced chisel comment marker. Post one GitHub review that cites file and line for every finding, separates blocking issues from suggestions, and quotes each command's result. Do not push commits.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app/pull/42"
    }
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

What comes back is one review on the pull request. It opens with the commands and their results, so the author sees straight away whether npm run check, the type check, Pint, PHPStan and the PHPUnit suite pass on their branch after a fresh build. Blocking findings follow, each with a file and line: a prop mismatch quotes both the server array and the TypeScript type, an exposure finding names the attribute and the prop path it would appear under, and a broken generated import names the route helper that no longer exists.

Suggestions are listed apart from blockers: a shared key missing from global.d.ts, a page that inherits the default layout by accident, a controller that could use Route::inertia because it passes no props. The review ends with what was not checked. The agent does not sign in to third-party services, and unless the prompt asks for it, it does not drive the page in a browser, so visual regressions are out of scope and the review says so.

Run it on every pull request

Install the Rush GitHub App on the repository under Settings → Connections, create a Project for it, and add an automation with this prompt and a github trigger on pull_request.opened and pull_request.synchronize. Mark it read only, so its runs can read the repository and comment but cannot push. Each pull request gets its own sandbox and its own review, and a new push gets a review of the new diff. The trigger puts the event after the prompt as data; the prompt is what tells the agent to review the pull request named there.

Only work by a repository owner, member or collaborator fires the trigger, so pull requests from forks start nothing. branch_patterns narrows it to pull requests against main, and the automation's max_runs_per_hour bounds a burst of pushes; an event past the cap waits for the hour to have room.

The use case this job follows, with its automation and trigger: Review every pull request.

Why run it on Rush?

The checks that matter here cannot be done from the diff. The route helpers are generated at build time, the type check only means something after that build, and the PHP suite needs a database. A Rush run has its own sandbox for each pull request, so the agent installs dependencies, builds, and runs composer ci:check for real, and the review quotes output from commands whose full log stays in the run's transcript for anyone who doubts a line.

It also happens while the author is still in context. Reviews start when the pull request opens, several can run at once without sharing a checkout or a database, and none of them ties up a teammate's machine or branch. The human reviewer arrives to a list of cross-language mismatches already found and spends their time on the design.

Frequently asked questions

Can it push fixes for what it finds?

Not with this request, which ends with an instruction not to push, and not from a read-only automation, whose runs can comment but cannot push. To get fixes, start a separate run with a prompt that asks for a commit on the pull request's branch. Keeping review and repair apart means a review never changes the code it is judging.

Does it work with the Vue or Svelte adapters?

Yes. The server side is the same inertiajs/inertia-laravel package, and config/inertia.php already lists vue and svelte among the page extensions. The agent reads the props a page declares in whatever form the adapter uses, such as defineProps in a Vue file, and compares them with the controller in the same way.

Why does it build the frontend before type checking?

Because the files that pages import from @/actions and @/routes are not in the repository. They are written by the Wayfinder Vite plugin during a build, from the PHP routes and controllers as they are on the branch. Type checking before that build either fails on missing modules or checks against stale helpers.

What does it do when the test suite already fails on main?

It says so. When a check fails, the agent runs the same command on the base branch and reports whether the failure is new in the pull request or was already there. A failure the branch inherited is listed as context and not as a blocking finding against the author.

More Inertia.js jobs

The same job on other stacks

Keep reading