@rolepod/wplab 1.2.1
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.
- package/.claude-plugin/plugin.json +21 -0
- package/CHANGELOG.md +394 -0
- package/LICENSE +21 -0
- package/README.md +101 -0
- package/dist/bin/rolepod-wplab.d.ts +1 -0
- package/dist/bin/rolepod-wplab.js +66951 -0
- package/dist/bin/rolepod-wplab.js.map +1 -0
- package/dist/cpufeatures-FGCCZK75.node +0 -0
- package/dist/index.d.ts +3103 -0
- package/dist/index.js +66293 -0
- package/dist/index.js.map +1 -0
- package/dist/sshcrypto-GDFKS5G5.node +0 -0
- package/package.json +77 -0
- package/skills/wp-audit-security/SKILL.md +58 -0
- package/skills/wp-audit-woo/SKILL.md +44 -0
- package/skills/wp-edit-elementor/SKILL.md +44 -0
- package/skills/wp-execute-php/SKILL.md +59 -0
- package/skills/wp-health-check/SKILL.md +50 -0
- package/skills/wp-introspect/SKILL.md +48 -0
- package/skills/wp-migrate-dryrun/SKILL.md +48 -0
- package/skills/wp-pair-setup/SKILL.md +78 -0
- package/skills/wp-scaffold-block/SKILL.md +61 -0
- package/skills/wp-scaffold-plugin/SKILL.md +53 -0
- package/skills/wp-scaffold-theme/SKILL.md +43 -0
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rolepod/wplab",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Novamira-class WordPress operations toolkit for AI coding agents — default-safe wp-cli + REST + scoped fs, opt-in companion for execute-php + runtime introspection. MIT, rolepod ecosystem.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"model-context-protocol",
|
|
8
|
+
"wordpress",
|
|
9
|
+
"wp-cli",
|
|
10
|
+
"rolepod",
|
|
11
|
+
"ai-agents",
|
|
12
|
+
"claude-code",
|
|
13
|
+
"cursor",
|
|
14
|
+
"codex"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://github.com/nuttaruj/rolepod-wplab",
|
|
17
|
+
"bugs": "https://github.com/nuttaruj/rolepod-wplab/issues",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/nuttaruj/rolepod-wplab.git"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": {
|
|
24
|
+
"name": "nuttaruj",
|
|
25
|
+
"url": "https://github.com/nuttaruj"
|
|
26
|
+
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"bin": {
|
|
31
|
+
"rolepod-wplab": "./dist/bin/rolepod-wplab.js"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"skills",
|
|
36
|
+
".claude-plugin",
|
|
37
|
+
".cursor-plugin",
|
|
38
|
+
".codex-plugin",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE",
|
|
41
|
+
"CHANGELOG.md"
|
|
42
|
+
],
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=20"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsup",
|
|
48
|
+
"dev": "tsup --watch",
|
|
49
|
+
"test": "vitest run",
|
|
50
|
+
"test:watch": "vitest",
|
|
51
|
+
"typecheck": "tsc --noEmit",
|
|
52
|
+
"lint": "oxlint src tests/unit tests/smoke",
|
|
53
|
+
"format": "prettier --write \"src/**/*.ts\" \"tests/unit/**/*.ts\" \"tests/smoke/**/*.ts\"",
|
|
54
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"tests/unit/**/*.ts\" \"tests/smoke/**/*.ts\"",
|
|
55
|
+
"doctor": "node ./dist/bin/rolepod-wplab.js doctor",
|
|
56
|
+
"smoke": "node ./dist/bin/rolepod-wplab.js smoke",
|
|
57
|
+
"prepublishOnly": "npm run build && npm test"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
61
|
+
"execa": "^9.0.0",
|
|
62
|
+
"zod": "^3.23.0"
|
|
63
|
+
},
|
|
64
|
+
"optionalDependencies": {
|
|
65
|
+
"dockerode": "^4.0.0",
|
|
66
|
+
"node-ssh": "^13.2.0"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@types/dockerode": "^4.0.1",
|
|
70
|
+
"@types/node": "^20.14.0",
|
|
71
|
+
"oxlint": "^0.9.0",
|
|
72
|
+
"prettier": "^3.3.0",
|
|
73
|
+
"tsup": "^8.2.0",
|
|
74
|
+
"typescript": "^5.5.0",
|
|
75
|
+
"vitest": "^2.0.0"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-audit-security
|
|
3
|
+
description: Audit a WordPress target against known vulnerabilities, outdated core/plugins/themes, weak users, file-permission issues, debug flags.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Before deploying a WP site or merging WP-touching changes.
|
|
9
|
+
- After installing a third-party plugin/theme.
|
|
10
|
+
- On a regular cadence as a smoke check (CI cron job).
|
|
11
|
+
- After a security advisory drops for a major WP plugin.
|
|
12
|
+
|
|
13
|
+
## When NOT to use
|
|
14
|
+
|
|
15
|
+
- For deep penetration testing. Use specialised tools (WPScan paid feed, Burp Suite, OWASP ZAP).
|
|
16
|
+
- For runtime exploit testing — wplab audits config + version posture, not active vulnerabilities.
|
|
17
|
+
|
|
18
|
+
## Inputs
|
|
19
|
+
|
|
20
|
+
- `target_id` — connected WP target.
|
|
21
|
+
- `report_format?` — `markdown` (default, human-readable) or `json` (machine-readable for CI).
|
|
22
|
+
|
|
23
|
+
## Outputs
|
|
24
|
+
|
|
25
|
+
- `run_id`
|
|
26
|
+
- `wp_core_outdated` — boolean
|
|
27
|
+
- `outdated_plugins[]` — `{ slug, current, latest }`
|
|
28
|
+
- `outdated_themes[]` — same shape
|
|
29
|
+
- `known_vulnerable_plugins[]` — `{ slug, version, advisory_url }` (CVE lookup via public source, cached locally)
|
|
30
|
+
- `weak_admin_users[]` — `{ login, reason }` (e.g. user named "admin", easy-to-guess username)
|
|
31
|
+
- `file_permission_issues[]` — `{ path, mode, recommended }`
|
|
32
|
+
- `wp_debug_on` — boolean (WP_DEBUG=true is fine on dev, smell on prod)
|
|
33
|
+
- `report_path` — markdown/json file on disk for the full report
|
|
34
|
+
|
|
35
|
+
## Process
|
|
36
|
+
|
|
37
|
+
1. Construct `rolepod_wp_audit_security` composite input.
|
|
38
|
+
2. Call the tool — composite chains: wp core check-update, wp plugin status, wp theme status, wp user list with role filter, file stat on key paths, wp_debug detection, CVE feed lookup.
|
|
39
|
+
3. Group findings by severity (CVE matches > outdated plugins > weak users > file perms > debug flags) and surface critical ones inline in the chat.
|
|
40
|
+
4. Save full report to `./.rolepod-wplab/artifacts/<run_id>/audit-report.md` and reference path in reply.
|
|
41
|
+
|
|
42
|
+
## If the tool is unavailable
|
|
43
|
+
|
|
44
|
+
Same handling as other shipped skills.
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
User: "audit security"
|
|
50
|
+
Lead → rolepod_wp_audit_security { target_id: "tgt_8585..." }
|
|
51
|
+
Lead reply: "Found 2 critical, 3 medium issues:
|
|
52
|
+
CRITICAL: Bricks v1.8.5 has CVE-2024-XXXX (auth bypass) — upgrade to 1.9.0+
|
|
53
|
+
CRITICAL: User 'admin' exists with role administrator — rename
|
|
54
|
+
MEDIUM: 3 plugins outdated (akismet, hello, contact-form-7)
|
|
55
|
+
MEDIUM: wp-config.php is world-readable (644 → 600)
|
|
56
|
+
MEDIUM: WP_DEBUG enabled on production-matched siteurl
|
|
57
|
+
Full report: ./.rolepod-wplab/artifacts/wplab_2026.../audit-report.md"
|
|
58
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-audit-woo
|
|
3
|
+
description: Audit WooCommerce config — products, settings, shipping zones, payment gateways. Read-only.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Pre-launch checklist for a WooCommerce shop.
|
|
9
|
+
- After installing/configuring a new payment or shipping plugin.
|
|
10
|
+
- Before merging a WooCommerce-touching change.
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Deep transaction debugging (use WP debug + `/wp-introspect` for runtime state).
|
|
15
|
+
- Non-WooCommerce site (tool returns `detected: false` quickly).
|
|
16
|
+
|
|
17
|
+
## Inputs
|
|
18
|
+
|
|
19
|
+
- `target_id`.
|
|
20
|
+
- Optional: `include_recent_orders` — default 0 (privacy default).
|
|
21
|
+
|
|
22
|
+
## Outputs
|
|
23
|
+
|
|
24
|
+
- Findings consolidated from multiple `rolepod_wp_woo_read` calls per scope: settings_groups, shipping_zones, payment_gateways.
|
|
25
|
+
|
|
26
|
+
## Process
|
|
27
|
+
|
|
28
|
+
1. Detect WooCommerce active via `rolepod_wp_woo_read { scope: settings_groups }`.
|
|
29
|
+
2. Loop scopes: shipping_zones, payment_gateways, settings_groups.
|
|
30
|
+
3. Synthesize findings into a brief report. Highlight: zero shipping zones, no active payment gateway, tax not configured.
|
|
31
|
+
|
|
32
|
+
## If the tool is unavailable
|
|
33
|
+
|
|
34
|
+
WooCommerce not active on this target. Skip the audit.
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
User: "audit WooCommerce on staging"
|
|
40
|
+
Lead → rolepod_wp_woo_read { target_id, scope: "settings_groups" }
|
|
41
|
+
→ rolepod_wp_woo_read { target_id, scope: "shipping_zones" }
|
|
42
|
+
→ rolepod_wp_woo_read { target_id, scope: "payment_gateways" }
|
|
43
|
+
Lead reply: "✓ tax configured, ✓ 2 shipping zones, ⚠ only Stripe enabled (no fallback)"
|
|
44
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-edit-elementor
|
|
3
|
+
description: Read or modify Elementor page widget trees on a connected WP target via the Elementor adapter.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- User wants to inspect or modify an Elementor page structure programmatically (audit widgets, bulk-update settings, migrate between page builders).
|
|
9
|
+
- Target has Elementor active.
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Page builder is not Elementor. Use Bricks adapter (`/wp-bricks-read`) or fall back to manual edit.
|
|
14
|
+
- Manual editing in the Elementor admin is faster for one-off design changes.
|
|
15
|
+
|
|
16
|
+
## Inputs
|
|
17
|
+
|
|
18
|
+
- `target_id`, `page_id`.
|
|
19
|
+
- For reads: `rolepod_wp_elementor_read { target_id, page_id }`.
|
|
20
|
+
- For writes: `rolepod_wp_elementor_write { target_id, post_id, widget_tree, allow_destructive: true, confirm? }`.
|
|
21
|
+
|
|
22
|
+
## Outputs
|
|
23
|
+
|
|
24
|
+
- Read: `pages[] | page` (widget_tree array of nested elements).
|
|
25
|
+
- Write: `bytes_written`, `backup_path` (pre-write backup of `_elementor_data` meta).
|
|
26
|
+
|
|
27
|
+
## Process
|
|
28
|
+
|
|
29
|
+
1. Detect Elementor active on target (adapter handshake — `detected` field).
|
|
30
|
+
2. For writes: production guard fires unless `confirm: true`.
|
|
31
|
+
3. Call adapter tool.
|
|
32
|
+
4. Surface diff summary or read content.
|
|
33
|
+
|
|
34
|
+
## If the tool is unavailable
|
|
35
|
+
|
|
36
|
+
Either: Elementor not active on this target, OR write op needs companion v0.2 fs-write endpoint and companion not installed. Doctor will distinguish.
|
|
37
|
+
|
|
38
|
+
## Examples
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
User: "list Elementor pages on staging.client.com"
|
|
42
|
+
Lead → rolepod_wp_elementor_read { target_id: tgt_staging }
|
|
43
|
+
→ pages: [{ id: 7, title: "Home" }, ...]
|
|
44
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-execute-php
|
|
3
|
+
description: Run a PHP payload inside the live WordPress request lifecycle via the companion plugin. Requires companion installed + ROLEPOD_WPLAB_PROFILE=power + target not production-matched + confirm:true.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- A debugging or introspection task that genuinely needs PHP runtime context (active hooks at call time, plugin-internal cache, transients tied to current request, code paths only reachable inside `init` / `wp_loaded` / `template_redirect`).
|
|
9
|
+
- The user has installed `rolepod-wplab-companion`, set `ROLEPOD_WPLAB_PROFILE=power`, and target is not production-matched.
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Anything achievable via wp-cli or REST. Use `rolepod_wp_cli_run` / `rolepod_wp_rest_request` / a typed `wp_*` tool instead.
|
|
14
|
+
- Anything that mutates content. Use typed CRUD tools (`rolepod_wp_post_update`, etc.) so the operation is replayable + audit-trailed via tool schema.
|
|
15
|
+
- Anything on a production-matched target. Tool will refuse; do not retry with override (no override exists).
|
|
16
|
+
- When companion is not installed. Skill fails with a clear "install companion" hint.
|
|
17
|
+
|
|
18
|
+
## Requires companion?
|
|
19
|
+
|
|
20
|
+
yes — `rolepod-wplab-companion` installed on target + `ROLEPOD_WPLAB_PROFILE=power` + target not production-matched.
|
|
21
|
+
|
|
22
|
+
## Inputs
|
|
23
|
+
|
|
24
|
+
- `target_id` — connected WP target.
|
|
25
|
+
- `payload` — PHP source (no `<?php` tag). MUST pass AST screen: no `eval` / `system` / `shell_exec` / `exec` / `proc_open` / `popen` / `pcntl_*` / `dl` / backtick / dynamic include/require.
|
|
26
|
+
- `timeout_ms?` — default 5000, max 30000.
|
|
27
|
+
- `confirm: true` — REQUIRED literal. Surface the payload to the user before invoking.
|
|
28
|
+
|
|
29
|
+
## Outputs
|
|
30
|
+
|
|
31
|
+
- `ok`, `return_value`, `stdout`, `duration_ms`, `php_warnings[]`, `audit_id`.
|
|
32
|
+
|
|
33
|
+
## Process
|
|
34
|
+
|
|
35
|
+
1. Verify companion handshake + power profile + non-prod target. If any missing, abort with diagnostic — do not retry.
|
|
36
|
+
2. Show payload to user, wait for explicit confirmation.
|
|
37
|
+
3. Construct `rolepod_wp_execute_php` input with `confirm: true`.
|
|
38
|
+
4. Call tool. Surface `audit_id` + result. Log entry on disk is permanent.
|
|
39
|
+
|
|
40
|
+
## If the tool is unavailable
|
|
41
|
+
|
|
42
|
+
Cause is one of:
|
|
43
|
+
- Companion not installed → install from https://github.com/nuttaruj/rolepod-wplab-companion/releases
|
|
44
|
+
- `power` profile not set → `export ROLEPOD_WPLAB_PROFILE=power` and restart MCP
|
|
45
|
+
- Target is production-matched → intentional; no override exists. Use `/wp-scaffold-*` or wp-cli direct on production after manual review.
|
|
46
|
+
|
|
47
|
+
Run `rolepod-wplab doctor` for a full diagnostic.
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
User: "debug why 'init' hook fires twice"
|
|
53
|
+
Lead → verify companion handshake (rolepod_wp_health_check → companion_ok: true)
|
|
54
|
+
Lead → show payload: "global $wp_filter; return count($wp_filter['init']->callbacks);"
|
|
55
|
+
User confirms
|
|
56
|
+
Lead → rolepod_wp_execute_php { target_id, payload, confirm: true }
|
|
57
|
+
→ { return_value: 47, audit_id: "wplab_audit_4a2b1f" }
|
|
58
|
+
Lead reply: "47 callbacks registered on init. Audit: wplab_audit_4a2b1f."
|
|
59
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-health-check
|
|
3
|
+
description: Return a lightweight diagnostic of a WordPress target — versions, DB connectivity, REST reachability, active plugins/theme, companion presence, warnings.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- After installing rolepod-wplab to confirm a target connects.
|
|
9
|
+
- Inside `check-work` workflow to provide WP-context evidence.
|
|
10
|
+
- Before invoking other wplab tools to confirm the target is reachable.
|
|
11
|
+
- After any wp-cli / REST change to verify nothing broke.
|
|
12
|
+
|
|
13
|
+
## When NOT to use
|
|
14
|
+
|
|
15
|
+
- For deep performance profiling. Use APM tools (New Relic, Query Monitor inside WP).
|
|
16
|
+
- For security audits — use `/wp-audit-security` instead.
|
|
17
|
+
|
|
18
|
+
## Inputs
|
|
19
|
+
|
|
20
|
+
- `target_id` — connected WP target (from `rolepod_wp_connect_local` or `rolepod_wp_connect_rest`).
|
|
21
|
+
|
|
22
|
+
## Outputs
|
|
23
|
+
|
|
24
|
+
- `wp_version`, `php_version`, `db_ok`, `wp_cli_ok`, `rest_ok`, `companion_ok`, `site_url`, `warnings[]`.
|
|
25
|
+
|
|
26
|
+
## Process
|
|
27
|
+
|
|
28
|
+
1. Call `rolepod_wp_health_check { target_id }`.
|
|
29
|
+
2. Surface any `warnings[]` prominently — they often indicate misconfig the user can fix in 1 minute.
|
|
30
|
+
3. If `companion_ok=false` but the user wants power tools, hint at companion install.
|
|
31
|
+
|
|
32
|
+
## If the tool is unavailable
|
|
33
|
+
|
|
34
|
+
The rolepod-wplab MCP server is not registered or is not responding.
|
|
35
|
+
|
|
36
|
+
- Confirm the plugin is installed: `claude plugin list | grep wplab` (or analogue for Cursor / Codex / Gemini).
|
|
37
|
+
- Run `rolepod-wplab doctor` to diagnose.
|
|
38
|
+
|
|
39
|
+
Do NOT attempt the work via wp-cli direct, Novamira, or any other backend.
|
|
40
|
+
|
|
41
|
+
## Examples
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
User: "WP health"
|
|
45
|
+
Lead → rolepod_wp_health_check { target_id: "tgt_8585f975d001" }
|
|
46
|
+
Lead reply: "WP 6.6.2 / PHP 8.2.10
|
|
47
|
+
✓ db_ok, wp_cli_ok, rest_ok
|
|
48
|
+
✗ companion_ok=false (install companion for power tools)
|
|
49
|
+
warnings: REST check deferred to v0.1"
|
|
50
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-introspect
|
|
3
|
+
description: Snapshot WordPress runtime context (hooks, transients, options, request state) via the companion endpoint. Read-only, no eval.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Debugging "why isn't this hook firing?" / "what's in this transient right now?"
|
|
9
|
+
- Auditing plugin behavior without modifying state.
|
|
10
|
+
- Before invoking `/wp-execute-php` to verify the runtime is in the expected state.
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- For data you can get from wp-cli (`wp option get`, `wp transient get`). Use those — faster, no companion required.
|
|
15
|
+
- For mutation. Use a typed write tool instead.
|
|
16
|
+
|
|
17
|
+
## Requires companion?
|
|
18
|
+
|
|
19
|
+
yes — `rolepod-wplab-companion` installed on target.
|
|
20
|
+
|
|
21
|
+
## Inputs
|
|
22
|
+
|
|
23
|
+
- `target_id`.
|
|
24
|
+
- `scope` — `hooks` | `transients` | `options_full` | `request_state`.
|
|
25
|
+
- `include_values?` — only effective on non-prod targets (default false).
|
|
26
|
+
|
|
27
|
+
## Outputs
|
|
28
|
+
|
|
29
|
+
- `scope`, `report` (shape varies by scope).
|
|
30
|
+
|
|
31
|
+
## Process
|
|
32
|
+
|
|
33
|
+
1. Verify companion handshake.
|
|
34
|
+
2. Call `rolepod_wp_introspect { target_id, scope }`.
|
|
35
|
+
3. Surface key findings inline; if `report` is large, save to disk and reference path.
|
|
36
|
+
|
|
37
|
+
## If the tool is unavailable
|
|
38
|
+
|
|
39
|
+
Companion not installed; install from companion releases page. Same flow as `/wp-execute-php`.
|
|
40
|
+
|
|
41
|
+
## Examples
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
User: "what hooks fire on init?"
|
|
45
|
+
Lead → rolepod_wp_hook_state { target_id, hook: "init" }
|
|
46
|
+
→ callbacks: [{ priority: 10, callback_identifier: "..." }, ...]
|
|
47
|
+
Lead reply: "47 callbacks on init, top 5 by priority: ..."
|
|
48
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-migrate-dryrun
|
|
3
|
+
description: Compute a migration plan between two WP targets without applying any changes. Useful for diffing dev → staging → prod.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Plan a migration between environments (e.g. staging → prod) without committing changes.
|
|
9
|
+
- Pre-deploy diff to surface plugin version mismatches, missing options, role drift.
|
|
10
|
+
- Sanity-check that two environments are aligned after a refactor.
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- One-way data sync (use a dedicated migration plugin like WP Migrate / Duplicator for actual data transfer).
|
|
15
|
+
- Tiny single-table copy (use `rolepod_wp_db_query` directly).
|
|
16
|
+
|
|
17
|
+
## Inputs
|
|
18
|
+
|
|
19
|
+
- `source_target_id` — connected source target.
|
|
20
|
+
- `dest_target_id` — connected destination target.
|
|
21
|
+
- `scope[]` — any of: `plugin_versions`, `options`, `users`, `posts`. Default: `[plugin_versions]`.
|
|
22
|
+
|
|
23
|
+
## Outputs
|
|
24
|
+
|
|
25
|
+
- `plan` — structured diff per scope.
|
|
26
|
+
- `plan_path` — markdown/json artifact under `./.rolepod-wplab/artifacts/<run_id>/migration-plan.json`.
|
|
27
|
+
|
|
28
|
+
## Process
|
|
29
|
+
|
|
30
|
+
1. Verify both targets are connected (call `rolepod_wp_health_check` on each).
|
|
31
|
+
2. Call `rolepod_wp_migrate_dryrun { source_target_id, dest_target_id, scope }`.
|
|
32
|
+
3. Surface key diffs inline (e.g. "5 plugin version mismatches, 12 options only on source").
|
|
33
|
+
4. Reference plan_path for full detail.
|
|
34
|
+
|
|
35
|
+
## If the tool is unavailable
|
|
36
|
+
|
|
37
|
+
Same handling as other shipped skills.
|
|
38
|
+
|
|
39
|
+
## Examples
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
User: "diff dev vs staging"
|
|
43
|
+
Lead → rolepod_wp_connect_local { path: "..." } (already connected)
|
|
44
|
+
Lead → rolepod_wp_connect_rest { url: "https://staging.client.com" }
|
|
45
|
+
Lead → rolepod_wp_migrate_dryrun { source_target_id, dest_target_id, scope: ["plugin_versions","users"] }
|
|
46
|
+
→ plan_path: "./.rolepod-wplab/artifacts/wplab_.../migration-plan.json"
|
|
47
|
+
Lead reply: "Plugin diff: WooCommerce on dev 9.4, staging 9.2 — upgrade staging first. Users: 1 admin on dev not on staging."
|
|
48
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-pair-setup
|
|
3
|
+
description: One-click WordPress pairing using a companion-issued pair_token. Trade the token for a real Application Password and open a Target without the user typing credentials.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- The user pastes a "rolepod-wplab one-click pair" prompt (generated by Tools → WPLab Setup on their WordPress site).
|
|
9
|
+
- The user pastes a `pair_token` string that looks like `wplab_pair_<48 hex>` and asks you to connect.
|
|
10
|
+
- After a fresh plugin install when the user says "connect to my site" and you have no stored credentials yet — ask them to open Tools → WPLab Setup → Generate setup prompt → paste the result here.
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- The user already has stored credentials for the site (use `rolepod_wp_connect_rest` directly).
|
|
15
|
+
- The user is on a CLI without the wplab plugin installed AND without a way to install it — fall back to manual setup via `rolepod-wplab init` (see `wp-health-check` for the manual path).
|
|
16
|
+
- The token is older than 60 minutes or has been used once already — it WILL fail. Ask the user to generate a fresh one.
|
|
17
|
+
|
|
18
|
+
## Inputs
|
|
19
|
+
|
|
20
|
+
- `siteurl` — full https:// URL of the target WordPress site.
|
|
21
|
+
- `pair_token` — single-use token matching `wplab_pair_[a-f0-9]{48}` issued by the companion.
|
|
22
|
+
|
|
23
|
+
## Outputs
|
|
24
|
+
|
|
25
|
+
- `target_id` — pass this to every subsequent `rolepod_wp_*` tool.
|
|
26
|
+
- `siteurl`, `username`, `capabilities[]`, `companion_version`, `is_production`, `app_password_name`, `credential_stored`.
|
|
27
|
+
|
|
28
|
+
## Process
|
|
29
|
+
|
|
30
|
+
1. Call `rolepod_wp_pair { siteurl, pair_token }`.
|
|
31
|
+
2. The MCP POSTs `/wp-json/wplab/v1/pair/redeem` to the companion (https-only, pair token is the auth). The companion atomically deletes the token (single-use), mints a WP Application Password under the issuing admin user (named `wplab-pair-<timestamp>`), and returns it.
|
|
32
|
+
3. The MCP stores the credential in the local vault (OS keychain when available) so subsequent sessions reconnect without re-pairing.
|
|
33
|
+
4. The MCP opens a `RestTarget` and registers it — `target_id` is returned.
|
|
34
|
+
5. Immediately call `rolepod_wp_health_check { target_id }` to confirm `db_ok`, `rest_ok`, `companion_ok` are all true.
|
|
35
|
+
6. Report back to the user: site connected, capabilities discovered, App Password name (so they can revoke it later from `profile.php` if needed).
|
|
36
|
+
|
|
37
|
+
## Failure modes
|
|
38
|
+
|
|
39
|
+
- `PAIR_REDEEM_INVALID` — token unknown / expired / already used. Ask the user to regenerate from Tools → WPLab Setup.
|
|
40
|
+
- `PAIR_REDEEM_THROTTLED` — too many failed redeems from your IP in the last hour. Wait or use manual setup.
|
|
41
|
+
- `PAIR_REDEEM_TIMEOUT` / `PAIR_REDEEM_NETWORK` — companion unreachable. Check `siteurl` typo + firewall + companion `endpoints_enabled` toggle.
|
|
42
|
+
- `PAIR_REDEEM_USER_GONE` — admin who issued the token lost `manage_options` between issue and redeem (rare).
|
|
43
|
+
- `PAIR_REDEEM_APP_PASSWORD_FAILED` — WP's `WP_Application_Passwords::create_new_application_password` rejected the create (very rare; check WP_DEBUG log).
|
|
44
|
+
|
|
45
|
+
## Security notes (DO NOT skip)
|
|
46
|
+
|
|
47
|
+
- `pair_token` is **App-Password-equivalent for 60 min**. Treat it as a secret.
|
|
48
|
+
- Never echo the token in chat logs after redeem. After step 1 it is one-time consumed anyway.
|
|
49
|
+
- The minted Application Password is stored locally only (vault). Never paste it into a chat or push to git.
|
|
50
|
+
- The user can revoke at any time via `profile.php#application-passwords-section` — name pattern `wplab-pair-<timestamp>`.
|
|
51
|
+
|
|
52
|
+
## If the tool is unavailable
|
|
53
|
+
|
|
54
|
+
The rolepod-wplab MCP is not registered. The user must install the wplab CLI plugin first:
|
|
55
|
+
|
|
56
|
+
- Claude Code: `/plugin install nuttaruj/rolepod-wplab`
|
|
57
|
+
- Cursor / Codex / Gemini: add an MCP server entry → `npx -y @rolepod/wplab serve` (see the prompt from Tools → WPLab Setup for exact syntax per CLI).
|
|
58
|
+
|
|
59
|
+
Do NOT attempt the pair via raw HTTP or curl from the user's machine. The MCP needs to receive the App Password so future sessions reconnect cleanly.
|
|
60
|
+
|
|
61
|
+
## Example
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
User: [pastes pair prompt with token wplab_pair_a1b2c3...]
|
|
65
|
+
|
|
66
|
+
Lead → rolepod_wp_pair {
|
|
67
|
+
siteurl: "https://walnutztudio.com",
|
|
68
|
+
pair_token: "wplab_pair_a1b2c3..."
|
|
69
|
+
}
|
|
70
|
+
→ { target_id: "tgt_8585f975d001", username: "admin", capabilities: [...] }
|
|
71
|
+
|
|
72
|
+
Lead → rolepod_wp_health_check { target_id: "tgt_8585f975d001" }
|
|
73
|
+
→ db_ok:true, rest_ok:true, companion_ok:true
|
|
74
|
+
|
|
75
|
+
Lead reply: "Paired ✓ walnutztudio.com (admin). Companion v1.2.0 — full power tools
|
|
76
|
+
available. App Password name: wplab-pair-20260526T000123 (revocable
|
|
77
|
+
from profile.php → Application Passwords)."
|
|
78
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-scaffold-block
|
|
3
|
+
description: Generate a Gutenberg block (PHP register + JS + CSS + block.json) into an existing WordPress plugin or theme on a connected target.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- User asks to create a new Gutenberg block.
|
|
9
|
+
- A target WordPress install is connected.
|
|
10
|
+
- A destination plugin slug or theme slug is identified.
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Editing an existing block. Use `rolepod_wp_file_write` directly with the specific file.
|
|
15
|
+
- Creating a non-Gutenberg widget. Use `wp_scaffold_plugin` with `features: ['admin_page']` instead.
|
|
16
|
+
- The destination plugin/theme doesn't exist yet. First run `/wp-scaffold-plugin` then come back.
|
|
17
|
+
|
|
18
|
+
## Inputs
|
|
19
|
+
|
|
20
|
+
- `target_id` — connected WP target.
|
|
21
|
+
- `destination` — `{ plugin_slug: string }` or `{ theme_slug: string }`.
|
|
22
|
+
- `block.slug` — namespaced, e.g. `my-team/testimonial`.
|
|
23
|
+
- `block.title`, `block.description?`, `block.category?`, `block.icon?`.
|
|
24
|
+
- `block.attributes?` — schema for block attributes.
|
|
25
|
+
- `block.supports?` — Gutenberg `supports` object.
|
|
26
|
+
- `render_strategy` — `dynamic` (PHP render callback) or `static` (save() output).
|
|
27
|
+
- `scaffold_test?` — if true, also generate a Playwright Test scaffold for rolepod-uiproof to run.
|
|
28
|
+
|
|
29
|
+
## Outputs
|
|
30
|
+
|
|
31
|
+
- `run_id`, `files_written[]`, `files_modified[]`, `test_file?`, `next_steps[]`.
|
|
32
|
+
|
|
33
|
+
## Process
|
|
34
|
+
|
|
35
|
+
1. Confirm the destination plugin/theme exists on the target — call `rolepod_wp_cli_run { args: ['plugin', 'is-installed', '<slug>'] }` if plugin_slug given.
|
|
36
|
+
2. Construct `rolepod_wp_scaffold_block` input from user intent (composite tool — lands v0.1+).
|
|
37
|
+
3. Call the tool.
|
|
38
|
+
4. Surface `next_steps[]` to the user — usually one of: activate parent plugin, rebuild block.json, run `wp cache flush`.
|
|
39
|
+
|
|
40
|
+
## If the tool is unavailable
|
|
41
|
+
|
|
42
|
+
The rolepod-wplab MCP server is not registered or is not responding. Run `rolepod-wplab doctor`.
|
|
43
|
+
|
|
44
|
+
Do NOT attempt to hand-write block files via raw `rolepod_wp_file_write` — the composite handles asset registration, dependency tracking, and test scaffolding consistently.
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
User: "/wp-scaffold-block testimonial card into my-team plugin, dynamic render"
|
|
50
|
+
Lead → rolepod_wp_scaffold_block {
|
|
51
|
+
target_id: "tgt_8585...",
|
|
52
|
+
destination: { plugin_slug: "my-team" },
|
|
53
|
+
block: { slug: "my-team/testimonial-card", title: "Testimonial Card", category: "design" },
|
|
54
|
+
render_strategy: "dynamic"
|
|
55
|
+
}
|
|
56
|
+
Lead reply: "Generated 4 files under wp-content/plugins/my-team/blocks/testimonial-card/
|
|
57
|
+
Next steps:
|
|
58
|
+
1. cd wp-content/plugins/my-team && npm run build
|
|
59
|
+
2. wp cache flush
|
|
60
|
+
3. Refresh editor — block appears in 'Design' category"
|
|
61
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-scaffold-plugin
|
|
3
|
+
description: Bootstrap a new WordPress plugin skeleton with optional REST endpoint, admin page, Gutenberg block, or WP-CLI command on a connected target.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Starting a brand new WP plugin.
|
|
9
|
+
- A target WP install is connected.
|
|
10
|
+
- User can name the plugin (slug + display name).
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Adding features to an existing plugin. Use `rolepod_wp_file_write` or `/wp-scaffold-block` instead.
|
|
15
|
+
- Scaffolding a theme — use a theme generator (out of v0.1 scope; lands v0.2 as `/wp-scaffold-theme`).
|
|
16
|
+
|
|
17
|
+
## Inputs
|
|
18
|
+
|
|
19
|
+
- `target_id`.
|
|
20
|
+
- `slug` — folder/textdomain slug, lowercase-with-dashes (e.g. `my-team-tools`).
|
|
21
|
+
- `name` — human-readable plugin name (e.g. `My Team Tools`).
|
|
22
|
+
- `description?` — one-sentence plugin description.
|
|
23
|
+
- `author?` — author name + url.
|
|
24
|
+
- `features[]?` — any of: `rest_endpoint`, `admin_page`, `gutenberg_block`, `cli_command`.
|
|
25
|
+
|
|
26
|
+
## Outputs
|
|
27
|
+
|
|
28
|
+
- `run_id`, `plugin_path`, `files_written[]`, `activate_command`.
|
|
29
|
+
|
|
30
|
+
## Process
|
|
31
|
+
|
|
32
|
+
1. Call `rolepod_wp_scaffold_plugin` with constructed input.
|
|
33
|
+
2. Surface `activate_command` so user can run it via wp-cli (or wplab does it automatically when `allow_destructive=true`).
|
|
34
|
+
3. Suggest follow-up: `/wp-health-check` to verify activation succeeded.
|
|
35
|
+
|
|
36
|
+
## If the tool is unavailable
|
|
37
|
+
|
|
38
|
+
Same handling as other shipped skills.
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
User: "/wp-scaffold-plugin my-team-tools with REST endpoint + admin page"
|
|
44
|
+
Lead → rolepod_wp_scaffold_plugin {
|
|
45
|
+
target_id: "tgt_8585...",
|
|
46
|
+
slug: "my-team-tools",
|
|
47
|
+
name: "My Team Tools",
|
|
48
|
+
features: ["rest_endpoint", "admin_page"]
|
|
49
|
+
}
|
|
50
|
+
Lead reply: "Created wp-content/plugins/my-team-tools/ (7 files)
|
|
51
|
+
Activate: wp --path=... plugin activate my-team-tools
|
|
52
|
+
REST endpoint stub: /wp-json/my-team-tools/v1/ping"
|
|
53
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-scaffold-theme
|
|
3
|
+
description: Bootstrap a minimum-viable WordPress block-theme skeleton (style.css + theme.json + functions.php + templates) on a connected target.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Starting a brand-new block-theme.
|
|
9
|
+
- A target WP install is connected.
|
|
10
|
+
- User can name the theme (slug + display name).
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Adding features to an existing theme. Use `rolepod_wp_file_write` for targeted edits.
|
|
15
|
+
- Customizing an existing block theme via theme.json — use `wp_file_write` on theme.json directly.
|
|
16
|
+
|
|
17
|
+
## Inputs
|
|
18
|
+
|
|
19
|
+
- `target_id`, `slug`, `name`, `description?`, `author?`.
|
|
20
|
+
- `allow_destructive: true` required (creates files on target).
|
|
21
|
+
|
|
22
|
+
## Outputs
|
|
23
|
+
|
|
24
|
+
- `theme_path`, `files_written[]`, `activate_command`.
|
|
25
|
+
|
|
26
|
+
## Process
|
|
27
|
+
|
|
28
|
+
1. Call `rolepod_wp_scaffold_theme` with constructed input.
|
|
29
|
+
2. Surface `activate_command` so user can switch themes.
|
|
30
|
+
3. Suggest follow-up: `/wp-health-check` to verify theme activates without errors.
|
|
31
|
+
|
|
32
|
+
## If the tool is unavailable
|
|
33
|
+
|
|
34
|
+
Same handling as other shipped skills.
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
User: "/wp-scaffold-theme my-team-blog"
|
|
40
|
+
Lead → rolepod_wp_scaffold_theme { target_id, slug: "my-team-blog", name: "My Team Blog", allow_destructive: true }
|
|
41
|
+
→ 6 files under wp-content/themes/my-team-blog/
|
|
42
|
+
Lead reply: "Theme scaffolded. Activate: wp theme activate my-team-blog"
|
|
43
|
+
```
|