con un clic
laravel-engineer
// Use when working on Laravel projects. Covers architecture decisions (Services vs Actions), thin controllers, Form Requests, API Resources, and API versioning. Enforces Larastan verification after code generation.
// Use when working on Laravel projects. Covers architecture decisions (Services vs Actions), thin controllers, Form Requests, API Resources, and API versioning. Enforces Larastan verification after code generation.
| name | laravel-engineer |
| description | Use when working on Laravel projects. Covers architecture decisions (Services vs Actions), thin controllers, Form Requests, API Resources, and API versioning. Enforces Larastan verification after code generation. |
./vendor/bin/phpstan analyse (Larastan) after generating codeThe most common mistake: generating a Service where an Action fits, or vice versa.
| Pattern | When to use | Example |
|---|---|---|
| Action | Single operation, called in one place, no shared state | CreateOrderAction, SendWelcomeEmailAction |
| Service | Reusable across multiple callers, wraps a capability | PaymentGatewayService, GeocodingService |
| Job | Async / background work, retry semantics needed | ProcessImportJob, SendBulkEmailJob |
Use Larastan (not raw PHPStan) for Laravel-aware type checking:
composer require --dev nunomaduro/larastan
Target level 5+ for new projects. On legacy code, baseline existing violations first, then climb:
./vendor/bin/phpstan analyse --level=5
./vendor/bin/phpstan analyse --generate-baseline # baseline legacy violations
Never ship code that fails at the project's configured level.
For APIs expected to evolve:
/api/v1/resourceDeprecation response header before removing old endpoints| Rule | Correct Pattern |
|---|---|
| Validate in Form Requests | class StorePostRequest extends FormRequest |
| Transform in Resources | class PostResource extends JsonResource |
| Business logic in Services or Actions | OrderService::calculate(), CreateOrderAction::handle() |
Use $fillable or $guarded | Never leave both empty |
| Eager-load relationships | Order::with('items', 'user')->get() |
| Use casts for types | 'status' => OrderStatus::class in $casts |
| Type-hint injected services | private readonly OrderService $service |
DB::table() when an Eloquent model exists->get() inside a loop (N+1)$request->all() for mass assignment — use $request->validated()Auth::user() directly in service layer — pass user as parameterapp() or resolve() as service locator — use constructor injectionHash::make(), never md5() or sha1()When implementing a feature, deliver in this order:
Senior Android engineer workflows — Kotlin-first (Java legacy supported), Jetpack Compose + View system, MVVM, Coroutines/Flow, Room, Retrofit, Hilt, plus device orchestration via plugin tools (device management, logcat, crash reports, app run) and mobile-mcp for UI interaction (element tree, taps, swipes). Use when implementing features, debugging crashes, fixing builds, writing tests, reviewing Android code, or running QA on an emulator.
Up-to-date library and framework documentation via Context7 MCP. Use when setup, API, or version-specific questions require current documentation.
Modern PHP 8.x policy and pitfalls. Use when writing, reviewing, or refactoring PHP code — enforces strict types, enum/readonly/match/DNF policy, PHPStan discipline, and catches the subtle traps (type coercion, mixed abuse, readonly mutation through references, enum serialization, fiber lifecycle, PDO emulation) that LLMs get wrong by default.
Redis policy & pitfalls — key naming, atomicity, TTL strategy, distributed locks, cache patterns, production traps. Use when designing Redis-backed caches, locks, queues, rate limiters, or sessions. Covers the traps LLMs get wrong by default: SETNX + EX (deprecated), KEYS on production, Pub/Sub no-persistence, HGETALL on big hashes, maxmemory-policy defaults, cluster hash tags, RDB fork memory.
SQL policy & pitfalls — query correctness, indexing strategy, safe migrations. Use when writing SQL, diagnosing slow queries, designing schemas, or reviewing Flyway/Liquibase migrations. Covers the traps LLMs miss by default: NOT IN with NULLs, function-on-column breaking indexes, OFFSET on large tables, NOT NULL column lock, CREATE INDEX blocking writes, immutable migrations.
Java 17–25 policy and pitfalls. Use when writing, reviewing, or refactoring Java code — enforces idioms around records, sealed types, switch exhaustiveness, Optional, virtual threads, and null-safety that LLMs frequently get wrong.