
Php Best Practices
PHP 8.x modern patterns, PSR standards, and SOLID rules for reviewing and auditing PHP code.
- skills.sh installs
- 3.9K
- GitHub stars
- 105
- last updated
- Aug 21, 2026
What it does
- Covers 51 rules in seven categories: type system, modern features, PSR, SOLID, errors, performance, and security
- Requires detecting the project's PHP version from
composer.jsonandphp -vbefore suggesting any syntax - Lists version-gated features from 8.0 through 8.5, such as enums, readonly classes, property hooks, and the pipe operator
- Designed for reviewing PHP code, checking type safety, and auditing code quality against the rule set
Install
$ npx -y skills add asyrafhussin/agent-skills --skill php-best-practices -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
PHP Best Practices
Modern PHP 8.x patterns, PSR standards, type system best practices, and SOLID principles. Contains 51 rules for writing clean, maintainable PHP code.
Step 1: Detect PHP Version
Always check the project's PHP version before giving any advice. Features vary significantly across 8.0 - 8.5. Never suggest syntax that doesn't exist in the project's version.
Check composer.json for the required PHP version:
{ "require": { "php": "^8.1" } } // -> 8.1 rules and below
{ "require": { "php": "^8.3" } } // -> 8.3 rules and below
{ "require": { "php": ">=8.4" } } // -> 8.4 rules and below
Also check the runtime version:
php -v # e.g. PHP 8.3.12
Feature Availability by Version
Details
- Repository
- github.com/asyrafhussin/agent-skills
- Categories
- PHP & Laravel, Code Review & Quality
More from asyrafhussin/agent-skills
All 14- React Vite Best Practices3K
- Laravel Best Practices2.4K
- Laravel Inertia React2.1K
- Clean Code Principles1.9K
- Laravel Database Optimization1.1K
- Typescript React Patterns1.1K
- Laravel Owasp Security1.1K
- Tailwind Best Practices1K
- Api Design Patterns1K
- Testing Best Practices975
- Web Design Guidelines970
- Git Workflow907
- State Management849
Similar to Php Best Practices
More PHP & Laravel
php-developmentSkillmindrally/skills1.1K installsExpert PHP 8+ guidance covering SOLID design, PSR standards, typing, security, and testing conventions.
laravel-best-practicesSkillasyrafhussin/agent-skills2.4K installsLaravel 13 conventions covering architecture, Eloquent, validation, and security with 31 rules across 7 categories.
php-modernizationSkillnetresearch/php-modernization-skill462 installsPHP modernization skill covering PHP 8.1-8.5 features, PSR compliance, and static analysis tooling.
magento-php-specialistSkillmaxnorm/magento2-agent-skills261 installsStrict Magento 2 PHP coding standards guide that enforces PSR-12, strict typing, and typed, DI-driven code.
fuse-phpPluginfusengine/agents36 starsExpert modern PHP 8.5/8.4 for non-Laravel projects — libraries, standalone Symfony components, Slim, API-first apps, and CLI tools, with PER Coding Style 3.1, P