php-project-conventions

Enforce PSR compliance, naming conventions, and file structure for PHP applications.

2|Updated Oct 25, 2025
One-click install
npx skills add https://github.com/calevans/staticforge --skill php-project-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-project-conventions
Source: https://github.com/calevans/staticforge/tree/main/.opencode/skills/php-project-conventions
Command: npx skills add https://github.com/calevans/staticforge --skill php-project-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures consistency and maintainability in PHP projects by providing clear guidelines on file structure, naming conventions, coding standards, and best practices.

Core Features & Use Cases

  • Project Structure: Defines a standardized directory layout for PHP applications.
  • Coding Standards: Enforces PSR compliance, naming conventions, and type hinting.
  • File Naming: Specifies clear naming rules for classes, APIs, configs, and migrations.
  • Error Handling & Security: Outlines patterns for robust error management and security checks.
  • Use Case: When starting a new PHP project or onboarding a new developer, use this Skill to establish and enforce a consistent coding style and project organization from the outset.

Quick Start

Follow the PHP Project Conventions to create a new API endpoint file for stock data.

Frequently Asked Questions about php-project-conventions

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

FAQPage Schema
What are the best practices for standardizing PHP project structure and coding conventions?

Standardizing PHP project structure involves enforcing PSR compliance, consistent naming conventions, type hinting, and a standardized directory layout. This ensures maintainability and clear guidelines for code organization, error handling, and security best practices across the application.

How do I enforce PSR compliance and coding standards when creating new PHP files?

To enforce PSR compliance and coding standards when creating new PHP files, apply specific naming rules for classes, APIs, configs, and migrations. This process ensures type hinting, standardized error handling patterns, and consistent code organization from the outset of development.

Do I need to follow specific PHP naming conventions for classes, APIs, and migrations?

Yes, following specific PHP naming conventions for classes, APIs, configs, and migrations is required. These rules specify clear file naming and structural organization, which ensures consistency and maintainability when onboarding new developers or starting a new PHP project.

What is the best way to establish consistent error handling and security patterns in PHP?

The best way to establish consistent error handling and security patterns in PHP is to enforce predefined project-specific conventions. This approach outlines robust error management routines and integrates security checks directly into the standardized coding guidelines.

Can I use this approach to standardize Git commit messages for PHP development?

Yes, you can use these PHP project conventions to standardize Git commit messages. The guidelines ensure that commit messages follow a consistent format alongside code structure, PSR compliance, and security best practices enforcement.

When do I need to define a standardized directory layout for a PHP application?

You need to define a standardized directory layout for a PHP application when starting a new project or onboarding new developers. Establishing a clear file structure early ensures consistent coding style, maintainability, and proper code organization.