akurbanov / dev-tools
Pre-commit checks and a project snapshot for coding agents: dev:check, dev:brief and a test-database guard
Requires
- php: ^8.2
- illuminate/console: ^11.0|^12.0|^13.0
- illuminate/database: ^11.0|^12.0|^13.0
- illuminate/process: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- symfony/finder: ^7.0|^8.0
- vlucas/phpdotenv: ^5.4
Requires (Dev)
- laravel/pint: ^1.13
- orchestra/testbench: ^9.0|^10.0|^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-18 06:48:42 UTC
README
Pre-commit checks and a project snapshot for coding agents (Claude Code, Codex) in Laravel projects. Install it as a dev dependency.
An agent starts every session by rebuilding the same picture of the project —
versions, packages, schedule, git state — and ends it by running the same
chain of checks, each time with a different tail. Both are deterministic,
so this package does them in one command and prints a short report instead of
a wall of output.
Heads up: command output and the source docblocks are in Russian.
Install
composer require --dev akurbanov/dev-tools
The service provider is picked up by package discovery and the commands are
registered in the console only. Nothing ships to production — the package
lives in require-dev.
Requires PHP 8.2+ and Laravel 11, 12 or 13.
Commands
php artisan dev:check # pint --dirty --test, git diff HEAD --check, tests, view:cache php artisan dev:check --full # + npm run build php artisan dev:check --only=pint --fix php artisan dev:check --only=tests --filter=LeadTest php artisan dev:brief # ~60 lines: versions, packages, code, schedule, git, docs/, TODO
dev:check prints one line per step and, for a failed step, only the part of
the output that explains the failure: for tests, everything from the first
failing test to the summary; for the JSON output of laravel/pao, a list of
file:line — test — message.
Steps do not abort each other, so a single run shows everything that needs fixing. The exception is the database guard: if it fails, the tests are not run at all.
Before running tests dev:check clears the config cache and checks the test
database declared in phpunit.xml (falling back to .env). Child processes
do not inherit the variables artisan loaded from .env, so tests run in the
same environment they would get from a bare shell.
Test database guard
use Akurbanov\DevTools\Testing\GuardsTestDatabase; abstract class TestCase extends BaseTestCase { use GuardsTestDatabase; public function createApplication() { return $this->guardTestDatabase(parent::createApplication()); } }
Tests refuse to run when APP_ENV is not testing, when the database is
neither sqlite :memory: nor named like test_*, *_test or *_testing,
or when the host is not local. The guard inspects the live connection rather
than phpunit.xml: a setting can be overridden by an environment variable or
a stale config cache, a connection cannot.
Patterns and hosts live in config/dev-tools.php:
php artisan vendor:publish --tag=dev-tools-config
Development
composer install vendor/bin/phpunit vendor/bin/pint
License
MIT — see LICENSE.