Files
wordvibe-hermes/skills/wordvibe-sites/SKILL.md
T
admin 6eeb8b9087 feat: add wordvibe_build_page (Word Page Builder over MCP)
Wraps the site tool wpb_build_page: build or update a Word Page from {kind, html} sections. The page lands as a native Word Page (payload in post meta, builder-rendered), so it stays editable and undoable in the builder. Also documents the builder tools in the bundled skill and README.
2026-09-22 01:59:54 +03:00

77 lines
4.4 KiB
Markdown

---
name: wordvibe-sites
description: "Use when driving a WordPress site through the WordVibe plugin (wordvibe_* tools). Covers site selection, read-before-write, snapshots/rollback, and which site tools to reach for."
version: 1.0.0
author: WordVibe
license: MIT
metadata:
hermes:
tags: [wordpress, wordvibe, mcp, files, agents]
---
# Driving WordPress with the wordvibe_* tools
The `wordvibe_*` tools talk to the MCP server inside the **WordVibe** WordPress plugin. One
configured site is the default; when several are configured, pass `site` (name or URL).
## Order of operations
1. `wordvibe_sites(probe=true)` — confirm the site(s) and that MCP is reachable.
2. `wordvibe_site_info` — WordPress version, active theme, plugin count, WordVibe plugin version.
3. `wordvibe_tools` — the catalogue. Filter it (`filter="post"`, `filter="security"`) when hunting.
4. Do the work with the wrappers, or `wordvibe_call` for anything without a wrapper.
## Rules that keep you out of trouble
- **Read before write.** `wordvibe_read_file` first, then `wordvibe_edit_file` (targeted
`search``replace`) rather than `wordvibe_write_file` (full overwrite). Read again after a batch
of edits.
- **Snapshots exist.** Every save on the site captures the previous version. If you break something,
`wordvibe_call` with `rollback_list`, then `rollback_restore`. Say so to the user instead of
improvising a fix.
- **`db_query` is SELECT-only**; `db_mutate` and `php_eval` are blocked over MCP by design. If a task
truly needs SQL writes or code execution, tell the user it has to be done in the site's own UI.
- **`cli_exec` runs WP-CLI** on the site (`wp plugin list`, `wp post list …`). Prefer the dedicated
tools (`plugin_list`, `post_list`) — they return structured output.
- **Never invent paths.** `list_directory` and `file_search` (or `wordvibe_search`) resolve the real
layout; `get_file_info` confirms a file exists.
- **Writes are live.** They hit a production site. Before a destructive or wide change, state what
you're about to change and why, and keep the change minimal.
## Common tasks → tools
| Task | Call |
|---|---|
| Find code | `wordvibe_search(query="add_filter", include="*.php")` |
| Inspect a plugin | `wordvibe_call(tool="plugin_list")`, then `list_directory path="wp-content/plugins/<slug>"` |
| Read/update a post | `wordvibe_call(tool="post_list")``wordvibe_call(tool="get_post")``update_post` |
| Database lookups | `wordvibe_call(tool="db_query", arguments={"sql":"SELECT COUNT(*) FROM wp_posts"})` |
| Security sweep | `wordvibe_call(tool="security_scan_installed")` |
| Roll back an edit | `wordvibe_call(tool="rollback_list")``rollback_restore` |
| Build a page | `wordvibe_build_page(title=…, sections=[{kind, html}], status="publish")` |
| Site basics | `wordvibe_call(tool="site_info")`, `theme_list`, `plugin_list` |
## Building pages (Word Page Builder)
`wordvibe_build_page` creates or updates a **Word Page** — a page the site's Word Page Builder owns and
renders from its own stored payload, so it opens natively in the builder (edit, undo, redo all work).
- One call builds the whole page: `title`, `sections: [{kind, html}]`, optional `slug`, `status`, `post_id`.
- Section kinds: `hero`, `features`, `pricing`, `testimonials`, `faq`, `cta`, `footer`, `gallery`,
`contact`, `about`, `services`, `custom`. Each becomes `<section data-wpb-section="kind" data-wpb-id="sec-…">`.
- Write inline styles rather than inventing class names — the builder preserves what you give it, but
the site's stylesheet won't contain classes that don't exist.
- Editing an existing page: `wordvibe_tools(filter="wpb")` lists the builder tools, then use
`wordvibe_call` with `wpb_get_page` / `wpb_get_page_full`, `wpb_replace_section_html`,
`wpb_add_section_to_page`, `wpb_delete_section`, `wpb_generate_page` (AI), `wpb_chat_edit_page` (AI, one
instruction per call), `wpb_list_pages`.
- Needs the page builder present in the site's build (WordVibe 1.0.x cloud/ide). Where it was stripped,
the tools answer "The Word Page Builder is not available in this build of the plugin." — say so instead
of faking it with a plain page.
## Multi-site
With `WORDVIBE_MCP_SITES` configured, name the target explicitly on every call — do not let a default
silently decide which client's site you just wrote to. When the user says "my site" and more than one
is configured, ask which one before writing anything.