Wechat ai app ops

From Dirtytrii/codex-skills · View interactive version

Wechat ai app ops is an AI agent skill from the GitHub repository Dirtytrii/codex-skills. Operate the WeChat Official Account AI-application workflow for articles, weekly digests, rich formatting, draft-box updates, and local handoff. Use for Agents, MCP, Skills, tool calling, workflows, and open-source AI updates; exclude Xiaohongshu and Xianyu.

How to use this skill

Skill file

WeChat AI App Ops

Use this skill for the user's WeChat Official Account AI application content workflow, usually inside an accounts or content-operations repository. Stay inside the WeChat content lane unless the user explicitly asks for Xiaohongshu or Xianyu.

Quick Workflow

  1. Check repository state first:
git status --short --branch
  1. Read the current handoff, manifest, prediction, article, source list, and target article directory before editing or API calls.
  2. Classify the article as weekly or flexible.
  3. For weekly articles, review the previous weekly article in the same series before drafting.
  4. If a separate raw drafting model/window is used, apply content-model-handoff: raw copy is not final copy; the WeChat role still owns source discipline, article structure, preview quality, draft-box state, and publish gates.
  5. Improve the article as a WeChat article, not a cold changelog: use a strong hook, human judgment, varied section structures, visible reader stakes, and explanatory image anchors. Before generating preview or draft-box handoff, run a humanizer-zh pass to remove template phrasing, fake reader emotions, repetitive contrast structures, and AI-ish section labels without changing facts or attribution.
  6. If the article feels visually dry, add useful illustrations or source screenshots before draft-box update. Save final media inside the WeChat article folder and configure the repository's inline-image manifest.
  7. For formal public formatting, prefer gzh-design when installed: choose a theme by article type, generate a clean body HTML plus preview wrapper, and run validate_gzh_html.py until ERROR=0. Use wechat-article-formatter as the legacy fallback.
  8. Write to the WeChat draft box only when authorized. Draft-box write is not publishing.
  9. Before publish, read the latest manifest and run the publish gate. Never publish unless the user explicitly authorizes publishing in the current turn and the gate passes.

References

Conditional Related Skills

Load these only when the article task needs that capability. If a related skill is not installed in the current Codex environment, state that and continue with the closest safe fallback:

Local Commands

Prefer the repository's documented node command or system node. Use Codex bundled Node only when system node is unavailable or denied; discover the bundled path from the active Codex runtime/workspace dependencies instead of hard-coding a personal machine path.

On Windows PowerShell, read Chinese article files with explicit UTF-8 and avoid trusting garbled terminal output:

Get-Content -Raw -Encoding UTF8 content\wechat\<date>\article.md

For repositories that have migrated to account-first content layout, prefer the repository's documented paths such as:

content/accounts/<account>/platforms/wechat/<article-dir>/
content/accounts/<account>/platforms/wechat/automation/daily-runs/<date>.json

Older repositories may still use:

content\wechat\<date>

Use the path documented by the target repo; do not create a parallel legacy directory just because an older command example says content/wechat.

If a Node one-liner needs to match Chinese text, prefer reading UTF-8 files directly or use Unicode escapes in the check script instead of piping raw Chinese through a shell that may recode it.

node --check scripts\wechat\create-draft.cjs

For a repository that uses scripts/wechat/create-draft.cjs, the draft command usually looks like:

node scripts\wechat\create-draft.cjs <article-directory>

Use WECHAT_MP_DRY_RUN=1 with WECHAT_MP_HTML_PREVIEW_PATH to generate the local HTML preview without WeChat API calls.

When updating an existing draft, set these only for the current shell:

$result = Get-Content -Raw -Encoding UTF8 content\wechat\<date>\wechat-draft-result.json | ConvertFrom-Json
$env:WECHAT_MP_UPDATE_DRAFT_MEDIA_ID = $result.draft_media_id
$env:WECHAT_MP_THUMB_MEDIA_ID = $result.thumb_media_id

Formal GZH Layout And Draft Gate

When the article is moving toward a real WeChat draft:

  1. Format gate. Prefer gzh-design if installed. Pick the theme by article type, generate the clean body HTML and preview wrapper, and run the validator until ERROR=0. Do not treat an unvalidated preview as publish-ready.
  2. Media gate. Preserve source screenshots, factual images, charts, and inline illustrations. Redesign explanatory cards to match the selected theme, but keep factual screenshots as factual screenshots with reader-facing captions.
  3. Draft-box gate. Updating the draft box is a write to the WeChat draft, not a publish. Reuse existing draft_media_id when updating the same article unless the user asks for a new draft.
  4. UI-prepare gate. Before publish, verify or ask the user to verify original/comment/appreciation states. If the draft content changed after the last UI prepare, the old UI prepare report is stale.
  5. Manifest gate. Publish automation must read the latest manifest/handoff file and stop on no_manifest, missing paths, stale UI prepare, low prediction score, too many revisions, window mismatch, or status not ready_for_publish.

Completion criterion: the final handoff can state the article path, prediction path, clean HTML/preview path, draft result, UI prepare state, manifest status, and whether the publish command was not run or was run with explicit current-turn approval.

Non-Negotiables

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.