wp-phpstan

Installation
Summary

PHPStan configuration, error fixing, and baseline management for WordPress projects.

  • Handles WordPress-specific typing patterns: REST endpoints with WP_REST_Request, hook callbacks with accurate @param types, database results, and Action Scheduler job arguments
  • Manages third-party plugin/theme class resolution via stubs (php-stubs/woocommerce-stubs, php-stubs/acf-pro-stubs) and targeted ignore patterns
  • Provides deterministic PHPStan discovery, configuration validation, baseline generation, and error reduction workflows
  • Requires szepeviktor/phpstan-wordpress or php-stubs/wordpress-stubs for WordPress core function typing; targets WordPress 6.9+ with PHP 7.2.24+
SKILL.md

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
  • generating or updating phpstan-baseline.neon
  • fixing PHPStan errors via WordPress-friendly PHPDoc (REST requests, hooks, query results)
  • handling third-party plugin/theme classes safely (stubs/autoload/targeted ignores)

Inputs required

  • wp-project-triage output (run first if you haven't)
  • Whether adding/updating Composer dev dependencies is allowed (stubs).
  • Whether changing the baseline is allowed for this task.

Procedure

Related skills

More from wordpress/agent-skills

Installs
1.0K
GitHub Stars
1.5K
First Seen
Feb 1, 2026