{
  "schemaVersion": "1.0",
  "item": {
    "slug": "mp-draft-push",
    "name": "公众号自动发布",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/wuhongchen/mp-draft-push",
    "canonicalUrl": "https://clawhub.ai/wuhongchen/mp-draft-push",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/mp-draft-push",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mp-draft-push",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "scripts.sh",
      "README.md",
      "SKILL.md"
    ],
    "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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "mp-draft-push",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T05:39:02.077Z",
      "expiresAt": "2026-05-09T05:39:02.077Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mp-draft-push",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mp-draft-push",
        "contentDisposition": "attachment; filename=\"mp-draft-push-1.0.2.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "mp-draft-push"
      },
      "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/mp-draft-push"
    },
    "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/mp-draft-push",
    "agentPageUrl": "https://openagent3.xyz/skills/mp-draft-push/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mp-draft-push/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mp-draft-push/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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "功能说明",
        "body": "接收调用方提供的文章内容，上传封面图（可选），并将文章发布到微信公众号草稿箱。\n\n不负责：内容采集、AI 写作、图片生成。"
      },
      {
        "title": "所需参数",
        "body": "调用方（用户或其他 Skill）需要提供：\n\n参数类型必填说明titlestring✅文章标题（不超过 64 字节，约 21 个中文字符）digeststring✅文章摘要（显示在分享卡片上）content_htmlstring✅文章正文 HTML（使用内联样式）cover_image_pathstring❌封面图本地路径（如不提供则用兜底 URL 或无封面）"
      },
      {
        "title": "执行流程",
        "body": "1. 接收参数\n       ↓\n2. 获取 access_token\n       ↓\n3. 上传封面图到微信素材库（获取 thumb_media_id）\n       ↓\n4. 创建草稿（发布到草稿箱）\n       ↓\n5. 提示用户前往后台检查"
      },
      {
        "title": "配置信息",
        "body": "AppID: WECHAT_APPID（通过环境变量配置）\nAppSecret: WECHAT_SECRET（通过环境变量配置）\n作者: WECHAT_AUTHOR（可选，默认 W）\n\n配置方法见 README.md。"
      },
      {
        "title": "Step 1: 接收参数",
        "body": "不要主动提问，等待调用方传入上述参数。\n\n若调用方没有提供 cover_image_path，检查环境变量 DEFAULT_COVER_URL：\n\n有值：先下载到本地临时文件 /tmp/wechat_cover_default.png，再上传\n无值：thumb_media_id 留空（草稿不含封面）"
      },
      {
        "title": "Step 2 & 3: 上传封面图并创建草稿",
        "body": "加载脚本：\n\nsource ./scripts.sh"
      },
      {
        "title": "获取 access_token",
        "body": "TOKEN=$(get_wechat_token)"
      },
      {
        "title": "上传封面图（如有）",
        "body": "MEDIA_RESPONSE=$(upload_wechat_image \"$TOKEN\" \"$cover_image_path\")\nTHUMB_MEDIA_ID=$(echo \"$MEDIA_RESPONSE\" | jq -r '.media_id')"
      },
      {
        "title": "构建草稿 JSON 并创建草稿",
        "body": "content_html 注意事项：\n\n所有样式必须内联（style=\"...\"），微信会过滤 <style> 标签\n图片只能使用 mmbiz.qpic.cn 域名（如有文章内图片，需提前上传到微信）\nJSON 序列化必须使用 ensure_ascii=False，否则中文乱码\n\nDRAFT_JSON=\"/tmp/draft_$(date +%Y%m%d%H%M%S).json\"\njq -n \\\n    --arg title \"$title\" \\\n    --arg author \"${WECHAT_AUTHOR:-koo AI}\" \\\n    --arg digest \"$digest\" \\\n    --arg content \"$content_html\" \\\n    --arg thumb_media_id \"$THUMB_MEDIA_ID\" \\\n    '{\n        articles: [{\n            title: $title,\n            author: $author,\n            digest: $digest,\n            content: $content,\n            thumb_media_id: $thumb_media_id,\n            need_open_comment: 1,\n            only_fans_can_comment: 0\n        }]\n    }' > \"$DRAFT_JSON\"\n\nDRAFT_RESPONSE=$(create_draft \"$TOKEN\" \"$DRAFT_JSON\")\nDRAFT_MEDIA_ID=$(echo \"$DRAFT_RESPONSE\" | jq -r '.media_id')\nrm -f \"$DRAFT_JSON\"\n\n若 DRAFT_MEDIA_ID 为空或 null，说明创建失败，打印 DRAFT_RESPONSE 排查。"
      },
      {
        "title": "Step 4: 提示用户检查",
        "body": "发布完成后输出：\n\n✅ 草稿发布成功！\n\n📝 文章信息\n- 标题：{title}\n- 摘要：{digest}\n- 草稿 ID：{DRAFT_MEDIA_ID}\n\n📌 请前往微信公众号后台检查并发布：\n   https://mp.weixin.qq.com\n\n⚠️ 检查要点：\n1. 图片是否正常显示\n2. 排版是否正确\n3. 标题和摘要是否合适\n4. 确认无误后点击\"发布\""
      },
      {
        "title": "HTML 内联样式参考",
        "body": "<section style=\"font-family: -apple-system, sans-serif; line-height: 1.8; color: #333; padding: 15px;\">\n  <p style=\"margin-bottom: 20px;\">段落内容</p>\n\n  <h2 style=\"border-bottom: 1px solid #eee; padding-bottom: 8px;\">标题</h2>\n\n  <p style=\"text-align: center; margin: 25px 0;\">\n    <img src=\"{mmbiz_img_url}\" style=\"max-width: 100%; border-radius: 6px;\">\n  </p>\n\n  <blockquote style=\"background: #f6f8fa; border-left: 4px solid #ddd; padding: 12px 16px;\">\n    引用内容\n  </blockquote>\n</section>"
      },
      {
        "title": "注意事项",
        "body": "中文编码：JSON 必须用 ensure_ascii=False，jq 默认已处理\n标题长度：最多 64 字节（约 21 个中文字符）\naccess_token：有效期 2 小时，每次需重新获取\n图片域名：文章内图片只能使用微信返回的 mmbiz.qpic.cn URL"
      }
    ],
    "body": "mp-draft-push\n功能说明\n\n接收调用方提供的文章内容，上传封面图（可选），并将文章发布到微信公众号草稿箱。\n\n不负责：内容采集、AI 写作、图片生成。\n\n所需参数\n\n调用方（用户或其他 Skill）需要提供：\n\n参数\t类型\t必填\t说明\ntitle\tstring\t✅\t文章标题（不超过 64 字节，约 21 个中文字符）\ndigest\tstring\t✅\t文章摘要（显示在分享卡片上）\ncontent_html\tstring\t✅\t文章正文 HTML（使用内联样式）\ncover_image_path\tstring\t❌\t封面图本地路径（如不提供则用兜底 URL 或无封面）\n执行流程\n1. 接收参数\n       ↓\n2. 获取 access_token\n       ↓\n3. 上传封面图到微信素材库（获取 thumb_media_id）\n       ↓\n4. 创建草稿（发布到草稿箱）\n       ↓\n5. 提示用户前往后台检查\n\n配置信息\nAppID: WECHAT_APPID（通过环境变量配置）\nAppSecret: WECHAT_SECRET（通过环境变量配置）\n作者: WECHAT_AUTHOR（可选，默认 W）\n\n配置方法见 README.md。\n\nStep 1: 接收参数\n\n不要主动提问，等待调用方传入上述参数。\n\n若调用方没有提供 cover_image_path，检查环境变量 DEFAULT_COVER_URL：\n\n有值：先下载到本地临时文件 /tmp/wechat_cover_default.png，再上传\n无值：thumb_media_id 留空（草稿不含封面）\nStep 2 & 3: 上传封面图并创建草稿\n\n加载脚本：\n\nsource ./scripts.sh\n\n获取 access_token\nTOKEN=$(get_wechat_token)\n\n上传封面图（如有）\nMEDIA_RESPONSE=$(upload_wechat_image \"$TOKEN\" \"$cover_image_path\")\nTHUMB_MEDIA_ID=$(echo \"$MEDIA_RESPONSE\" | jq -r '.media_id')\n\n构建草稿 JSON 并创建草稿\n\ncontent_html 注意事项：\n\n所有样式必须内联（style=\"...\"），微信会过滤 <style> 标签\n图片只能使用 mmbiz.qpic.cn 域名（如有文章内图片，需提前上传到微信）\nJSON 序列化必须使用 ensure_ascii=False，否则中文乱码\nDRAFT_JSON=\"/tmp/draft_$(date +%Y%m%d%H%M%S).json\"\njq -n \\\n    --arg title \"$title\" \\\n    --arg author \"${WECHAT_AUTHOR:-koo AI}\" \\\n    --arg digest \"$digest\" \\\n    --arg content \"$content_html\" \\\n    --arg thumb_media_id \"$THUMB_MEDIA_ID\" \\\n    '{\n        articles: [{\n            title: $title,\n            author: $author,\n            digest: $digest,\n            content: $content,\n            thumb_media_id: $thumb_media_id,\n            need_open_comment: 1,\n            only_fans_can_comment: 0\n        }]\n    }' > \"$DRAFT_JSON\"\n\nDRAFT_RESPONSE=$(create_draft \"$TOKEN\" \"$DRAFT_JSON\")\nDRAFT_MEDIA_ID=$(echo \"$DRAFT_RESPONSE\" | jq -r '.media_id')\nrm -f \"$DRAFT_JSON\"\n\n\n若 DRAFT_MEDIA_ID 为空或 null，说明创建失败，打印 DRAFT_RESPONSE 排查。\n\nStep 4: 提示用户检查\n\n发布完成后输出：\n\n✅ 草稿发布成功！\n\n📝 文章信息\n- 标题：{title}\n- 摘要：{digest}\n- 草稿 ID：{DRAFT_MEDIA_ID}\n\n📌 请前往微信公众号后台检查并发布：\n   https://mp.weixin.qq.com\n\n⚠️ 检查要点：\n1. 图片是否正常显示\n2. 排版是否正确\n3. 标题和摘要是否合适\n4. 确认无误后点击\"发布\"\n\nHTML 内联样式参考\n<section style=\"font-family: -apple-system, sans-serif; line-height: 1.8; color: #333; padding: 15px;\">\n  <p style=\"margin-bottom: 20px;\">段落内容</p>\n\n  <h2 style=\"border-bottom: 1px solid #eee; padding-bottom: 8px;\">标题</h2>\n\n  <p style=\"text-align: center; margin: 25px 0;\">\n    <img src=\"{mmbiz_img_url}\" style=\"max-width: 100%; border-radius: 6px;\">\n  </p>\n\n  <blockquote style=\"background: #f6f8fa; border-left: 4px solid #ddd; padding: 12px 16px;\">\n    引用内容\n  </blockquote>\n</section>\n\n注意事项\n中文编码：JSON 必须用 ensure_ascii=False，jq 默认已处理\n标题长度：最多 64 字节（约 21 个中文字符）\naccess_token：有效期 2 小时，每次需重新获取\n图片域名：文章内图片只能使用微信返回的 mmbiz.qpic.cn URL"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wuhongchen/mp-draft-push",
    "publisherUrl": "https://clawhub.ai/wuhongchen/mp-draft-push",
    "owner": "wuhongchen",
    "version": "1.0.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/mp-draft-push",
    "downloadUrl": "https://openagent3.xyz/downloads/mp-draft-push",
    "agentUrl": "https://openagent3.xyz/skills/mp-draft-push/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mp-draft-push/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mp-draft-push/agent.md"
  }
}