wechat-article-api

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

A tool for preparing WeChat Official Account article drafts through WeChat's official server API. It validates an article package, uploads its images, creates a draft, and reads the draft back for checking.

In plain words
What is it for?
Use it when an article package contains the required metadata, HTML, cover, and body images and you need to create a WeChat article draft through the API.
Why use it?
It provides a repeatable server-side way to create drafts and verify them without operating a browser. It does not publish, mass-send, or delete articles.

Skill for Codex

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

Good fit Use it when an article package contains the required metadata, HTML, cover, and body images and you need to create a WeChat article draft through the API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/413162826/kevinsu-skills/wechat-article-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-article-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-article-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/413162826/kevinsu-skills/wechat-article-api/github.svg)](https://agentmods.dev/skills/413162826/kevinsu-skills/wechat-article-api)
Your own site
<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.

agentmods 80×15 button for wechat-article-api

Your own site · 80×15
<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>
Per session 99 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,174 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.00099 $0.01174
Opus 5 $0.00049 $0.00587
Sonnet 5 $0.00020 $0.00235
Haiku 4.5 $0.00010 $0.00117

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

Security

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 9d ago.

The scan reads SKILL.md. This mod also ships 6 executable files (scripts/New-WeChatArticleExample.ps1, scripts/Publish-WeChatArticleDraft.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-article-api/SKILL.md · 84 lines

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=1onlyFansCanComment=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 兜底。

Read the full file on GitHub · 84 lines

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. 9d ago First seen · 84 lines · 99 tokens per session scan A caee3445d3c6

Subscribe to this mod's changes

wechat-article-api is a skill published in the GitHub repository 413162826/kevinsu-skills (2 stars, last pushed 5d ago), licensed MIT. It adds 99 tokens to every session and 1,174 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

detecting-fileless-attacks-on-endpoints

Use when detects fileless malware and in-memory attacks that execute entirely in RAM without writing persistent files to disk, evading traditional antivirus. Use when building detections for PowerShell-based attacks, reflective DLL injection, WMI persistence, and registry-resident malware. Activates for requests…

oyi77/1ai-skills · 87 tokens

SVG Recolor for Power BI

Cambia el color de los iconos SVG de un proyecto PBIP sin tocar nada más — detecta qué colores hay, sustituye solo los que son colores de verdad (no referencias url(#id) ni selectores CSS), conserva la codificación de cada archivo y avisa de lo que no puede reescribir.

CSalcedoDataBI/powerbi-pbip-tools · 73 tokens

Power BI Semantic Architect

Transforma modelos de datos técnicos de Power BI en modelos semánticos documentados — genera descripciones, KPIs y un Context Store completo usando MCP como puente de comunicación bidireccional. El analista pasa de constructor manual a Auditor de Inteligencia.

CSalcedoDataBI/powerbi-pbip-tools · 57 tokens

powershell-docs

PowerShell 7.6 + Windows PowerShell 5.1 — variables, arrays, hashtables, functions, classes, remoting, modules, DSC.

pledgeandgrow/pledge-skills · 39 tokens

publish-wechat-remote

Prepare, upload, save, inspect, and formally publish WeChat Official Account articles through the authenticated wechatpublisher remote MCP server. Use when the user asks to post Markdown, HTML, plain text, covers, or inline images to a subscription or service account; manage WeChat drafts; test account API access; or…

HsiangNianian/wechat-publisher-mcp · 75 tokens

analyzing-powershell-script-block-logging

Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX files to detect obfuscated commands, encoded payloads, and living-off-the-land techniques. Uses python-evtx to extract and reconstruct multi-block scripts, applies entropy analysis and pattern matching for Base64-encoded commands, Invoke-Expression…

pinkpixel-dev/skills-collection-1 · 88 tokens