Use when configuring, running, or fixing PHPStan static analysis in WordPress projects (plugins/themes/sites): phpstan.neon setup, baselines, WordPress-specific typing, and handling third-party plugin classes.
Start a fresh conversation. Replace the highlighted placeholders.
Use wp-phpstan to configure or improve PHPStan for this WordPress project using [wp-project-triage output]; confirm before adding Composer stubs or changing [baseline permission], then fix actionable first-party typing issues without baselining new errors.
Required inputs
[wp-project-triage output]
[baseline permission]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: wp-phpstandescription: "Use when configuring, running, or fixing PHPStan static analysis in WordPress projects (plugins/themes/sites): phpstan.neon setup, baselines, WordPress-specific typing, and handling third-party plugin classes."compatibility: "Targets WordPress 7.0+ (PHP 7.4.0+). Requires Composer-based PHPStan."
WP PHPStan
When to use
Use this skill when working on PHPStan in a WordPress codebase, for example:
setting up or updating phpstan.neon / phpstan.neon.dist
Prefer the repo’s existing composer script (e.g. composer run phpstan) when present.
1) Ensure WordPress core stubs are loaded
szepeviktor/phpstan-wordpress or php-stubs/wordpress-stubs are effectively required for most WordPress plugin/theme repos. Without it, expect a high volume of errors about unknown WordPress core functions.
Confirm the package is installed (see composer.dependencies in the inspect report).
Ensure the PHPStan config references the stubs (see references/third-party-classes.md).
2) Ensure a sane phpstan.neon for WordPress projects
Keep paths focused on first-party code (plugin/theme directories).