Wp Phpstan
Wp Phpstan analyzes WordPress code for potential errors and style issues, boosting code quality and preventing bugs during development.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add automattic-wp-phpstan npx -- -y @trustedskills/automattic-wp-phpstan
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"automattic-wp-phpstan": {
"command": "npx",
"args": [
"-y",
"@trustedskills/automattic-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 codebases for potential errors and style issues using PHPStan, a static analysis tool. It helps developers improve code quality, prevent bugs, and maintain a consistent coding standard within WordPress projects. The skill assists with configuring PHPStan specifically for WordPress development, including handling core functions and third-party plugin/theme integrations.
When to use it
- Setting up or updating the
phpstan.neonorphpstan.neon.distconfiguration files. - Generating or updating the
phpstan-baseline.neonfile. - Fixing PHPStan errors by improving PHPDoc comments, especially for REST requests, hooks, and database query results.
- Safely handling code from third-party plugins and themes using stubs or targeted ignores.
- Managing baseline files to address legacy code issues over time.
Key capabilities
- Discovers PHPStan entrypoints automatically.
- Ensures WordPress core stubs (like
szepeviktor/phpstan-wordpressorphp-stubs/wordpress-stubs) are loaded for accurate analysis. - Helps configure a suitable
phpstan.neonfile, focusing on first-party code and excluding unnecessary files like vendor directories. - Provides guidance on correcting types in WordPress-specific code patterns (REST endpoints, hook callbacks, database results).
- Offers strategies for handling third-party plugin/theme classes through stubs or targeted error ignores.
Example prompts
- "Analyze this WordPress plugin's code with PHPStan and update the
phpstan.neonfile." - "Generate a baseline file for my WordPress theme to address existing errors."
- "Help me fix the PHPStan errors related to REST API request parameters in this function."
Tips & gotchas
- The skill requires a "wp-project-triage" output as initial input.
- Ensure WordPress core stubs are installed and properly configured within the
phpstan.neonfile for accurate results; otherwise, expect numerous errors related to unknown functions. - Prioritize correcting code types over simply ignoring PHPStan errors whenever possible.
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.