php-pro
Guidance for writing efficient, type-safe, and modern PHP code using language best practices.
Install
mkdir -p .claude/skills/php-pro && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1434" && unzip -o skill.zip -d .claude/skills/php-pro && rm skill.zipInstalls to .claude/skills/php-pro
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Write idiomatic PHP code with generators, iterators, SPL dataKey capabilities
- →Implement memory-efficient data processing with generators
- →Utilize SPL data structures like SplQueue and SplHeap
- →Apply PHP 8+ features including match expressions and enums
- →Enforce strict typing with union and intersection types
- →Design architecture using traits and reflection
How it works
The skill applies PHP standard library functions and modern language features to refactor code for memory efficiency and type safety. It prioritizes built-in functions over external dependencies to maintain clean architecture.
Inputs & outputs
When to use php-pro
- →Optimizing memory usage
- →Implementing iterators
- →Applying modern PHP 8 features
- →Refactoring legacy code
About this skill
Use this skill when
- Working on php pro tasks or workflows
- Needing guidance, best practices, or checklists for php pro
Do not use this skill when
- The task is unrelated to php pro
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open
resources/implementation-playbook.md.
You are a PHP expert specializing in modern PHP development with focus on performance and idiomatic patterns.
Focus Areas
- Generators and iterators for memory-efficient data processing
- SPL data structures (SplQueue, SplStack, SplHeap, ArrayObject)
- Modern PHP 8+ features (match expressions, enums, attributes, constructor property promotion)
- Type system mastery (union types, intersection types, never type, mixed type)
- Advanced OOP patterns (traits, late static binding, magic methods, reflection)
- Memory management and reference handling
- Stream contexts and filters for I/O operations
- Performance profiling and optimization techniques
Approach
- Start with built-in PHP functions before writing custom implementations
- Use generators for large datasets to minimize memory footprint
- Apply strict typing and leverage type inference
- Use SPL data structures when they provide clear performance benefits
- Profile performance bottlenecks before optimizing
- Handle errors with exceptions and proper error levels
- Write self-documenting code with meaningful names
- Test edge cases and error conditions thoroughly
Output
- Memory-efficient code using generators and iterators appropriately
- Type-safe implementations with full type coverage
- Performance-optimized solutions with measured improvements
- Clean architecture following SOLID principles
- Secure code preventing injection and validation vulnerabilities
- Well-structured namespaces and autoloading setup
- PSR-compliant code following community standards
- Comprehensive error handling with custom exceptions
- Production-ready code with proper logging and monitoring hooks
Prefer PHP standard library and built-in functions over third-party packages. Use external dependencies sparingly and only when necessary. Focus on working code over explanations.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
When not to use it
- →Tasks unrelated to PHP development
- →Situations requiring tools outside the PHP domain
Limitations
- →Requires clear task scope definition
- →Does not replace manual testing or environment-specific validation
- →Requires explicit input and success criteria
How it compares
It provides a structured approach to performance profiling and idiomatic pattern application rather than relying on manual trial-and-error refactoring.
Compared to similar skills
php-pro side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| php-pro (this skill) | 13 | 4mo | No flags | Intermediate |
| php-best-practices | 15 | 1mo | No flags | Beginner |
| php-guidelines-from-spatie | 6 | 6mo | No flags | Beginner |
| code-refactor-php-mediawiki | 0 | 2mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by sickn33
View all by sickn33 →You might also like
php-best-practices
HoangNguyen0403
PHP best practices, PSR standards, and code quality guidelines.
php-guidelines-from-spatie
freekmurze
Describes PHP and Laravel guidelines provided by Spatie. These rules result in more maintainable, and readable code.
code-refactor-php-mediawiki
SemanticMediaWiki
>
laravel-best-practices
binotaliu
Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strateg
check-method-length
dykyi-roman
Analyzes PHP code for method length issues. Detects methods exceeding 30 lines, single responsibility violations, extract method opportunities.
woocommerce-code-review
woocommerce
Review WooCommerce code changes for coding standards compliance. Use when reviewing code locally, performing automated PR reviews, or checking code quality.