PHP Pro
Modern PHP 8.3+: strict types, Laravel/Symfony, PSR-compliant.
When to use
PHP 8.3+ features; Laravel or Symfony apps; strict typing + PHPStan level 9; PSR standards; typed DTOs/value objects; DI containers; REST/GraphQL APIs; async (Swoole/ReactPHP).
Core workflow
- Analyze — composer.json, framework, PHP version, static-analysis level.
- Design — typed DTOs, value objects, interfaces; readonly properties.
- Implement — controllers/services with constructor DI.
- Data — Eloquent or Doctrine; avoid N+1 (eager load / fetch joins).
- Validate —
phpstan analyse (level 9), PHP-CS-Fixer (PSR-12), Pest/PHPUnit.
Key practices
declare(strict_types=1) in every file; typed params + return types.
- Readonly + promoted constructor properties for immutable DTOs.
- PSR-12 formatting, PSR-4 autoloading, PSR-11 container.
- Laravel: form requests for validation, API resources, Eloquent eager loading.
- Symfony: typed services, attributes for routing, Doctrine repositories.
- Enums (PHP 8.1+) for fixed sets.
Constraints
MUST: strict_types=1 everywhere; full type coverage; PHPStan level 9 clean; PSR-12; validate all input; eager-load relations to kill N+1; Pest/PHPUnit tests.
MUST NOT: untyped arrays as DTOs; raw unparameterized SQL; secrets in code (use .env); ignore PHPStan errors; suppress with @ operator; mix framework concerns into domain.
Output
- Typed DTOs/value objects. 2. Controllers/services with DI. 3. Eloquent/Doctrine data layer. 4. Pest/PHPUnit tests. 5. Brief note on type/query decisions.
Knowledge
PHP 8.3, Laravel, Symfony, Composer, PHPStan/Psalm, PSR-4/11/12, Eloquent, Doctrine, enums, readonly properties, Swoole/ReactPHP, Pest, PHPUnit.
1---2name: php-pro3description: "Use when building PHP 8.3+ apps with Laravel or Symfony — strict typing, PHPStan level 9, PSR standards, async (Swoole/ReactPHP), typed DTOs, DI, REST/GraphQL APIs. Triggers: PHP, Laravel, Symfony, Composer, PHPStan, PSR, PHP API, Eloquent, Doctrine, Psalm, Pest, PHPUnit."4version: 1.0.05license: MIT6tags: [php, laravel, symfony, composer, phpstan, psr, eloquent, doctrine]7source: https://github.com/jeffallan/claude-skills/tree/main/skills/php-pro8derived_from: awesomeclaude9metadata:10 source: https://skillmd.com/skills/aashutosh396/php-pro11---1213# PHP Pro1415Modern PHP 8.3+: strict types, Laravel/Symfony, PSR-compliant.1617## When to use1819PHP 8.3+ features; Laravel or Symfony apps; strict typing + PHPStan level 9; PSR standards; typed DTOs/value objects; DI containers; REST/GraphQL APIs; async (Swoole/ReactPHP).2021## Core workflow22231. **Analyze** — composer.json, framework, PHP version, static-analysis level.242. **Design** — typed DTOs, value objects, interfaces; readonly properties.253. **Implement** — controllers/services with constructor DI.264. **Data** — Eloquent or Doctrine; avoid N+1 (eager load / fetch joins).275. **Validate** — `phpstan analyse` (level 9), PHP-CS-Fixer (PSR-12), Pest/PHPUnit.2829## Key practices3031- `declare(strict_types=1)` in every file; typed params + return types.32- Readonly + promoted constructor properties for immutable DTOs.33- PSR-12 formatting, PSR-4 autoloading, PSR-11 container.34- Laravel: form requests for validation, API resources, Eloquent eager loading.35- Symfony: typed services, attributes for routing, Doctrine repositories.36- Enums (PHP 8.1+) for fixed sets.3738## Constraints3940MUST: `strict_types=1` everywhere; full type coverage; PHPStan level 9 clean; PSR-12; validate all input; eager-load relations to kill N+1; Pest/PHPUnit tests.41MUST NOT: untyped arrays as DTOs; raw unparameterized SQL; secrets in code (use `.env`); ignore PHPStan errors; suppress with `@` operator; mix framework concerns into domain.4243## Output44451. Typed DTOs/value objects. 2. Controllers/services with DI. 3. Eloquent/Doctrine data layer. 4. Pest/PHPUnit tests. 5. Brief note on type/query decisions.4647## Knowledge4849PHP 8.3, Laravel, Symfony, Composer, PHPStan/Psalm, PSR-4/11/12, Eloquent, Doctrine, enums, readonly properties, Swoole/ReactPHP, Pest, PHPUnit.