phpcs-standardslisted
Install: claude install-skill JMAILLY/claude-migration-skills
# PHP_CodeSniffer: set up, verify, and clear the custom code
Two jobs in one skill:
1. **Set up / verify** the toolchain — dependencies, `phpcs.xml`, Makefile
targets — so `make phpcs` and `make phpcbf` are trustworthy.
2. **Clear the violations** module by module, without breaking the site.
> ⚠️ **This is not a cosmetic-only task.** On a real Drupal codebase, the
> `DrupalPractice` sniffs force dependency injection, method renames and
> `t()` routing — changes that *can* break behaviour. Those are applied, but
> **isolated in their own commit and paired with a mandatory manual UAT entry**
> in the MR. See `references/risky-sniffs-uat.md`.
## Golden rule: everything goes through the Makefile
Never run `phpcs`, `phpcbf`, `composer` or `drush` on the host.
| Need | Make target |
|---|---|
| Check standards | `make phpcs c='<args>'` |
| Autofix | `make phpcbf c='<args>'` |
| Static analysis | `make phpstan` |
| Add a dev dependency | `make composer-require <pkg> --dev` |
| Generic Drush command | `make drush c='<cmd>'` |
| Clear caches | `make cr` |
| Shell in the PHP container | `make shell` |
Many Makefiles end with a catch-all (`%:` / `@:`) that **swallows positional
arguments**. So always pass phpcs arguments through a variable — `make phpcs
c='web/modules/custom/foo'` — never `make phpcs web/modules/custom/foo`.
## Step 0 — Ask before running anything
Ask these together, in one message, and remember the answers for the session:
1. **Which standard?**
- `Drup