aws-wechat-article-formatting
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese排版
Layout
公众号一键排版 —— Markdown 转微信后台可粘贴 HTML,多主题、多字号、所见即所得。
套件说明 · 本 skill 属一条龙套件(共 9 个 slug,入口aws-wechat-article-*)。跨 skill 的相对引用依赖同一aws-wechat-article-main目录,建议一并skills/全套。源码:https://github.com/aiworkskills/wechat-article-skillsclawhub install
One-click WeChat Official Account Layout — Converts Markdown to HTML that can be pasted into WeChat backend, with multiple themes, font sizes, and WYSIWYG.
Suite Description · This skill belongs to theone-stop suite (9 slugs in total, entry isaws-wechat-article-*). Cross-skill relative references depend on the sameaws-wechat-article-maindirectory, it is recommended to install the full set viaskills/together. Source code: https://github.com/aiworkskills/wechat-article-skillsclawhub install
能力披露(Capabilities)
Capability Disclosure
本 skill 为纯本地 Markdown → HTML 转换,零网络、零凭证。
- 凭证:无
- 网络:无
- 文件读(仓库内):、本篇
.aws-article/config.yaml、article.yaml、可选article.md、closing.md.aws-article/presets/formatting/<名>.yaml - 文件读(仓库外):还会检查用户家目录
format.py(跨项目共享的自定义排版主题;只读预设文件,不读凭证)。不需要这个能力可清空 / 不创建该目录~/.aws-article/presets/formatting/ - 文件写:本篇
article.html - shell:仅
python3 {baseDir}/scripts/format.py
This skill is a pure local Markdown → HTML conversion, no network, no credentials.
- Credentials: None
- Network: None
- File Read (Within Repository) : , current
.aws-article/config.yaml,article.yaml, optionalarticle.md,closing.md.aws-article/presets/formatting/<name>.yaml - File Read (Outside Repository) : also checks the user's home directory
format.py(custom layout themes shared across projects; only reads preset files, no credentials). This capability can be disabled by emptying/not creating this directory~/.aws-article/presets/formatting/ - File Write: Current
article.html - Shell: Only
python3 {baseDir}/scripts/format.py
配套 skill(informational)
Supporting Skills (informational)
本 skill 是 一条龙公众号套件的排版环节(入口 )。
aws-wechat-article-*aws-wechat-article-main- 单独安装可直接使用:本 skill 的脚本 零依赖、纯本地,无跨 skill 脚本调用。
format.py - 工作流文档中会链接到 (首次引导等)。套件未装齐时,链接跳转会断,但排版功能本身可用。
../aws-wechat-article-main/references/*.md
完整 9 slug 清单见 源码仓库。
This skill is the layout stage of the one-stop WeChat Official Account suite (entry is ).
aws-wechat-article-*aws-wechat-article-main- Can be used directly when installed separately: The script of this skill has zero dependencies, is pure local, and has no cross-skill script calls.
format.py - Workflow documents will link to (first-time guidance, etc.). When the suite is not fully installed, link jumps will break, but the layout function itself is still available.
../aws-wechat-article-main/references/*.md
The complete list of 9 slugs can be found in the source code repository.
路由
Routing
一键发文且未明确只要排版 → aws-wechat-article-main。
将 Markdown 文章转换为微信公众号兼容的 HTML,所有样式 inline。
One-click publishing without explicitly requesting only layout → aws-wechat-article-main.
Convert Markdown articles to HTML compatible with WeChat Official Accounts, with all styles inline.
脚本目录
Script Directory
Agent 执行:确定本 SKILL.md 所在目录为 。
{baseDir}| 脚本 | 用途 |
|---|---|
| Markdown → 微信兼容 HTML |
Agent Execution: Determine the directory where this SKILL.md is located as .
{baseDir}| Script | Purpose |
|---|---|
| Markdown → WeChat-compatible HTML |
配置检查 ⛔
Configuration Check ⛔
任何操作执行前,必须按 首次引导 执行其中的 「检测顺序」。单独启用本 skill 时同上。检测通过后才能进行以下操作(或用户明确书面确认「本次不检查」):
Before any operation, must follow the First-time Setup and execute the "Detection Sequence" within it. The same applies when enabling this skill alone. Only proceed with the following operations after passing the detection (or the user explicitly confirms in writing "No check this time"):
内置主题
Built-in Themes
| 主题 | 风格 | 适用场景 |
|---|---|---|
| 经典蓝 — 沉稳大气,色块小标题 | 科技、商业、通用 |
| 优雅紫 — 柔和圆润,左边框小标题 | 文化、美学 |
| 暖橙 — 活力大胆,色块小标题 | 自媒体、创业 |
| 极简黑 — 极度克制,大量留白 | 思想深度、学术 |
每个主题包含:标题样式(h1-h4)、段落、引用块、列表、分割线、图片、代码块、链接、强调色等完整规则。
| Theme | Style | Applicable Scenarios |
|---|---|---|
| Classic Blue — Calm and grand, colored block subheadings | Technology, business, general use |
| Elegant Purple — Soft and rounded, left-border subheadings | Culture, aesthetics |
| Warm Orange — Dynamic and bold, colored block subheadings | We Media, entrepreneurship |
| Minimalist Black — Extremely restrained, large white spaces | In-depth thinking, academia |
Each theme includes complete rules for title styles (h1-h4), paragraphs, quote blocks, lists, dividers, images, code blocks, links, accent colors, etc.
工作流
Workflow
排版进度:
- [ ] 第0步:配置检查(见本节「配置检查」)⛔
- [ ] 第1步:确定主题(与合并配置 / 用户指定)
- [ ] 第2步:转换
- [ ] 第3步:输出 HTMLLayout Progress:
- [ ] Step 0: Configuration Check (see "Configuration Check" in this section) ⛔
- [ ] Step 1: Determine Theme (merge with configuration / user-specified)
- [ ] Step 2: Conversion
- [ ] Step 3: Output HTML第1步:确定主题
Step 1: Determine Theme
主题解析顺序( 行为与智能体择一):
format.py- 命令行 :显式指定时始终优先。
--theme <名称> - 未传 :
--theme仅读取 与format.py同目录的article.md中article.yaml(须为 YAML 列表:default_format_preset或单元素[]);为空则用内置主题名[主题名]。default - 智能体在对话中帮用户选主题时,按:用户口述 → 本篇 →
article.yaml.default_format_preset自定义 → 内置.aws-article/presets/formatting/。default候选池解析由 main 在“本篇准备”阶段完成并写回custom_* / default_*。article.yaml
主题名须对应 内置主题 或 。字段说明见 articlescreening-schema.md(与仓库 顶层字段对齐)。
.aws-article/presets/formatting/<名>.yamlconfig.yamlTheme resolution order (choose one between behavior and the agent):
format.py- Command line : Always take precedence when explicitly specified.
--theme <name> - No passed:
--themeonly readsformat.pyindefault_format_presetin the same directory asarticle.yaml(must be a YAML list:article.mdor single element[]); use the built-in theme name[theme name]if empty.default - When the agent helps the user select a theme in the conversation, follow: user's statement → current article's → custom themes in
article.yaml.default_format_preset→ built-in.aws-article/presets/formatting/. The parsing ofdefaultcandidate pool is completed by main in the "Article Preparation" stage and written back tocustom_* / default_*.article.yaml
Theme names must correspond to built-in themes or . For field descriptions, see articlescreening-schema.md (aligned with top-level fields in the repository's ).
.aws-article/presets/formatting/<name>.yamlconfig.yaml第2步:转换
Step 2: Conversion
在仓库根执行(路径按实际本篇目录调整):
bash
undefinedExecute at the repository root (adjust the path according to the actual directory of this article):
bash
undefined不传 --theme:使用合并配置中的 default_format_preset,否则 default
No --theme passed: use default_format_preset in merged configuration, otherwise default
python {baseDir}/scripts/format.py drafts/YYYYMMDD-slug/article.md -o drafts/YYYYMMDD-slug/article.html
python {baseDir}/scripts/format.py drafts/YYYYMMDD-slug/article.md -o drafts/YYYYMMDD-slug/article.html
显式指定主题(覆盖配置)
Explicitly specify theme (overrides configuration)
python {baseDir}/scripts/format.py drafts/YYYYMMDD-slug/article.md --theme grace -o drafts/YYYYMMDD-slug/article.html
python {baseDir}/scripts/format.py drafts/YYYYMMDD-slug/article.md --theme grace -o drafts/YYYYMMDD-slug/article.html
自定义主色 / 字号
Custom main color / font size
python {baseDir}/scripts/format.py article.md --theme modern --color "#A93226"
python {baseDir}/scripts/format.py article.md --font-size 15px
python {baseDir}/scripts/format.py article.md --theme modern --color "#A93226"
python {baseDir}/scripts/format.py article.md --font-size 15px
列出可用主题
List available themes
python {baseDir}/scripts/format.py --list-themes
undefinedpython {baseDir}/scripts/format.py --list-themes
undefined嵌入元素 {embed:...}
{embed:...}Embedded Elements {embed:...}
{embed:...}- :名片 / 小程序 的
format.py以embeds为准;仅「往期链接」:本篇.aws-article/config.yaml可写article.yaml,与全局embeds.related_articles深度合并(用于每篇不同推荐)。合并结果中非空related_articles时解析embeds;否则不对嵌入占位符做替换(视为无配置)。{embed:profile|miniprogram|miniprogram_card|link:名称} - 与 writing 结构模板 中的占位说明一致。
- :
format.pyfor business cards / mini-programs are based onembeds; only "previous links": current article's.aws-article/config.yamlcan writearticle.yaml, which is deeply merged with the globalembeds.related_articles(used for different recommendations per article). When the merged result has non-emptyrelated_articles, parseembeds; otherwise, do not replace the embed placeholders (considered as no configuration).{embed:profile|miniprogram|miniprogram_card|link:name} - Consistent with the placeholder description in Writing Structure Template.
第3步:输出 HTML
Step 3: Output HTML
输出的 HTML 特性:
- 所有样式 inline(微信编辑器兼容)
- 正文不含文章标题:Markdown 中第一个 (h1)在转换时被跳过,标题在公众号后台单独填写,正文不重复
# - 配图标记 保留为
标签,待 images skill 替换<img> - 图注自动从标记描述中提取
- 同目录存在 时,
closing.md会追加到文末(脚本既有行为)format.py
HTML Output Features:
- All styles are inline (compatible with WeChat editor)
- Article title not included in main text: The first (h1) in Markdown is skipped during conversion; the title is filled separately in the WeChat backend and will not be repeated in the main text
# - Image markers are retained as
tags, to be replaced by the images skill<img> - Image captions are automatically extracted from the marker description
- If exists in the same directory,
closing.mdwill append it to the end of the article (existing behavior of the script)format.py
选项
Options
| 选项 | 说明 | 默认值 |
|---|---|---|
| 主题;省略则按合并配置 → default | 见上文 |
| 自定义主色 | 主题默认 |
| 字号 | 16px |
| 输出路径 | 同名 .html |
| 列出可用主题 |
| Option | Description | Default Value |
|---|---|---|
| Theme; if omitted, follow merged configuration → default | See above |
| Custom main color | Theme default |
| Font size | 16px |
| Output path | Same name .html |
| List available themes |
自定义主题
Custom Themes
在 下新建主题文件即可。
.aws-article/presets/formatting/主题文件格式和扩展方式详见:references/presets/README.md
Create a new theme file under .
.aws-article/presets/formatting/For the theme file format and extension methods, see: references/presets/README.md
过程文件
Process Files
| 读取 | 产出 |
|---|---|
| |
| Read | Generated |
|---|---|
| |