LaunchKit · 2026

Setup & Installation

npx skills add https://github.com/WordPress/agent-skills --skill wp-phpstan
or paste the link and ask your coding assistant to install it
https://github.com/WordPress/agent-skills/tree/trunk/skills/wp-phpstan
View on GitHub

What This Skill Does

Configures and runs PHPStan static analysis in WordPress codebases. Handles phpstan.neon setup, baseline management, WordPress-specific type annotations, and third-party plugin stub integration for plugins and themes.

WordPress adds enough non-standard patterns (hooks, REST requests, direct database queries) that generic PHPStan configs produce hundreds of false positives, and this skill handles the WordPress-specific typing and stub setup needed to get meaningful results.

When to use it

  • Setting up phpstan.neon for a WordPress plugin with correct paths and exclusions
  • Generating a baseline to suppress legacy errors 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 to resolve iterable type complaints
  • Configuring WooCommerce or ACF stubs when PHPStan cannot resolve third-party classes