Description
wp-phpstan is an agent skill for setting up and running PHPStan static analysis in WordPress plugins and themes. It handles the phpstan.neon configuration with the right paths and exclusions, baseline management so that legacy errors can be suppressed while new code is held to the standard, WordPress-specific type annotations, and stubs for third-party plugins. The page explains the reason: WordPress uses many non-standard patterns, such as hooks, REST requests and direct database queries, so a generic PHPStan configuration tends to produce hundreds of false positives. The skill adds the WordPress-specific typing needed to get useful results. Listed uses include setting up phpstan.neon for a plugin, generating a baseline before enforcing PHPStan on new code, typing WP_REST_Request parameters to fix unknown property errors in REST endpoints, adding PHPDoc shapes for WP_Query results so iterable type complaints go away, and configuring WooCommerce or Advanced Custom Fields stubs when PHPStan cannot resolve third-party code. It suits plugin developers who want static analysis in their build or CI. You install it with the skills command from the WordPress/agent-skills repository, and the source is public on GitHub.…
Highlights
- phpstan.neon setup with paths and exclusions
- Baseline generation for legacy code
- WordPress-specific type annotations
- WP_REST_Request and WP_Query typing
- WooCommerce and ACF stubs
Ratings & Reviews
No ratings yet
Be the first to rate WordPress/wp-phpstan.
People also visit

wp-phpstan
Configuring, running, or fixing PHPStan static analysis in WordPress projects
WordPress/wp-phpstan FAQ
What does this skill do?
It configures and runs PHPStan on WordPress code, with baselines and WordPress-aware typing.
How do I install it?
Run npx skills add https://github.com/WordPress/agent-skills --skill wp-phpstan, or paste the repository link and ask your coding assistant to install it.
Who is it for?
WordPress plugin and theme developers who want static analysis in their workflow.
Why is a WordPress-specific setup needed?
The page says hooks, REST requests and direct database queries cause many false positives in a generic PHPStan configuration.
Is it free?
The skill is in a public repository on GitHub and the page shows no price, so it is open source.
What are the best WordPress/wp-phpstan alternatives?
Popular alternatives to WordPress/wp-phpstan include wp-phpstan, wp-guard and wp-plugin-development. See all WordPress/wp-phpstan alternatives







