
Wp Phpstan
Configures and manages PHPStan static analysis for WordPress plugins and themes, handling the quirks that make WordPress codebases tricky to analyze. It sets up phpstan.neon files with WordPress core stubs, fixes type errors using WP-specific annotations for REST requests and hook callbacks, and deals with third-party plugin classes that aren't present during analysis. The baseline management approach is sensible: treat it as a migration tool for legacy code, not a place to hide new errors. Most useful when you're adding PHPStan to an existing WordPress project or trying to reduce a massive error count without resorting to ignore-everything patterns.
- skills.sh installs
- 4.9K
- GitHub stars
- 2.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add wordpress/agent-skills --skill wp-phpstan --agent claude-codeInstalls into .claude/skills of the current project.
Files
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-triageoutput (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
0) Discover PHPStan entrypoints (deterministic)
- Inspect PHPStan setup (config, baseline, scripts):
node skills/wp-phpstan/scripts/phpstan_inspect.mjs
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.
Sponsors
Details
- Repository
- github.com/wordpress/agent-skills
- Categories
- AI & Agent Building, PHP & Laravel, Databases
- First seen
- Apr 16, 2026
More from wordpress/agent-skills
All 17- Wp Abilities Api4.6K
- Wp Interactivity Api4.5K
- Wpds4.3K
- Blueprint4K
- Wp Plugin Directory Guidelines3.9K
- Wp Abilities Audit2.9K
- Wp Abilities Verify2.8K
- Wp Plugin Development8.6K
- Wp Performance6.7K
- Wp Rest Api6.3K
- Wp Block Themes6.3K
- Wordpress Router6K
- Wp Wpcli And Ops6K
- Wp Project Triage5.9K
- Wp Block Development5.9K
- Wp Playground5.1K