plugins/php-expert/skills/php-standards/SKILL.md
Use when setting up a PHP package, choosing a coding style, wiring autoloading, or selecting PSR interfaces — PSR-4 autoloading, PER Coding Style 3.0 vs PSR-12, the active PSR catalog, and modern composer.json. Do NOT use for language syntax/features (use php-language-modern) or Laravel-specific conventions (use the laravel plugin).
npx skillsauth add fusengine/agents php-standardsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before applying a standard, use TeamCreate to spawn 3 agents:
.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.0 | "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)psr/log, psr/http-message, …)autoload-devtarget-dir (deprecated)testing
Copy self-audit and ban-lists — filler verbs/hype adjectives, slop placeholder names, fake-precise numbers, Title Case headlines, humor in error copy ('Oops!'), em-dash crutch, one copy register per page.
development
Logged-in web apps — dashboards, auth flows, settings, onboarding, data tables, command palettes, modals, toasts. Register `product`: density and glance-speed over marketing polish, no hero/CTA-tricks, every data surface covers empty/loading/error explicitly, tables and dataviz follow preattentive-processing rules.
development
Marketing sites, landing pages, campaign pages — register `brand` (design IS the product). Structure comes from the register's POV + a macrostructure pick, never from copying an inspiration site's section flow. Hero discipline, deviated section order, asymmetric grids, and a silhouette lookalike-test gate before ship.
development
Token-strategy core — OKLCH color rules, neutral tinting, accent-commitment levels, type scale, 8pt spacing grid, touch targets, and the canonical output format of design-system.md (the file the harness gates on). This is routing step 1 of design-method/SKILL.md — read it before design-web/design-webapp/design-ios/design-android, before picking or auditing a single color/type/spacing value.