php
Skill15 starsChanged 42 days agoMITView on GitHub
Expert modern PHP (PHP 8.2/8.3+) assistance covering strict typing, attributes, fibers, Composer, and OPcache. Use when building Laravel/Symfony web apps, developing REST APIs, or optimizing PHP workloads.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- TheLunchTrae/claude-code-configstheir own version, first seen Nov 8, 2026
- AnyOrgName/php-skillstheir own version, first seen Nov 8, 2026
- rogue-dev-studio/ai-agents-roguetheir own version, first seen Nov 1, 2026
- hmj1026/dhpktheir own version, first seen Nov 1, 2026
- turkeryildirim/ai-skillstheir own version, first seen Nov 1, 2026
- bsene/skillstheir own version, first seen Oct 25, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- nimadorostkar/Claude-Skills-collection★ 33same name
- bsene/skills★ 7same name
- AnyOrgName/php-skills★ 4same name
- turkeryildirim/ai-skills★ 4same name
- hmj1026/dhpk★ 2same name
- kimtth/agent-skill-100-lines-or-less★ 2same name
- rogue-dev-studio/ai-agents-rogue★ 2same name
- cocart-headless/cocart-skills★ 1same name
- 1tomany/agent-skills★ 0same name
- sudarshanpjadhav/finggu-skills★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 98
Use PHP 8 constructor property promotion with readonly:
- Very specific: line 122
Always Add declare(strict_types=1);: Enforce strict scalar type checking at the top of every single PHP file.
- Distinctive: line 123
Use PHPStan or Psalm at Level 8+: Integrate static analysis in CI to eliminate type bugs and undefined method calls.
- Very specific: line 125
Use DateTimeImmutable: Prevent accidental time-mutation bugs by replacing mutable DateTime with DateTimeImmutable.
- Very specific: line 129
Use raw superglobals ($_POST, $_GET): Validate incoming parameters via framework Request classes and validation schemas.
- Very specific: line 130
Use weak comparison (==): Always use strict equality (===) to avoid unintended type coercion.
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PHP
A popular specific-purpose scripting language that is especially suited to web development.
When to Use
- Modern Full-Stack Web Development: Powering high-velocity Laravel and Symfony web backends with rich ecosystem tooling.
- Enterprise CMS Platforms: Building and extending WordPress, Drupal, and headless CMS architectures.
- High-Performance Asynchronous APIs (FrankenPHP / Swoole): Running persistent in-memory PHP workers serving thousands of requests per second.
- Rapid CRUD & API Engineering: Building robust APIs quickly with PHP 8.3/8.4 typed properties, attributes, and match expressions.
Quick Start
<?php
$name = "World";
echo "Hello, $name!";
$colors = ["red", "green", "blue"];
foreach ($colors as $color) {
echo $color . "<br>";
}
?>Core Concepts
Modern Strict Typing & Constructor Promotion (PHP 8.2+)
Enforces strict scalar types, readonly classes, and promoted constructor properties:
<?php
declare(strict_types=1);
namespace App\Domain;
final readonly class Order
{
public function __construct(
public string $id,
public float $amount,
public OrderStatus $status = OrderStatus::Pending,
public \DateTimeImmutable $createdAt = new \DateTimeImmutable()
) {}
}
enum OrderStatus: string
{
case Pending = 'PENDING';
case Paid = 'PAID';
case Shipped = 'SHIPPED';
}Expressive match Expressions & First-Class Callables
Replaces verbose switch statements with strict type comparison and returned values:
function getDiscountPercentage(OrderStatus $status): float
{
return match ($status) {
OrderStatus::Pending => 0.0,
OrderStatus::Paid => 0.05,
OrderStatus::Shipped => 0.10,
};
}Modern Fiber-Based Concurrency & Persistent Runtimes
Runs concurrent fibers and persistent memory workers with FrankenPHP:
$fiber = new Fiber(function (): void {
$value = Fiber::suspend('paused');
echo "Resumed with: $value
";
});
$result = $fiber->start();
$fiber->resume('active');Common Patterns
Constructor Promotion and Readonly Properties
Problem: Verbose boilerplate required to declare, type, and assign class properties.
Solution:
Use PHP 8 constructor property promotion with readonly:
<?php
declare(strict_types=1);
readonly class UserProfile
{
public function __construct(
public int $id,
public string $name,
public string $email,
public array $roles = ['user']
) {}
}
$user = new UserProfile(1, 'Jane', 'jane@example.com');
echo $user->name;Best Practices
Do:
- Always Add
declare(strict_types=1);: Enforce strict scalar type checking at the top of every single PHP file. - Use PHPStan or Psalm at Level 8+: Integrate static analysis in CI to eliminate type bugs and undefined method calls.
- Deploy with FrankenPHP or Octane: Maximize throughput by serving applications via persistent workers in production.
- Use
DateTimeImmutable: Prevent accidental time-mutation bugs by replacing mutableDateTimewithDateTimeImmutable.
Don't:
- Use raw superglobals (
$_POST,$_GET): Validate incoming parameters via framework Request classes and validation schemas. - Use weak comparison (
==): Always use strict equality (===) to avoid unintended type coercion. - Ignore Composer lock files: Always commit
composer.lockand runcomposer install --no-dev --optimize-autoloaderin production.
Troubleshooting
| Error | Cause | Solution |
TypeError: Argument 1 passed must be of the type ... | Strict types enabled and caller passed mismatched type. | Cast argument explicitly or verify caller inputs. |
Fatal error: Allowed memory size of ... bytes exhausted | Script exceeded memory_limit loading large dataset. | Use generators (yield) or increase memory_limit in php.ini. |
Class '...' not found | Autoloader not included or Composer autoloader stale. | Add require __DIR__ . '/vendor/autoload.php'; and run composer dump-autoload. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

