/fuse-php:php-quality-toolingfrom fuse-php
Sets up PHPStan, Rector, and PHP-CS-Fixer on non-Laravel PHP projects, including CI wiring. Covers config templates, decision guides for greenfield vs legacy codebases, and a three-agent workflow for exploration, research, and validation.
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 a decision guide for greenfield vs legacy codebases (PHPStan level + baseline strategy, Rector's withPhpSets()/withPhpLevel(), PHP-CS-Fixer rule sets), plus ready-to-copy templates for phpstan.neon, rector.php, .php-cs-fixer.dist.php, and a composer-scripts CI pipeline.
Do NOT use this skill on Laravel projects — Laravel uses Pint (a thin wrapper over PHP-CS-Fixer) and Larastan instead, both owned by laravel-expert. Do NOT use it for test framework setup (php-testing) or language syntax questions (php-language-modern).
Three complementary tools. PHPStan finds type bugs, Rector rewrites code (upgrades + refactors), PHP-CS-Fixer formats to a coding standard. They do not overlap — run all three.
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
After implementation, run fuse-ai-pilot:sniper for validation.
| Tool | Role | Config file | Verdict |
|---|---|---|---|
| PHPStan | Static analysis (type safety, dead code) | phpstan.neon | Reports errors, never edits |
| Rector | Automated upgrade + refactor | rector.php | Rewrites source |
| PHP-CS-Fixer | Coding-standard formatter | .php-cs-fixer.dist.php | Rewrites whitespace/style |
Scope note: Laravel Pint is a thin opinionated wrapper around PHP-CS-Fixer. On a Laravel project use Pint (→ laravel-expert); everywhere else use PHP-CS-Fixer directly, which is what this skill covers.
--dry-run first - Review the diff before applying; commit before a bare runlevel 4check → PHPStan → tests; a formatting diff should fail fast--dev in composer.json; a minor bump can add rules and break CINew project from scratch?
├── Static analysis → PHPStan level 8-9+ from day one (our default; nothing to baseline yet)
├── Style → PHP-CS-Fixer @PER-CS (always-latest) or @PER-CS3x0 (pinned; `@PER-CS3.0` is deprecated)
└── Rector → withPhpSets() (reads composer.json) + deadCode/codeQuality prepared sets
Legacy codebase?
├── PHPStan → start at a level that passes, generate baseline, raise 1 level per PR
├── Rector → withPhpLevel(n) / withTypeCoverageLevel(n), one level at a time
└── Style → @PER-CS + fix once, then enforce check in CI
| Topic | Reference | Load when |
|---|---|---|
| PHPStan levels & baseline | references/phpstan-levels.md | Choosing/raising analysis strictness |
| Rector sets & upgrades | references/rector-upgrades.md | Automating PHP upgrades or refactors |
| PHP-CS-Fixer rule sets | references/php-cs-fixer.md | Configuring code style |
| Template | Use Case |
|---|---|
references/templates/phpstan-neon.md | Complete phpstan.neon (strict + baseline) |
references/templates/rector-php.md | Complete rector.php (upgrade + quality) |
references/templates/php-cs-fixer-dist.md | Complete .php-cs-fixer.dist.php (@PER-CS3x0) |
references/templates/composer-ci.md | composer scripts + GitHub Actions pipeline |
composer require --dev phpstan/phpstan rector/rector friendsofphp/php-cs-fixer
vendor/bin/php-cs-fixer check # style gate (no writes)
vendor/bin/phpstan analyse # type analysis
vendor/bin/rector process --dry-run # preview refactors
→ Full config in references/templates/
phpstan-strict-rules + Bleeding Edge on greenfield projectscomposer.json via withPhpSets()@phpstan-ignore where a real type fix is cheapreferences/php-cs-fixer.md (opens in a new tab)references/phpstan-levels.md (opens in a new tab)references/rector-upgrades.md (opens in a new tab)references/templates/composer-ci.md (opens in a new tab)references/templates/php-cs-fixer-dist.md (opens in a new tab)references/templates/phpstan-neon.md (opens in a new tab)references/templates/rector-php.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
6 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./php-standardsUse when setting up PHP-package autoloading, coding style, or PSR interfaces — PSR-4, PER Coding Style 3.1, composer.json. Do NOT use for syntax or Laravel./php-testingUse when writing/configuring tests on a non-Laravel PHP project — PHPUnit vs Pest. Do NOT use for Laravel test helpers or quality tooling (php-quality-tooling).npx claudepluginhub fusengine/claude-plugins --plugin fuse-phpOther plugins' skills for the same job