wechat-image-api

wechat-image-api is a skill for Codex from 413162826/kevinsu-skills. It costs 97 tokens per session (988 once invoked), scanned A, original, MIT.

A Windows PowerShell skill for using WeChat's official server API to check image packages, upload permanent images, and create image-message drafts for a public account.

In plain words
What is it for?
Use it to prepare and verify a package containing 1–20 images, then create and read back a WeChat public-account image draft through the official API.
Why use it?
It avoids browser automation and prevents accidentally publishing, mass-sending, or deleting content. It also checks the required files and account details before making the draft.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions Codex.

Good fit Use it to prepare and verify a package containing 1–20 images, then create and read back a WeChat public-account image draft through the official API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/413162826/kevinsu-skills/wechat-image-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add 413162826/kevinsu-skills --skill wechat-image-api
Clone the repo
git clone --depth 1 https://github.com/413162826/kevinsu-skills

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for wechat-image-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/413162826/kevinsu-skills/wechat-image-api/github.svg)](https://agentmods.dev/skills/413162826/kevinsu-skills/wechat-image-api)
Your own site
<a href="https://agentmods.dev/skills/413162826/kevinsu-skills/wechat-image-api"><img src="https://agentmods.dev/badge/skills/413162826/kevinsu-skills/wechat-image-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for wechat-image-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/413162826/kevinsu-skills/wechat-image-api"><img src="https://agentmods.dev/badge/skills/413162826/kevinsu-skills/wechat-image-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 988 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00097 $0.00988
Opus 5 $0.00048 $0.00494
Sonnet 5 $0.00019 $0.00198
Haiku 4.5 $0.00010 $0.00099

Measured 10d ago against content hash 6921d3a70b4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

wechat-image-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

The scan reads SKILL.md. This mod also ships 6 executable files (scripts/New-WeChatImagePackageExample.ps1, scripts/Publish-WeChatImageDraft.ps1, scripts/Set-WeChatOfficialAccountCredential.ps1, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

wechat-image-api/SKILL.md · 64 lines

What it actually says

微信公众号贴图 API

只使用 api.weixin.qq.com 官方接口创建并验收图片消息草稿。不启动浏览器,不调用发布、群发或删除接口,也不提供 RPA 兜底。

环境

要求 Windows 与 PowerShell 7.2+。AppSecret 使用当前 Windows 用户的 DPAPI 加密,默认保存到 $env:CODEX_HOME\secrets;未设置 CODEX_HOME 时使用 $env:USERPROFILE\.codex\secrets。网络请求在 PowerShell 进程内完成,不把 access token 传给外部命令。

输入与离线校验

执行前完整阅读 references/package-contract.md。素材目录必须包含 image-post.json 和 1–20 张图片;account 必须明确填写,留言字段不得缺省。

先定位 Skill,再离线校验:

$codexHome = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $env:USERPROFILE '.codex' }
$skill = Join-Path $codexHome 'skills\wechat-image-api'
& (Join-Path $skill 'scripts\Test-WeChatImagePackage.ps1') -InputFolder 'D:\贴图素材目录'

需要完整示例时,在一个尚未包含示例文件的新目录中生成并校验:

& (Join-Path $skill 'scripts\New-WeChatImagePackageExample.ps1') -OutputFolder 'D:\贴图示例'

首次配置

两个微信 API Skill 可共用同一份 DPAPI 凭据。凭据不存在时,不让用户在聊天中粘贴 AppSecret;运行本机交互式配置:

& (Join-Path $skill 'scripts\Set-WeChatOfficialAccountCredential.ps1')
& (Join-Path $skill 'scripts\Test-WeChatOfficialAccountApi.ps1')

第二条命令验证 AppID、AppSecret、草稿权限和 IP 白名单。素材包 account 必须与配置时保存的公众号名称严格一致。

如果微信返回 40164 invalid ip,立即停止并把错误中的公网出口 IP 告诉用户,提醒其进入“设置与开发 → 开发接口管理 → IP 白名单”添加该 IP。用户确认后只重试同一官方 API;禁止改走浏览器、RPA、Cookie Profile 或其他发布通道。

创建并验收草稿

只有用户明确要求写入草稿后才运行:

& (Join-Path $skill 'scripts\Publish-WeChatImageDraft.ps1') -InputFolder 'D:\贴图素材目录'

脚本逐张上传图片到 material/add_material,再用 draft/add 创建 newspic 草稿;第一张由微信作为封面。最后用 draft/get 回读并核对账号、标题、正文、图片顺序、留言设置和 media_id

幂等与异常边界

  • 每个素材目录使用独占锁,同一目录不能并发执行。
  • 检查点只在确认收到 media_id 后推进;已记录草稿 ID 时,重复执行只回读验收,不重复创建。
  • 如果网络或进程中断在图片上传或 draft/add 提交阶段,结果可能不确定。后续执行必须停止,禁止自动重试;先人工核对素材库或草稿箱,再使用新目录继续。
  • 素材指纹变化但存在旧检查点时停止,不静默清空状态。
  • 状态与回执使用同目录临时文件原子替换,避免留下半截 JSON。
  • 只有 draft/get 回读全部字段通过,才报告“草稿创建并验收通过”;不得报告“已发表”。
  • 回执写入 wechat-image-api-receipt.json。任一官方 API 失败均原地报告,本 Skill 没有浏览器/RPA 兜底。
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 64 lines · 97 tokens per session scan A 6921d3a70b4d

Subscribe to this mod's changes

wechat-image-api is a skill published in the GitHub repository 413162826/kevinsu-skills (2 stars, last pushed 6d ago), licensed MIT. It adds 97 tokens to every session and 988 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

skin-creator

Create and apply a two-asset LobsterAI visual skin from the user's style description. Use only when the AI Skin Designer kit supplies the structured skinpack workflow marker; do not use for ordinary theme or image requests.

netease-youdao/LobsterAI · 48 tokens

canvas-design

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

netease-youdao/LobsterAI · 59 tokens

shogun-screenshot

A screenshot tool for getting images from a computer or web page and then cropping, resizing, or masking sensitive information. Playwright is a browser-automation tool used here to capture web pages.

yohey-w/multi-agent-shogun · 149 tokens

cli-anything-photoshop

A command-line tool that controls Adobe Photoshop through Windows automation. It can work with Photoshop documents, layers, selections, text, image adjustments, and exports.

yb2460/harness-anything · 43 tokens

canvas-design

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

ComposioHQ/awesome-claude-skills · 59 tokens

adobe-automation

Automate Adobe tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/awesome-claude-skills · 26 tokens