
Description
php-best-practices is an agent skill with modern PHP 8.x patterns, PSR standards, type system guidance and SOLID principles. It contains 51 rules for writing clean and maintainable PHP. It applies when reviewing PHP code, checking type safety, auditing code quality, or making sure a project follows best practices. The skill's first step is to detect the project's PHP version, because features differ across PHP 8.0 to 8.5, and the skill says never to suggest syntax the project's version does not support. It reads the required version from composer.json, for example a caret constraint on 8.1 or 8.3, or a minimum of 8.4, and it also checks the installed runtime version with php -v. Only then does it give advice. Install it with npx skills add https://github.com/asyrafhussin/agent-skills --skill php-best-practices. The skill is part of the asyrafhussin/agent-skills repository on GitHub.…
Highlights
- 51 rules for PHP 8.x code
- PSR standards and SOLID principles
- Type system guidance
- Detects PHP version from composer.json and php -v
- Advice limited to the project's version
Ratings & Reviews
No ratings yet
Be the first to rate php-best-practices.
People also visit

PhpCodeArcheology/PhpCodeArcheology
PHP static analysis: code quality metrics, problem detection

clean-code-principles
SOLID principles, design patterns, DRY, KISS, and clean code fundamentals

code-reviewer
Thorough code review with focus on security, performance, and best practices

code-review-skill
Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+
php-best-practices FAQ
What does the skill cover?
Modern PHP 8.x patterns, PSR standards, type safety and SOLID principles, in 51 rules.
Why does it check the PHP version first?
The skill says features vary between PHP 8.0 and 8.5, so it only suggests syntax the project's version supports.
Where does it find the version?
In the php requirement of composer.json and in the installed runtime, via php -v.
How do I install it?
Run npx skills add https://github.com/asyrafhussin/agent-skills --skill php-best-practices.
What do the security audits say?
Gen Agent Trust Hub: Pass. Socket: Pass. Snyk: Pass.
What are the best php-best-practices alternatives?
Popular alternatives to php-best-practices include php-pro, PhpCodeArcheology/PhpCodeArcheology and clean-code-principles. See all php-best-practices alternatives














