Use when implementing a backend task in the Laravel Modular Monolith: adding a module, creating an endpoint, writing a service, implementing a domain event, or fixing a backend bug. Defines technical standards and file structure — NOT the testing methodology (use test-driven-development for TDD discipline) or execution framework (use executing-plans for task sequencing).
How this skill is triggered — by the user, by Claude, or both
Slash command
/fullstack-project-skills:backend-module-devThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Implements a single task (new module, new endpoint, new service, bug fix) within the Laravel Modular Monolith architecture. Every task ends with updated documentation and passing tests.
Implements a single task (new module, new endpoint, new service, bug fix) within the Laravel Modular Monolith architecture. Every task ends with updated documentation and passing tests.
**ALL commands run inside Sail.** Never run `php`, `composer`, `artisan`, or `./vendor/bin/pest` directly on the host. Use `sail artisan`, `sail composer`, `sail test`, `sail pint`. A command run outside Sail produces a different PHP version, different env vars, and silently wrong results.Putting business logic, Eloquent queries, or conditional branching inside controllers or Form Requests. Controllers have one job: receive a validated request, call a service, return a resource. Business rules live in services and models.
CLAUDE.md — confirm module exists in the Module/Feature MapCLAUDE.md — understand its current state, rules, eventsARCHITECTURE.mdsail pint — zero style violations before commitsail test — all tests green/docs/api and confirm new/changed endpoints appear correctlyCLAUDE.mdCLAUDE.md Module/Feature Mapdigraph backend_module {
rankdir=TB;
node [shape=box, style=rounded];
A [label="Read CLAUDE.md\n(root + module)"];
B [label="Determine Level\n& File Scope"];
C [label="Value Objects\nneeded?", shape=diamond];
D [label="Create Value Objects"];
E [label="ModuleApi or\nDomain Event?", shape=diamond];
F [label="Define ModuleApi\ninterface"];
G [label="Define Shared Event\ncontract"];
H [label="Implement:\nModel / Service / Controller\nRequest / Resource"];
I [label="Write Pest Tests\n(Feature + Unit)"];
J [label="sail pint\nsail test"];
K [label="Verify Scramble\n/docs/api"];
L [label="Update CLAUDE.md\n& Module Map"];
M [label="Commit"];
A -> B -> C;
C -> D [label="yes"];
C -> E [label="no"];
D -> E;
E -> F [label="sync"];
E -> G [label="async"];
F -> H; G -> H;
H -> I -> J -> K -> L -> M;
}
Before any code: read root CLAUDE.md and the target module's CLAUDE.md. If the module doesn't exist, create it with its CLAUDE.md and ServiceProvider first.
Determine what files to create:
| Level | Creates | Skips |
|---|---|---|
| 1 | Model, Controller, Request, Resource, Migration, Tests | Service (optional), Repository, Events |
| 2 | Full structure — Model, Service, Controller, Request, Resource, Events, Listeners, Migrations, Seeder, Tests | Repository (unless complex queries) |
| 3 | Level 2 + multiple Services, Repository, external adapters | — |
Any domain concept with a validation rule or business meaning needs a Value Object. Examples: Email, Money, OrderStatus, DateRange. Implement as Laravel Casts where appropriate. Never pass raw primitives across module boundaries.
BModuleServiceProvider, inject the interface (never the implementation) in module A's service.app/Shared/Events/. Listeners register in their own ServiceProvider.Models/ — Eloquent + business invariants + Value Objects. Not anemic.Services/ — One public method = one use case. Returns Result for business errors.Http/Controllers/ — Zero logic: validate → call service → return resource.Http/Requests/ — Input validation only (format rules, required fields). Business rules go in service.Http/Resources/ — Output transformation. Keeps internal representation decoupled from API contract.Events/ — Events this module emits.Listeners/ — Handlers for events from other modules.[Module]ModuleApi.php — Interface defining everything other modules can consume.Feature tests are the primary test type. They test the full flow: HTTP → controller → service → DB → response.
uses(RefreshDatabase::class);
it('rejects duplicate email on registration', function () {
User::factory()->create(['email' => '[email protected]']);
postJson('/api/auth/register', ['email' => '[email protected]', ...])
->assertStatus(422)
->assertJsonValidationErrors(['email']);
});
Rules:
expect() Pest API, not $this->assert*()sail pint # auto-fix style issues
sail pint --test # verify (for CI — zero violations required)
sail test # all tests must be green
With sail up -d running, open http://localhost/docs/api. Verify:
Scramble reads Form Requests (parameters) and API Resources (response shape) automatically. Keep them well-typed.
Documentation (ALWAYS update before closing the task):
app/Modules/[Module]/CLAUDE.md — update Purpose, Models, Business Rules, Events, API Public sectionsCLAUDE.md Module/Feature Map — update Estado and Endpoints columnsdocs/ADR/NNN-title.md — if a significant technical decision was made/docs/api, it doesn't exist for the frontendThis skill activates during the backend implementation phase (within each plan task). Superpowers handles the TDD methodology (test-driven-development) and the execution framework (executing-plans). This skill handles the technical standards: Laravel file structure, Pest conventions, Sail, Scramble, and modular architecture rules.
When both are active:
If Superpowers is not installed, this skill works independently including its own testing instructions (without strict TDD enforcement).
npx claudepluginhub juan-apscreativas/fullstack-project-skills --plugin fullstack-project-skillsGuides interactive brainstorming for Laravel features and refactors, clarifying goals, domain, data models, APIs, side-effects, testing, and Sail environments.
Builds production-grade Laravel REST APIs using essa/api-tool-kit patterns (ApiResponse, QueryFilters, dynamicPaginate, EnumHelpers) and best practices for code quality, auth, testing, database.
Provides production-grade, idiomatic Laravel solutions with clean architecture, security best practices, performance optimizations, and modern standards for Laravel 10/11+. Use for features, refactoring, APIs, auth, services, DB interactions, and code reviews.