About wp-phpstan-review
A review skill for PHPStan setup in WordPress projects. It helps developers assess configuration, WordPress extensions and stubs, baselines, analysis coverage, and CI workflows.
Key features
- 01PHPStan configuration review
- 02WordPress extension and stub checks
- 03Baseline and ignore review
- 04Analysis scope assessment
- 05CI workflow checks
Use cases
- 01Reviewing PHPStan configuration files
- 02Planning static analysis adoption
- 03Auditing baselines and ignored errors
- 04Comparing local and CI analysis commands
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ jorgerosal/ wordpress-skills --skill wp-phpstan-reviewAfter installing, type/wp-phpstan-reviewin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/baseline-and-ci.mdconfig-and-bootstrap.mdsample-phpstan.neon.distwordpress-stubs-guide.mdDetails
From the project READMEWordPress PHPStan Review Skill
Overview
Systematic review guidance for PHPStan in WordPress projects. Core principle: static analysis should be strict enough to catch real bugs without becoming noise, and WordPress-specific extensions or stubs should be wired in intentionally. Review covers config files, includes, baselines, CI integration, analysis paths, bootstrap files, WordPress stubs, and gradual adoption strategy.
When to Use
Use when:
- Reviewing
phpstan.neon,phpstan.neon.dist, or CI config - Planning PHPStan adoption in a WordPress plugin or theme
- Auditing baseline usage or ignored errors
- Reviewing
szepeviktor/phpstan-wordpresssetup - Checking analysis scope, bootstrap files, or stub configuration
Don't use for:
- Runtime performance review
- PHPUnit or browser test strategy without static analysis focus
- General PHP refactors unrelated to analysis setup
Code Review Workflow
-
Identify the analysis entrypoints
phpstan.neon/phpstan.neon.dist- Composer
require-dev - CI workflows and scripts
- bootstrap or stub files
-
Check base configuration first
- Config file naming and includes
- Level and analysed paths
- Exclusions and bootstrap files
- Whether WordPress-specific extensions/stubs are actually loaded
-
Review baseline and ignore strategy
- Baseline used to phase in analysis, not bury new issues forever
- Ignored errors are intentional and reviewable
- New code is still held to a higher bar
-
Review CI ergonomics
- Deterministic command
- Correct config path
- Reasonable failure behavior
- No accidental drift between local and CI config
-
Classify findings
- CRITICAL: PHPStan appears configured but is not really analysing project code, WordPress extension missing, baseline hiding everything indefinitely
- WARNING: overly broad exclusions, stale baseline workflow, config split is confusing, analysis paths too narrow
- INFO: could raise level, document bootstrap behavior, or tighten ignores
File-Type Specific Checks
PHPStan Config
- CRITICAL: Config analyses no meaningful project paths
- WARNING:
ignoreErrorsor excludes are too broad - WARNING: WordPress extension installed but not included when extension installer is not present
- INFO: Could split local overrides into
phpstan.neonon top of a committed.distfile
Baseline Files
- WARNING: Baseline regenerated casually instead of fixed deliberately
- WARNING: Baseline used when analysis still appears underconfigured
- INFO: Could document when to refresh versus when to fix findings
CI and Composer
- WARNING: CI command differs materially from the documented local command
- WARNING:
require-devincludes stubs/extension but config does not use them correctly - INFO: Could add clearer scripts or output formatting
Search Patterns for Quick Detection (PST-21)
Use these rg commands to find PHPStan setup quickly.
Config and CI Discovery
rg -n "phpstan|phpstan\\.neon|phpstan\\.neon\\.dist|phpstan-baseline" . -g '*.{neon,php,json,md,yml,yaml}'
rg -n "vendor/bin/phpstan|composer .*phpstan|phpstan analyse" . -g '*.{json,md,yml,yaml,sh}'
WordPress-Specific Setup
rg -n "szepeviktor/phpstan-wordpress|php-stubs/wordpress-stubs|extension\\.neon" . -g '*.{json,neon,md}'
rg -n "bootstrapFiles|scanFiles|scanDirectories|paths|ignoreErrors|includes:" . -g '*.neon*'
Reference Files
references/config-and-bootstrap.md- Config structure, includes, analysed paths, bootstrap files, and WordPress extension wiringreferences/baseline-and-ci.md- Baseline strategy, CI integration, and rollout heuristicsreferences/wordpress-stubs-guide.md-phpstan-wordpress, WordPress stubs, and common WordPress static-analysis tradeoffsreferences/sample-phpstan.neon.dist- Sample shared config file for a WordPress plugin or theme
Output Format (PST-23)
For each finding include:
- Severity:
CRITICAL,WARNING, orINFO - File and line number
- Static-analysis issue summary
- Why it matters for WordPress PHPStan coverage or signal quality
- Recommended fix
If no issues are found, say so clearly and mention any residual risk such as baseline growth, narrow analysis scope, or undocumented local overrides.