agentleFS
lingengyuanlingengyuan/my-skills/.claude/skills/md2wechat/SKILL.md

md2wechat

Skill9 starsChanged 3 days agoMITView on GitHub

Convert Markdown articles into WeChat Official Account compatible inline-styled HTML and optionally publish them to the WeChat draft box. Use when formatting articles for WeChat, rendering WeChat HTML, styling Markdown with themes, uploading article images, or publishing drafts to WeChat.

  • Reads credentials

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep this file local. The repository ignores Skill-level .env files.

    line 21
  2. Very specific:

    Image placeholders: Ensure no unexpanded __generate:...

    line 55
  3. Very specific:

    All CSS declarations must be inlined in style attributes.

    line 59
  4. Distinctive:

    Before completing the task, verify:

    line 66
  5. Distinctive:

    All styles are properly inlined on HTML elements.

    line 69
  6. Very specific:

    If publishing draft, the API response returns a valid media_id.

    line 71

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Markdown to WeChat Skill

Convert Markdown into WeChat Official Account compatible HTML with inline CSS styling, and optionally upload articles directly to the WeChat draft box.

Setup

HTML rendering requires Python 3.8+ and uses only the Python standard library.

Draft publishing requires valid credentials stored in a local .env file within this Skill's directory:

WECHAT_APPID=your_wechat_app_id
WECHAT_SECRET=your_wechat_secret

Keep this file local. The repository ignores Skill-level .env files.

Workflows

1. Render WeChat HTML (Local)

Render Markdown into styled HTML with inlined CSS:

python3 "<skill-dir>/scripts/md_ai_render.py" --md article.md --theme autumn-warm --out article.html

Supported preset themes:

  • autumn-warm: Warm orange tone, editorial styling
  • spring-fresh: Fresh green tone, clean reading
  • ocean-calm: Deep blue tone, technical and business style

For custom CSS rules and theme details, see references/themes.md.

2. Publish to WeChat Draft Box (Remote)

Publishing mutates external state on the WeChat platform. Execute publishing only when the user explicitly requests it:

python3 "<skill-dir>/scripts/wechat_publish.py" --env "<skill-dir>/.env" --md article.md --html article.html --draft --cover cover.jpg

See references/wechat-api.md for publishing API options and error codes.

Image Handling

  • Local images: Referenced local images are uploaded to WeChat permanent material storage during draft publishing and replaced with WeChat CDN URLs.
  • Remote images: Downloaded and uploaded to WeChat storage during publishing.
  • Cover image: Specify --cover <image-path> explicitly. If unspecified, ask the user before publishing.
  • Image placeholders: Ensure no unexpanded __generate:... placeholders remain in the final HTML. See references/image-syntax.md.

WeChat HTML Compatibility Rules

  • All CSS declarations must be inlined in style attributes.
  • Wrap body content in a top-level container <div>.
  • Explicitly specify font colors on <p> and heading tags to prevent WeChat dark mode overriding text colors.
  • Disallowed tags: <script>, <iframe>, <style>, <link>, <form>. See references/html-guide.md.

Verification Checklist

Before completing the task, verify:

  1. Rendered HTML file exists and is non-empty.
  2. All styles are properly inlined on HTML elements.
  3. Local image paths in Markdown resolve to valid image files on disk.
  4. If publishing draft, the API response returns a valid media_id.
  5. Report the output HTML path and publication status to the user.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.