Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add 404kidwiz/claude-supercode-skills --skill "php-pro"
Install specific skill from multi-skill repository
# Description
PHP 8.2+ specialist with expertise in modern patterns, Composer ecosystem, and enterprise PHP development. Use when building PHP applications, optimizing performance, or modernizing legacy PHP code. Triggers include "PHP", "Composer", "PHP 8", "PSR", "Symfony components", "PHP performance".
# SKILL.md
name: php-pro
description: PHP 8.2+ specialist with expertise in modern patterns, Composer ecosystem, and enterprise PHP development. Use when building PHP applications, optimizing performance, or modernizing legacy PHP code. Triggers include "PHP", "Composer", "PHP 8", "PSR", "Symfony components", "PHP performance".
PHP Pro
Purpose
Provides expert guidance on modern PHP development using PHP 8.2+ features, modern patterns, and the Composer ecosystem. Specializes in building enterprise-grade PHP applications with proper architecture and performance optimization.
When to Use
- Building modern PHP applications
- Using PHP 8.2+ features (readonly, enums, attributes)
- Working with Composer and packages
- Implementing PSR standards
- Optimizing PHP performance
- Modernizing legacy PHP codebases
- Building APIs with pure PHP
- Using Symfony components standalone
Quick Start
Invoke this skill when:
- Developing PHP 8.2+ applications
- Working with Composer packages
- Implementing PSR standards
- Optimizing PHP performance
- Modernizing legacy PHP
Do NOT invoke when:
- Laravel-specific development β use /laravel-specialist
- WordPress development β use /wordpress-master
- General API design β use /api-designer
- Database design β use /database-administrator
Decision Framework
PHP Project Type?
βββ Full Framework
β βββ Rapid development β Laravel
β βββ Enterprise/Symfony β Symfony
βββ Microframework
β βββ Slim / Mezzio
βββ API Only
β βββ API Platform / Slim
βββ Standalone Components
βββ Symfony Components + Composer
Core Workflows
1. Modern PHP Setup
- Install PHP 8.2+ with required extensions
- Initialize Composer project
- Configure PSR-4 autoloading
- Set up coding standards (PHP-CS-Fixer, PHPStan)
- Configure error handling
- Implement dependency injection
2. PHP 8.2+ Feature Usage
- Use readonly classes for DTOs
- Apply enums for fixed value sets
- Leverage attributes for metadata
- Use named arguments for clarity
- Implement intersection types
- Apply null-safe operator
3. Performance Optimization
- Enable OPcache with proper settings
- Use preloading for stable code
- Implement JIT where beneficial
- Profile with Xdebug/Blackfire
- Optimize database queries
- Implement caching layers
Best Practices
- Use strict types in all files (
declare(strict_types=1)) - Follow PSR-12 coding standards
- Use type hints for all parameters and returns
- Leverage Composer for autoloading
- Use PHPStan or Psalm for static analysis
- Write tests with PHPUnit or Pest
Anti-Patterns
| Anti-Pattern | Problem | Correct Approach |
|---|---|---|
| No type hints | Runtime errors | Use strict types |
| Global state | Hard to test | Dependency injection |
| Manual autoloading | Error-prone | Composer autoload |
| Suppressing errors (@) | Hidden bugs | Handle errors properly |
| No static analysis | Type bugs | PHPStan/Psalm |
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.