Wp Phpstan
WP PHPStan analyzes WordPress code for potential errors and style issues, boosting code quality and preventing bugs.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add wp-phpstan npx -- -y @trustedskills/wp-phpstan
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"wp-phpstan": {
"command": "npx",
"args": [
"-y",
"@trustedskills/wp-phpstan"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
The WP PHPStan skill analyzes WordPress code for potential errors and style issues using PHPStan, a static analysis tool. It helps improve code quality by identifying bugs and inconsistencies within WordPress projects, particularly plugins and themes. The skill guides users through configuring and running PHPStan effectively in a WordPress environment, including handling WordPress-specific coding patterns and third-party dependencies.
When to use it
This skill is useful when:
- Setting up or updating the
phpstan.neonorphpstan.neon.distconfiguration files. - Generating or updating the
phpstan-baseline.neonfile. - Fixing PHPStan errors by improving PHPDoc comments to reflect WordPress patterns (e.g., REST requests, hooks, query results).
- Safely handling classes from third-party plugins and themes using stubs or targeted ignores.
- Managing the baseline file as a tool for migrating legacy code towards better quality.
Key capabilities
- Discovers PHPStan entrypoints automatically.
- Inspects existing PHPStan configurations (config, baseline, scripts).
- Ensures WordPress core stubs are loaded (
szepeviktor/phpstan-wordpressorphp-stubs/wordpress-stubs). - Guides users on creating a suitable
phpstan.neonconfiguration for WordPress projects. - Provides guidance on fixing errors using WordPress-specific typing and PHPDoc annotations.
- Offers strategies for handling third-party plugin/theme classes when stubs are unavailable.
- Manages baseline files to track and reduce legacy code issues.
Example prompts
- "Analyze my WordPress plugin's code with PHPStan."
- "Generate a baseline file for my WordPress theme."
- "Help me fix the PHPStan errors related to REST endpoints in my plugin."
Tips & gotchas
- The skill requires a
wp-project-triageoutput as input. Run this first if you haven't already. - Ensure that WordPress core stubs are loaded, otherwise expect numerous errors about unknown functions.
- Prioritize correcting types and improving PHPDoc over simply ignoring PHPStan errors.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🏢 Official
Published by the company or team that built the technology.