/rolepod-wplab:wp-edit-themefrom rolepod-wplab
Read or modify theme-level config on a connected target — theme files (functions.php, templates, style.css), theme.json, Site Editor global-styles, child themes, and theme switches. Phase = Build.
Ships in rolepod-wplab. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
If the marker file $GIT_ROOT/.rolepod/parent-active exists, follow the
with-rolepod mode — return the edit diff only. The parent's
implement-plan owns verify + review; do not re-run them here.
Otherwise, follow standalone mode — edit + impact analysis + verification suggestion in one flow.
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) || GIT_ROOT="$PWD"
if [ -f "$GIT_ROOT/.rolepod/parent-active" ]; then
MODE=with-rolepod
else
MODE=standalone
fi
Theme-level writes — the highest-risk surface in WordPress (bad PHP in functions.php = White Screen of Death; bad JSON in theme.json = Site Editor white-page in editor). This skill enforces child-theme-first, pre-write validation, snapshot-before-switch, and atomic session grouping so the user can revert any combination.
Skip when:
wp-edit-design.wp-scaffold.wp-edit-plugin.wp-content.Owns:
rolepod_wp_child_theme_create — scaffold child theme of a parent.rolepod_wp_theme_switch_safe — snapshot + activate + auto-rollback on red.rolepod_wp_theme_snapshot — manual snapshot for risky multi-file edits.rolepod_wp_theme_restore — restore from snapshot.rolepod_wp_file_write against wp-content/themes/<slug>/** — theme files (functions.php, style.css, templates, parts, patterns, theme.json).rolepod_wp_rest_request POST /wp/v2/global-styles/<id> — Site Editor user customizations (auto-ledgered + cache-flushed).Does not own:
wp-edit-design.wp-scaffold.wp-edit-plugin.Return / hand off:
wp-edit-design for any layout-side adjustments.wp-edit-design.wp-content/themes/<slug>/./wp/v2/global-styles/themes/<stylesheet>).| User intent | Tool |
|---|---|
| edit theme file | rolepod_wp_file_write |
| edit theme.json | rolepod_wp_file_write (path ends theme.json → auto cache flush after) |
| edit global styles | rolepod_wp_rest_request POST /wp/v2/global-styles/<id> (auto-ledger + cache flush) |
| create child theme | rolepod_wp_child_theme_create |
| snapshot theme | rolepod_wp_theme_snapshot |
| restore theme | rolepod_wp_theme_restore |
| switch active theme | rolepod_wp_theme_switch_safe |
For multi-file work (e.g. add a feature that touches functions.php + template + theme.json):
1. rolepod_wp_session_start { label: "add-product-banner" }
→ returns session_id, sets env so all writes auto-group
2. ...file_write calls...
3. If anything goes wrong:
rolepod_wp_changes_query { source_session: <id> } → see all writes
rolepod_wp_changes_toggle_bulk { ids: <all>, applied: false } → atomic revert
If editing an installed parent theme (e.g. Twenty Twenty-Five, Astra, Kadence), default to:
1. rolepod_wp_child_theme_create { parent_slug, child_slug: "<parent>-rolepod" }
2. rolepod_wp_theme_switch_safe { new_stylesheet: "<child>" }
3. file_write into the child dir
Only edit parent directly if user is the theme AUTHOR (uncommon).
Validators run automatically inside file_write:
.php files → companion runs php -l server-side. Reject on syntax error with line + message..json files → MCP runs JSON.parse client-side. Reject on parse error.If validation throws, do NOT retry the same content. Read the error, fix the payload.
wp-health-check after every theme file edit.GET /wp/v2/global-styles/<id> to confirm the new theme.json keys resolve.rolepod:rolepod-builder for theme.json palette / typography decisions.rolepod:rolepod-reviewer with lens: ui for accessibility audit.rolepod:rolepod-builder for template + functions.php logic.rolepod:rolepod-builder for complex callbacks in functions.php.wp-changes (or auto-rollback for theme switch).No durable artifact per call. The Change Ledger row IS the rollback artifact. For theme switches, the .tar.gz snapshot at wp-content/uploads/rolepod-wp-theme-snapshots/ is the canonical restore source.
Read EVERY time before first parent-theme edit on a target — the child-theme-first pattern is in here:
examples/theme-examples.md — good vs bad functions.php edit; good vs bad theme switch; good vs bad theme.json palette change.Load when:
references/theme-json-schema.md — block-theme config shape, common pitfalls (preset prefix var:preset|color|<slug>, slug vs name collisions, custom property emission).references/template-hierarchy.md — single vs archive vs front-page, when override fires.PHP_SYNTAX_ERROR → STOP, surface line + message; do not retry with same content.wp_theme_switch_safe returns rolled_back: true → STOP, the new theme broke the frontend; investigate the new theme (or its required plugins) before retrying.wp_child_theme_create returns CHILD_THEME_ALREADY_EXISTS → STOP, ask the user whether to delete the existing child first OR pick a different slug.Full Rolepod adds a "design system" group: theme.json + global-styles + custom CSS + font registrations all tagged with the same source_session, revertable as one atomic operation. Standalone, the user runs rolepod_wp_session_start manually for the same grouping.
wp-edit-design to update any builder layouts that depend on the new tokens.wp-health-check + spot-check 3 user-visible URLs.wp-changes to toggle off the recent writes; restored snapshot is in wp-content/uploads/rolepod-wp-theme-snapshots/.What SKILL.md sets; muted values are Claude Code's defaults
user wants to "edit theme / change theme files / make a child theme / set theme.json palette / edit global styles / switch active theme", OR a hook callback needs to live in a theme rather than a custom plugin
npx claudepluginhub nuttaruj/rolepod-wplab --plugin rolepod-wplab15 skills in this plugin
/wp-changesQuery the AI Change Ledger on a connected target — the writes the MCP recorded through the companion (RestTarget only), categorized; toggle on/off; panic-revert recent changes. Phase = Recovery./wp-connectOpen a WordPress Target on any kind (local / REST + App Password / SSH / Docker) using credentials already in the vault. Phase = Define./wp-contentCreate, read, update, search posts/pages/users/options/taxonomies via the core WP REST API on a connected target. Phase = Build./wp-diagnoseMulti-probe diagnostic + security audit of a connected target — plugin conflicts, slow queries, large autoload options, broken images, PHP errors, outdated core/plugins/themes, weak admins. Phase = Debug.