skills/wp-phpstan/SKILL.md
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.
npx skillsauth add WordPress/agent-skills wp-phpstanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when working on PHPStan in a WordPress codebase, for example:
phpstan.neon / phpstan.neon.distphpstan-baseline.neonwp-project-triage output (run first if you haven't)node skills/wp-phpstan/scripts/phpstan_inspect.mjsPrefer the repo’s existing composer script (e.g. composer run phpstan) when present.
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.
composer.dependencies in the inspect report).references/third-party-classes.md).phpstan.neon for WordPress projectspaths focused on first-party code (plugin/theme directories).vendor/, node_modules/, build artifacts, tests unless explicitly analyzed).ignoreErrors entries narrow and documented.See:
references/configuration.mdPrefer correcting types over ignoring errors. Common WP patterns that need help:
WP_REST_Request<...>@param types for callback args$args array shapes for job callbacksSee:
references/wordpress-annotations.mdWhen integrating with plugins/themes not present in the analysis environment:
php-stubs/woocommerce-stubs, php-stubs/acf-pro-stubs).ignoreErrors patterns for the specific vendor prefix.See:
references/third-party-classes.mdSee:
references/configuration.mdcomposer run ... or vendor/bin/phpstan analyse).ignoreErrors to ensure patterns are not masking unrelated issues.paths, add excludePaths, start at a lower level, then ratchet uptools
Verify a WordPress plugin's Abilities API registrations: enumerate abilities, check that callback behavior matches each annotation's claim (the adversarial readonly-but-writes detection), validate permissions and schemas, and validate audit documents produced by wp-abilities-audit.
tools
Audit a WordPress plugin's REST surface and produce a standardized audit document proposing Abilities API registrations. Produces a markdown doc with a YAML schema and prose sections that humans and agents can both consume when planning a registration rollout. Works on any WP plugin.
tools
Use when working with the WordPress Abilities API (wp_register_ability, wp_register_ability_category, /wp-json/wp-abilities/v1/*, @wordpress/abilities) including defining abilities, categories, meta, REST exposure, and permissions checks for clients.
tools
Use when reviewing WordPress plugins for GPL compliance, checking license headers or compatibility, evaluating upsell/freemium/trialware patterns, validating plugin naming or trademark rules, checking plugin slugs, understanding why a plugin was rejected from WordPress.org, or answering any question about the 18 WordPress.org Plugin Directory guidelines — even if the user doesn't mention 'guidelines' explicitly.