One‑Click AI‑Powered WeChat Article Creation: Write, Illustrate, and Publish Automatically
This guide walks you through building an automated workflow that uses Google’s Antigravity AI to generate a fully formatted WeChat public‑account article—including text, multiple high‑quality images, cloud upload, and markdown‑to‑WeChat conversion—so you can copy‑paste the result directly into the editor.
Many WeChat editors find the backend steps of writing, finding images, and formatting more cumbersome than writing the article itself.
Goal
Create a "Skill" that, given a topic, automatically produces a complete article with multiple high‑quality images, uploads the images to Tencent Cloud COS, converts the markdown to a format recognized by the WeChat editor, and outputs a ready‑to‑paste file.
Core workflow (six steps)
Intelligent drafting : AI writes a well‑structured article based on the input topic.
Precise image generation : AI analyses each paragraph and generates matching images.
Automatic upload : A script uploads the images to a cloud image host (e.g., Tencent Cloud COS).
Link replacement : Local image paths are replaced with the returned COS URLs.
Format conversion : A conversion script turns the markdown into the rich‑text format accepted by the WeChat editor.
Finalization : The result can be copied, pasted, and published in one step.
Step 1 – Directory layout
Set up the following folders and files: SKILLS.md: Skill definition. resources/html: Destination for optional HTML output. resources/images: Temporary storage for AI‑generated pictures. resources/article.md: The raw markdown article produced by the AI. scripts/convert_to_wechat.py: Core script that performs markdown‑to‑WeChat conversion. scripts/upload_to_cos.py: Script that uploads images to Tencent Cloud COS. .env: Stores cloud credentials; should be kept secret and added to .gitignore.
Step 2 – Write the skill manifest
Use a simple markdown file; Antigravity’s autocomplete assists the author. Example manifest:
---
name: 微信文章助手
version: 2.0.0
description: 帮助写一篇图文并茂的微信文章,根据用户输入的主题,先用markdown写出来文章,进行配图,上传到腾讯云COS,最后生成可直接复制到微信编辑器的markdown文章。
---
# 任务流程
## 第一步:编写文章
1. 用户输入主题
2. 根据主题撰写约 500 字的文章
3. 使用 markdown 排版
## 第二步:配图
1. 分析文章结构,定位需要配图的段落
2. 调用 generate_image 工具生成配图
- 比例:16:9
- 风格:超真实、照片级
- 质量:1K
- 数量:每篇不超过 3 张
## 第三步:上传图片到腾讯云 COS
1. 将图片保存到 /resources/images/ 并按顺序命名
2. 调用 scripts/upload_to_cos.py 上传
3. 获取 COS URL
## 第四步:生成微信编辑器兼容的 Markdown
1. 调用 scripts/convert_to_wechat.py 转换
2. 脚本自动替换本地路径为 COS URL
3. 输出可直接复制的 markdown
## 第五步:保存并复制文章
1. 转换后保存为 /resources/article_wechat.md
2. 全选复制内容
3. 粘贴到微信公众号编辑器Step 3 – Configure Tencent Cloud COS
Copy .env.example to .env and fill in COS_SECRET_ID, COS_SECRET_KEY, COS_BUCKET, and COS_REGION. Install dependencies with pip install cos-python-sdk-v5 markdown.
Step 4 – Security reminder
The .env file contains sensitive keys; it is listed in .gitignore and must not be committed.
Ensure uploaded images are publicly accessible via their COS URLs.
Step 5 – Run the skill
Execute the workflow, provide a topic such as 咪蒙风格的鸡汤文:职场女性, and let the AI generate the article, images, upload them, and produce article_wechat.md. The final file can be copied into the WeChat editor with proper formatting and embedded images.
Conclusion
The example demonstrates how AI can automate repetitive content‑creation tasks, freeing designers and writers to focus on creativity. The same pattern can be extended to more complex skills.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Design Hub
Periodically delivers AI‑assisted design tips and the latest design news, covering industrial, architectural, graphic, and UX design. A concise, all‑round source of updates to boost your creative work.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
