mohamed-ashraf-elsaed / claude-kit
One command sets up Claude Code (and any AI coding agent) on a Laravel project: engineering rules, a quality gate (PHPStan, Pint, Pest), skills, git hooks, and stack-aware frontend tooling.
Package info
github.com/mohamed-ashraf-elsaed/claude-kit
pkg:composer/mohamed-ashraf-elsaed/claude-kit
Requires
- php: ^8.2
- illuminate/console: ^11.0 || ^12.0 || ^13.0
- illuminate/filesystem: ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^11.0 || ^12.0 || ^13.0
- laravel/prompts: ^0.1 || ^0.2 || ^0.3
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.20
- orchestra/testbench: ^9.0 || ^10.0
- pestphp/pest: ^3.0 || ^4.0
- pestphp/pest-plugin-laravel: ^3.0 || ^4.0
- phpstan/phpstan-strict-rules: ^2.0
Suggests
- larastan/larastan: Adds Laravel-aware static analysis to the generated phpstan.neon.
- laravel/boost: Adds the Laravel Boost MCP server that claude-kit wires into .mcp.json.
- laravel/pint: Runs the code-style check the installer configures in pint.json.
- pestphp/pest: Runs the test gate and the generated architecture test suite.
- pestphp/pest-plugin-laravel: Adds the Laravel test helpers the Pest gate uses.
- phpstan/phpstan-strict-rules: Adds the strict rule set the generated phpstan.neon can include.
README
claude-kit
Set up Claude Code — and any AI coding agent — on a Laravel project in one command.
Engineering rules, a quality gate (PHPStan · Pint · Pest), skills, feature-doc scaffolding, and stack-aware frontend tooling.
claude-kit packages a battle-tested setup so every Laravel project — and every
developer — gets the same guardrails instead of hand-copying config between
repos: a Stop-hook + pre-commit quality gate, reusable Claude Code skills,
PHPStan level 7 + strict-rules, Pint, Pest with an optional coverage floor, an
architecture test suite that actually runs, feature-doc scaffolding, and
stack-aware frontend tooling (Vue, React, Livewire, Blade, or none).
Who it's for
- Teams putting Claude Code, Cursor, or GitHub Copilot to work on a Laravel codebase and wanting consistent, enforced conventions.
- Anyone who wants one command for PHPStan + Pint + Pest + git hooks instead of wiring them by hand.
- Projects that need AI coding guardrails an agent can't skip — the same gate runs at commit time, at the end of every Claude turn, and in CI.
Table of contents
- Requirements
- Installation
- What it installs
- Choosing what to install
- The hybrid update model
- The quality gate
- Documentation
- Contributing
- Security
- License
Requirements
- PHP 8.2+
- Laravel 11, 12, or 13
- Claude Code (to use the rules, hooks, and skills)
- A coverage driver (
pcovor Xdebug) only if you ask the gate to enforce coverage
Installation
composer require --dev mohamed-ashraf-elsaed/claude-kit php artisan claude-kit:install
claude-kit itself depends only on Laravel — it will not pull Pint, PHPStan, or a test runner into your project, and it will not move a version you already have. The installer detects your frontend stack (Inertia + Vue, Inertia + React, Livewire, Blade, or API-only), asks which parts to scaffold, works out the exact tooling your answers need, and offers to install it:
The selected tooling is not installed yet: laravel/pint, larastan/larastan, pestphp/pest
Run `composer require --dev laravel/pint larastan/larastan pestphp/pest` now? (yes/no) [yes]
Anything already in your project is left out of that list. Decline it, or run
with --no-interaction, and the command is printed for you to run yourself.
Note
If that command fails on Pest, it is an upstream conflict, not claude-kit.
Current Pest releases conflict with phpunit/phpunit newer than 12.5.30, and
the Laravel 13 skeleton pins a newer PHPUnit — so composer require --dev pestphp/pest cannot resolve on a fresh Laravel 13 app even with claude-kit
uninstalled. Re-running the same command with -W resolves it by letting
composer downgrade PHPUnit to 12.5.30. claude-kit never adds -W for you;
accepting that downgrade is your decision.
Then:
composer install # wires the git pre-commit hook composer lint # once, to normalize Laravel's shipped files npm install # only if a frontend stack was set up
Not published to Packagist yet? Install straight from GitHub by adding this to
your composer.json and running composer require --dev mohamed-ashraf-elsaed/claude-kit:dev-main:
{
"repositories": [
{ "type": "vcs", "url": "https://github.com/mohamed-ashraf-elsaed/claude-kit" }
]
}
What it installs
| Part | What lands in your project |
|---|---|
| .claude core | .claude/settings.json (hook wiring + permission allowlist, deep-merged into any existing file), the reusable skills for your stack, and .mcp.json (Laravel Boost). |
| CLAUDE.md | Short and specific: project identity, the quality gate, the feature-doc rule, and an index of the installed rules — inside claude-kit:begin/end markers, so re-running refreshes it without touching your own additions. |
| Rules | .claude/rules/ — one file per selected architecture layer, a clean-code rule (strict / balanced / relaxed), a stack-specific frontend rule, and the always-on anti-overengineering + anti-assumption rules. Path-scoped where it makes sense, so they load only when relevant. |
| Agents | Read-only design-reviewer (output vs the stated design) and docs-reviewer (output vs supplied docs). |
| Workflow skills | /commit, /deploy (both you-only), /dead-code, /codemap. |
| Quality gate | phpstan.neon (your level, Larastan and strict-rules toggles), pint.json, a generated tests/Arch/ArchTest.php matching your layers — plus a tests/Arch testsuite added to your phpunit.xml so it actually runs — .githooks/pre-commit, an edit-time PHPStan hook, and merged composer scripts. |
| Frontend | Stack-matching eslint.config.js / .prettierrc / tsconfig.json, plus merged package.json scripts and devDependencies. Skipped for API-only projects. |
| Docs | features/_TEMPLATE/ + features/README.md, .editorconfig, .gitattributes. |
| CI | Generic GitHub Actions tests.yml and lint.yml. |
Nothing is clobbered. An identical file is left alone, a file you have edited is
asked about (keep / replace / show diff), settings.json and CLAUDE.md are
merged rather than replaced, and composer.json / package.json keep your
entries. The conventions claude-kit writes are opinionated defaults — read them
and adapt them to how your team actually works.
Choosing what to install
claude-kit:install is a fully interactive configurator — it asks what you
want rather than assuming:
- Code style: Pint on/off
- Static analysis: PHPStan on/off → level (0–9) → Larastan on/off → strict-rules on/off → analyse each edited file? → block or warn only
- Tests: on/off → runner (Pest / PHPUnit) → coverage minimum → architecture tests
- Architecture: any of Services · Repositories · Data Objects · Value
Objects · Actions · Contracts. A layer you decline gets no rule, no
arch()block, and no mention in CLAUDE.md - Clean code: strict / balanced / relaxed — three concrete rule variants
- Hooks: Stop hook (which checks + how many consecutive clean runs), git pre-commit hook, feature-doc requirement
- Reviewers:
design-reviewer,docs-reviewer - Workflow skills:
/commit(your convention, verbatim),/deploy(your command, or a marked TODO — never a guess),/dead-code,/codemap - Behavioural rules: anti-overengineering, anti-assumption; plus the git-worktree workflow rule and a concise output style
- Skills: which bundled skills to install — plus optional search & install of
more via skills.sh (
npx skills find/add) - Extras: CLAUDE.md + rules, feature-doc templates,
.editorconfig, MCP, CI
Your answers are recorded in .claude/claude-kit.json, which the quality gate
and claude-kit:update read.
php artisan claude-kit:install # interactive (recommended) php artisan claude-kit:install --stack=inertia-react # preselect the stack php artisan claude-kit:install --no-interaction # accept sensible defaults php artisan claude-kit:install --force # replace existing files php artisan claude-kit:update # refresh what you installed
- Stacks:
inertia-vue,inertia-react,livewire,blade,none
The hybrid update model
- Machinery —
quality-checks.shand the Stop hook — lives invendor/mohamed-ashraf-elsaed/claude-kit/runtime/and is referenced, socomposer updatepropagates fixes to every project automatically. - Content you own —
CLAUDE.md, the rules, the skills, the agents, the feature templates, the linter configs, and the generatedphpstan.neon— is written into your repo so you can customise it freely. php artisan claude-kit:updaterefreshes that copied content: a file you never touched is updated silently, a file you edited is never replaced without asking.
The quality gate
vendor/mohamed-ashraf-elsaed/claude-kit/runtime/quality-checks.sh is the single
source of truth. It runs Pint, PHPStan at your level, and your test runner with
your coverage floor, then the frontend checks your package.json actually
defines. The same script backs the git pre-commit hook, Claude's Stop hook, and
CI — so the gate is identical everywhere.
- The Stop hook requires N consecutive clean runs (default 2) before Claude may finish a turn, and can be limited to a subset of the checks.
- Coverage needs the
pcovor Xdebug extension; without it, the gate warns instead of blocking on coverage only. - Disable the feature-doc requirement with
CLAUDE_KIT_FEATURE_DOCS=0.
Documentation
Full guides live in the wiki
and the docs/ directory:
- Installation
- Usage
- Configuration
- Frontend stacks
- Quality gate
- Skills
- Architecture
- Publishing to Packagist
- Upgrading
- FAQ
Contributing
Contributions are welcome! Please read CONTRIBUTING.md and the Code of Conduct. Releases follow SemVer; see RELEASING.md.
Security
Please report vulnerabilities privately — see SECURITY.md.
License
The MIT License. See LICENSE.