No slash command · from fuse-php
Guides setup of framework-agnostic PHP packages: PSR-4 autoloading, PER Coding Style 3.1 vs PSR-12, composer.json templates, and PSR interface selection for logging, caching, HTTP, DI, events, and time.
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.
Includes composer.json and project-structure templates (src/ for library code, tests/ wired via autoload-dev, PSR-4 namespace mapping), and the core PER/PSR-1 file rules (4 spaces, LF endings, no closing ?>).
Do NOT use this skill for language syntax or feature questions — that is php-language-modern. Do NOT use it for Laravel-specific conventions, which live in the Laravel plugin.
Before applying a standard, spawn 3 agents in parallel, one Agent call each with a name:
.php-cs-fixer.php, phpcs.xml), composer.json autoloadAfter changes, run fuse-ai-pilot:sniper for validation.
| Concern | Standard | Notes |
|---|---|---|
| Autoloading | PSR-4 | Recommended; PSR-0 is deprecated |
| Coding style | PER Coding Style 3.1 | "Extends, expands and replaces PSR-12"; PSR-12 remains the Accepted PSR |
| Logging | PSR-3 | LoggerInterface |
| Caching | PSR-6 / PSR-16 | Pool vs Simple Cache |
| HTTP | PSR-7 / 15 / 17 / 18 | Message / Handlers / Factories / Client |
| DI container | PSR-11 | ContainerInterface |
| Events | PSR-14 | Event Dispatcher |
| Time | PSR-20 | ClockInterface — testable "now" |
target-dir are deprecated. See psr4-autoloading.md.Psr\Log\LoggerInterface, not a concrete logger.?> - Core PER/PSR-1 file rules.src/ for library code, tests/ for tests - Wire tests/ via autoload-dev, never autoload.my-package/
├── composer.json # PSR-4 autoload + autoload-dev + scripts
├── src/ # Namespace root (Vendor\Package\)
│ └── Service.php
├── tests/ # PSR-4 dev namespace (Vendor\Package\Tests\)
│ └── ServiceTest.php
└── bin/ # CLI entry points (composer "bin")
→ See project-structure.md for the full layout
| Topic | Reference | When to Consult |
|---|---|---|
| PER Coding Style | per-coding-style.md | Formatting rules, PER vs PSR-12 |
| PSR catalog | psr-catalog.md | Which PSR to depend on / avoid |
| PSR-4 autoloading | psr4-autoloading.md | Namespace-to-path mapping |
| Template | When to Use |
|---|---|
| composer-json.md | Starting or modernizing a package |
| project-structure.md | Laying out directories |
src/ mapped to the vendor namespace@PER-CS ruleset — it currently enforces the 3.0 rules; apply the 3.1 additions by review)psr/log, psr/http-message, …)autoload-devtarget-dir (deprecated)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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-language-modernUse when writing modern non-framework PHP 8.1-8.5 — property hooks, asymmetric visibility, pipe operator, attributes, enums, readonly. Do NOT use for style (php-standards) or Laravel.Other plugins' skills for the same job