php-conventions

Enforce modern PHP coding standards with strict typing and PHPDoc.

8|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/zb-ss/opencode-workflows --skill php-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-conventions
Source: https://github.com/zb-ss/opencode-workflows/tree/main/skill/php-conventions
Command: npx skills add https://github.com/zb-ss/opencode-workflows --skill php-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures PHP code adheres to modern best practices, improving code quality, maintainability, and reducing bugs.

Core Features & Use Cases

  • Strict Typing: Enforces declare(strict_types=1); and scalar/class type hints.
  • OOP Patterns: Promotes classes, interfaces, dependency injection, and immutability.
  • Error Handling: Guides the use of exceptions over error suppression.
  • Documentation: Mandates PHPDoc blocks for clarity.
  • Use Case: Maintain a consistent and high-quality codebase across a PHP project, especially when multiple developers are involved.

Quick Start

Apply the php-conventions skill to the file '/path/to/your/php/file.php'.

Frequently Asked Questions about php-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce strict typing and OOP patterns in PHP 8.1+?

Enforce PHP strict typing and OOP patterns by applying `declare(strict_types=1);`, scalar type hints, classes, interfaces, and dependency injection to ensure code quality and maintainability in PHP 8.1+ environments.

What is the best way to standardize PHPDoc documentation across a project?

Standardize PHPDoc documentation by mandating comprehensive PHPDoc blocks across your codebase. This enforces modern PHP coding standards, improving clarity and maintainability for multiple developers involved in the project.

Why should I use exceptions instead of error suppression in PHP?

Use exceptions instead of error suppression in PHP to ensure robust error handling. This approach guides structured exception management, reducing bugs and improving overall application security and code quality.

Does this PHP coding standard skill work for legacy codebases?

This skill targets PHP 8.1+ development environments to ensure code quality. While it enforces modern standards like strict typing and immutability, applying it to legacy codebases requires updating code to meet these specific PHP 8.1+ requirements.

How do I apply PHP coding standards to a specific file?

Apply PHP coding standards to a specific file by targeting '/path/to/your/php/file.php'. This enforces strict typing, object-oriented programming patterns, and comprehensive PHPDoc documentation for that file.