cadasto/php-coding-plugin/php-coding
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 whenever a task writes, reviews, edits, refactors, or debugs PHP, including a pasted snippet, a .php file, a PHPUnit test, composer.json, or a question that mentions PHPStan or php-cs-fixer, even when the user does not mention standards, for example "review this method", "write a PHPUnit test", "add a Guzzle client", or "can we add a method to this interface". PHP 8.4 and later with 8.5 as hints, PER Coding Style 3.1 through php-cs-fixer @PER-CS, PHPStan level 8, PHPUnit 12. It routes each change to a command to run and a reference to read, covering style, idioms (types, comparisons, exceptions, enums), testing, security, public-API compatibility, the PSR interfaces (PSR-3, 6, 7, 11, 14, 15, 16, 17, 18, 20), Guzzle, Monolog, OpenTelemetry, Slim 4, and standalone Symfony components (Console, Process, Yaml, HttpFoundation, EventDispatcher, Cache, Dotenv). Not for Laravel framework code (Laravel Boost covers it), full-stack Symfony configuration, WordPress, Drupal, or Pest.
Install
npx vskill@latest install cadasto/php-coding-plugin/php-codingSKILL.md
The same SKILL.md was published earlier as cadasto/php-coding-plugin/php-coding.
php-coding — PHP standards index
- Deterministic beats prose. Whatever php-cs-fixer, PHPStan, PHPUnit, or
composer auditfails the build for, run the tool. The references hold only what a green run can still ship, each with its source. - The pin is PHP 8.4. Features that need 8.5 are hints until
composer.jsonrequires them.
Route the change
Map every concern the change touches to a row below. Read each mapped reference before editing, and skip the rest. The files live in this skill's references/ directory.
| The change touches | Run | Read | |
|---|---|---|---|
layout, naming, line length, side effects in a declaring file, switch or closure or array formatting | vendor/bin/php-cs-fixer fix --dry-run --diff | style.md | |
a type, mixed, a union, never, an array shape, a generic, ==, in_array(), json_decode(), throw or catch, an enum or its from(), readonly, a date, match or switch, #[\Override], an 8.4 or 8.5 feature | vendor/bin/phpstan analyse | idioms.md | |
| a test, a data provider, a coverage attribute, a fixture, a mock or stub, a guard that rejects input | vendor/bin/phpunit | testing.md | |
| a public or protected class, interface, method signature, property, or constant that other packages use | vendor/bin/roave-backward-compatibility-check | compatibility.md | |
SQL, HTML output, passwords, tokens, unserialize, shell commands, file paths or URLs from input, XML, sessions | composer audit | security.md | |
a PSR interface, with or without the Psr\ prefix in view: ServerRequestInterface, ResponseInterface, MiddlewareInterface, RequestHandlerInterface, LoggerInterface, ContainerInterface, ClientInterface, ClockInterface, a PSR-6 or PSR-16 cache, a PSR-14 dispatcher, a PSR-17 factory | vendor/bin/phpstan analyse | psr.md | |
GuzzleHttp\ | none | guzzle.md | |
Monolog\ | none | monolog.md | |
OpenTelemetry\ | none | opentelemetry.md | |
a Slim 4 app: Slim\, AppFactory, the PHP-DI bridge, route and middleware setup | none | slim.md | |
| a Symfony component used on its own: Console, Process, Yaml, HttpFoundation, EventDispatcher, Cache, Dotenv | none | symfony-components.md | |
.php-cs-fixer.php, phpstan.neon, rector.php | none | run /php-lint-setup |
The session-start hook names the library references that match composer.json. A subagent does not inherit loaded skills, so an orchestrator puts this table, or the references to read, into every implementer and reviewer brief.
Minimum checklist
Apply these even when no reference is read:
- Run
vendor/bin/php-cs-fixer fix --dry-run --diffandvendor/bin/phpstan analyse. Do not hand-apply a rule either tool decides. - Every PHP file has
declare(strict_types=1);. Compare with===and!==. - Do not swallow an exception. Chain the previous one when translating it.
- Bind SQL parameters. Escape output for the context it lands in.
- Every guard has a test that fails when the guard is removed.
Tie-breaks and review
When both forms pass the tools, pick the form a reference cites and name the rule that decided it. "More idiomatic" alone is not a reason.
For a focused review, dispatch the php-reviewer agent. It reports and never edits. If a workflow already owns the review seat, that reviewer reads these references itself; do not run php-reviewer beside it.
Anything a person reads, such as a PR description or a review comment, goes in plain English, with the effect before the mechanism.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/php-coding/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-coding)