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.
npx skills add 413162826/kevinsu-skills --skill wechat-article-apigit clone --depth 1 https://github.com/413162826/kevinsu-skillsWrote 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.
[](https://agentmods.dev/skills/413162826/kevinsu-skills/wechat-article-api)<a href="https://agentmods.dev/skills/413162826/kevinsu-skills/wechat-article-api"><img src="https://agentmods.dev/badge/skills/413162826/kevinsu-skills/wechat-article-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.
<a href="https://agentmods.dev/skills/413162826/kevinsu-skills/wechat-article-api"><img src="https://agentmods.dev/badge/skills/413162826/kevinsu-skills/wechat-article-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00099 | $0.01174 |
| Opus 5.5 | $0.00040 | $0.00470 |
| Sonnet 5.5 | $0.00020 | $0.00235 |
| Haiku 4.5 | $0.00010 | $0.00117 |
Grade A, and why
wechat-article-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 2mo ago.
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.
How it starts
The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.
微信公众号文章 API
只使用 api.weixin.qq.com 官方接口,不启动或操作浏览器。只创建草稿,不调用发布、群发或删除接口。
运行条件
- Windows 与 PowerShell 7.2+(
pwsh)。 - 公众号已获得草稿接口权限,当前公网出口 IP 已加入公众号 API 白名单。
- AppSecret 只由用户在本机交互式终端输入;不要要求用户在聊天中粘贴。
命令中的 Codex 主目录按 CODEX_HOME 环境变量解析;未设置时使用
%USERPROFILE%\.codex:
$codexHome = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $env:USERPROFILE '.codex' }
$skillRoot = Join-Path $codexHome 'skills\wechat-article-api'
输入
执行前完整阅读 references/package-contract.md。素材目录必须包含 article.json、正文 HTML、封面和正文图片。
account 必填,并且必须与加密凭据中的公众号名称逐字一致。模板默认开启所有用户留言:
needOpenComment=1、onlyFansCanComment=0。
先离线校验:
& (Join-Path $skillRoot 'scripts\Test-WeChatArticlePackage.ps1') -InputFolder "D:\成品文章目录"
需要检查素材契约时,可生成一个不会连接微信的完整合成示例包:
& (Join-Path $skillRoot 'scripts\New-WeChatArticleExample.ps1') -OutputFolder "D:\wechat-article-example"
首次配置
打开本机交互式 pwsh,让用户录入 AppID、公众号名称和 AppSecret:
& (Join-Path $skillRoot 'scripts\Set-WeChatOfficialAccountCredential.ps1')
凭据使用当前 Windows 用户的 DPAPI 加密,默认保存到
$CODEX_HOME\secrets\wechat-official-account.dpapi.json;未设置 CODEX_HOME 时保存到
%USERPROFILE%\.codex\secrets\wechat-official-account.dpapi.json。该文件只能由同一台 Windows
计算机上的同一用户解密,不得提交到代码仓。
配置后先验证权限和 IP 白名单:
& (Join-Path $skillRoot 'scripts\Test-WeChatOfficialAccountApi.ps1')
如果微信返回 40164 invalid ip,立即停止并把错误中的公网出口 IP 告诉用户,提醒其进入“设置与开发 → 开发接口管理 → IP 白名单”添加该 IP。用户确认后只重试同一官方 API;禁止改走浏览器、RPA、Cookie Profile 或其他发布通道。
创建草稿
用户明确要求写入草稿后运行:
& (Join-Path $skillRoot 'scripts\Publish-WeChatArticleDraft.ps1') -InputFolder "D:\成品文章目录"
使用 -DryRun 只做离线校验。脚本上传正文图片到 media/uploadimg,封面到 material/add_material,用 draft/add 创建 news 草稿,再用 draft/get 回读标题、封面和正文图片。
重复提交保护与结果
- 同一素材目录使用独占锁,禁止两个进程并发创建草稿。
- 在素材目录原子写入
wechat-article-api-state.json,逐张记录图片 URL、封面media_id和草稿media_id。 - 已保存草稿
media_id时,同一素材指纹重复执行只回读该草稿,不再次调用draft/add。 - 调用
draft/add前先记录draft_submitting。若网络中断等原因导致服务端结果无法确认,保留不确定状态并禁止自动重试;要求用户先人工核对草稿箱,不能承诺“绝不重复”。 - 微信明确返回错误码时允许修正问题后重试;正文图片或封面上传遇到不确定网络失败时,重试可能产生未引用的重复素材,但不会自动越过不确定的草稿提交状态。
- 素材变化但存在旧检查点时停止,要求使用新目录;不得静默重置。
- 只有
draft/get回读验收通过,才报告成功。 - 回执原子写入
wechat-article-api-receipt.json。报告账号、标题、media_id、图片数、阶段与微信原始错误码;不得报告“已发表”。 - 任一官方 API 失败均原地报告并保留检查点;本 Skill 没有浏览器/RPA 兜底。
What ships with it
11 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- agents/openai.yaml 308 B
- assets/article.json 399 B
- assets/body.html 194 B
- references/package-contract.md 2.1 KB
- scripts/New-WeChatArticleExample.ps1 1.2 KB runs code
- scripts/Publish-WeChatArticleDraft.ps1 9.3 KB runs code
- scripts/Set-WeChatOfficialAccountCredential.ps1 1.4 KB runs code
- scripts/Test-WeChatArticleApiOffline.ps1 6.2 KB runs code
- scripts/Test-WeChatArticlePackage.ps1 5.4 KB runs code
- scripts/Test-WeChatOfficialAccountApi.ps1 1.1 KB runs code
- scripts/WeChatOfficialApi.psm1 18 KB
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.
- 2mo ago First seen · 84 lines · 99 tokens per session scan A caee3445d3c6
wechat-article-api is a skill published in the GitHub repository 413162826/kevinsu-skills (2 stars, last pushed 2mo ago), licensed MIT. It adds 99 tokens to every session and 1,174 once invoked, about $0.0004 per session on Opus 5.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.
wechat-article-api compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| wechat-article-api413162826/kevinsu-skills | Skill | 2 | 2mo ago | MIT | A | 99 | Codex |
| segment-docsJanDeDobbeleer/oh-my-posh | Skill | 24k | 3d ago | MIT | A | 59 | Claude Code, Codex |
| golangJanDeDobbeleer/oh-my-posh | Skill | 24k | 3d ago | MIT | A | 31 | Claude Code, Codex |
| segment-createJanDeDobbeleer/oh-my-posh | Skill | 24k | 3d ago | MIT | A | 42 | Claude Code, Codex |
| oh-my-poshJanDeDobbeleer/oh-my-posh | Skill | 24k | 3d ago | MIT | A | 47 | Claude Code, Codex |
| conventional-commitJanDeDobbeleer/oh-my-posh | Skill | 24k | 3d ago | MIT | A | 26 | Claude Code, Codex |
| code-changesJanDeDobbeleer/oh-my-posh | Skill | 24k | 3d ago | MIT | A | 48 | Claude Code, Codex |