You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c0c5f61
Browse filesBrowse the repository at this point in the historyBrowse files
[wp-env][wordpress-router]: correct wp-env against @wordpress/env 11.16.0 and route to it
Upstream's wp-env skill (WordPress#38) follows the @wordpress/env README, which
lags the package code in several places. Checked against the 11.16.0
tarball (published 2026-09-23) and, where behavior mattered, run:
- `composer` is not a `wp-env run` container. The package removed it
(and `phpunit`), and validate-run-container.js throws on both. The
list is now mysql, wordpress, cli, phpmyadmin (only when enabled), plus
the tests-* containers.
- `wp-env run cli "wp rewrite structure /%postname%/"` fails. run()
hands argv to `docker compose exec` with no shell, so the quoted string
is looked up as one executable name ("executable file not found in
$PATH", reproduced with docker exec). The command is now unquoted, with
a short explanation.
- `wp-env run mysql mysql ...` fails: the database service is
mariadb:lts (12.3.3 today), which ships `mariadb` and no `mysql`.
- `npx wp-env` resolves the unscoped `wp-env` npm package when the local
install is missing (a third-party "Security PoC" package), and npm
assumes --yes in a non-interactive shell. Replaced with the README's
own `npm exec --no -- wp-env`.
- `cleanup` and `destroy` block on a confirmation prompt unless
`--force`; the skill now says to get the user's go-ahead and pass it.
- Override files merge `config`, `mappings`, and `lifecycleScripts`
(merge-configs.js), not only the first two.
- The invalid-source error is `Invalid or unrecognized source: "<value>"`,
and a relative path without a leading `.` is parsed as a GitHub repo.
- The tests environment still starts by default on 8889 but is
deprecated with a startup warning; the skill names the
`"testsEnvironment": false` opt-out and the `--config` replacement.
- `--auto-port` is ignored when CI is set.
Fork conventions: the 6.9 floor per docs/compatibility-policy.md (wp-env
covers no 7.0-only API), the license field, a wp-playground boundary in
the description, and "verified against @wordpress/env 11.16.0" in prose.
@wordpress/env is not a drift-registry upstream, so it carries no
`verified through:` marker.
Registration: docs/skill-set-v1.md lists 22 skills. The router sends
wp-env / .wp-env.json requests to wp-env (upstream still routes wp-env
to the planned wp-testing skill) and WordPress#105's WebMCP / Playground MCP
terms to wp-playground's website.md. wp-playground's escalation now
names the wp-env skill.
assertWpEnvPrecision pins the corrections and the fork-only router
entry. It fails on upstream's original SKILL.md, and each of its six
exclusions matches a line in that original.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: skills/wp-env/SKILL.md
+28-17Lines changed: 28 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,16 @@
1
1
---
2
2
name: wp-env
3
-
description: "Use when setting up, configuring, or troubleshooting local WordPress development environments with @wordpress/env (wp-env). Triggers on mentions of wp-env, local WordPress development, Docker-based WordPress, or requests to start/stop/configure a local WordPress instance."
description: "Use when setting up, configuring, or troubleshooting local WordPress development environments with @wordpress/env (wp-env). Triggers on mentions of wp-env, local WordPress development, Docker-based WordPress, or requests to start/stop/configure a local WordPress instance. For a quick, disposable local site without Docker, use wp-playground instead."
4
+
compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Requires Docker (default runtime) and Node.js 18.12+; verified against @wordpress/env 11.16.0."
5
+
license: GPL-2.0-or-later
5
6
---
6
7
7
8
# @wordpress/env (wp-env)
8
9
9
10
Zero-config, Docker-based local WordPress development environment for plugins, themes, and core.
10
11
12
+
Verified against `@wordpress/env` 11.16.0. When exact flags matter, check `wp-env --version` and `wp-env <command> --help`.
13
+
11
14
## When to use
12
15
13
16
- User asks to set up a local WordPress development environment
@@ -43,9 +46,11 @@ npm -g install @wordpress/env
43
46
44
47
# Or project-local
45
48
npm i @wordpress/env --save-dev
46
-
# Then use: npx wp-env start
49
+
# Then use: npm exec --no -- wp-env start
47
50
```
48
51
52
+
Run a project-local install with `npm exec --no -- wp-env` (or a `package.json` script), not `npx wp-env`. If the local install is missing, `npx wp-env` fetches the unscoped `wp-env` package from the registry, which is not `@wordpress/env`, and a non-interactive shell installs it without asking. `--no` makes npm fail instead.
53
+
49
54
### 2. Start the environment
50
55
51
56
```sh
@@ -61,7 +66,9 @@ Common start options:
61
66
-`wp-env start --update` -- pull latest sources and reconfigure
-`wp-env start --auto-port` -- find available ports when defaults are busy
69
+
-`wp-env start --auto-port` -- find available ports when defaults are busy (ignored when `CI` is set)
70
+
71
+
By default `start` also creates a separate tests environment (port 8889, `tests-*` containers) and prints a deprecation warning. Add `"testsEnvironment": false` to `.wp-env.json` to start only the development environment; for an isolated test site, run a second environment from its own config file with `wp-env start --config=<file>`.
65
72
66
73
### 3. Auto-detection (no config file)
67
74
@@ -112,11 +119,11 @@ Place at the project root. All fields are optional.
112
119
| ZIP URL |`"https://downloads.wordpress.org/plugin/akismet.zip"`|
113
120
| Git SSH |`"ssh://user@host/repo.git#ref"`|
114
121
115
-
**GOTCHA:** WordPress.org plugin/theme slugs (bare names like `"akismet"`) do NOT work. Use the full ZIP URL.
122
+
**GOTCHA:** WordPress.org plugin/theme slugs (bare names like `"akismet"`) do NOT work. Use the full ZIP URL. Relative local paths must start with `.` (`"."`, `"./path"`, `"../path"`): `"plugins/my-plugin"` is parsed as the GitHub repository `plugins/my-plugin`.
116
123
117
124
#### Local overrides with `.wp-env.override.json`
118
125
119
-
Create `.wp-env.override.json` next to `.wp-env.json` for personal settings (gitignored). Only `config`and `mappings` are **merged** -- all other fields (including `plugins` and `themes` arrays) **fully replace** the base.
126
+
Create `.wp-env.override.json` next to `.wp-env.json` for personal settings (gitignored). `config`, `mappings`, and `lifecycleScripts` are **merged** key by key -- all other fields (including `plugins` and `themes` arrays) **fully replace** the base.
120
127
121
128
### 5. Run commands in containers
122
129
@@ -125,7 +132,7 @@ Create `.wp-env.override.json` next to `.wp-env.json` for personal settings (git
125
132
wp-env run cli wp user list
126
133
wp-env run cli wp plugin list
127
134
wp-env run cli wp option update blogname "My Site"
128
-
wp-env run cli "wp rewrite structure /%postname%/"
135
+
wp-env run cli wp rewrite structure /%postname%/
129
136
130
137
# Run commands in a specific directory
131
138
wp-env run cli --env-cwd=wp-content/plugins/my-plugin composer install
@@ -137,10 +144,12 @@ wp-env run cli --env-cwd=wp-content/plugins/my-plugin vendor/bin/phpunit
137
144
wp-env run cli php -- --version
138
145
139
146
# MySQL access
140
-
wp-env run mysql mysql -- --user=root --password=password wordpress
147
+
wp-env run mysql mariadb -- --user=root --password=password wordpress
141
148
```
142
149
143
-
Available containers: `mysql`, `wordpress`, `cli`, `composer`, `phpmyadmin`.
150
+
`wp-env run` hands each argument straight to `docker compose exec` without a shell. Never wrap the whole command in one quoted string: `wp-env run cli "wp user list"` fails with `executable file not found in $PATH`. Quote only individual arguments that contain spaces. The database image is `mariadb:lts`, which ships a `mariadb` client but no `mysql` binary.
151
+
152
+
Available containers: `mysql`, `wordpress`, `cli`, and `phpmyadmin` (only when enabled), plus `tests-mysql`, `tests-wordpress`, and `tests-cli` while the tests environment is on. The `composer` and `phpunit` containers were removed; run those tools in `cli`.
wp-env destroy --force# Remove everything including images
157
166
```
158
167
168
+
`cleanup` and `destroy` delete the site's database and content. Without `--force` they wait for an interactive confirmation that a non-interactive agent shell cannot answer, so get the user's go-ahead first and then pass `--force`.
169
+
159
170
### 7. Xdebug setup
160
171
161
172
```sh
@@ -200,13 +211,13 @@ IDE listens on port **9003**. VS Code `launch.json` needs:
200
211
| "Cannot connect to Docker daemon" | Docker not running | Start Docker Desktop |
201
212
| "Port 8888 already in use" | Port conflict | Use `--auto-port` or set custom `port` in `.wp-env.json`|
202
213
| Plugin not appearing | Missing `Plugin Name:` header in main PHP file | Add standard plugin header comment |
203
-
|"Could not find a valid source"|Invalid source string in config | Use full ZIP URL for wp.org plugins, not bare slugs|
204
-
| Stale environment after source changes | Cached Docker volumes |`wp-env start --update` or `wp-env destroy && wp-env start`|
205
-
| White screen / PHP errors |Corrupted database |`wp-env reset all && wp-env start`|
206
-
| Override not taking effect | Wrong merge behavior |`plugins`/`themes` in override **replace** base arrays; only `config`/`mappings` merge |
207
-
| Tests environment not accessible | Wrong port| Test environment runs on port 8889 by default|
214
+
|`Invalid or unrecognized source: "<value>"`|Bare wp.org slug, or a relative path without a leading `.`| Use the full ZIP URL for wp.org plugins; prefix local paths with `./`|
215
+
| Stale environment after source changes | Cached Docker volumes |`wp-env start --update`; if that fails and the user accepts losing local data, `wp-env destroy --force` then `wp-env start`|
216
+
| White screen / PHP errors |PHP fatal in the code under development, or a corrupted database |Check `wp-env logs --no-watch` first; if the database is the cause, `wp-env reset all && wp-env start` (deletes all site content)|
217
+
| Override not taking effect | Wrong merge behavior |`plugins`/`themes` in override **replace** base arrays; only `config`/`mappings`/`lifecycleScripts` merge |
218
+
| Tests environment not accessible | Wrong port, or `"testsEnvironment": false`| It runs on port 8889 unless disabled; the separate tests environment is deprecated, so prefer a second config started with `--config`|
208
219
| Xdebug not connecting | IDE not listening or wrong port | Ensure IDE listens on port 9003 with correct `pathMappings`|
209
-
| npm global install permission error | Node installed to a system path | Use `nvm`, or install locally: `npm i -D @wordpress/env` and run via `npx wp-env`|
220
+
| npm global install permission error | Node installed to a system path | Use `nvm`, or install locally: `npm i -D @wordpress/env` and run via `npm exec --no -- wp-env`|
Copy file name to clipboardExpand all lines: skills/wp-playground/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,4 +50,4 @@ This is a thin routing wrapper. Use it to pick the right Playground workflow, th
50
50
51
51
## Escalation
52
52
53
-
- If the task needs native PHP extensions, external database access, persistence, or production-like infrastructure that Playground cannot provide, use a full WordPress stack such as wp-env, Docker, or the project-provided environment.
53
+
- If the task needs native PHP extensions, external database access, persistence, or production-like infrastructure that Playground cannot provide, use a full WordPress stack such as wp-env (see the `wp-env` skill), Docker, or the project-provided environment.
0 commit comments