iamzifei/wechat-article-formatter-skill
Overview
This skill converts Markdown into styled HTML optimized for WeChat public account articles and automatically uploads local images to get online URLs. It applies a custom CSS theme, calls a rendering API, and returns ready-to-paste HTML that preserves alt text, titles, and formatting. The workflow includes image scanning/upload, bm.md rendering, and optional publishing to WeChat.
How this skill works
The skill reads Markdown (from a file path or pasted content) and loads custom CSS from styles/custom.css. It scans the Markdown for local images, resolves absolute paths (using the markdown file's directory or a user-provided base), uploads each local image via the /image-upload skill, and replaces local paths with returned online URLs. Finally it posts the updated Markdown plus CSS to the bm.md render API and returns the rendered HTML (saved to a .html file by default).
When to use it
- Preparing articles for WeChat public accounts to ensure consistent styling and mobile optimization
- Converting Markdown drafts with local images into HTML ready to paste into WeChat's editor
- Batch-processing markdown files that reference local assets and need hosted image URLs
- When you want a consistent theme (green-simple) and custom CSS applied automatically
- Before publishing drafts using an integrated publisher skill for WeChat
Best practices
- Provide a markdown file path when using relative image paths so the skill can resolve them automatically
- Keep local images organized inside or near the article folder to avoid missing-file errors
- Check the styles/custom.css to adjust typography or color accents before rendering
- Process images sequentially to reduce upload errors and rate limiting
- Review the image upload summary and fix any failed uploads before publishing
Example use cases
- Format /Users/james/articles/my-post.md: upload images, render HTML, save my-post.html
- Paste raw markdown in conversation and provide a base directory for resolving relative image paths
- Convert a technical post with code blocks and tables into WeChat-optimized HTML with syntax highlighting
- Automate article formatting and then publish the formatted HTML as a draft via /wechat-article-publisher
FAQ
You can provide a markdown file path or paste raw markdown content. For relative images with pasted content, also provide a base directory.
How are local images handled?
Local images are detected, absolute paths are resolved, each file is uploaded via /image-upload, and markdown image paths are replaced with returned URLs. A summary of uploads is reported.
Which rendering options are used?
The skill uses bm.md with markdownStyle set to "green-simple", platform "wechat", footnote links enabled, and openLinksInNewWindow true. Custom CSS from styles/custom.css is included.
Can you publish the formatted article to WeChat?
Yes. After formatting you will be asked if you want to publish a draft. If confirmed, the skill invokes /wechat-article-publisher with the formatted HTML.