No slash command · from fuse-php
Covers modern PHP 8.1-8.5 language features: property hooks, asymmetric visibility, pipe operator, attributes, enums, readonly, lazy objects, and #[ NoDiscard]. Prevents LLMs from writing pre-8.0 docblock annotations instead of native #[Attribute] syntax.
Ships in fuse-php. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Its focus is language features that LLMs frequently get wrong or write in a pre-8.0 style — most notably using docblock annotations (@Route, @ORM\Column) instead of native #[Attribute] syntax, which is the #1 mistake this skill exists to prevent.
Do NOT use this skill for coding style, PSR compliance, or autoloading — that is php-standards. Do NOT use it for Laravel-specific syntax conventions — that lives in the Laravel plugin.
Before writing PHP, spawn 3 agents in parallel, one Agent call each with a name:
composer.json require.php, CI matrix)After writing, run fuse-ai-pilot:sniper for validation.
| Feature | Since | Use it for |
|---|---|---|
| Enums (backed + methods/interfaces) | 8.1 | Closed sets of values with behavior |
First-class callable syntax f(...) | 8.1 | Passing callables without strings |
| readonly properties / classes | 8.1 / 8.2 | Immutable value objects / DTOs |
#[\Override] | 8.3 | Fail-fast on broken inheritance |
Property hooks get/set | 8.4 | Computed/validated properties, no getter/setter boilerplate |
Asymmetric visibility public private(set) | 8.4 (static: 8.5) | Public read, restricted write |
Lazy objects newLazyGhost() | 8.4 | Deferred initialization in DI containers |
Pipe operator |> | 8.5 | Left-to-right data transformation chains |
clone() function + $withProperties | 8.5 | Immutable "with" updates, incl. readonly |
#[\NoDiscard] | 8.5 | Enforce return-value consumption |
#[Attribute] replaces @annotation docblocks for routing, ORM, DI, validation. This is the #1 LLM mistake — see attributes-over-docblocks.md.composer.json require.php before choosing a feature.readonly + property hooks over hand-written getters/setters — less boilerplate, enforced immutability.declare(strict_types=1); at the top of every file.src/
├── Enum/
│ └── Status.php # backed enum + interface + methods
├── ValueObject/
│ └── Money.php # readonly class, clone() with $withProperties
└── Model/
└── User.php # property hooks, asymmetric visibility
→ See modern-class.md for complete working code
| Topic | Reference | When to Consult |
|---|---|---|
| PHP 8.5 features | php-85-features.md | Pipe operator, clone(), #[\NoDiscard], static aviz |
| PHP 8.4 features | php-84-features.md | Property hooks, aviz, lazy objects, #[\Deprecated] |
| 8.1–8.3 baseline | php-81-83-baseline.md | Enums, readonly, fibers, #[\Override] |
| Attributes vs docblocks | attributes-over-docblocks.md | Any metadata: routing, ORM, DI, validation |
| Template | When to Use |
|---|---|
| modern-class.md | Writing a new class the modern way |
require.php before picking a feature version__get@Route/@ORM\Column docblock annotations — use attributesreadonly fitWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
php-8.5, php-8.4, php-8.3, php-8.2, php-8.1, attributes, enums, property-hooks
npx claudepluginhub fusengine/claude-plugins --plugin fuse-php6 skills in this plugin
/php-ecosystem-referenceUse when picking a non-Laravel PHP tool — Symfony components, API Platform, or Slim — and routing to implementation. Do NOT use for Laravel (laravel-expert)./php-http-psrUse when building framework-agnostic PHP HTTP code — PSR-7/15/17/18 messages, middleware, factories, clients. Do NOT use for Laravel HTTP or Symfony HttpFoundation (not PSR-7)./php-quality-toolingUse when setting up PHPStan, Rector, or PHP-CS-Fixer on a non-Laravel PHP project, incl. CI wiring. Do NOT use for Laravel (Pint/Larastan), tests, or syntax.Other plugins' skills for the same job