wordpress-agent-kit 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/.agents/skills/wp-bootstrap/SKILL.md +314 -0
  2. package/.agents/skills/wp-bootstrap/references/composer-setup.md +275 -0
  3. package/.agents/skills/wp-bootstrap/references/monorepo-patterns.md +184 -0
  4. package/.agents/skills/wp-bootstrap/scripts/bootstrap.sh +151 -0
  5. package/.agents/skills/wp-bootstrap/scripts/detect-structure.mjs +466 -0
  6. package/.agents/skills/wp-bootstrap/scripts/package-wp.sh +173 -0
  7. package/.agents/skills/wp-bootstrap/scripts/playground-start.sh +148 -0
  8. package/.agents/skills/wp-bootstrap/scripts/playground-verify.sh +165 -0
  9. package/.agents/skills/wp-bootstrap/scripts/setup-github.sh +417 -0
  10. package/.agents/skills/wp-wpengine/SKILL.md +76 -12
  11. package/.agents/skills/wp-wpengine/references/github-actions-deploy.md +16 -9
  12. package/README.md +1 -1
  13. package/dist/cli.js +2 -0
  14. package/dist/commands/bootstrap.js +105 -0
  15. package/dist/lib/api.js +1 -0
  16. package/dist/lib/bootstrap.js +352 -0
  17. package/extensions/wp-agent-kit/index.ts +143 -3
  18. package/package.json +1 -1
  19. package/skills-custom/wp-bootstrap/SKILL.md +314 -0
  20. package/skills-custom/wp-bootstrap/references/composer-setup.md +275 -0
  21. package/skills-custom/wp-bootstrap/references/monorepo-patterns.md +184 -0
  22. package/skills-custom/wp-bootstrap/scripts/bootstrap.sh +151 -0
  23. package/skills-custom/wp-bootstrap/scripts/detect-structure.mjs +466 -0
  24. package/skills-custom/wp-bootstrap/scripts/package-wp.sh +173 -0
  25. package/skills-custom/wp-bootstrap/scripts/playground-start.sh +148 -0
  26. package/skills-custom/wp-bootstrap/scripts/playground-verify.sh +165 -0
  27. package/skills-custom/wp-bootstrap/scripts/setup-github.sh +417 -0
  28. package/skills-custom/wp-wpengine/SKILL.md +76 -12
  29. package/skills-custom/wp-wpengine/references/github-actions-deploy.md +16 -9
  30. package/.github/skills/blueprint/SKILL.md +0 -418
  31. package/.github/skills/wordpress-router/SKILL.md +0 -52
  32. package/.github/skills/wordpress-router/references/decision-tree.md +0 -55
  33. package/.github/skills/wp-abilities-api/SKILL.md +0 -108
  34. package/.github/skills/wp-abilities-api/references/delegate-helper-pattern.md +0 -241
  35. package/.github/skills/wp-abilities-api/references/domain-vs-projection.md +0 -113
  36. package/.github/skills/wp-abilities-api/references/error-code-vocabulary.md +0 -123
  37. package/.github/skills/wp-abilities-api/references/grouping-heuristic.md +0 -89
  38. package/.github/skills/wp-abilities-api/references/input-schema-gotchas.md +0 -265
  39. package/.github/skills/wp-abilities-api/references/php-registration.md +0 -94
  40. package/.github/skills/wp-abilities-api/references/plugin-family-patterns.md +0 -233
  41. package/.github/skills/wp-abilities-api/references/rest-api.md +0 -13
  42. package/.github/skills/wp-abilities-api/references/shared-core-service.md +0 -184
  43. package/.github/skills/wp-abilities-audit/SKILL.md +0 -199
  44. package/.github/skills/wp-abilities-audit/references/audit-schema.md +0 -300
  45. package/.github/skills/wp-abilities-audit/references/capability-gate-tracing.md +0 -197
  46. package/.github/skills/wp-abilities-audit/references/controller-enumeration.md +0 -116
  47. package/.github/skills/wp-abilities-verify/SKILL.md +0 -215
  48. package/.github/skills/wp-abilities-verify/references/annotation-correctness.md +0 -154
  49. package/.github/skills/wp-abilities-verify/references/audit-schema-validation.md +0 -131
  50. package/.github/skills/wp-abilities-verify/references/permission-roundtrip.md +0 -190
  51. package/.github/skills/wp-abilities-verify/references/runtime-harness.md +0 -462
  52. package/.github/skills/wp-abilities-verify/references/schema-lints.md +0 -118
  53. package/.github/skills/wp-abilities-verify/references/static-enumeration.md +0 -126
  54. package/.github/skills/wp-block-development/SKILL.md +0 -175
  55. package/.github/skills/wp-block-development/references/attributes-and-serialization.md +0 -22
  56. package/.github/skills/wp-block-development/references/block-json.md +0 -49
  57. package/.github/skills/wp-block-development/references/creating-new-blocks.md +0 -46
  58. package/.github/skills/wp-block-development/references/debugging.md +0 -36
  59. package/.github/skills/wp-block-development/references/deprecations.md +0 -24
  60. package/.github/skills/wp-block-development/references/dynamic-rendering.md +0 -23
  61. package/.github/skills/wp-block-development/references/inner-blocks.md +0 -25
  62. package/.github/skills/wp-block-development/references/registration.md +0 -30
  63. package/.github/skills/wp-block-development/references/supports-and-wrappers.md +0 -18
  64. package/.github/skills/wp-block-development/references/tooling-and-testing.md +0 -21
  65. package/.github/skills/wp-block-development/scripts/list_blocks.mjs +0 -121
  66. package/.github/skills/wp-block-themes/SKILL.md +0 -117
  67. package/.github/skills/wp-block-themes/references/creating-new-block-theme.md +0 -37
  68. package/.github/skills/wp-block-themes/references/debugging.md +0 -24
  69. package/.github/skills/wp-block-themes/references/patterns.md +0 -18
  70. package/.github/skills/wp-block-themes/references/style-variations.md +0 -14
  71. package/.github/skills/wp-block-themes/references/templates-and-parts.md +0 -16
  72. package/.github/skills/wp-block-themes/references/theme-json.md +0 -59
  73. package/.github/skills/wp-block-themes/scripts/detect_block_themes.mjs +0 -117
  74. package/.github/skills/wp-interactivity-api/SKILL.md +0 -180
  75. package/.github/skills/wp-interactivity-api/references/debugging.md +0 -29
  76. package/.github/skills/wp-interactivity-api/references/directives-quickref.md +0 -30
  77. package/.github/skills/wp-interactivity-api/references/server-side-rendering.md +0 -310
  78. package/.github/skills/wp-performance/SKILL.md +0 -147
  79. package/.github/skills/wp-performance/references/autoload-options.md +0 -24
  80. package/.github/skills/wp-performance/references/cron.md +0 -20
  81. package/.github/skills/wp-performance/references/database.md +0 -20
  82. package/.github/skills/wp-performance/references/http-api.md +0 -15
  83. package/.github/skills/wp-performance/references/measurement.md +0 -21
  84. package/.github/skills/wp-performance/references/object-cache.md +0 -24
  85. package/.github/skills/wp-performance/references/query-monitor-headless.md +0 -38
  86. package/.github/skills/wp-performance/references/server-timing.md +0 -22
  87. package/.github/skills/wp-performance/references/wp-cli-doctor.md +0 -24
  88. package/.github/skills/wp-performance/references/wp-cli-profile.md +0 -32
  89. package/.github/skills/wp-performance/scripts/perf_inspect.mjs +0 -128
  90. package/.github/skills/wp-phpstan/SKILL.md +0 -98
  91. package/.github/skills/wp-phpstan/references/configuration.md +0 -52
  92. package/.github/skills/wp-phpstan/references/third-party-classes.md +0 -76
  93. package/.github/skills/wp-phpstan/references/wordpress-annotations.md +0 -124
  94. package/.github/skills/wp-phpstan/scripts/phpstan_inspect.mjs +0 -263
  95. package/.github/skills/wp-playground/SKILL.md +0 -233
  96. package/.github/skills/wp-playground/references/blueprints.md +0 -36
  97. package/.github/skills/wp-playground/references/cli-commands.md +0 -39
  98. package/.github/skills/wp-playground/references/debugging.md +0 -16
  99. package/.github/skills/wp-playground/references/e2e-playwright.md +0 -115
  100. package/.github/skills/wp-plugin-development/SKILL.md +0 -113
  101. package/.github/skills/wp-plugin-development/references/data-and-cron.md +0 -19
  102. package/.github/skills/wp-plugin-development/references/debugging.md +0 -19
  103. package/.github/skills/wp-plugin-development/references/lifecycle.md +0 -33
  104. package/.github/skills/wp-plugin-development/references/security.md +0 -29
  105. package/.github/skills/wp-plugin-development/references/settings-api.md +0 -22
  106. package/.github/skills/wp-plugin-development/references/structure.md +0 -16
  107. package/.github/skills/wp-plugin-development/scripts/detect_plugins.mjs +0 -122
  108. package/.github/skills/wp-plugin-directory-guidelines/SKILL.md +0 -133
  109. package/.github/skills/wp-plugin-directory-guidelines/references/gpl-compliance.md +0 -217
  110. package/.github/skills/wp-plugin-directory-guidelines/references/guideline-review-checklist.md +0 -592
  111. package/.github/skills/wp-plugin-directory-guidelines/references/naming-rules.md +0 -121
  112. package/.github/skills/wp-project-triage/SKILL.md +0 -39
  113. package/.github/skills/wp-project-triage/references/triage.schema.json +0 -143
  114. package/.github/skills/wp-project-triage/scripts/detect_wp_project.mjs +0 -610
  115. package/.github/skills/wp-rest-api/SKILL.md +0 -115
  116. package/.github/skills/wp-rest-api/references/authentication.md +0 -18
  117. package/.github/skills/wp-rest-api/references/custom-content-types.md +0 -20
  118. package/.github/skills/wp-rest-api/references/discovery-and-params.md +0 -20
  119. package/.github/skills/wp-rest-api/references/responses-and-fields.md +0 -30
  120. package/.github/skills/wp-rest-api/references/routes-and-endpoints.md +0 -36
  121. package/.github/skills/wp-rest-api/references/schema.md +0 -22
  122. package/.github/skills/wp-wpcli-and-ops/SKILL.md +0 -124
  123. package/.github/skills/wp-wpcli-and-ops/references/automation.md +0 -30
  124. package/.github/skills/wp-wpcli-and-ops/references/cron-and-cache.md +0 -23
  125. package/.github/skills/wp-wpcli-and-ops/references/debugging.md +0 -17
  126. package/.github/skills/wp-wpcli-and-ops/references/multisite.md +0 -22
  127. package/.github/skills/wp-wpcli-and-ops/references/packages-and-updates.md +0 -22
  128. package/.github/skills/wp-wpcli-and-ops/references/safety.md +0 -30
  129. package/.github/skills/wp-wpcli-and-ops/references/search-replace.md +0 -40
  130. package/.github/skills/wp-wpcli-and-ops/scripts/wpcli_inspect.mjs +0 -90
  131. package/.github/skills/wp-wpengine/SKILL.md +0 -127
  132. package/.github/skills/wpds/SKILL.md +0 -59
@@ -1,418 +0,0 @@
1
- ---
2
- name: blueprint
3
- description: Use when creating, editing, or reviewing WordPress Playground blueprint JSON files. Triggers on mentions of blueprints, playground configuration, or requests to set up a WordPress demo environment.
4
- license: GPL-2.0-or-later
5
- compatibility: "WordPress 6.9+, PHP 7.2.24+. Optionally Playground CLI or a browser"
6
- ---
7
-
8
- # WordPress Playground Blueprints
9
-
10
- ## Overview
11
-
12
- A Blueprint is a JSON file that declaratively configures a WordPress Playground instance — installing plugins/themes, setting options, running PHP/SQL, manipulating files, and more.
13
-
14
- **Core principle:** Blueprints are trusted JSON-only declarations. No arbitrary JavaScript. They work on web, Node.js, and CLI.
15
-
16
- ## Quick Start Template
17
-
18
- ```json
19
- {
20
- "$schema": "https://playground.wordpress.net/blueprint-schema.json",
21
- "landingPage": "/wp-admin/",
22
- "preferredVersions": { "php": "8.3", "wp": "latest" },
23
- "steps": [{ "step": "login" }]
24
- }
25
- ```
26
-
27
- ## Top-Level Properties
28
-
29
- All optional. Only documented keys are allowed — the schema rejects unknown properties.
30
-
31
- | Property | Type | Notes |
32
- |----------|------|-------|
33
- | `$schema` | string | Always `"https://playground.wordpress.net/blueprint-schema.json"` |
34
- | `landingPage` | string | Relative path, e.g. `/wp-admin/` |
35
- | `meta` | object | `{ title, author, description?, categories? }` — title and author required |
36
- | `preferredVersions` | object | `{ php, wp }` — both required when present |
37
- | `features` | object | `{ networking?: boolean, intl?: boolean }` — **only** these two keys, nothing else. Networking defaults to `true` |
38
- | `extraLibraries` | array | `["wp-cli"]` — auto-included when any `wp-cli` step is present |
39
- | `constants` | object | Shorthand for `defineWpConfigConsts`. Values: string/boolean/number |
40
- | `plugins` | array | Shorthand for `installPlugin` steps. Strings = wp.org slugs |
41
- | `siteOptions` | object | Shorthand for `setSiteOptions` |
42
- | `login` | boolean or object | `true` = login as admin. Object = `{ username?, password? }` (both default to `"admin"`/`"password"`) |
43
- | `steps` | array | Main execution pipeline. Runs after shorthands |
44
-
45
- ### preferredVersions Values
46
-
47
- - **php:** Major.minor only (e.g. `"8.3"`, `"7.4"`), or `"latest"`. Patch versions like `"7.4.1"` are invalid. Check the schema for currently supported versions.
48
- - **wp:** Recent major versions (e.g. `"6.7"`, `"6.8"`), `"latest"`, `"nightly"`, `"beta"`, or a URL to a custom zip. Check the schema for the full list.
49
-
50
- ### Shorthands vs Steps
51
-
52
- Shorthands (`login`, `plugins`, `siteOptions`, `constants`) are expanded and prepended to `steps` in an **unspecified order**. Use explicit steps when execution order matters.
53
-
54
- ## Resource References
55
-
56
- Resources tell Playground where to find files. Used by `installPlugin`, `installTheme`, `writeFile`, `writeFiles`, `importWxr`, etc.
57
-
58
- | Resource Type | Required Fields | Example |
59
- |--------------|----------------|---------|
60
- | `wordpress.org/plugins` | `slug` | `{ "resource": "wordpress.org/plugins", "slug": "woocommerce" }` |
61
- | `wordpress.org/themes` | `slug` | `{ "resource": "wordpress.org/themes", "slug": "astra" }` |
62
- | `url` | `url` | `{ "resource": "url", "url": "https://example.com/plugin.zip" }` |
63
- | `git:directory` | `url`, `ref` | See below |
64
- | `literal` | `name`, `contents` | `{ "resource": "literal", "name": "file.txt", "contents": "hello" }` |
65
- | `literal:directory` | `name`, `files` | See below |
66
- | `bundled` | `path` | References a file within a blueprint bundle (e.g. `{ "resource": "bundled", "path": "/plugin.zip" }`) |
67
- | `zip` | `inner` | Wraps another resource in a ZIP — use when a step expects a zip but your source isn't one (e.g. wrapping a `url` resource pointing to a raw directory) |
68
-
69
- ### git:directory — Installing from GitHub
70
-
71
- ```json
72
- {
73
- "resource": "git:directory",
74
- "url": "https://github.com/WordPress/gutenberg",
75
- "ref": "trunk",
76
- "refType": "branch",
77
- "path": "/"
78
- }
79
- ```
80
-
81
- - When using a branch or tag name for `ref`, you **must** set `refType` (`"branch"` | `"tag"` | `"commit"` | `"refname"`). Without it, only `"HEAD"` resolves reliably.
82
- - `path` selects a subdirectory (defaults to repo root).
83
-
84
- ### literal:directory — Inline File Trees
85
-
86
- ```json
87
- {
88
- "resource": "literal:directory",
89
- "name": "my-plugin",
90
- "files": {
91
- "plugin.php": "<?php /* Plugin Name: My Plugin */ ?>",
92
- "includes": {
93
- "helper.php": "<?php // helper code ?>"
94
- }
95
- }
96
- }
97
- ```
98
-
99
- - `files` uses nested objects for subdirectories — keys are filenames or directory names, values are **plain strings** (file content) or **objects** (subdirectories). Never use resource references as values.
100
- - **Do NOT use path separators in keys** (e.g. `"includes/helper.php"` is wrong — use a nested `"includes": { "helper.php": "..." }` object).
101
-
102
- ## Steps Reference
103
-
104
- Every step requires `"step": "<name>"`. Any step can optionally include `"progress": { "weight": 1, "caption": "Installing..." }` for UI feedback.
105
-
106
- ### Plugin & Theme Installation
107
-
108
- ```json
109
- {
110
- "step": "installPlugin",
111
- "pluginData": { "resource": "wordpress.org/plugins", "slug": "gutenberg" },
112
- "options": { "activate": true, "targetFolderName": "gutenberg" },
113
- "ifAlreadyInstalled": "overwrite"
114
- }
115
- ```
116
-
117
- ```json
118
- {
119
- "step": "installTheme",
120
- "themeData": { "resource": "wordpress.org/themes", "slug": "twentytwentyfour" },
121
- "options": { "activate": true, "importStarterContent": true },
122
- "ifAlreadyInstalled": "overwrite"
123
- }
124
- ```
125
-
126
- - Use `pluginData` / `themeData` — **NOT** the deprecated `pluginZipFile` / `themeZipFile`.
127
- - `pluginData` / `themeData` accept any FileReference or DirectoryReference — a zip URL, a `wordpress.org/plugins` slug, a `git:directory`, or a `literal:directory` (no `zip` wrapper needed).
128
- - `options.activate` controls activation. No need for a separate `activatePlugin`/`activateTheme` step when using `installPlugin`/`installTheme`.
129
- - `ifAlreadyInstalled`: `"overwrite"` | `"skip"` | `"error"`
130
-
131
- ### Activation (standalone)
132
-
133
- Only needed for plugins/themes already on disk (e.g. after `writeFile`/`writeFiles`):
134
-
135
- ```json
136
- { "step": "activatePlugin", "pluginPath": "my-plugin/my-plugin.php" }
137
- ```
138
- ```json
139
- { "step": "activateTheme", "themeFolderName": "twentytwentyfour" }
140
- ```
141
-
142
- ### File Operations
143
-
144
- ```json
145
- { "step": "writeFile", "path": "/wordpress/wp-content/mu-plugins/custom.php", "data": "<?php // code" }
146
- ```
147
-
148
- `data` accepts a plain string (as shown above) or a resource reference (e.g. `{ "resource": "url", "url": "https://..." }`).
149
-
150
- ```json
151
- {
152
- "step": "writeFiles",
153
- "writeToPath": "/wordpress/wp-content/plugins/",
154
- "filesTree": {
155
- "resource": "literal:directory",
156
- "name": "my-plugin",
157
- "files": {
158
- "plugin.php": "<?php\n/*\nPlugin Name: My Plugin\n*/",
159
- "includes": {
160
- "helpers.php": "<?php // helpers"
161
- }
162
- }
163
- }
164
- }
165
- ```
166
-
167
- **`writeFiles` requires a DirectoryReference** (`literal:directory` or `git:directory`) as `filesTree` — not a plain object.
168
-
169
- Other file operations: `mkdir`, `cp`, `mv`, `rm`, `rmdir`, `unzip`.
170
-
171
- ### Running Code
172
-
173
- **runPHP:**
174
- ```json
175
- { "step": "runPHP", "code": "<?php require '/wordpress/wp-load.php'; update_option('key', 'value');" }
176
- ```
177
- **GOTCHA:** You must `require '/wordpress/wp-load.php';` to use any WordPress functions.
178
-
179
- **wp-cli:**
180
- ```json
181
- { "step": "wp-cli", "command": "wp post create --post_type=page --post_title='Hello' --post_status=publish" }
182
- ```
183
- The step name is `wp-cli` (with hyphen), NOT `cli` or `wpcli`.
184
-
185
- **runSql:**
186
- ```json
187
- { "step": "runSql", "sql": { "resource": "literal", "name": "q.sql", "contents": "UPDATE wp_options SET option_value='val' WHERE option_name='key';" } }
188
- ```
189
-
190
- ### Site Configuration
191
-
192
- ```json
193
- { "step": "setSiteOptions", "options": { "blogname": "My Site", "blogdescription": "A tagline" } }
194
- ```
195
- ```json
196
- { "step": "defineWpConfigConsts", "consts": { "WP_DEBUG": true } }
197
- ```
198
- ```json
199
- { "step": "setSiteLanguage", "language": "en_US" }
200
- ```
201
- ```json
202
- { "step": "defineSiteUrl", "siteUrl": "https://example.com" }
203
- ```
204
-
205
- ### Other Steps
206
-
207
- | Step | Key Properties |
208
- |------|---------------|
209
- | `login` | `username?`, `password?` (default `"admin"` / `"password"`) |
210
- | `enableMultisite` | (no required props) |
211
- | `importWxr` | `file` (FileReference) |
212
- | `importThemeStarterContent` | `themeSlug?` |
213
- | `importWordPressFiles` | `wordPressFilesZip`, `pathInZip?` — imports a full WordPress directory from a zip |
214
- | `request` | `request: { url, method?, headers?, body? }` |
215
- | `updateUserMeta` | `userId`, `meta` |
216
- | `runWpInstallationWizard` | `options?` — runs the WP install wizard with given options |
217
- | `resetData` | (no props) |
218
-
219
- ## Common Patterns
220
-
221
- ### Inline mu-plugin (quick custom code)
222
-
223
- ```json
224
- {
225
- "step": "writeFile",
226
- "path": "/wordpress/wp-content/mu-plugins/custom.php",
227
- "data": "<?php\n// mu-plugins load automatically — no activation needed, no require wp-load.php\nadd_filter('show_admin_bar', '__return_false');"
228
- }
229
- ```
230
-
231
- ### Inline plugin with multiple files
232
-
233
- ```json
234
- {
235
- "step": "writeFiles",
236
- "writeToPath": "/wordpress/wp-content/plugins/",
237
- "filesTree": {
238
- "resource": "literal:directory",
239
- "name": "my-plugin",
240
- "files": {
241
- "my-plugin.php": "<?php\n/*\nPlugin Name: My Plugin\n*/\nrequire __DIR__ . '/includes/main.php';",
242
- "includes": {
243
- "main.php": "<?php // main logic"
244
- }
245
- }
246
- }
247
- }
248
- ```
249
-
250
- Then activate it with a separate step:
251
-
252
- ```json
253
- { "step": "activatePlugin", "pluginPath": "my-plugin/my-plugin.php" }
254
- ```
255
-
256
- ### Plugin from a GitHub branch
257
-
258
- ```json
259
- {
260
- "step": "installPlugin",
261
- "pluginData": {
262
- "resource": "git:directory",
263
- "url": "https://github.com/user/repo",
264
- "ref": "feature-branch",
265
- "refType": "branch",
266
- "path": "/"
267
- }
268
- }
269
- ```
270
-
271
- ## Common Mistakes
272
-
273
- | Mistake | Correct |
274
- |---------|---------|
275
- | `pluginZipFile` / `themeZipFile` | `pluginData` / `themeData` |
276
- | `"step": "cli"` | `"step": "wp-cli"` |
277
- | Flat object as `writeFiles.filesTree` | Must be a `literal:directory` or `git:directory` resource |
278
- | Path separators in `files` keys | Use nested objects for subdirectories |
279
- | `runPHP` without `wp-load.php` | Always `require '/wordpress/wp-load.php';` for WP functions |
280
- | Invented top-level keys | Only documented keys work — schema rejects unknown properties |
281
- | Inventing proxy URLs for GitHub | Use `git:directory` resource type |
282
- | Omitting `refType` with branch/tag `ref` | Required — only `"HEAD"` works without it |
283
- | Resource references in `literal:directory` `files` values | Values must be plain strings (content) or objects (subdirectories) — never resource refs |
284
- | `features.debug` or other invented feature keys | `features` only supports `networking` and `intl` — use `constants: { "WP_DEBUG": true }` for debug mode |
285
- | `require wp-load.php` in mu-plugin code | Only needed in `runPHP` steps — mu-plugins already run within WordPress |
286
- | Schema URL with `.org` domain | Must be `playground.wordpress.net`, not `playground.wordpress.org` |
287
-
288
- ## Full Reference
289
-
290
- This skill covers the most common steps and patterns. For the complete API, see:
291
-
292
- - **Blueprint docs:** https://wordpress.github.io/wordpress-playground/blueprints
293
- - **JSON schema:** https://playground.wordpress.net/blueprint-schema.json
294
-
295
- Additional steps not covered above: `runPHPWithOptions` (run PHP with custom `ini` settings), `runWpInstallationWizard`, and resource types `vfs` and `bundled` (for advanced embedding scenarios).
296
-
297
- ## Blueprint Bundles
298
-
299
- Bundles are self-contained packages that include a `blueprint.json` along with all the resources it references (plugins, themes, WXR files, etc.). Instead of hosting assets externally, bundle them alongside the blueprint.
300
-
301
- ### Bundle Structure
302
-
303
- ```
304
- my-bundle/
305
- ├── blueprint.json ← must be at the root
306
- ├── my-plugin.zip ← zipped plugin directory
307
- ├── theme.zip
308
- └── content/
309
- └── sample-content.wxr
310
- ```
311
-
312
- Plugins and themes must be zipped before bundling — `installPlugin` expects a zip, not a raw directory. To create the zip from a plugin directory:
313
-
314
- ```bash
315
- cd my-bundle
316
- zip -r my-plugin.zip my-plugin/
317
- ```
318
-
319
- ### Referencing Bundled Resources
320
-
321
- Use the `bundled` resource type to reference files within the bundle:
322
-
323
- ```json
324
- {
325
- "step": "installPlugin",
326
- "pluginData": {
327
- "resource": "bundled",
328
- "path": "/my-plugin.zip"
329
- },
330
- "options": { "activate": true }
331
- }
332
- ```
333
-
334
- ```json
335
- {
336
- "step": "importWxr",
337
- "file": {
338
- "resource": "bundled",
339
- "path": "/content/sample-content.wxr"
340
- }
341
- }
342
- ```
343
-
344
- ### Creating a Bundle Step by Step
345
-
346
- 1. Create the bundle directory and add `blueprint.json` at its root.
347
- 2. Write your plugin/theme source files in a subdirectory (e.g. `my-plugin/my-plugin.php`).
348
- 3. Zip the plugin directory: `zip -r my-plugin.zip my-plugin/`
349
- 4. Reference it in `blueprint.json` using `{ "resource": "bundled", "path": "/my-plugin.zip" }`.
350
-
351
- Full example — a bundle that installs a custom plugin:
352
-
353
- ```
354
- dashboard-widget-bundle/
355
- ├── blueprint.json
356
- ├── dashboard-widget.zip ← zip of dashboard-widget/
357
- └── dashboard-widget/ ← plugin source (kept for editing)
358
- └── dashboard-widget.php
359
- ```
360
-
361
- ```json
362
- {
363
- "$schema": "https://playground.wordpress.net/blueprint-schema.json",
364
- "landingPage": "/wp-admin/",
365
- "preferredVersions": { "php": "8.3", "wp": "latest" },
366
- "steps": [
367
- { "step": "login" },
368
- {
369
- "step": "installPlugin",
370
- "pluginData": { "resource": "bundled", "path": "/dashboard-widget.zip" },
371
- "options": { "activate": true }
372
- }
373
- ]
374
- }
375
- ```
376
-
377
- ### Distribution Formats
378
-
379
- | Format | How to use |
380
- |--------|-----------|
381
- | ZIP file (remote) | Website: `https://playground.wordpress.net/?blueprint-url=https://example.com/bundle.zip` |
382
- | ZIP file (local) | CLI: `npx @wp-playground/cli server --blueprint=./bundle.zip` |
383
- | Local directory | CLI: `npx @wp-playground/cli server --blueprint=./my-bundle/ --blueprint-may-read-adjacent-files` |
384
- | Git repository directory | Point `blueprint-url` at a repo directory containing `blueprint.json` |
385
-
386
- **GOTCHA:** Local directory bundles always need `--blueprint-may-read-adjacent-files` for the CLI to read bundled resources. Without it, any `"resource": "bundled"` reference will fail with a "File not found" error. ZIP bundles don't need this flag — all files are self-contained inside the archive.
387
-
388
- ## Testing Blueprints
389
-
390
- ### Inline Blueprints (quick test, no bundles)
391
-
392
- Minify the blueprint JSON (no extra whitespace), prepend `https://playground.wordpress.net/#`, and open the URL in a browser:
393
-
394
- ```
395
- https://playground.wordpress.net/#{"$schema":"https://playground.wordpress.net/blueprint-schema.json","preferredVersions":{"php":"8.3","wp":"latest"},"steps":[{"step":"login"}]}
396
- ```
397
-
398
- Very large blueprints may exceed browser URL length limits; use the CLI instead.
399
-
400
- ### Local CLI Testing
401
-
402
- **Interactive server** (keeps running, opens in browser):
403
- ```bash
404
- # Directory bundle — requires --blueprint-may-read-adjacent-files
405
- npx @wp-playground/cli server --blueprint=./my-bundle/ --blueprint-may-read-adjacent-files
406
-
407
- # ZIP bundle — self-contained, no extra flags needed
408
- npx @wp-playground/cli server --blueprint=./bundle.zip
409
- ```
410
-
411
- **Headless validation** (runs blueprint and exits):
412
- ```bash
413
- npx @wp-playground/cli run-blueprint --blueprint=./my-bundle/ --blueprint-may-read-adjacent-files
414
- ```
415
-
416
- ### Testing with the wordpress-playground-server Skill
417
-
418
- Use the `wordpress-playground-server` skill to start a local Playground instance with `--blueprint /path/to/blueprint.json`, then verify the expected state with Playwright MCP. For directory bundles, pass `--blueprint-may-read-adjacent-files` as an extra argument.
@@ -1,52 +0,0 @@
1
- ---
2
- name: wordpress-router
3
- description: "Use when the user asks about WordPress codebases (plugins, themes, block themes, Gutenberg blocks, WP core checkouts) and you need to quickly classify the repo and route to the correct workflow/skill (blocks, theme.json, REST API, WP-CLI, performance, security, testing, release packaging)."
4
- license: GPL-2.0-or-later
5
- compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Filesystem-based agent with bash + node. Some workflows require WP-CLI."
6
- ---
7
-
8
- # WordPress Router
9
-
10
- ## When to use
11
-
12
- Use this skill at the start of most WordPress tasks to:
13
-
14
- - identify what kind of WordPress codebase this is (plugin vs theme vs block theme vs WP core checkout vs full site),
15
- - pick the right workflow and guardrails,
16
- - delegate to the most relevant domain skill(s).
17
-
18
- ## Inputs required
19
-
20
- - Repo root (current working directory).
21
- - The user’s intent (what they want changed) and any constraints (WP version targets, WP.com specifics, release requirements).
22
-
23
- ## Procedure
24
-
25
- 1. Run the project triage script:
26
- - `node skills/wp-project-triage/scripts/detect_wp_project.mjs`
27
- 2. Read the triage output and classify:
28
- - primary project kind(s),
29
- - tooling available (PHP/Composer, Node, @wordpress/scripts),
30
- - tests present (PHPUnit, Playwright, wp-env),
31
- - any version hints.
32
- 3. Route to domain workflows based on user intent + repo kind:
33
- - For the decision tree, read: `skills/wordpress-router/references/decision-tree.md`.
34
- 4. Apply guardrails before making changes:
35
- - Confirm any version constraints if unclear.
36
- - Prefer the repo’s existing tooling and conventions for builds/tests.
37
-
38
- ## Verification
39
-
40
- - Re-run the triage script if you create or restructure significant files.
41
- - Run the repo’s lint/test/build commands that the triage output recommends (if available).
42
-
43
- ## Failure modes / debugging
44
-
45
- - If triage reports `kind: unknown`, inspect:
46
- - root `composer.json`, `package.json`, `style.css`, `block.json`, `theme.json`, `wp-content/`.
47
- - If the repo is huge, consider narrowing scanning scope or adding ignore rules to the triage script.
48
-
49
- ## Escalation
50
-
51
- - If routing is ambiguous, ask one question:
52
- - “Is this intended to be a WordPress plugin, a theme (classic/block), or a full site repo?”
@@ -1,55 +0,0 @@
1
- # Router decision tree (v1)
2
-
3
- This is a lightweight routing guide. It assumes you can run `wp-project-triage` first.
4
-
5
- ## Step 1: classify repo kind (from triage)
6
-
7
- Use `triage.project.kind` and the strongest signals:
8
-
9
- - `wp-core` → treat as WordPress core checkout work (core patches, PHPUnit, build tools).
10
- - `wp-site` → treat as a full site repo (wp-content present; changes might be theme + plugins).
11
- - `wp-block-theme` → theme.json/templates/patterns workflows.
12
- - `wp-theme` → classic theme workflows (templates PHP, `functions.php`, `style.css`).
13
- - `wp-block-plugin` → Gutenberg block development in a plugin (block.json, build pipeline).
14
- - `wp-plugin` / `wp-mu-plugin` → plugin workflows (hooks, admin, settings, cron, REST, security).
15
- - `gutenberg` → Gutenberg monorepo workflows (packages, tooling, docs).
16
-
17
- If multiple kinds match, prefer the most specific:
18
- `gutenberg` > `wp-core` > `wp-site` > `wp-block-theme` > `wp-block-plugin` > `wp-theme` > `wp-plugin`.
19
-
20
- ## Step 2: route by user intent (keywords)
21
-
22
- Route by intent even if repo kind is broad (like `wp-site`):
23
-
24
- - **Interactivity API / data-wp-* directives / @wordpress/interactivity / viewScriptModule**
25
- - Route → `wp-interactivity-api`.
26
- - **Abilities API / wp_register_ability / wp-abilities/v1 / @wordpress/abilities**
27
- - Route → `wp-abilities-api`.
28
- - **Playground / run-blueprint / build-snapshot / @wp-playground/cli / playground.wordpress.net**
29
- - Route → `wp-playground`.
30
- - **Blocks / block.json / registerBlockType / attributes / save serialization**
31
- - Route → `wp-block-development`.
32
- - **theme.json / Global Styles / templates/*.html / patterns/**
33
- - Route → `wp-block-themes`.
34
- - **Plugins / hooks / activation hook / uninstall / Settings API / admin pages**
35
- - Route → `wp-plugin-development`.
36
- - **REST endpoint / register_rest_route / permission_callback**
37
- - Route → `wp-rest-api`.
38
- - **WP-CLI / wp-cli.yml / commands**
39
- - Route → `wp-wpcli-and-ops`.
40
- - **Build tooling / @wordpress/scripts / webpack / Vite / npm scripts**
41
- - Route → `wp-build-tooling` (planned).
42
- - **Testing / PHPUnit / wp-env / Playwright**
43
- - Route → `wp-testing` (planned).
44
- - **PHPStan / static analysis / phpstan.neon / phpstan-baseline.neon**
45
- - Route → `wp-phpstan`.
46
- - **Performance / caching / query profiling / editor slowness**
47
- - Route → `wp-performance`.
48
- - **Security / nonces / capabilities / sanitization/escaping / uploads**
49
- - Route → `wp-security` (planned).
50
-
51
- ## Step 3: guardrails checklist (always)
52
-
53
- - Verify detected tooling before suggesting commands (Composer vs npm/yarn/pnpm).
54
- - Prefer existing lint/test scripts if present.
55
- - If version constraints aren’t detectable, ask for target WP core and PHP versions.
@@ -1,108 +0,0 @@
1
- ---
2
- name: wp-abilities-api
3
- description: "Use when working with the WordPress Abilities API (wp_register_ability, wp_register_ability_category, /wp-json/wp-abilities/v1/*, @wordpress/abilities) including defining abilities, categories, meta, REST exposure, and permissions checks for clients."
4
- license: GPL-2.0-or-later
5
- compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Filesystem-based agent with bash + node. Some workflows require WP-CLI."
6
- ---
7
-
8
- # WP Abilities API
9
-
10
- ## When to use
11
-
12
- Use this skill when the task involves:
13
-
14
- - registering abilities or ability categories in PHP,
15
- - exposing abilities to clients via REST (`wp-abilities/v1`),
16
- - consuming abilities in JS (notably `@wordpress/abilities`),
17
- - diagnosing “ability doesn’t show up” / “client can’t see ability” / “REST returns empty”.
18
-
19
- ## Inputs required
20
-
21
- - Repo root (run `wp-project-triage` first if you haven’t).
22
- - Target WordPress version(s) and whether this is WP core or a plugin/theme.
23
- - Where the change should live (plugin vs theme vs mu-plugin).
24
-
25
- ## Procedure
26
-
27
- Before deciding what to register, read `references/domain-vs-projection.md` — abilities live at the domain capability layer; MCP / Command Palette / REST exposure is a projection. Registration shape and exposure shape are different decisions, and conflating them forces re-registration every time a consumer's constraints change.
28
-
29
- ### 1) Confirm availability and version constraints
30
-
31
- - If this is WP core work, check `signals.isWpCoreCheckout` and `versions.wordpress.core`.
32
- - If the project targets WP < 6.9, you may need the Abilities API plugin/package rather than relying on core.
33
-
34
- ### 2) Find existing Abilities usage
35
-
36
- Search for these in the repo:
37
-
38
- - `wp_register_ability(`
39
- - `wp_register_ability_category(`
40
- - `wp_abilities_api_init`
41
- - `wp_abilities_api_categories_init`
42
- - `wp-abilities/v1`
43
- - `@wordpress/abilities`
44
-
45
- If none exist, decide whether you’re introducing Abilities API fresh (new registrations + client consumption) or only consuming.
46
-
47
- ### 3) Register categories (optional)
48
-
49
- If you need a logical grouping, register an ability category early (see `references/php-registration.md`).
50
-
51
- ### 4) Register abilities (PHP)
52
-
53
- For grouping decisions (how many abilities to register, and where to put filters vs. new ability names), read `references/grouping-heuristic.md` first — it keeps you from shipping one atomic ability per REST operation.
54
-
55
- To avoid drift between the ability and the existing UI / REST code path, see `references/shared-core-service.md` — abilities, REST handlers, CLI commands, and UI controllers should be thin adapters over a shared service. The reference also covers the metric trap (REST handlers that emit usage telemetry) and the `AGENTS.md` rule for keeping registrations in sync when underlying code paths change.
56
-
57
- For shared helper patterns when multiple execute callbacks delegate to existing REST controllers, see `references/plugin-family-patterns.md` (identify the shared-API-client vs zero-arg-controllers shape) and `references/delegate-helper-pattern.md` (one helper shape that works, and when not to use it).
58
-
59
- For standardized `WP_Error` codes that let agents reason about retry vs. escalation, see `references/error-code-vocabulary.md`.
60
-
61
- Implement the ability in PHP registration with:
62
-
63
- - stable `id` (namespaced),
64
- - `label`/`description`,
65
- - `category`,
66
- - `meta`:
67
- - add `readonly: true` when the ability is informational,
68
- - set `show_in_rest: true` for abilities you want visible to clients.
69
-
70
- Use the documented init hooks for Abilities API registration so they load at the right time (see `references/php-registration.md`).
71
-
72
- ### 5) Confirm REST exposure
73
-
74
- - Verify the REST endpoints exist and return expected results (see `references/rest-api.md`).
75
- - If the client still can’t see the ability, confirm `meta.show_in_rest` is enabled and you’re querying the right endpoint.
76
-
77
- ### 6) Consume from JS (if needed)
78
-
79
- - Prefer `@wordpress/abilities` APIs for client-side access and checks.
80
- - Ensure build tooling includes the dependency and the project’s build pipeline bundles it.
81
-
82
- ## Verification
83
-
84
- - `wp-project-triage` indicates `signals.usesAbilitiesApi: true` after your change (if applicable).
85
- - REST check (in a WP environment): endpoints under `wp-abilities/v1` return your ability and category when expected.
86
- - If the repo has tests, add/update coverage near:
87
- - PHP: ability registration and meta exposure
88
- - JS: ability consumption and UI gating
89
-
90
- ## Failure modes / debugging
91
-
92
- - Ability never appears:
93
- - registration code not running (wrong hook / file not loaded),
94
- - missing `meta.show_in_rest`,
95
- - incorrect category/ID mismatch.
96
- - REST shows ability but JS doesn’t:
97
- - wrong REST base/namespace,
98
- - JS dependency not bundled,
99
- - caching (object/page caches) masking changes.
100
- - Execute callback returns unexpected errors or silently ignores input:
101
- - `input_schema` defaults aren't being applied, pagination key drift between the ability and the backing, or `empty()`-based ID validation — see `references/input-schema-gotchas.md`.
102
-
103
- ## Escalation
104
-
105
- - If you’re uncertain about version support, confirm target WP core versions and whether Abilities API is expected from core or as a plugin.
106
- - For canonical details, consult:
107
- - `references/rest-api.md`
108
- - `references/php-registration.md`