cadasto/php-coding-plugin/php-lint-setup
Claude Code and agent skill by cadasto/php-coding-plugin
- community
Checking that the SKILL.md file is still in the repository.
This skill should be used when the user runs /php-lint-setup or asks to "set up php-cs-fixer", "add PHPStan", "scaffold the PHP lint config", "bootstrap code style for this PHP repo", or "pin PHPStan to PHP 8.4". It writes .php-cs-fixer.php (@PER-CS plus declare_strict_types) and phpstan.neon (level 8, phpVersion 80400) without overwriting existing files, and suggests the Composer dev requirements. Rector is optional and stays off unless asked. Not for explaining a rule (read the php-coding references) or for non-PHP projects.
Install
npx vskill@latest install cadasto/php-coding-plugin/php-lint-setupSKILL.md
The same SKILL.md was published earlier as cadasto/php-coding-plugin/php-lint-setup.
php-lint-setup — reference PHP config
Write the plugin's reference config so the repo's tools match the skills. Single interaction. The pin is PHP 8.4. Do not write a PHPCS PSR-12 ruleset. @PER-CS already includes @PSR12, and PER replaces PSR-12 as the living standard.
$ARGUMENTS is an optional directory. Default is the repository root. Call that directory $ROOT below.
Steps
- Do not overwrite an existing config. If
$ROOT/.php-cs-fixer.php,$ROOT/.php-cs-fixer.dist.php,$ROOT/phpstan.neon, or$ROOT/phpstan.neon.distexists, show how it differs and ask before changing it. - Write
$ROOT/.php-cs-fixer.phpand$ROOT/phpstan.neonfrom the blocks below. Ifsrc/ortests/is missing, drop that path rather than inventing it. Ifcomposer.jsonhas aphpconstraint higher than^8.4, keep it and setphpVersionto that minor (80500for 8.5). Do not lower a constraint. - Rector stays off. Write
$ROOT/rector.phponly when the user asked for Rector. It is not part of the default check. - Report the commands:
vendor/bin/php-cs-fixer fix --dry-run --diff,vendor/bin/phpstan analyse,vendor/bin/phpunit, andcomposer dump-autoload --optimize --strict-psr. Suggest Composer dev requirementsfriendsofphp/php-cs-fixer,phpstan/phpstan^2,phpunit/phpunit^12.5, andphpstan/phpstan-phpunitwithphpstan/extension-installer(which loads the extension without editingphpstan.neon), and"php": "^8.4"whencomposer.jsonhas no PHP constraint yet. For a package other code depends on, also suggestroave/backward-compatibility-check(see the php-codingcompatibility.mdreference). Ifphpunit.xmlexists, suggestrequireCoverageMetadata="true",beStrictAboutCoverageMetadata="true", andfailOnRisky="true"(see the php-codingtesting.mdreference).
After Rector, if it was asked for, run php-cs-fixer again. Rector's PHP 8.4 set can strip new parentheses that @PER-CS puts back. The fixer wins. Do not enable Rector prepared sets (deadCode, codeQuality, codingStyle) in the written file; the template-repo turned the first two on, and a coding-style set can disagree with @PER-CS.
.php-cs-fixer.php
Mirrors references/php-cs-fixer.php. @PER-CS aliases the newest set the fixer ships, @PER-CS3x0 (PER 3.0). PER 3.1 is the current standard; its additions are listed in the php-coding style.md reference and are followed by hand until the fixer ships a 3.1 set. declare_strict_types is outside PER; setRiskyAllowed(true) is only there so that one risky rule runs.
php-cs-fixer has no language-version key. The pin lives in phpstan.neon.
phpstan.neon
Mirrors references/phpstan.neon. Level 8 is the template-repo level. 80400 is PHP 8.4 (<https://phpstan.org/config-reference>). Leave treatPhpDocTypesAsCertain unset (default true); the template-repo sets false, which relaxes checks.
rector.php (only if asked)
Mirrors references/rector.php. <https://getrector.com/documentation/set-lists>
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/php-lint-setup/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cadasto/php-coding-plugin/php-lint-setup)