| name | code-quality |
| description | Runs linting and static analysis on PHP/CSS/JS using phpcs, phpstan, and rector. Use when checking code style, fixing lint errors, or running static analysis. |
| allowed-tools | Read, Grep, Glob, Bash |
Code Quality Standards
Quick Commands
npm run php:lint
npm run php:lint-fix
npm run php:phpstan
npm run lint:js
npm run lint:css
Project-Specific Rules
| Area | Standard |
|---|
| PHP | 7.4+, WordPress Coding Standards |
| Prefixes | sh, simplehistory, simple_history |
| Text domain | simple-history |
| CSS naming | SuitCSS: sh-ComponentName-subpart |
| Array syntax | Short [] not array() |
| Control structures | Always use braces {}, never colon syntax |
Essential Principles
- Always escape output - Use WordPress escaping functions
- Prefix everything - All hooks, functions, classes
- Run tools after changes - phpcs/phpstan before committing
Detailed Guidelines
Related Files
phpcs.xml.dist - PHP_CodeSniffer config
phpstan.neon - PHPStan config