wp-phpstan-review
WordPress PHPStan review and setup guidance. Use when reviewing `phpstan.neon`, WordPress static-analysis setup, baselines, PHPStan levels, CI jobs, WordPress stubs, `szepeviktor/phpstan-wordpress`, or when user mentions "PHPStan", "static analysis", "phpstan.neon", "baseline", "WordPress stubs", or "CI type checks". Helps review WordPress-specific PHPStan configuration, baseline strategy, extension wiring, and practical rollout patterns for plugins, themes, and larger WordPress codebases.
How do I install this agent skill?
npx skills add https://github.com/jorgerosal/wordpress-skills --skill wp-phpstan-reviewIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides systematic guidance and reference material for auditing PHPStan configurations in WordPress projects. It identifies relevant files, recommends strict analysis levels, and provides search patterns for detecting common static-analysis issues without introducing any malicious commands or unsafe behaviors.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
WordPress PHPStan Review Skill
Overview
Systematic review guidance for PHPStan in WordPress projects. Core principle: static analysis should be strict enough to catch real bugs without becoming noise, and WordPress-specific extensions or stubs should be wired in intentionally. Review covers config files, includes, baselines, CI integration, analysis paths, bootstrap files, WordPress stubs, and gradual adoption strategy.
When to Use
Use when:
- Reviewing
phpstan.neon,phpstan.neon.dist, or CI config - Planning PHPStan adoption in a WordPress plugin or theme
- Auditing baseline usage or ignored errors
- Reviewing
szepeviktor/phpstan-wordpresssetup - Checking analysis scope, bootstrap files, or stub configuration
Don't use for:
- Runtime performance review
- PHPUnit or browser test strategy without static analysis focus
- General PHP refactors unrelated to analysis setup
Code Review Workflow
-
Identify the analysis entrypoints
phpstan.neon/phpstan.neon.dist- Composer
require-dev - CI workflows and scripts
- bootstrap or stub files
-
Check base configuration first
- Config file naming and includes
- Level and analysed paths
- Exclusions and bootstrap files
- Whether WordPress-specific extensions/stubs are actually loaded
-
Review baseline and ignore strategy
- Baseline used to phase in analysis, not bury new issues forever
- Ignored errors are intentional and reviewable
- New code is still held to a higher bar
-
Review CI ergonomics
- Deterministic command
- Correct config path
- Reasonable failure behavior
- No accidental drift between local and CI config
-
Classify findings
- CRITICAL: PHPStan appears configured but is not really analysing project code, WordPress extension missing, baseline hiding everything indefinitely
- WARNING: overly broad exclusions, stale baseline workflow, config split is confusing, analysis paths too narrow
- INFO: could raise level, document bootstrap behavior, or tighten ignores
File-Type Specific Checks
PHPStan Config
- CRITICAL: Config analyses no meaningful project paths
- WARNING:
ignoreErrorsor excludes are too broad - WARNING: WordPress extension installed but not included when extension installer is not present
- INFO: Could split local overrides into
phpstan.neonon top of a committed.distfile
Baseline Files
- WARNING: Baseline regenerated casually instead of fixed deliberately
- WARNING: Baseline used when analysis still appears underconfigured
- INFO: Could document when to refresh versus when to fix findings
CI and Composer
- WARNING: CI command differs materially from the documented local command
- WARNING:
require-devincludes stubs/extension but config does not use them correctly - INFO: Could add clearer scripts or output formatting
Search Patterns for Quick Detection (PST-21)
Use these rg commands to find PHPStan setup quickly.
Config and CI Discovery
rg -n "phpstan|phpstan\\.neon|phpstan\\.neon\\.dist|phpstan-baseline" . -g '*.{neon,php,json,md,yml,yaml}'
rg -n "vendor/bin/phpstan|composer .*phpstan|phpstan analyse" . -g '*.{json,md,yml,yaml,sh}'
WordPress-Specific Setup
rg -n "szepeviktor/phpstan-wordpress|php-stubs/wordpress-stubs|extension\\.neon" . -g '*.{json,neon,md}'
rg -n "bootstrapFiles|scanFiles|scanDirectories|paths|ignoreErrors|includes:" . -g '*.neon*'
Reference Files
references/config-and-bootstrap.md- Config structure, includes, analysed paths, bootstrap files, and WordPress extension wiringreferences/baseline-and-ci.md- Baseline strategy, CI integration, and rollout heuristicsreferences/wordpress-stubs-guide.md-phpstan-wordpress, WordPress stubs, and common WordPress static-analysis tradeoffsreferences/sample-phpstan.neon.dist- Sample shared config file for a WordPress plugin or theme
Output Format (PST-23)
For each finding include:
- Severity:
CRITICAL,WARNING, orINFO - File and line number
- Static-analysis issue summary
- Why it matters for WordPress PHPStan coverage or signal quality
- Recommended fix
If no issues are found, say so clearly and mention any residual risk such as baseline growth, narrow analysis scope, or undocumented local overrides.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/jorgerosal/wordpress-skills/wp-phpstan-review">View wp-phpstan-review on skillZs</a>