gzh-design
微信公众号文章排版引擎,将 Markdown 转换为可直接粘贴到公众号编辑器的 HTML。主题风格从 references/theme-index.md 注册的自定义主题库中选取,自动章节编号、关键词下划线标记、引言卡片、目录导航、代码块、图片/GIF、作者签名。支持 Markdown / Word(.docx) / PDF / 纯文本输入(非 Markdown 先自动归一化),也支持"一键自动排版"(自动推断结构+选主题),还支持根据用户描述/参考图生成自定义主题组件库并保存本地复用。触发场景:(1) 用户提到"公众号排版""公众号文章""微信排版""gzh",(2) 用户想把文章(md/docx/pdf/纯文本)转成公众号 HTML,(3) 用户说"自动排版""一键排版"公众号内容,(4) 用户想为公众号排版"生成新主题/自定义风格/按这张图做一套组件库"。不用于生成普通网页/落地页/PPT(用前端或 PPT 类 skill)。
Security Assessment
About gzh-design
gzh-design is a WeChat Official Account (公众号) article-layout engine that converts a Markdown article into HTML you can paste straight into the WeChat editor without losing its styling. It solves the recurring pain of formatting long-form content for a platform that strips <style> tags, CSS classes, media queries, animations, grid, and CSS variables — the skill emits only inline-styled <section> fragments that survive the paste. Non-Markdown inputs (Word .docx, PDF, plain text, rich web text) are first normalized into a Markdown draft, using a bundled docx-extraction script for Word files and paged reading for PDFs.
The core asset is a library of registered themes under references/, each providing design variables, complete component HTML, a template skeleton, and mapping rules, plus a shared incremental library for code blocks, images/GIFs, and label headings. The workflow recommends a theme by matching article genre against theme-index, parses the Markdown structure (title, intro quote, sections, inline emphasis, images, code, tables), assembles components by recipe, and then runs a validation script that deterministically checks for platform-forbidden constructs and required span wrapping before delivery. A one-click auto mode can infer structure and pick a theme without prompting, and users can generate and save new custom themes from a description or reference image.
It targets Chinese content creators, marketers, and technical writers who publish to WeChat Official Accounts and want consistent, editor-safe typography — tutorials, roundups, opinion pieces, interviews, and data recaps — without hand-writing inline HTML for every article.
FAQ
What input formats can it handle?
Markdown text or .md files go straight into the pipeline; Word (.docx), PDF, plain text, and rich web text are first normalized to a Markdown draft (docx via the bundled extract_docx.py script, PDF via paged reading and noise cleanup) before layout.
Why does the output only contain <section> fragments?
The WeChat editor only accepts body fragments and discards document wrappers, so the skill deliberately outputs a pure inline-styled section fragment with no <!DOCTYPE>, <html>, <head>, or <body>, ensuring the styling survives the paste.
How do I get the result into WeChat?
The skill saves a clean HTML file and also generates a preview page with a Copy button (via wrap_preview.py); you open the preview, click Copy to WeChat, then paste into the editor. The clean file is provided as a manual fallback.
Is the output validated before delivery?
Yes. After writing the HTML, the skill must run validate_gzh_html.py, which checks platform-forbidden items and span-leaf wrapping. All ERRORs (and half-width punctuation WARNINGs) must be cleared before the article is considered done.
Can I create my own visual style?
Yes. If none of the registered themes fit, the skill can generate a new custom theme component library from your description or a reference image, register it in theme-index, and reuse it locally for future articles.
All Files
74 filesInstall gzh-design
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
isjiamu/gzh-design-skill