WP PHPStan

94TrustedShips scripts

Static analysis configuration and error resolution for WordPress projects.

What it does

Wp Phpstan transforms how your assistant interacts with PHPStan in WordPress environments. It allows the assistant to audit your configuration, manage project baselines, and suggest precise PHPDoc annotations that align with WordPress patterns like REST requests, hooks, and database queries.

This skill provides the assistant with specific guidance on integrating WordPress-specific stubs and handling dependencies from third-party plugins. By interpreting the project structure, it helps maintain high code quality standards while minimizing noise in analysis results.

When it earns its place

Reach for it when…

Apply this when you need to introduce static analysis to a legacy plugin, resolve persistent class-not-found errors from external dependencies, or migrate existing code to stricter PHPStan analysis levels without drowning in hundreds of unaddressed legacy warnings.

Look elsewhere when…

Avoid this for non-WordPress PHP projects, as the logic is deeply coupled with WordPress core functions and common plugin stubs. It is also unnecessary for simple scripts that do not require complex dependency resolution or formal typing.

What to say to use it

You never invoke a skill directly — the assistant picks it up when your request matches what it covers. These are the kinds of things that do that.

  • configure phpstan for my wordpress plugin
  • how do i fix these wordpress hook type errors in phpstan
  • create a phpstan baseline for this legacy theme
  • add stubs for these missing plugin classes in my analysis

Install it

Install for all your projects

Copy the skill directory into your personal skills folder. Claude picks it up on its own the next time your request matches what it does — there is nothing to enable.

bash
git clone --depth 1 --branch trunk https://github.com/WordPress/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/wp-phpstan ~/.claude/skills/wp-phpstan

Install for one project only

Put it in the project's own skills folder instead, so it can be committed and shared with everyone working on that repository.

bash
cp -r /tmp/agent-skills/skills/wp-phpstan .claude/skills/wp-phpstan

If a skill of the same name exists in both places, the personal one wins.

Installing on Claude.ai or through the API instead? The full guide covers every surface.

Pair it with an MCP server