PluginBench
Skill
Pass
Audit score 90

php-pro

jeffallan/claude-skills

Senior PHP developer for modern PHP 8.3+, Laravel, Symfony with strict typing, PHPStan level 9, and enterprise patterns.

What is php-pro?

PHP Pro is a specialist skill for building production-grade PHP applications using PHP 8.3+, Laravel, or Symfony frameworks. It enforces strict typing, PSR standards, dependency injection, and comprehensive testing. Use it when developing typed domain models, services, controllers, migrations, REST/GraphQL APIs, and when working with Eloquent, Doctrine, or async patterns.

  • Creates typed entities, DTOs, value objects, and enums with strict type declarations
  • Implements services and repositories with constructor-based dependency injection
  • Generates controllers, middleware, and REST/GraphQL API endpoints
  • Writes PHPUnit and Pest tests with 80%+ coverage enforcement
  • Configures Laravel migrations, Eloquent models, and Doctrine ORM patterns
  • Runs PHPStan level 9 static analysis and validates PSR-12 compliance

How to install php-pro

npx skills add https://github.com/jeffallan/claude-skills --skill php-pro
Prerequisites
  • PHP 8.3+ installed and configured
  • Composer for dependency management
  • PHPStan and PHPUnit or Pest installed in project
  • Laravel 11 or Symfony 7 (or compatible versions)
  • Understanding of PSR standards and dependency injection patterns
Claude Code
Cursor
Windsurf
Cline

How to use php-pro

  1. 1.Review your project architecture, framework version, and existing dependencies
  2. 2.Define your domain models as typed entities, value objects, or enums using readonly properties
  3. 3.Implement service classes with constructor-based dependency injection
  4. 4.Create controllers or API endpoints that use services to handle business logic
  5. 5.Write PHPUnit or Pest tests with mocks, targeting 80%+ code coverage
  6. 6.Run `vendor/bin/phpstan analyse --level=9` and fix all errors
  7. 7.Run `vendor/bin/phpunit` or `vendor/bin/pest` to verify tests pass
  8. 8.Deploy only after both static analysis and tests pass cleanly

Use cases

Good for
  • Building a Laravel REST API with typed DTOs and service layer architecture
  • Implementing Symfony command handlers with dependency injection and event listeners
  • Creating domain models with readonly properties and value objects for a complex business domain
  • Writing comprehensive test suites with mocking for service classes and repositories
  • Refactoring legacy PHP code to use modern PHP 8.3+ features and strict typing
Who it's for
  • Senior PHP developers building enterprise applications
  • Teams adopting Laravel or Symfony frameworks with modern PHP standards
  • Developers migrating to PHP 8.3+ and strict typing practices
  • API developers working with REST or GraphQL endpoints
  • QA engineers enforcing code quality through PHPStan and test coverage

php-pro FAQ

When should I use PHP Pro instead of a general PHP assistant?

Use PHP Pro when building modern PHP 8.3+ applications with strict typing, frameworks like Laravel or Symfony, or when you need enterprise-grade patterns like dependency injection, typed DTOs, and comprehensive testing with PHPStan level 9 enforcement.

Does PHP Pro support both Laravel and Symfony?

Yes. PHP Pro is designed for both Laravel 11+ and Symfony 7+, with reference guides for framework-specific patterns like Laravel services/repositories and Symfony DI/events/commands.

What testing frameworks does PHP Pro use?

PHP Pro supports both PHPUnit and Pest, with templates for unit tests, mocking, and enforcement of 80%+ code coverage before delivery.

Is async/concurrent PHP supported?

Yes. PHP Pro includes patterns for Swoole, ReactPHP, and PHP fibers for building high-performance async applications.

What happens if PHPStan or tests fail?

PHP Pro enforces a strict verification workflow: it runs PHPStan level 9 and PHPUnit/Pest, fixes all errors, and only delivers code when both pass cleanly.

Full instructions (SKILL.md)

Source of truth, from jeffallan/claude-skills.


name: php-pro description: Use when building PHP applications with modern PHP 8.3+ features, Laravel, or Symfony frameworks. Invokes strict typing, PHPStan level 9, async patterns with Swoole, and PSR standards. Creates controllers, configures middleware, generates migrations, writes PHPUnit/Pest tests, defines typed DTOs and value objects, sets up dependency injection, and scaffolds REST/GraphQL APIs. Use when working with Eloquent, Doctrine, Composer, Psalm, ReactPHP, or any PHP API development. license: MIT metadata: author: https://github.com/Jeffallan version: "1.1.0" domain: language triggers: PHP, Laravel, Symfony, Composer, PHPStan, PSR, PHP API, Eloquent, Doctrine role: specialist scope: implementation output-format: code related-skills: fullstack-guardian, fastapi-expert

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', 'alice@example.com', 'secret');
        $user = new User(['name' => 'Alice', 'email' => 'alice@example.com']);

        $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

Related skills

More from jeffallan/claude-skills and the wider catalog.

LA

laravel-specialist

jeffallan/claude-skills

Build Laravel 10+ applications with Eloquent models, Sanctum auth, queues, APIs, and Livewire components.

17k installsAudited
GO

golang-pro

jeffallan/claude-skills

Senior Go developer for concurrent systems, microservices, and production-grade performance optimization.

15k installsAudited
FL

flutter-expert

jeffallan/claude-skills

Senior Flutter engineer for cross-platform apps with Riverpod, Bloc, GoRouter, and performance optimization.

12k installsAudited
KU

kubernetes-specialist

jeffallan/claude-skills

Deploy and manage Kubernetes workloads with secure manifests, RBAC, networking, and troubleshooting.

11k installs
DE

devops-engineer

jeffallan/claude-skills

Creates Dockerfiles, configures CI/CD pipelines, writes Kubernetes manifests, and generates Terraform/Pulumi infrastructure templates. Handles deployment automation, GitOps configuration, incident response runbooks, and internal developer platform tooling. Use when setting up CI/CD pipelines, containerizing applications, managing infrastructure as code, deploying to Kubernetes clusters, configuring cloud platforms, automating releases, or responding to production incidents. Invoke for pipelines, Docker, Kubernetes, GitOps, Terraform, GitHub Actions, on-call, or platform engineering.

6.8k installs
SP

spring-boot-engineer

jeffallan/claude-skills

Generates Spring Boot 3.x configurations, creates REST controllers, implements Spring Security 6 authentication flows, sets up Spring Data JPA repositories, and configures reactive WebFlux endpoints. Use when building Spring Boot 3.x applications, microservices, or reactive Java applications; invoke for Spring Data JPA, Spring Security 6, WebFlux, Spring Cloud integration, Java REST API design, or Microservices Java architecture.

6.8k installsAudited