Skip to content
php-pro logo

PHP Pro

php-pro

Modern PHP development with strict typing, enterprise patterns, and framework expertise across Laravel and Symfony.

jeffallan/claude-skills14.8Kinstalls11.7KstarsPHP & Laravel

SKILL.md

Full skill instructions

PHP Pro

Senior PHP developer with deep expertise in PHP 8.3+, Laravel, Symfony, and modern PHP patterns with strict typing and enterprise architecture.

Core Workflow

  1. Analyze architecture — Review framework, PHP version, dependencies, and patterns
  2. Design models — Create typed domain models, value objects, DTOs
  3. Implement — Write strict-typed code with PSR compliance, DI, repositories
  4. Secure — Add validation, authentication, XSS/​SQL injection protection
  5. Verify — Run vendor/​bin/​phpstan analyse --level=9; fix all errors before proceeding. Run vendor/​bin/​phpunit or vendor/​bin/​pest; enforce 80%+ coverage. Only deliver when both pass clean.

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Modern PHPreferences/​modern-php-features.mdReadonly, enums, attributes, fibers, types
Laravelreferences/​laravel-patterns.mdServices, repositories, resources, jobs
Symfonyreferences/​symfony-patterns.mdDI, events, commands, voters
Async PHPreferences/​async-patterns.mdSwoole, ReactPHP, fibers, streams
Testingreferences/​testing-quality.mdPHPUnit, PHPStan, Pest, mocking

Constraints

MUST DO

  • Declare strict types (declare(strict_types=1))
  • Use type hints for all properties, parameters, returns
  • Follow PSR-12 coding standard
  • Run PHPStan level 9 before delivery
  • Use readonly properties where applicable
  • Write PHPDoc blocks for complex logic
  • Validate all user input with typed requests
  • Use dependency injection over global state

MUST NOT DO

  • Skip type declarations (no mixed types)
  • Store passwords in plain text (use bcrypt/​argon2)
  • Write SQL queries vulnerable to injection
  • Mix business logic with controllers
  • Hardcode configuration (use .env)
  • Deploy without running tests and static analysis
  • Use var_dump in production code

Code Patterns

Every complete implementation delivers: a typed entity/​DTO, a service class, and a test. Use these as the baseline structure.

Readonly DTO / Value Object

<?php

declare(strict_types=1);

namespace App\DTO;

final readonly class CreateUserDTO
{
    public function __construct(
        public string $name,
        public string $email,
        public string $password,
    ) {}

    public static function fromArray(array $data): self
    {
        return new self(
            name: $data['name'],
            email: $data['email'],
            password: $data['password'],
        );
    }
}

Typed Service with Constructor DI

<?php

declare(strict_types=1);

namespace App\Services;

use App\DTO\CreateUserDTO;
use App\Models\User;
use App\Repositories\UserRepositoryInterface;
use Illuminate\Support\Facades\Hash;

final class UserService
{
    public function __construct(
        private readonly UserRepositoryInterface $users,
    ) {}

    public function create(CreateUserDTO $dto): User
    {
        return $this->users->create([
            'name'     => $dto->name,
            'email'    => $dto->email,
            'password' => Hash::make($dto->password),
        ]);
    }
}

PHPUnit Test Structure

<?php

declare(strict_types=1);

namespace Tests\Unit\Services;

use App\DTO\CreateUserDTO;
use App\Models\User;
use App\Repositories\UserRepositoryInterface;
use App\Services\UserService;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

final class UserServiceTest extends TestCase
{
    private UserRepositoryInterface&MockObject $users;
    private UserService $service;

    protected function setUp(): void
    {
        parent::setUp();
        $this->users   = $this->createMock(UserRepositoryInterface::class);
        $this->service = new UserService($this->users);
    }

    public function testCreateHashesPassword(): void
    {
        $dto  = new CreateUserDTO('Alice', '[email protected]', 'secret');
        $user = new User(['name' => 'Alice', 'email' => '[email protected]']);

        $this->users
            ->expects($this->once())
            ->method('create')
            ->willReturn($user);

        $result = $this->service->create($dto);

        $this->assertSame('Alice', $result->name);
    }
}

Enum (PHP 8.1+)

<?php

declare(strict_types=1);

namespace App\Enums;

enum UserStatus: string
{
    case Active   = 'active';
    case Inactive = 'inactive';
    case Banned   = 'banned';

    public function label(): string
    {
        return match($this) {
            self::Active   => 'Active',
            self::Inactive => 'Inactive',
            self::Banned   => 'Banned',
        };
    }
}

Output Templates

When implementing a feature, deliver in this order:

  1. Domain models (entities, value objects, enums)
  2. Service/​repository classes
  3. Controller/​API endpoints
  4. Test files (PHPUnit/​Pest)
  5. Brief explanation of architecture decisions

Knowledge Reference

PHP 8.3+, Laravel 11, Symfony 7, Composer, PHPStan, Psalm, PHPUnit, Pest, Eloquent ORM, Doctrine, PSR standards, Swoole, ReactPHP, Redis, MySQL/​PostgreSQL, REST/​GraphQL APIs

Documentation

More PHP & Laravel skills

wp-performance logo
PHP & Laravel

wp-performance

A backend-only profiling workflow for slow WordPress sites when you can't click around in wp-admin.

2.2K 5.3K
View
wp-rest-api logo
PHP & Laravel

wp-rest-api

This handles the full lifecycle of WordPress REST API work: registering custom routes with proper namespacing, exposing custom post...

2.2K 5.2K
View
wp-block-themes logo
PHP & Laravel

wp-block-themes

Handles the full filesystem layer of WordPress block theme development: theme.json editing for global settings and styles, template and...

2.2K 5.2K
View

This covers the full lifecycle of WordPress Gutenberg block development: scaffolding with @wordpress/create-block, managing block.json...

2.2K 4.9K
View
wordpress-router logo
PHP & Laravel

wordpress-router

Before you touch a WordPress repo, this skill figures out what you're actually working with.

2.2K 4.9K
View
wp-wpcli-and-ops logo
PHP & Laravel

wp-wpcli-and-ops

This is a guardrails-first approach to WordPress operations through WP-CLI.

2.2K 4.8K
View
wp-project-triage logo
PHP & Laravel

wp-project-triage

Before you start refactoring a WordPress repo or setting up CI, run this to get a deterministic JSON report of what you're actually...

2.2K 4.7K
View
wp-playground logo
PHP & Laravel

wp-playground

Use for WordPress Playground workflows: fast disposable WP instances in the browser or locally via @wp-playground/cli (server, run-blueprint, build-snapshot), auto-mounting plugins/themes, switching WP/PHP versions, blueprints, and debugging (Xdebug).

2.2K 4.1K
View
wp-phpstan logo
PHP & Laravel

wp-phpstan

Configures and manages PHPStan static analysis for WordPress plugins and themes, handling the quirks that make WordPress codebases...

2.2K 4.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View