{
  "schemaVersion": "1.0",
  "item": {
    "slug": "wordpress-api-gutenberg",
    "name": "Wopdpress AI Blogger",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/chirukinbb/wordpress-api-gutenberg",
    "canonicalUrl": "https://clawhub.ai/chirukinbb/wordpress-api-gutenberg",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/wordpress-api-gutenberg",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=wordpress-api-gutenberg",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "assets/block_samples/basic_blocks.html",
      "assets/templates/article_template.json",
      "scripts/block_generator.py",
      "scripts/wp_publish.py",
      "scripts/media_uploader.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "wordpress-api-gutenberg",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-11T02:41:35.639Z",
      "expiresAt": "2026-05-18T02:41:35.639Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=wordpress-api-gutenberg",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=wordpress-api-gutenberg",
        "contentDisposition": "attachment; filename=\"wordpress-api-gutenberg-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "wordpress-api-gutenberg"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/wordpress-api-gutenberg"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/wordpress-api-gutenberg",
    "agentPageUrl": "https://openagent3.xyz/skills/wordpress-api-gutenberg/agent",
    "manifestUrl": "https://openagent3.xyz/skills/wordpress-api-gutenberg/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/wordpress-api-gutenberg/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Overview",
        "body": "This skill provides comprehensive guidance for interacting with WordPress REST API to create and manage posts using Gutenberg block editor format. It covers authentication, block serialization, media upload, and publishing workflows."
      },
      {
        "title": "Quick Start",
        "body": "Before using the API, ensure you have:\n\nWordPress site with REST API enabled (default)\n\n\nAuthentication credentials:\n\nApplication Password (WordPress 5.6+): Generate at /wp-admin/admin.php?page=application-passwords\nJWT Authentication plugin installed (alternative)\nUsername/password for Basic Auth (not recommended for production)\n\n\n\nBase URL: https://your-site.com/wp-json/wp/v2"
      },
      {
        "title": "Application Password (Recommended)",
        "body": "# Set environment variables\nexport WP_URL=\"https://your-site.com\"\nexport WP_USERNAME=\"admin\"\nexport WP_APPLICATION_PASSWORD=\"xxxx xxxx xxxx xxxx xxxx xxxx\"\n\nimport requests\nimport os\n\nwp_url = os.environ.get('WP_URL')\nusername = os.environ.get('WP_USERNAME')\npassword = os.environ.get('WP_APPLICATION_PASSWORD')\n\nauth = (username, password)"
      },
      {
        "title": "JWT Authentication",
        "body": "If using JWT plugin, obtain token first:\n\nimport requests\n\nwp_url = \"https://your-site.com\"\nusername = \"admin\"\npassword = \"password\"\n\n# Get token\nresp = requests.post(f\"{wp_url}/wp-json/jwt-auth/v1/token\", \n                     json={\"username\": username, \"password\": password})\ntoken = resp.json()['token']\n\nheaders = {\"Authorization\": f\"Bearer {token}\"}"
      },
      {
        "title": "Creating Posts with Gutenberg Blocks",
        "body": "WordPress REST API expects posts in Gutenberg's serialized block format. The content field should contain block comments and HTML."
      },
      {
        "title": "Basic Block Structure",
        "body": "def create_gutenberg_post(title, content_blocks):\n    \"\"\"\n    Create a post with Gutenberg blocks.\n    \n    Args:\n        title: Post title\n        content_blocks: List of block dictionaries with 'blockName' and 'attrs'\n    \n    Returns:\n        JSON data for POST request\n    \"\"\"\n    # Serialize blocks to Gutenberg format\n    block_html = []\n    for block in content_blocks:\n        block_name = block.get('blockName', 'core/paragraph')\n        attrs = block.get('attrs', {})\n        inner_html = block.get('innerHTML', '')\n        \n        # Create block comment\n        attrs_json = json.dumps(attrs) if attrs else ''\n        block_comment = f'<!-- wp:{block_name} {attrs_json} -->'\n        block_html.append(f'{block_comment}{inner_html}<!-- /wp:{block_name} -->')\n    \n    content = '\\n\\n'.join(block_html)\n    \n    return {\n        \"title\": title,\n        \"content\": content,\n        \"status\": \"draft\",  # or \"publish\"\n        \"format\": \"standard\"\n    }"
      },
      {
        "title": "Common Block Examples",
        "body": "See references/common_blocks.md for detailed examples of:\n\nParagraph blocks with formatting\nHeading blocks (h2-h4)\nImage blocks with captions and alignment\nList blocks (ordered/unordered)\nQuote blocks\nCode blocks\nCustom HTML blocks\nColumns and layout blocks"
      },
      {
        "title": "Step 1: Prepare Authentication",
        "body": "Set up credentials as environment variables or in a configuration file."
      },
      {
        "title": "Step 2: Create Post Data",
        "body": "Define title, content blocks, categories, tags, featured image."
      },
      {
        "title": "Step 3: Upload Media (if needed)",
        "body": "def upload_image(image_path, post_id=None):\n    \"\"\"Upload image to WordPress media library.\"\"\"\n    with open(image_path, 'rb') as f:\n        files = {'file': f}\n        data = {}\n        if post_id:\n            data['post'] = post_id\n        \n        response = requests.post(f\"{wp_url}/wp-json/wp/v2/media\",\n                                 files=files, data=data, auth=auth)\n        return response.json()"
      },
      {
        "title": "Step 4: Create Post",
        "body": "def create_post(post_data):\n    \"\"\"Create new WordPress post.\"\"\"\n    response = requests.post(f\"{wp_url}/wp-json/wp/v2/posts\",\n                             json=post_data, auth=auth)\n    return response.json()"
      },
      {
        "title": "Step 5: Update Status",
        "body": "Change from draft to publish:\n\ndef publish_post(post_id):\n    \"\"\"Publish a draft post.\"\"\"\n    response = requests.post(f\"{wp_url}/wp-json/wp/v2/posts/{post_id}\",\n                             json={\"status\": \"publish\"}, auth=auth)\n    return response.json()"
      },
      {
        "title": "Categories and Tags",
        "body": "# Get or create category\ndef ensure_category(name, slug=None):\n    categories = requests.get(f\"{wp_url}/wp-json/wp/v2/categories\",\n                             params={\"search\": name}, auth=auth).json()\n    if categories:\n        return categories[0]['id']\n    else:\n        new_cat = requests.post(f\"{wp_url}/wp-json/wp/v2/categories\",\n                               json={\"name\": name, \"slug\": slug or name.lower()},\n                               auth=auth).json()\n        return new_cat['id']"
      },
      {
        "title": "Featured Image",
        "body": "# Upload image first, then set as featured\nimage_data = upload_image(\"path/to/image.jpg\")\npost_data[\"featured_media\"] = image_data['id']"
      },
      {
        "title": "Custom Fields (ACF)",
        "body": "If using Advanced Custom Fields plugin:\n\npost_data[\"meta\"] = {\n    \"your_field_name\": \"field_value\"\n}"
      },
      {
        "title": "Error Handling",
        "body": "Always check responses:\n\nresponse = requests.post(...)\nif response.status_code in [200, 201]:\n    print(\"Success!\")\nelse:\n    print(f\"Error {response.status_code}: {response.text}\")\n\nCommon issues:\n\n401: Authentication failed\n403: User lacks permission\n404: Endpoint not found (check WordPress version)\n500: Server error (check PHP error logs)"
      },
      {
        "title": "Scripts",
        "body": "The scripts/ directory contains helper utilities:\n\nwp_publish.py: Complete publishing pipeline\nblock_generator.py: Generate Gutenberg block HTML from markdown\nmedia_uploader.py: Batch upload images"
      },
      {
        "title": "References",
        "body": "common_blocks.md: Detailed block examples\napi_reference.md: Complete WordPress REST API reference\ntroubleshooting.md: Common issues and solutions"
      },
      {
        "title": "Assets",
        "body": "templates/article_template.json: JSON template for typical article structure\nblock_samples/: Example block HTML for various content types"
      },
      {
        "title": "Example Request",
        "body": "# Using curl with Application Password\ncurl -X POST https://your-site.com/wp-json/wp/v2/posts \\\n  -u \"admin:xxxx xxxx xxxx xxxx xxxx xxxx\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"title\": \"My New Post\",\n    \"content\": \"<!-- wp:paragraph --><p>Hello World!</p><!-- /wp:paragraph -->\",\n    \"status\": \"draft\"\n  }'"
      }
    ],
    "body": "WordPress API with Gutenberg\nOverview\n\nThis skill provides comprehensive guidance for interacting with WordPress REST API to create and manage posts using Gutenberg block editor format. It covers authentication, block serialization, media upload, and publishing workflows.\n\nQuick Start\n\nBefore using the API, ensure you have:\n\nWordPress site with REST API enabled (default)\n\nAuthentication credentials:\n\nApplication Password (WordPress 5.6+): Generate at /wp-admin/admin.php?page=application-passwords\nJWT Authentication plugin installed (alternative)\nUsername/password for Basic Auth (not recommended for production)\n\nBase URL: https://your-site.com/wp-json/wp/v2\n\nAuthentication\nApplication Password (Recommended)\n# Set environment variables\nexport WP_URL=\"https://your-site.com\"\nexport WP_USERNAME=\"admin\"\nexport WP_APPLICATION_PASSWORD=\"xxxx xxxx xxxx xxxx xxxx xxxx\"\n\nimport requests\nimport os\n\nwp_url = os.environ.get('WP_URL')\nusername = os.environ.get('WP_USERNAME')\npassword = os.environ.get('WP_APPLICATION_PASSWORD')\n\nauth = (username, password)\n\nJWT Authentication\n\nIf using JWT plugin, obtain token first:\n\nimport requests\n\nwp_url = \"https://your-site.com\"\nusername = \"admin\"\npassword = \"password\"\n\n# Get token\nresp = requests.post(f\"{wp_url}/wp-json/jwt-auth/v1/token\", \n                     json={\"username\": username, \"password\": password})\ntoken = resp.json()['token']\n\nheaders = {\"Authorization\": f\"Bearer {token}\"}\n\nCreating Posts with Gutenberg Blocks\n\nWordPress REST API expects posts in Gutenberg's serialized block format. The content field should contain block comments and HTML.\n\nBasic Block Structure\ndef create_gutenberg_post(title, content_blocks):\n    \"\"\"\n    Create a post with Gutenberg blocks.\n    \n    Args:\n        title: Post title\n        content_blocks: List of block dictionaries with 'blockName' and 'attrs'\n    \n    Returns:\n        JSON data for POST request\n    \"\"\"\n    # Serialize blocks to Gutenberg format\n    block_html = []\n    for block in content_blocks:\n        block_name = block.get('blockName', 'core/paragraph')\n        attrs = block.get('attrs', {})\n        inner_html = block.get('innerHTML', '')\n        \n        # Create block comment\n        attrs_json = json.dumps(attrs) if attrs else ''\n        block_comment = f'<!-- wp:{block_name} {attrs_json} -->'\n        block_html.append(f'{block_comment}{inner_html}<!-- /wp:{block_name} -->')\n    \n    content = '\\n\\n'.join(block_html)\n    \n    return {\n        \"title\": title,\n        \"content\": content,\n        \"status\": \"draft\",  # or \"publish\"\n        \"format\": \"standard\"\n    }\n\nCommon Block Examples\n\nSee references/common_blocks.md for detailed examples of:\n\nParagraph blocks with formatting\nHeading blocks (h2-h4)\nImage blocks with captions and alignment\nList blocks (ordered/unordered)\nQuote blocks\nCode blocks\nCustom HTML blocks\nColumns and layout blocks\nComplete Workflow\nStep 1: Prepare Authentication\n\nSet up credentials as environment variables or in a configuration file.\n\nStep 2: Create Post Data\n\nDefine title, content blocks, categories, tags, featured image.\n\nStep 3: Upload Media (if needed)\ndef upload_image(image_path, post_id=None):\n    \"\"\"Upload image to WordPress media library.\"\"\"\n    with open(image_path, 'rb') as f:\n        files = {'file': f}\n        data = {}\n        if post_id:\n            data['post'] = post_id\n        \n        response = requests.post(f\"{wp_url}/wp-json/wp/v2/media\",\n                                 files=files, data=data, auth=auth)\n        return response.json()\n\nStep 4: Create Post\ndef create_post(post_data):\n    \"\"\"Create new WordPress post.\"\"\"\n    response = requests.post(f\"{wp_url}/wp-json/wp/v2/posts\",\n                             json=post_data, auth=auth)\n    return response.json()\n\nStep 5: Update Status\n\nChange from draft to publish:\n\ndef publish_post(post_id):\n    \"\"\"Publish a draft post.\"\"\"\n    response = requests.post(f\"{wp_url}/wp-json/wp/v2/posts/{post_id}\",\n                             json={\"status\": \"publish\"}, auth=auth)\n    return response.json()\n\nAdvanced Features\nCategories and Tags\n# Get or create category\ndef ensure_category(name, slug=None):\n    categories = requests.get(f\"{wp_url}/wp-json/wp/v2/categories\",\n                             params={\"search\": name}, auth=auth).json()\n    if categories:\n        return categories[0]['id']\n    else:\n        new_cat = requests.post(f\"{wp_url}/wp-json/wp/v2/categories\",\n                               json={\"name\": name, \"slug\": slug or name.lower()},\n                               auth=auth).json()\n        return new_cat['id']\n\nFeatured Image\n# Upload image first, then set as featured\nimage_data = upload_image(\"path/to/image.jpg\")\npost_data[\"featured_media\"] = image_data['id']\n\nCustom Fields (ACF)\n\nIf using Advanced Custom Fields plugin:\n\npost_data[\"meta\"] = {\n    \"your_field_name\": \"field_value\"\n}\n\nError Handling\n\nAlways check responses:\n\nresponse = requests.post(...)\nif response.status_code in [200, 201]:\n    print(\"Success!\")\nelse:\n    print(f\"Error {response.status_code}: {response.text}\")\n\n\nCommon issues:\n\n401: Authentication failed\n403: User lacks permission\n404: Endpoint not found (check WordPress version)\n500: Server error (check PHP error logs)\nScripts\n\nThe scripts/ directory contains helper utilities:\n\nwp_publish.py: Complete publishing pipeline\nblock_generator.py: Generate Gutenberg block HTML from markdown\nmedia_uploader.py: Batch upload images\nReferences\ncommon_blocks.md: Detailed block examples\napi_reference.md: Complete WordPress REST API reference\ntroubleshooting.md: Common issues and solutions\nAssets\ntemplates/article_template.json: JSON template for typical article structure\nblock_samples/: Example block HTML for various content types\nExample Request\n# Using curl with Application Password\ncurl -X POST https://your-site.com/wp-json/wp/v2/posts \\\n  -u \"admin:xxxx xxxx xxxx xxxx xxxx xxxx\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"title\": \"My New Post\",\n    \"content\": \"<!-- wp:paragraph --><p>Hello World!</p><!-- /wp:paragraph -->\",\n    \"status\": \"draft\"\n  }'"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/chirukinbb/wordpress-api-gutenberg",
    "publisherUrl": "https://clawhub.ai/chirukinbb/wordpress-api-gutenberg",
    "owner": "chirukinbb",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/wordpress-api-gutenberg",
    "downloadUrl": "https://openagent3.xyz/downloads/wordpress-api-gutenberg",
    "agentUrl": "https://openagent3.xyz/skills/wordpress-api-gutenberg/agent",
    "manifestUrl": "https://openagent3.xyz/skills/wordpress-api-gutenberg/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/wordpress-api-gutenberg/agent.md"
  }
}