What the agent does
Before it could rank anything, the agent had to make coverage measurable: laravelio/laravel.io's phpunit.xml has no <source> block. It ran Pest against an untracked copy, phpunit.cov.xml, that adds app/, and kept that file out of the diff. From the clover report it set aside the Filament widgets and tables at 0%, which are chart and column configuration.
The five it picked: app/Concerns/PreparesSearch.php (0 of 19 statements), app/Notifications/SlowQueryLogged.php (0/12), app/Http/Controllers/Settings/NotificationSettingsController.php (0/7), and the Livewire components RefreshAvatar (2/15) and LikeArticle (1/8). Two first drafts failed on the tests' own mistakes: a wrong search-splitter expectation and a nonexistent likesCount() method.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Run the test suite with coverage, pick the five least-covered files that hold real logic, and write Pest tests for them that exercise behaviour, not implementation details. Do not change production code unless a test reveals a bug; if it does, say so in the description. Open a pull request with the coverage before and after.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- 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.
- 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.
- 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
Tried on laravelio/laravel.io at 55be0d80: 5 files changed, 224 insertions(+), all new files under tests/. The new tests alone ended Tests: 18 passed (61 assertions); the run did not capture that exit code. The full suite exited 2 before and after with the same 14 failures; after the change it ended Tests: 14 failed, 1 skipped, 472 passed (1133 assertions), and covered statements went from 1950 to 2013 of 2614. The run installed PHP 8.5, pcov and MariaDB, reset MariaDB's root password to the .env.example value after a first 88-failure baseline, and built the Vite assets. No pull request was opened.
For the reviewer: check the 14 failures on real MySQL, which the run could not test. PreparesSearch joins merged paragraphs with one \r\n where the input had two, and the tests pin that behaviour, so say if it is unintended. Pint was not run.
Run it on every night
An automation with a schedule trigger, cron 0 2 * * * and your timezone, runs this prompt in the Project's repository each night. Failing checks end a run needs_review, and on this trial's MariaDB the full suite exits 2 before any new test is written, and the run could not confirm MySQL clears it, so expect each morning's run to need a look until that is settled.
The use case this job follows, with its automation and trigger: Write the missing tests.
Why run it on Rush?
Laravel.io ships no coverage configuration, so the run added the <source> block outside the diff, then looked past a 0% list full of Filament configuration to classes with branches, like the search splitter that cuts a chunk over 5000 characters on single new lines.
Frequently asked questions
Why does the full suite still fail?
The run traced all 14 to the sandbox's MariaDB, whose ONLY_FULL_GROUP_BY rejects a group by users.id query (error 1055 on users.github_id), while phpunit.xml targets MySQL. Loosening sql_mode did not help.
Did any new test find a bug?
No, and no production code changed. LikeArticle stays at 7 of 8 statements: the likeToggled() listener's return $this->article is the one line left untested.
More Laravel jobs
The same job on other stacks
- Write Unit Tests for an MCP Server (MCP server)
- Write Unit Tests for a Medusa Backend (Medusa)
- Write Unit Tests for a Node.js App (Node.js)