php
PHP guides you through modern language conventions, strict type declarations, and contemporary idioms for PHP 8.5+. It covers naming standards, type system rules, enumerations, class design patterns, and functional programming constructs to keep your code explicit and maintainable.
PHP helps you write and refactor code using modern conventions, strict typing, and PHP 8.5+ idioms.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-10
PHP helps you write and refactor code using modern conventions, strict typing, and PHP 8.5+ idioms. PHP guides you through modern language conventions, strict type declarations, and contemporary idioms for PHP 8.5+. It covers naming standards, type system rules, enumerations, class design patterns, and functional programming constructs to keep your code explicit and maintainable.
Use it when
- PHP teaches strict typing by declaring `declare(strict_types=1);` at the top of your files.
- PHP covers PHP 8.5+ features including readonly classes and properties, constructor promotion, property hooks.
Verify before relying
Read SKILL.md below before installing (6 files). Open directory: indexed for reading, not audited.
Install
xobotyi/cc-foundry/php · repository language: JavaScript
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What does PHP help with regarding coding conventions and best practices?
PHP guides you through modern language conventions, strict type declarations, and contemporary idioms for PHP 8.5+. It covers naming standards, type system rules, enumerations, class design patterns, and functional programming constructs to keep your code explicit and maintainable.
How do I write PHP with strict types enabled?
PHP teaches strict typing by declaring `declare(strict_types=1);` at the top of your files. This enforces type coercion rules, requiring function parameters and return types to match exactly. PHP covers type declarations for scalars, union types, intersection types, and nullable types to catch errors early and improve code clarity.
What PHP 8.5 modern syntax and type system features does this cover?
PHP covers PHP 8.5+ features including readonly classes and properties, constructor promotion, property hooks, enums for type-safe constants, first-class callables, arrow functions, and match expressions. It explains the type system's variance rules, union and intersection types, and how these features reduce boilerplate while maintaining strict safety.
How should I structure a PHP project with Composer and autoloading?
PHP guides you through setting up composer.json with PSR-4 autoloading namespaces, organizing source code in src/ directories, and configuring require and require-dev dependencies. It covers best practices for project structure, version constraints, and how autoloading integrates with modern PHP tooling for clean dependency management.
What naming conventions does PHP recommend for classes, methods, and variables?
PHP teaches PascalCase for class names, camelCase for method and variable names, and UPPER_SNAKE_CASE for constants. It emphasizes descriptive, intention-revealing names and explains interface naming conventions (often prefixed with I or suffixed with Interface) to make code self-documenting and maintainable.
How can I refactor legacy PHP code to modern standards?
PHP provides strategies for incrementally modernizing legacy code: adding strict type declarations, replacing switch statements with match expressions, extracting magic values into enums, using constructor promotion to simplify class initialization, and applying dependency injection patterns. It covers LSP tools for safe navigation and refactoring of complex codebases.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
PHP
Strict types, explicit contracts, no magic. If a class needs a docblock to explain what its properties do, the properties are named wrong.
PHP 8.5+ is the baseline. Use modern syntax unconditionally — union types, enums, readonly classes, property hooks,
named arguments, match, pipe operator. No backward compatibility with older PHP versions unless the project explicitly
requires it.
Every PHP file starts with declare(strict_types=1).
References
- Type system →
${CLAUDE_SKILL_DIR}/references/typing.md— Union/intersection/DNF types, nullable patterns, typed properties and constants, coercion rules, variance - OOP patterns →
${CLAUDE_SKILL_DIR}/references/oop.md— Interfaces, traits, readonly, property hooks, enums, constructor promotion, lazy objects, magic methods - Concurrency →
${CLAUDE_SKILL_DIR}/references/concurrency.md— Fiber API, generator coroutines, comparison table, async library guidance -
(truncated - see the full file via the links below)
File tree — 6 files
plugins/php/skills/php/.dev/reference-inventory.json
plugins/php/skills/php/SKILL.md
plugins/php/skills/php/references/concurrency.md
plugins/php/skills/php/references/oop.md
plugins/php/skills/php/references/packaging.md
plugins/php/skills/php/references/typing.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Write or refactor PHP code following modern conventions and strict typing”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
PHP Best Practices audits your code against 51 rules covering type systems, modern PHP 8.x features, PSR standards, SOLID principles, error handling, performance, and security. It detects your project's PHP version and applies only relevant guidance, from union types and match expressions in 8.0 through property hooks and the pipe operator in 8.4+.
Upgrade legacy PHP projects to current language standards using PHP 8.1+ features, strict typing, and modern patterns. This skill guides you through static analysis configuration, automated refactoring with Rector, code style fixes, and architectural improvements like DTOs and enums. It enforces best practices across PSR compliance, PHPStan levels, and framework-specific patterns while protecting critical code from unsafe transformations.
Upgrade legacy PHP projects to current language versions and coding standards. This skill guides you through type declarations, PSR/PER-CS compliance, static analysis setup, and modern patterns like DTOs and enums. It covers PHP 8.1 through 8.5 features, Rector automation, PHPStan configuration, and framework-specific edges.
PHP Specialist guides you through modern PHP 8.x development with language features like enums, readonly properties, and match expressions. It covers the complete toolchain: PSR interoperability, Composer dependency management, static analysis configuration, and coding standards enforcement. Apply it whenever you're authoring, reviewing, or refactoring PHP code to ensure type safety and architectural correctness.
This skill covers contemporary PHP development with PHP 7.4+ and 8.x features, including strict typing, constructor promotion, union and intersection types, and attributes. It explores object-oriented patterns through traits, interfaces, and abstract classes, plus enums and custom exception handling.
This skill covers idiomatic PHP 8.x development, emphasizing strict typing, immutable data structures via readonly classes and enums, and domain-driven error handling. Learn named arguments, match expressions, constructor injection, and PSR-12 naming conventions alongside static analysis tools like PHPStan and Psalm.
More skills php-expert (Apache-2.0) · php-development (Apache-2.0)