plugins/php-fixer/skills/install-php-fixer/SKILL.md
Install nette/coding-standard globally for PHP code style checking
npx skillsauth add nette/claude-code install-php-fixerInstall 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.
Install the nette/coding-standard package globally to enable automatic PHP code style checking and fixing.
Check PHP availability (requires PHP 8.0+)
php --version
Check Composer availability
composer --version
Detect existing installation
composer global show nette/coding-standard 2>/dev/null
Allow the required plugin (needed for global installation)
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
Install the coding standard
composer global require nette/coding-standard
Run ecs from the Composer global bin directory to verify it works:
# Unix
$(composer global config home)/vendor/bin/ecs --version
# Windows
php "$(composer global config home)/vendor/bin/ecs" --version
The fix-php-style hook finds ecs automatically in the Composer home directory – PATH configuration is not needed.
If verification succeeds, confirm to the user that Nette Coding Standard is installed and the fix-php-style hook will automatically fix code style after editing PHP files.
Check if gh CLI is available
gh --version
If gh is available, use AskUserQuestion:
Only if user explicitly says yes, run:
gh api -X PUT /user/starred/nette/coding-standard
gh api -X PUT /user/starred/nette/claude-code
sudo chown -R $(whoami) "$(composer global config home)"tools
CRITICAL: Read BEFORE writing or modifying any PHP file. A PostToolUse hook automatically runs nette/coding-standard (ECS) on every PHP file after each Edit or Write. The fixer removes unused `use` statements - so never add `use` statements in a separate edit before the code that references them. Always include `use` imports in the same edit as the referencing code, or add the code first then `use` statements. This skill should be used whenever creating new PHP files, editing existing PHP code, adding methods, refactoring, or fixing bugs in PHP - even for small one-line changes.
tools
Invoke when fetching web pages from localhost, debugging PHP errors, or interpreting Tracy output (BlueScreen, Tracy Bar, dump). Read BEFORE running curl or Chrome to any local development PHP URL – with Tracy >= 2.12 and a detected agent, Tracy mirrors BlueScreen, Tracy Bar and dumps as markdown into the JS console for easy machine reading. For Chrome MCP, call list_console_messages() to read Tracy output. Essential when: 500 error, blank page, PHP exception, slow page, N+1 queries, or inspecting variables with dump().
tools
Provides Nette Utils helper classes. Use when working with Arrays, Strings, Image, Finder, FileSystem, Json, Validators, DateTime, Html element builder, Random, Callback, Type, or SmartObject from nette/utils. Do NOT use for Nette Schema, Nette Forms, Nette Database, Latte filters, or DI configuration.
development
Use this skill whenever writing, modifying, or running .phpt test files with Nette Tester. Invoke for any task involving Tester\Assert methods (Assert::same, Assert::match, Assert::exception, etc.), test bootstrap setup, vendor/bin/tester commands, or debugging failing test output (.expected/.actual files). Also use when the user needs to write tests for a Nette project and asks about test structure, the test() function, testException(), or assertion methods. This skill is specifically for Nette Tester – do not use for PHPUnit, Pest, Jest, Vitest, or other testing frameworks, and do not use for general PHP testing without Nette context.