wp-phpstan

Configure, run, and fix PHPStan static analysis in WordPress projects.

2|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/joseconti/mcp-skills --skill wp-phpstan-joseconti
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wp-phpstan
Source: https://github.com/joseconti/mcp-skills/tree/main/wp-phpstan
Command: npx skills add https://github.com/joseconti/mcp-skills --skill wp-phpstan-joseconti

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

WordPress projects often suffer from inconsistent or missing static analysis setup. This skill helps configure, run, and fix PHPStan in WordPress environments by guiding through WP-specific typing, baseline creation, and stubs usage.

Core Features & Use Cases

  • Setup and maintain phpstan.neon and phpstan.neon.dist for WordPress plugins/themes/sites.
  • Generate and update phpstan-baseline.neon to track and reduce regressions.
  • Improve type safety with WordPress-specific PHPDoc annotations and stubs for core and third-party plugins.
  • Safely handle third-party plugin/theme classes with stubs/autoload/targeted ignores.

Quick Start

Run the PHPStan inspection script to discover entrypoints and execute the project’s PHPStan command to analyze WordPress code.

Frequently Asked Questions about wp-phpstan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure PHPStan static analysis for a WordPress project?

To configure PHPStan static analysis for WordPress, you set up a phpstan.neon configuration file and ensure WordPress stubs are loaded via Composer so core functions and plugin APIs become resolvable.

Why does PHPStan report undefined functions when scanning WordPress plugins?

PHPStan reports undefined functions in WordPress plugins because it lacks core API definitions. Installing WordPress stubs provides the necessary PHPDoc annotations and type definitions to resolve these functions.

What's the best way to handle third-party plugin classes in PHPStan?

The best way to handle third-party plugin classes in PHPStan is by generating stubs or using targeted ignores in your phpstan.neon configuration to safely manage external code type safety.

How do I generate a PHPStan baseline to track existing errors in WordPress?

Generate a PHPStan baseline by running the static analysis command with the baseline flag, which creates a phpstan-baseline.neon file to track existing errors and prevent new regressions.

Do I need Composer to run PHPStan on WordPress code?

Yes, you need Composer to run PHPStan on WordPress code because it manages the PHPStan installation and provides the WordPress stubs required to make core functions and hooks resolvable.

Can I use PHPStan to type check WordPress REST API and hooks?

Yes, PHPStan can type check WordPress REST API and hooks by applying WordPress-specific PHPDoc annotations and utilizing stubs to ensure proper type safety for these core features.