Md2wechat

From aAAaqwq/AGI-Super-Team · View interactive version

Md2wechat is an AI agent skill from the GitHub repository aAAaqwq/AGI-Super-Team. Convert Markdown to WeChat Official Account HTML, inspect supported providers/themes/prompts, generate article images, create drafts, write with creator styles, and remove AI writing traces.

How to use this skill

Skill file

md2wechat

Use md2wechat when the user wants to:

Intent Routing

Choose the command family before doing any publish action:

Defaults And Config

1. ~/.config/md2wechat/config.yaml

2. environment variables such as MD2WECHAT_BASE_URL

3. project-local md2wechat.yaml, md2wechat.yml, or md2wechat.json

Discovery First

Run these before selecting a provider, theme, or prompt:

Inspect a specific resource before using it:

When choosing image presets, prefer the prompt metadata returned by prompts show --json, especially primary_use_case, compatible_use_cases, recommended_aspect_ratios, and default_aspect_ratio.

When choosing an image model, prefer providers show <name> --json and read supported_models before hard-coding --model.

Core Commands

Configuration:

Conversion:

Image handling:

Drafts and image posts:

Writing and humanizing:

Article Metadata Rules

For convert, metadata resolution is:

Limits enforced by the CLI:

Draft behavior:

Agent Rules

Custom AI Themes (Daniel Li · agi-super-team)

When using md2wechat convert --mode ai --theme custom, select the appropriate theme from below based on article content and audience. Provide the full theme specification as the AI prompt for conversion.

Theme Selection Guide

| Category | # | Theme Name | Best For |

|----------|---|------------|----------|

| 极简系 | 01 | Swiss Minimal | 设计、建筑、现代艺术 |

| 极简系 | 02 | Nordic Clean | 生活方式、家居、旅行 |

| 极简系 | 03 | Japanese Zen | 哲学、散文、东方美学 |

| 极简系 | 04 | Editorial Print | 深度报道、行业分析 |

| 暖色系 | 05 | Golden Hour | 生活方式、美食、情感 |

| 暖色系 | 06 | Coffee Notes | 创业日记、散文、感悟 |

| 暖色系 | 09 | Rose Quartz | 女性向、美妆、情感 |

| 暖色系 | 20 | Desert Dawn | 旅行、探险、自由生活 |

| 暗色系 | 07 | Elegant Noir | 品牌故事、高端生活方式 |

| 暗色系 | 08 | Deep Ocean | AI、科技、数据分析 |

| 暗色系 | 10 | Cyber Neon | 极客、Web3、未来文化 |

| 暗色系 | 18 | Midnight Blue | 深夜阅读、诗歌、哲学 |

| 文艺系 | 11 | Monet Garden | 文艺、艺术、自然 |

| 文艺系 | 12 | Academic Classic | 学术、知识、历史 |

| 文艺系 | 14 | Ink Wash | 东方文化、书画、禅 |

| 文艺系 | 17 | Forest Mist | 自然、冥想、可持续 |

| 现代系 | 13 | Aurora Gradient | 创意、设计、未来趋势 |

| 现代系 | 15 | Glass Morphism | 产品设计、UX、生活方式 |

| 现代系 | 16 | Brutalist Raw | 街头文化、独立观点 |

| 现代系 | 19 | Summer Mint | 流行文化、社交媒体 |


极简系

01 · Swiss Minimal
02 · Nordic Clean
03 · Japanese Zen
04 · Editorial Print

暖色系

05 · Golden Hour
06 · Coffee Notes
09 · Rose Quartz
20 · Desert Dawn

暗色系

07 · Elegant Noir
08 · Deep Ocean
10 · Cyber Neon
18 · Midnight Blue

文艺系

11 · Monet Garden
12 · Academic Classic
14 · Ink Wash
17 · Forest Mist

现代系

13 · Aurora Gradient
15 · Glass Morphism
16 · Brutalist Raw
19 · Summer Mint

Usage with md2wechat

To use these themes with md2wechat AI mode, specify the theme name and provide its specification as the AI prompt:

# AI mode with custom theme prompt
md2wechat convert article.md --mode ai --theme custom --preview

# Combine with humanization
md2wechat convert article.md --mode ai --theme custom --preview
md2wechat humanize article.md --intensity medium

# Full pipeline with cover generation
md2wechat convert article.md --mode ai --theme custom -o output.html
md2wechat generate_cover --article article.md --preset cover-hero
md2wechat convert output.html --draft --cover cover.jpg

When using AI mode conversion, embed the selected theme's color palette, font stack, layout rules, and CSS core into the AI prompt to guide the HTML generation.

Safety And Transparency

Mandatory Pre-Publish Layout Review (强制排版审查)

铁律 (2026-06-03, Daniel Li 反馈): 公众号发布前 必须 先渲染 HTML 视觉预览 → 检查渲染问题 → 修复后再发布。绝不允许「渲染→发布」二步并一步。

为什么

WeChat 公众号编辑器和常规 HTML 浏览器渲染存在以下差异,不预览直接发布会导致用户在前台看到排版事故:

  1. 公众号样式覆盖不可控 — <style> 中的部分 CSS 会被微信编辑器过滤(如 position: fixed)
  2. 主题/模板的"装饰元素"在公众号里会变成视觉噪点 — 例如 tech 主题在每个 <li> 前面注入 $ 装饰 span,叠加微信默认 list-style:disc 会出现 •$ 文本 双重前缀
  3. 代码高亮的内联 span 在某些主题里会被错误合并或嵌套
  4. blockquote 的渐变背景在暗色主题下可能让文字不可读

强制 5 步审查流程

每次发布前必须执行,不允许跳过:

# Step 1: 渲染并保存 HTML
md2wechat convert article.md --mode ai --theme <theme> -o /tmp/review.html

# Step 2: 视觉预览(生成本地 HTML 截图或浏览器打开)
open /tmp/review.html  # macOS
# 或使用 Playwright/Chrome 截图
playwright screenshot --full-page /tmp/review.html /tmp/review.png

# Step 3: 检查清单(必须全部 ✅ 才能发布)
#   ✅ list 渲染:ul/ol 是否有重复前缀($ / • / -)
#   ✅ list 渲染:是否有 list-style:none 与 list-style-type 冲突
#   ✅ code 渲染:代码块是否有高亮 span 嵌套错误
#   ✅ table 渲染:表头和隔行背景是否清晰
#   ✅ blockquote 渲染:暗色主题下文字是否可读
#   ✅ heading 渲染:H1/H2 编号徽章是否对齐
#   ✅ 图片渲染:cover 和内联图是否上传成功、是否溢出

# Step 4: 修复(用 scripts/fix-list-rendering.js 等后处理脚本)
node scripts/fix-list-rendering.js /tmp/review.html -o /tmp/review-fixed.html

# Step 5: 重新预览 → 确认无误 → 才允许发布
md2wechat convert /tmp/review-fixed.html --draft --cover cover.jpg

已知主题渲染陷阱 (Common Rendering Issues)

| 主题 | 问题 | 修复 |

|------|------|------|

| tech (深色终端风) | <li> 前面有 $ 装饰 span + list-style:none,与 <ul> 的 list-style-type:disc 冲突 → 公众号渲染出 •$ 文本 双重前缀 | 移除 $ span,移除 list-style:none,让微信默认 disc/decimal 渲染 |

| tech | blockquote 使用 linear-gradient(#0F172A,#1E293B) 深色背景 + #94A3B8 浅灰文字 → 部分主题下文字-背景对比度 < 4.5:1,无障碍不达标 | 提高文字色亮度到 #D1FAE5 或 #E0F2F1 |

| tech | 代码块 <code> 内联 span 颜色 #B91C1C 在深色背景下对比度不足 | 改为 #FCA5A5 或 #FECACA |

| business | 表格 <th> 渐变背景在公众号中可能丢失,文字看不清 | 改用纯色 #1E40AF |

| simple | H2 左侧 4px 绿色竖条在某些公众号编辑器被裁切 | 改用 border-left: 4px solid 而非 box-shadow |

| 任何主题 | <ul style="padding-left:28px"> 在 6.5 寸屏上偏右 | 改 padding-left:24px |

自动化审查脚本

发布前必跑的修复脚本(位于 scripts/):

不允许的操作

审查后必须报告

每次发布到草稿箱前,AI Agent 必须输出审查报告:

✅ 排版审查报告 (2026-06-03)
- 主题: tech (深色终端风)
- 文件: /tmp/review-fixed.html
- 列表 ul/ol: 0 个重复前缀 / 0 个 list-style:none
- 代码块: 12 个,高亮正常
- 表格: 1 个,隔行背景正常
- 引用块: 0 个,文字可读
- 封面: markitdown-cover.png ✅
- 审查结论: 可发布
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.