Back to Skills

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)。

3,136stars365forksUpdated 8/16/2026

Security Assessment

Safe(95/100)
Security Score95/100

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 files
scripts/component_lint.py3.1 KB
View
archive/themes-v1/theme-mist-blue.md19.8 KB
View
archive/themes-v1/theme-emerald-tech.md19.9 KB
View
archive/themes-v1/theme-morandi.md19.4 KB
View
archive/themes-v1/theme-slate-minimal.md16.7 KB
View
assets/sample-article.md1.1 KB
View
.github/ISSUE_TEMPLATE/bug_report.md0.3 KB
View
.gitignore0.2 KB
View
README.en.md15.3 KB
View
README.md11.6 KB
View
archive/gallery-v1/heikeji.html20.5 KB
View
archive/gallery-v1/jiaotang.html15.7 KB
View
archive/gallery-v1/qingshiban.html15.0 KB
View
archive/gallery-v1/magfeature.html20.4 KB
View
archive/gallery-v1/zise.html15.7 KB
View
archive/gallery-v1/rich_terminal.html16.5 KB
View
archive/themes-v1/theme-card-notes.md26.4 KB
View
archive/themes-v1/theme-data-infographic.md28.9 KB
View
archive/themes-v1/theme-indigo-business.md16.1 KB
View
archive/themes-v1/theme-rose-pink.md17.9 KB
View
archive/themes-v1/theme-terminal.md21.2 KB
View
docs/all-themes.md1.6 KB
View
docs/gallery/moyu-green.html22.7 KB
View
docs/gallery/olive-journal.html24.5 KB
View
references/eval-cases.md2.7 KB
View
references/theme-index.md1.7 KB
View
docs/gallery/zen-whitespace.html15.2 KB
View
scripts/wrap_preview.py1.3 KB
View
SKILL.md8.5 KB
View
.github/ISSUE_TEMPLATE/theme_request.md0.3 KB
View
archive/gallery-v1/cardnote.html16.8 KB
View
archive/gallery-v1/dianlan.html15.7 KB
View
archive/gallery-v1/graphite.html17.4 KB
View
LICENSE34.1 KB
View
archive/gallery-v1/meigui.html15.2 KB
View
archive/gallery-v1/rich_morandi.html14.1 KB
View
archive/gallery-v1/mistblue.html18.5 KB
View
archive/gallery-v1/rich_zen.html12.3 KB
View
archive/themes-v1/theme-amber-orange.md17.1 KB
View
archive/themes-v1/theme-editorial-feature.md19.9 KB
View
.github/PULL_REQUEST_TEMPLATE.md0.3 KB
View
CONTRIBUTING.md1.2 KB
View
archive/gallery-v1/cream.html16.3 KB
View
archive/gallery-v1/datainfo.html27.2 KB
View
archive/gallery-v1/heibaihui.html15.4 KB
View
archive/gallery-v1/hongbai.html15.2 KB
View
archive/gallery-v1/hupo.html15.1 KB
View
archive/gallery-v1/lvkeji.html18.8 KB
View
archive/gallery-v1/rich_hongbai.html13.2 KB
View
archive/gallery-v1/tianlan.html14.3 KB
View
archive/themes-v1/theme-cream-warmth.md17.0 KB
View
archive/themes-v1/theme-caramel-brown.md17.5 KB
View
archive/themes-v1/theme-elegant-purple.md16.1 KB
View
archive/themes-v1/theme-sky-blue.md10.8 KB
View
archive/themes-v1/theme-mono-black.md14.8 KB
View
assets/preview-template.html2.7 KB
View
docs/gallery/index.html2.6 KB
View
archive/themes-v1/theme-terracotta-tech.md17.4 KB
View
docs/gallery/graphite-minimal.html16.6 KB
View
docs/gallery/moyu-ticket.html20.5 KB
View
docs/gallery/red-white.html17.0 KB
View
references/format-normalize.md2.1 KB
View
references/theme-generator.md11.6 KB
View
references/theme-moyu-ticket.md17.6 KB
View
references/theme-moyu-green.md36.4 KB
View
references/theme-red-white.md22.2 KB
View
assets/theme-previews/theme-mono-blue-editorial.html40.2 KB
View
docs/gallery/sample-article.md1.1 KB
View
references/common-components.md8.1 KB
View
references/theme-graphite-minimal.md24.5 KB
View
scripts/extract_docx.py5.6 KB
View
scripts/validate_gzh_html.py5.9 KB
View
references/theme-olive-journal.md44.7 KB
View
references/theme-zen-whitespace.md16.7 KB
View

Install gzh-design

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill