Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
jeffallan avatar

Php Pro

  • 12.7k installs
  • 10.8k repo stars
  • Updated May 20, 2026
  • jeffallan/claude-skills

php-pro is a specialist skill for PHP 8.3+ development with Laravel/Symfony, covering typed architecture, enterprise patterns, and quality enforcement via PHPStan and PHPUnit

About

A skill for building PHP applications with PHP 8.3+, Laravel, and Symfony. Covers typed entities, value objects, services, repositories, REST APIs, and strict quality enforcement. Developers use it for enterprise PHP architecture, test-driven development, and secure API development.

  • PHP 8.3+ with strict typing, readonly properties, enums, and modern patterns
  • Laravel and Symfony expertise: services, repositories, DTOs, dependency injection
  • Quality gate: PHPStan level 9 and 80%+ test coverage required before delivery

Php Pro by the numbers

  • 12,665 all-time installs (skills.sh)
  • +291 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #2 of 65 PHP & Laravel skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

php-pro capabilities & compatibility

Use cases
api development
Runs
Hosted SaaS
From the docs

What php-pro says it does

Declare strict types (`declare(strict_types=1)`)
SKILL.md
Run `vendor/bin/phpstan analyse --level=9`; fix all errors before proceeding. Run `vendor/bin/phpunit` or `vendor/bin/pest`; enforce 80%+ coverage
SKILL.md
npx skills add https://github.com/jeffallan/claude-skills --skill php-pro

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs12.7k
repo stars10.8k
Security audit3 / 3 scanners passed
Last updatedMay 20, 2026
Repositoryjeffallan/claude-skills

How do you build async PHP APIs with Swoole?

Building PHP 8.3+ applications with Laravel/Symfony, designing typed domain models, implementing services and repositories, writing secure REST APIs

Who is it for?

Teams building typed PHP APIs, Laravel/Symfony applications requiring strict typing, developers enforcing 80%+ test coverage and static analysis

Skip if: Legacy PHP 5.x/7.x codebases; projects skipping testing or type safety

When should I use this skill?

Building PHP APIs, designing Laravel/Symfony services, implementing typed DTOs, configuring DI containers

What you get

Swoole HTTP server code with worker configuration, coroutine-enabled request handlers, and routed API endpoints.

  • Swoole HTTP server scaffold
  • Coroutine-enabled route handlers
  • Worker and task pool configuration

By the numbers

  • PHP 8.3+ with strict typing required
  • PHPStan level 9 enforcement before delivery
  • Minimum 80% test coverage enforced

Files

SKILL.mdMarkdownGitHub ↗

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

How it compares

Choose php-pro over generic PHP snippets when Swoole-specific coroutine and task-worker configuration is required.

FAQ

When do I use DTOs vs. Eloquent models?

Use DTOs for request/response contracts and type safety. Use Eloquent models for ORM persistence. Keep them separate

What coverage and static analysis levels are required?

Minimum: 80%+ test coverage (PHPUnit/Pest), PHPStan level 9 with zero errors. Delivery blocked until both pass clean

Is Php Pro safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

PHP & Laravelbackenddevops

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.