From 7c89d6bc3becf9b41bd4db62747a3924d5aa4e0d Mon Sep 17 00:00:00 2001 From: Ben Kalsky Date: Mon, 1 Jun 2026 23:36:25 +0300 Subject: [PATCH] feat: Claude Code install path + requirements.txt (v3.5.0) The skill was OpenClaw-only. Add a Claude Code installation path so the same payload runs in Claude Code, plus an explicit dependency manifest. - INSTALL.sh: copies the payload into ~/.claude/skills/wordpress-api-pro/ so Claude Code auto-discovers it (idempotent; prompts before overwrite; reports whether `requests` is available). SKILL.md frontmatter already carries the name+description Claude Code needs. - wordpress-api-pro/requirements.txt: `requests`, needed only by the ACF / SEO / JetEngine / plugin-detection scripts. Core post/page/media/WooCommerce/batch scripts stay stdlib-only. - README: "Via Claude Code" install section + Elementor MCP kit pairing note. - SKILL.md: "Running in Claude Code" section (auth, deps, local-dev sites). - Bump to 3.5.0; ship INSTALL.sh + requirements.txt in package files; CHANGELOG. Verified: `bash -n INSTALL.sh`, package.json valid, `npm test` passes (compileall + batch dry-run), installer smoke-run lands the skill at ~/.claude/skills/wordpress-api-pro/ with SKILL.md v3.5.0. Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 9 +++ INSTALL.sh | 93 ++++++++++++++++++++++++++++++ README.md | 16 ++++- package.json | 4 +- wordpress-api-pro/SKILL.md | 13 ++++- wordpress-api-pro/requirements.txt | 5 ++ 6 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 INSTALL.sh create mode 100644 wordpress-api-pro/requirements.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 592276d..425929f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 3.5.0 - 2026-06-01 + +Claude Code support. + +- Added `INSTALL.sh` to install the skill into `~/.claude/skills/wordpress-api-pro/` for [Claude Code](https://claude.ai/download), alongside the existing OpenClaw path. +- Added `wordpress-api-pro/requirements.txt` (`requests`) — needed only by the ACF / SEO / JetEngine / plugin-detection scripts; the core scripts remain stdlib-only. +- Documented the Claude Code workflow in `README.md` and `SKILL.md`, including local-dev sites and pairing with the Elementor MCP kit. +- Packaging: shipped `INSTALL.sh` + `requirements.txt`, bumped version to `3.5.0`. + ## 3.4.0 - 2026-05-05 Security and packaging cleanup for ClawHub publication. diff --git a/INSTALL.sh b/INSTALL.sh new file mode 100644 index 0000000..01d704a --- /dev/null +++ b/INSTALL.sh @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +# ============================================================================= +# WordPress API Pro — Claude Code Installer (Mac / Linux) +# +# Copies the skill payload into ~/.claude/skills/wordpress-api-pro/ so Claude +# Code discovers it automatically. The same payload also works as an OpenClaw +# skill (see README) — this installer only wires up the Claude Code path. +# +# Safe to re-run (asks before overwriting an existing install). +# ============================================================================= + +set -euo pipefail + +BOLD=$'\033[1m'; GREEN=$'\033[32m'; CYAN=$'\033[36m'; YELLOW=$'\033[33m' +RED=$'\033[31m'; DIM=$'\033[2m'; RESET=$'\033[0m' + +ok() { printf " ${GREEN}✓${RESET} %s\n" "$*"; } +warn() { printf " ${YELLOW}⚠${RESET} %s\n" "$*"; } +fail() { printf " ${RED}✗${RESET} %s\n" "$*"; } +step() { printf "\n${BOLD}${CYAN}▸ %s${RESET}\n" "$*"; } + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SRC="$HERE/wordpress-api-pro" + +[ -d "$SRC" ] || { fail "Cannot find $SRC — run this from the repo root."; exit 1; } +[ -f "$SRC/SKILL.md" ] || { fail "Missing SKILL.md in $SRC."; exit 1; } + +cat <<'BANNER' + + ╭───────────────────────────────────────────────╮ + │ WordPress API Pro — Claude Code Installer │ + │ ───────────────────────────────────── │ + │ Installs the skill into ~/.claude/skills/ │ + │ so Claude Code can find and run it. │ + ╰───────────────────────────────────────────────╯ + +BANNER + +DEST="$HOME/.claude/skills/wordpress-api-pro" + +step "Installing to $DEST" +if [ -d "$DEST" ]; then + warn "An install already exists at $DEST" + printf " Overwrite? [y/N] " + read -r ans + if [[ ! "$ans" =~ ^[Yy]$ ]]; then + warn "Left existing install untouched. Nothing changed." + exit 0 + fi + rm -rf "$DEST" +fi + +mkdir -p "$DEST" +# Copy the payload contents (SKILL.md, scripts/, references/, config/, wp.sh, +# requirements.txt) to the skill root so relative `scripts/*.py` paths resolve. +cp -R "$SRC"/. "$DEST"/ +chmod +x "$DEST/wp.sh" 2>/dev/null || true +ok "Installed skill payload" + +step "Python dependency (optional)" +printf " ${DIM}The ACF / SEO / JetEngine / plugin-detection scripts need 'requests'.\n The core post/page/media/WooCommerce/batch scripts use the stdlib only.${RESET}\n" +if python3 -c "import requests" >/dev/null 2>&1; then + ok "'requests' already available" +else + warn "'requests' not installed. Install it when you need the plugin scripts:" + printf " ${CYAN}python3 -m pip install -r \"$DEST/requirements.txt\"${RESET}\n" + printf " ${DIM}(or use a venv: python3 -m venv .venv && .venv/bin/pip install -r requirements.txt)${RESET}\n" +fi + +cat < Pairs well with the [Elementor MCP kit](https://github.com/Digitizers/claude-elementor-pro): build pages with the MCP, then handle media uploads, SEO meta, custom fields, and WooCommerce with these scripts. + ## Quick Start ### Option A: Multi-Site Setup — recommended for 2+ sites ⭐ diff --git a/package.json b/package.json index 48c91b8..858146d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wordpress-api-pro", - "version": "3.4.0", + "version": "3.5.0", "description": "WordPress REST API integration skill for OpenClaw - manage posts, pages, media, WooCommerce, Elementor, and metadata with explicit safety boundaries", "private": true, "main": "wordpress-api-pro/SKILL.md", @@ -53,6 +53,8 @@ "wordpress-api-pro/references/**/*.md", "wordpress-api-pro/scripts/**/*.py", "wordpress-api-pro/wp.sh", + "wordpress-api-pro/requirements.txt", + "INSTALL.sh", "README.md", "CHANGELOG.md", "LICENSE.txt" diff --git a/wordpress-api-pro/SKILL.md b/wordpress-api-pro/SKILL.md index 3188bfa..b64cc33 100644 --- a/wordpress-api-pro/SKILL.md +++ b/wordpress-api-pro/SKILL.md @@ -1,6 +1,6 @@ --- name: wordpress-api-pro -version: 3.4.0 +version: 3.5.0 license: MIT-0 description: | WordPress REST API integration for managing posts, pages, media, WooCommerce products, Elementor content, SEO meta, ACF, and JetEngine fields. @@ -11,7 +11,16 @@ description: | # WordPress API Pro -Manage WordPress sites through the REST API from an OpenClaw skill. +Manage WordPress sites through the REST API. Runs as an OpenClaw skill or in Claude Code. + +## Running in Claude Code + +This skill runs the `scripts/*.py` directly. From the skill directory (`~/.claude/skills/wordpress-api-pro/` after `bash INSTALL.sh`): + +- **Auth:** export `WP_URL` / `WP_USERNAME` / `WP_APP_PASSWORD`, or use `config/sites.json` for multi-site. +- **Dependencies:** the ACF / SEO / JetEngine / plugin-detection scripts need `requests` (`python3 -m pip install -r requirements.txt`, ideally in a venv). The core post/page/media/WooCommerce/batch scripts use the stdlib only. +- **Local dev sites** (e.g. `http://site.local`) work — the private/HTTP restriction applies only to `--allow-remote-url` media downloads, not the WP API base URL. +- **Pairs with the Elementor MCP kit** (`claude-elementor-pro`): build page structure with the MCP, then do media uploads, SEO meta, custom fields, and WooCommerce here. ## Safety rules diff --git a/wordpress-api-pro/requirements.txt b/wordpress-api-pro/requirements.txt new file mode 100644 index 0000000..5613ab3 --- /dev/null +++ b/wordpress-api-pro/requirements.txt @@ -0,0 +1,5 @@ +# Runtime dependency for the plugin-integration scripts only +# (acf_fields.py, detect_plugins.py, jetengine_fields.py, seo_meta.py). +# The core post/page/media/WooCommerce/batch scripts use the Python stdlib +# and need nothing here. +requests>=2.25.0