/php-fixer:migrate-to-dresscodefrom php-fixer
Migrates PHP projects from the retired nette/coding-standard (ECS) to DressCode. Installs DressCode, generates dresscode.neon config, and shows formatting changes.
Ships in php-fixer. 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.
None: SKILL.md is the whole skill.
Version 2 of the php-fixer plugin formats PHP with DressCode. Until DressCode is installed, its hook still runs the nette/coding-standard of version 1 and tells you once a session to offer this migration. The migration installs DressCode, gives the project a dresscode.neon and shows what the new standard would change.
Run commands with the client's available shell tool and ask questions through its available question tool or chat. Tell the user what each step will do before it runs.
php --version. If it fails or is older, stop and tell the user DressCode needs PHP 8.4.composer --version. If it fails, stop and point to https://getcomposer.org/.composer.json, nearest above the files being edited. Without one, the project root is the repository root and DressCode can only be installed globally.DressCode goes into the project when the project has PHPStan (phpstan/phpstan in require or require-dev of its composer.json), so that it uses the project's PHPStan and its extensions for the types of the code. Otherwise it goes globally, together with PHPStan: DressCode takes the types from the PHPStan installed beside it.
composer require --dev dresscode/dresscode:^1.3
composer global show nette/coding-standard succeeds), because the version locked in the global installation conflicts with DressCode:
composer global update nette/coding-standard
Then:
composer global require dresscode/dresscode:^1.3 phpstan/phpstan
When the global installation still fails on a conflict with nette/coding-standard, offer to remove that first (Step 4) and try again.
When the project root already has dresscode.neon or dresscode.php (or a .dist variant), keep it and skip this step. Otherwise write dresscode.neon there:
use: nette
paths:
- app
- tests
typeAnalysis: phpstan
paths lists the directories with the project's PHP code, which a run without file names checks; take them from the autoload and autoload-dev sections of composer.json plus the tests directory, and list only those that exist. When the tests are .phpt files (Nette Tester), add:
fileExtensions:
- php
- phpt
typeAnalysis: phpstan lets DressCode use the types of the code; it needs PHPStan beside DressCode, which Step 1 installed or the project already has.
Run a check from the project root, with vendor/bin/dresscode or, for the global installation, php "<composer global config home>/vendor/bin/dresscode":
vendor/bin/dresscode check
Exit code 1 only means there are violations. Summarize for the user how many files the standard would change and what kind of changes they are. DressCode's Nette standard differs from nette/coding-standard in details, so the hook will now also touch such places in the files you edit.
Do not run dresscode fix over the project on your own. Offer it; the user may prefer to reformat the whole project in one commit of its own.
Violations marked as risky (such as a missing declare(strict_types=1)) are left by fix, because fixing them may change what the code does. Explain that to the user. Only with their explicit consent for one decision run dresscode fix --fix-risky=<path> with the path the report shows on the right, for example --fix-risky=file.strictTypes.declaration, and show the diff; never allow all risky fixes at once. dresscode fix --ask-risky, which asks about each one, needs an interactive terminal, so leave it to the user.
The hook no longer needs the global nette/coding-standard. Ask whether to remove it, and mention that other projects of the user or their own scripts may still use it. Only if the user agrees:
composer global remove nette/coding-standard
From the next edit on, the hook formats PHP files with DressCode by the project's dresscode.neon. Projects without a dresscode.neon get the Nette coding standard.
What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/dresscodeHow to run and configure DressCode, the PHP code style checker and fixer that also rewrites code for newer PHP and library versions. Use when running `dresscode` yourself (check, fix, config, explain, catalogue, init, baseline, upgrade), writing or changing `dresscode.neon` or `dresscode.php`, reading its report (violations, risky fixes, exit codes), changing a decision, silencing a finding or adding a baseline, choosing a standard or a set, setting DressCode up in CI or a Git hook, or upgrading a project to a newer PHP or library version with it. Ordinary PHP edits do not need it; the php-auto-fixer skill covers the hook that fixes them./install-php-fixerInstall DressCode, globally or into a project with PHPStan, for automatic PHP code style fixing/npx claudepluginhub nette/agent-plugins --plugin php-fixerOther plugins' skills for the same job