
Wp Phpstan
wordpress/agent-skillsOfficial
Setup, baseline, and typing guidance for running PHPStan static analysis on WordPress plugins, themes, and sites.
- skills.sh installs
- 5.1K
- GitHub stars
- 2.4K
- last updated
- Aug 21, 2026
What it does
- Covers PHPStan config setup, baseline generation and reduction, and fixing errors with WordPress-specific PHPDoc types
- Requires WordPress core stubs (
szepeviktor/phpstan-wordpressorphp-stubs/wordpress-stubs) and points to references for third-party plugin classes - Enforces narrow
ignoreErrorspatterns, and treats baselines as a migration tool that never absorbs newly introduced errors - Designed for WordPress 7.0+ projects on PHP 7.4.0+ using Composer-based PHPStan, run first after
wp-project-triage
Install
$ npx -y skills add wordpress/agent-skills --skill wp-phpstan -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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.
Details
- Repository
- github.com/wordpress/agent-skills
- Categories
- PHP & Laravel, Code Review & Quality
- First seen
- Apr 16, 2026
More from wordpress/agent-skills
All 17- Wp Abilities Api4.8K
- Wp Interactivity Api4.6K
- Wpds4.5K
- Blueprint4.1K
- Wp Plugin Directory Guidelines4.1K
- Wp Abilities Audit3.1K
- Wp Abilities Verify3K
- Wp Plugin Development9K
- Wp Performance7K
- Wp Rest Api6.6K
- Wp Block Themes6.5K
- Wordpress Router6.3K
- Wp Wpcli And Ops6.2K
- Wp Project Triage6.2K
- Wp Block Development6.1K
- Wp Playground5.3K
Similar to Wp Phpstan
More PHP & Laravel
wp-plugin-developmentwordpress/agent-skills9K installsA structured guide for WordPress plugin work covering architecture, lifecycle, settings, security, and data handling.
wp-project-triagewordpress/agent-skills6.2K installsDeterministic WordPress repository inspector that outputs a JSON report of project type, tooling, and version hints.
php-modernizationnetresearch/php-modernization-skill462 installsPHP modernization skill covering PHP 8.1-8.5 features, PSR compliance, and static analysis tooling.
wordpress-projeffallan/claude-skills10.3K installsExpert WordPress development skill for themes, plugins, Gutenberg blocks, WooCommerce, and hardened, cached sites.
php-best-practicesasyrafhussin/agent-skills3.9K installsPHP 8.x modern patterns, PSR standards, and SOLID rules for reviewing and auditing PHP code.
wordpress-performance-best-practicesbartekmis/wordpress-performance-best-practices518 installsWordPress performance guidelines covering 34 prioritized rules for writing, reviewing, and refactoring plugin and theme PHP code.