aws-wechat-article-formatting

Original🇨🇳 Chinese
Translated
1 scriptsChecked / no sensitive code detected

WeChat Official Account Layout | Markdown to HTML | Layout Themes | Paragraph Styles — One-click layout tool for WeChat Official Accounts, converts Markdown manuscripts to HTML that can be pasted into WeChat backend, supports multiple themes, font sizes, paragraph style switching, and WYSIWYG. Targeted at WeChat Official Account editors, independent authors, and layout specialists. Trigger words: 'layout', 'format', 'beautify', 'formatting', 'font size', 'paragraph style', 'change layout theme', 'change format', 'convert to HTML', 'make it look better', 'adjust format'. For changing preset packages/brand packages/complete theme color schemes, use aws-wechat-article-assets; for multi-link workflows (writing + review + layout + image matching + publishing), use aws-wechat-article-main.

12installs
Added on

NPX Install

npx skill4agent add aiworkskills/wechat-article-skills aws-wechat-article-formatting

SKILL.md Content (Chinese)

View Translation Comparison →

Layout

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 the
aws-wechat-article-*
one-stop suite (9 slugs in total, entry is
aws-wechat-article-main
). Cross-skill relative references depend on the same
skills/
directory, it is recommended to install the full set via
clawhub install
together. Source code: https://github.com/aiworkskills/wechat-article-skills

Capability Disclosure

This skill is a pure local Markdown → HTML conversion, no network, no credentials.
  • Credentials: None
  • Network: None
  • File Read (Within Repository) :
    .aws-article/config.yaml
    , current
    article.yaml
    ,
    article.md
    , optional
    closing.md
    ,
    .aws-article/presets/formatting/<name>.yaml
  • File Read (Outside Repository) :
    format.py
    also checks the user's home directory
    ~/.aws-article/presets/formatting/
    (custom layout themes shared across projects; only reads preset files, no credentials). This capability can be disabled by emptying/not creating this directory
  • File Write: Current
    article.html
  • Shell: Only
    python3 {baseDir}/scripts/format.py

Supporting Skills (informational)

This skill is the layout stage of the
aws-wechat-article-*
one-stop WeChat Official Account suite (entry is
aws-wechat-article-main
).
  • Can be used directly when installed separately: The script
    format.py
    of this skill has zero dependencies, is pure local, and has no cross-skill script calls.
  • Workflow documents will link to
    ../aws-wechat-article-main/references/*.md
    (first-time guidance, etc.). When the suite is not fully installed, link jumps will break, but the layout function itself is still available.
The complete list of 9 slugs can be found in the source code repository.

Routing

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 Execution: Determine the directory where this SKILL.md is located as
{baseDir}
.
ScriptPurpose
scripts/format.py
Markdown → WeChat-compatible HTML

Configuration Check ⛔

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

ThemeStyleApplicable Scenarios
default
Classic Blue — Calm and grand, colored block subheadingsTechnology, business, general use
grace
Elegant Purple — Soft and rounded, left-border subheadingsCulture, aesthetics
modern
Warm Orange — Dynamic and bold, colored block subheadingsWe Media, entrepreneurship
simple
Minimalist Black — Extremely restrained, large white spacesIn-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

Layout 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

Step 1: Determine Theme

Theme resolution order (choose one between
format.py
behavior
and the agent):
  1. Command line
    --theme <name>
    : Always take precedence when explicitly specified.
  2. No
    --theme
    passed
    :
    format.py
    only reads
    default_format_preset
    in
    article.yaml
    in the same directory as
    article.md
    (must be a YAML list:
    []
    or single element
    [theme name]
    ); use the built-in theme name
    default
    if empty.
  3. When the agent helps the user select a theme in the conversation, follow: user's statement → current article's
    article.yaml.default_format_preset
    → custom themes in
    .aws-article/presets/formatting/
    → built-in
    default
    . The parsing of
    custom_* / default_*
    candidate pool is completed by main in the "Article Preparation" stage and written back to
    article.yaml
    .
Theme names must correspond to built-in themes or
.aws-article/presets/formatting/<name>.yaml
. For field descriptions, see articlescreening-schema.md (aligned with top-level fields in the repository's
config.yaml
).

Step 2: Conversion

Execute at the repository root (adjust the path according to the actual directory of this article):
bash
# 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

# Explicitly specify theme (overrides configuration)
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

# List available themes
python {baseDir}/scripts/format.py --list-themes

Embedded Elements
{embed:...}

  • format.py
    :
    embeds
    for business cards / mini-programs are based on
    .aws-article/config.yaml
    ; only "previous links": current article's
    article.yaml
    can write
    embeds.related_articles
    , which is deeply merged with the global
    related_articles
    (used for different recommendations per article). When the merged result has non-empty
    embeds
    , parse
    {embed:profile|miniprogram|miniprogram_card|link:name}
    ; otherwise, do not replace the embed placeholders (considered as no configuration).
  • Consistent with the placeholder description in Writing Structure Template.

Step 3: Output HTML

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
    ![Type: Description](placeholder)
    are retained as
    <img>
    tags, to be replaced by the images skill
  • Image captions are automatically extracted from the marker description
  • If
    closing.md
    exists in the same directory,
    format.py
    will append it to the end of the article (existing behavior of the script)

Options

OptionDescriptionDefault Value
--theme <name>
Theme; if omitted, follow merged configuration → defaultSee above
--color <hex>
Custom main colorTheme default
--font-size <px>
Font size16px
-o <path>
Output pathSame name .html
--list-themes
List available themes

Custom Themes

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

ReadGenerated
article.md
,
.aws-article/config.yaml
+ same directory
article.yaml
(default theme and
embeds
),
closing.md
(optional)
article.html