Search by

akurbanov / dev-tools

akurbanov

Pre-commit checks and a project snapshot for coding agents: dev:check, dev:brief and a test-database guard

Package info

github.com/2rkmen/dev-tools

pkg:composer/akurbanov/dev-tools

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-09-18 06:35 UTC

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.