# Wp phpstan

> Wp phpstan is an open-source agent skill for developer tools. Guides PHPStan setup, level raising and baseline fixes in WordPress Acorn projects. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/hekivo/kivo-wise/tree/main/plugins/kivo-wise/skills/wp-phpstan
- **Repository:** https://github.com/hekivo/kivo-wise
- **GitHub stars:** 14
- **License:** MIT
- **Skill name:** wp-phpstan
- **Collection:** https://github.com/hekivo/kivo-wise
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill helps an agent configure and run PHPStan static analysis in WordPress projects built on Acorn, such as Sage themes, Acorn mu-plugins and Radicle apps. It covers phpstan.neon, the analysis paths limited to application code, WordPress stubs from szepeviktor/phpstan-wordpress and the extension installer, and how to raise the level one step at a time with a baseline that only shrinks.

The skill points to a longer upstream procedure bundled in the kivo-wise plugin and adds Roots-specific guidance. It includes an inspection script that reads the config, baseline and stub status without running PHPStan, then walks through installing dev dependencies, choosing paths, deciding whether Larastan can boot under Acorn, and running analysis through the project's Composer runner. Fixes are ordered by cause, covering stubs, PHPDoc, real bugs and targeted ignores, with a CI step that fails when the baseline grows.

The agent is expected to know Composer and PHP tooling, and to run commands in the project container. It also lists common failures such as missing WordPress functions, out-of-memory errors and differences between local and CI PHP versions.

## When your agent uses it

> Use when configuring, running or fixing PHPStan in a WordPress project that uses Acorn - phpstan.neon, baseline, szepeviktor/phpstan-wordpress stubs, larastan, level raising, "Cannot access property on mixed", get_field() types, paths for app/. For Pint or Mago formatting use testing-wp; for runtime errors use roots-debugging.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/hekivo/kivo-wise/tree/HEAD/plugins/kivo-wise/skills/wp-phpstan)
- [License: MIT](https://github.com/hekivo/kivo-wise/tree/HEAD/plugins/kivo-wise/skills/wp-phpstan)

## Features

- **PHPStan configuration setup:** Creates or fixes phpstan.neon with paths limited to the application code for each Acorn project profile.
- **WordPress stubs installation:** Installs the WordPress stubs and extension installer so core functions and classes are recognised.
- **Level raising and baselines:** Raises the analysis level step by step and generates baselines only for existing errors.
- **Larastan decision guidance:** Explains when Larastan helps with facades and models under Acorn and when plain PHPDoc is enough.
- **Error fixing by cause:** Orders fixes from missing stubs to PHPDoc, real bugs and narrow ignores, including get_field() typing.
- **CI integration checks:** Describes running PHPStan in CI with GitHub annotations and failing when the baseline grows.

## Good for

- Set up PHPStan in an Acorn-based Sage theme
- Fix 'Cannot access property on mixed' errors from get_field()
- Raise the PHPStan level by one and regenerate the baseline
- Stop PHPStan from scanning vendor and wp core folders
- Wire PHPStan into a CI pipeline for a WordPress project

## Install

### Claude Code

This skill ships in the `kivo-wise` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add hekivo/kivo-wise
/plugin install kivo-wise@kivo-wise
```

Or copy only this skill to `~/.claude/skills/wp-phpstan`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/hekivo/kivo-wise.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/wp-phpstan &&
cp -R "$tmp/plugins/kivo-wise/skills/wp-phpstan" ~/.claude/skills/wp-phpstan &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/wp-phpstan` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/wp-phpstan` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/hekivo/kivo-wise.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/wp-phpstan &&
cp -R "$tmp/plugins/kivo-wise/skills/wp-phpstan" ~/.agents/skills/wp-phpstan &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/wp-phpstan` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/wp-phpstan` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/hekivo/kivo-wise.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/wp-phpstan &&
cp -R "$tmp/plugins/kivo-wise/skills/wp-phpstan" ~/.cursor/skills/wp-phpstan &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/wp-phpstan` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/hekivo/kivo-wise.git --path plugins/kivo-wise/skills/wp-phpstan
```

Or copy the folder to `~/.gemini/skills/wp-phpstan` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/wp-phpstan`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/hekivo/kivo-wise.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/wp-phpstan &&
cp -R "$tmp/plugins/kivo-wise/skills/wp-phpstan" ~/.copilot/skills/wp-phpstan &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/wp-phpstan` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/hekivo/kivo-wise.git
```

Then copy `kivo-wise/plugins/kivo-wise/skills/wp-phpstan` into your agent's skills folder as `wp-phpstan`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Wp phpstan need to run?

It needs the kivo-wise plugin's third-party procedure files and a project using Acorn with a Composer runner. Commands are run through the project's runner, such as Lando or Composer.

### Does Wp phpstan install packages automatically?

No, it gives the agent a Composer command to install phpstan, szepeviktor/phpstan-wordpress and the extension installer as dev dependencies, which the agent runs in the project.

### Which tool handles Pint or runtime errors?

The skill says formatting questions go to testing-wp and runtime errors go to roots-debugging.

### How do I install Wp phpstan in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/wp-phpstan to use it in all your projects, or to .claude/skills/wp-phpstan in one project. Or install the kivo-wise plugin, which includes it: /plugin marketplace add hekivo/kivo-wise, then /plugin install kivo-wise@kivo-wise.

### Does Wp phpstan run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Wp phpstan?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Wp phpstan?

The closest alternatives to Wp phpstan are Acorn stack, Testing wp, Acorn background, Acorn scaffolding and Roots debugging.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Acorn stack](https://ai-powered.com/skills/acorn-stack): Acorn stack is an open-source agent skill for developer tools.
- [Testing wp](https://ai-powered.com/skills/testing-wp): Testing wp is an open-source agent skill for developer tools.
- [Acorn background](https://ai-powered.com/skills/acorn-background): Acorn background is an open-source agent skill for developer tools.
- [Acorn scaffolding](https://ai-powered.com/skills/acorn-scaffolding): Acorn scaffolding is an open-source agent skill for developer tools.
- [Roots debugging](https://ai-powered.com/skills/roots-debugging): Roots debugging is an open-source agent skill for developer tools.
- [Wp security escaping](https://ai-powered.com/skills/wp-security-escaping): Wp security escaping is an open-source agent skill for security.
- [Wp hooks lifecycle](https://ai-powered.com/skills/wp-hooks-lifecycle): Wp hooks lifecycle is an open-source agent skill for developer tools.
- [Acorn routes API](https://ai-powered.com/skills/acorn-routes-api): Acorn routes API is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/wp-phpstan
