Laravel Claude Toolkit GitHub

Laravel in layers. Claude Code stays inside them.

A starter kit for AI-assisted modular development. Modular monolith and hexagonal architecture, plus the agents, skills, and rules that keep generated code in the right layer.

  • PHP 8.5
  • Laravel 13
  • React 19
  • Inertia.js
  • TypeScript
  • Tailwind CSS 4
  • Vite
  • Vitest
  • SQLite
  • Sail

Start a project

Three commands. Edit the values and copy.

Repository

Needs the GitHub CLI and Docker.

Six skills. Every file lands in its layer.

This is the feature workflow for an Order module. Each skill writes the test first, then the code, into the folder its layer owns.

The rule for that folder loads as soon as Claude Code touches it.

    /create-module Order

    Press play, or pick any step to see what it writes.

    Domain

    modules/Order/Domain/

    Pure PHP. Depends on nothing.

    domain-layer.mdmodules/*/Domain/**/*.php

      Application

      modules/Order/Application/

      Commands and queries. Depends on Domain.

      application-layer.mdmodules/*/Application/**/*.php

        Infrastructure

        modules/Order/Infrastructure/

        Laravel adapters. Depends on Application and Domain.

        infrastructure-layer.mdmodules/*/Infrastructure/**/*.php

          Tests

          tests/

          Unit, Integration, and Feature. Written first.

          testing.mdtests/**/*.php

            Also loaded for every file under modules/: architecture.md, inter-module.md, performance.md

            Laravel projects grow into tangled monoliths.

            Adding features becomes risky and testing becomes painful. This toolkit pairs structured patterns (modular monolith, hexagonal, DDD) with AI guardrails that enforce consistency and guide architectural decisions.

            Who it is for

            • Teams that want structure without microservices
            • Developers learning DDD and clean architecture with real examples
            • Projects that might extract modules into services later

            Rules load themselves.

            Each rule in .claude/rules/ declares a file glob. When Claude Code works on a matching file, that rule is in context. Three rules have no glob and always apply.

            RuleLoads forEnforces
            domain-layermodules/*/Domain/**/*.phpPure PHP, final readonly classes, static factories, no Laravel
            application-layermodules/*/Application/**/*.phpOne invokable handler per use case, transactions, domain events
            infrastructure-layermodules/*/Infrastructure/**/*.phpThin controllers, Form Requests, Resources, provider bindings
            architecturemodules/**/*.phpModule layout and layer boundaries
            inter-modulemodules/**/*.phpNo circular dependencies, ID-only references, events across modules
            performancemodules/**/*.phpN+1 prevention, eager loading, queued heavy work
            testingtests/**/*.phpRed-green-refactor, InMemory repositories, 80% coverage floor
            react-conventionsresources/js/**/*.{tsx,ts}Page and subcomponent patterns, strict TypeScript, Inertia
            frontendresources/js/**/*.{tsx,ts}Shared UI components, dark mode, interaction states
            frontend-testingresources/js/**/*.test.{tsx,ts}Co-located tests, shared mocks, prop factories
            coding-stylealwaysImmutability, size limits, naming
            securityalwaysNo hardcoded secrets, validated input, OWASP checks
            git-workflowalwaysConventional commits, PR process

            Seven agents for the questions a template can't answer.

            Agents live in .claude/agents/. Ask in plain words; each one answers inside this architecture.

            AgentYou askIt works through
            domain-architectDDD and hexagonal design"How should I structure the Order module?"Entities (Order, OrderLine, OrderId), value objects (Money, Quantity, Address), repository placement, module boundaries
            tdd-coachRed-green-refactor coaching"Help me TDD a discount calculator."A failing test for a 10% discount, the minimum code to pass, a refactor to a strategy, then edge cases
            clean-code-reviewerSOLID and code smells"Review my OrderService class."SRP and DIP violations, long methods to extract, missing null checks
            security-reviewerOWASP Top 10 for Laravel"Review security of the auth module."Hardcoded secrets, SQL injection, Blade escaping, CSRF, rate limiting
            react-reviewerReact, Inertia, TypeScript"Review the Order pages."Pattern compliance, TypeScript quality, UI consistency, accessibility, dark mode, performance
            changelog-keeperCHANGELOG.md upkeep"Update the changelog for this branch."User-focused entries sorted into Feature, Improvement, Fix, and Breaking Change
            explorerRead-only codebase search"Where is the Order repository bound?"Fast lookups with read, find, and grep only; it never edits

            Every skill, one line each.

            Type a slash command in Claude Code. Reference skills load on their own when you work in the matching area.

            Backend scaffolding

            Test first, in the right layer

            • /create-module <Module>Every layer plus a service provider
            • /create-value-object <Module> <Name>Immutable, self-validating value
            • /create-entity <Module> <Name>Entity, ID, and exception
            • /create-repository <Module> <Entity>Interface, Eloquent, and InMemory
            • /create-use-case <Module> <Type> <Name>Command or query DTO and handler
            • /create-controller <Module> <Name>Thin controller, request, resource

            Frontend scaffolding

            React and Inertia, with tests

            • /create-page <Module> <Page>Inertia page, test, and factory
            • /create-component <Module> <Name>Page subcomponent with exports
            • /create-hook <use-name>Custom hook with co-located test

            Review

            Reports before you merge

            • /code-review [path]Quality and architecture compliance
            • /refactor-check <path>SOLID violations and refactor options
            • /security-review [path]OWASP checks and composer audit
            • /ui-review [path]Design consistency and theming

            Workflow

            From issue to pull request

            • /tdd-cycle [test]Guided red-green-refactor
            • /test [filter]Run tests with smart filtering
            • /fixAuto-fix every quality issue in order
            • /gh-issue <number>Fetch an issue and plan it
            • /pr [title]Pull request with changelog update
            • /update-changelog [change]Record this session's changes

            Reference

            Loaded when the work matches

            • laravel-hexagonalModule structure and where code lives
            • react-inertiaFrontend architecture map
            • solid-principlesRefactoring and design questions
            • tdd-workflowTesting strategy and PHPUnit runs

            Every commit runs seven checks first.

            composer setup points Git at .githooks/. The pre-commit hook runs these and blocks the commit if one fails.

            CheckRun it yourselfCatches
            Pintcomposer lint · composer fixLaravel code style
            Rectorcomposer rector · composer rector:fixOutdated syntax, dead code, inconsistent patterns
            PHPStan, level maxcomposer phpstanType errors before runtime, Laravel-aware through Larastan
            ESLintnpm run lint · npm run lint:fixFrontend code issues
            TypeScriptnpm run typecheckStrict-mode type errors
            PHPUnit./vendor/bin/sail testUnit, integration, and feature tests
            Vitestnpm run test:unitPage, hook, and utility tests