wechat-article
npx skills add https://github.com/freeany/wechat-article --skill wechat-article
Agent 安装分布
Skill 文档
WeChat Article Converter
Overview
Convert Markdown articles to WeChat Official Account (微信å
¬ä¼å·) compatible HTML format with themed styling and inline CSS. This skill handles the entire conversion process automatically using the md_to_wechat.py script.
Core capability: Transform standard Markdown â WeChat-compatible HTML with professional styling.
Workflow
Step 1: Identify User Request
Trigger this skill when user asks for:
- Converting Markdown to WeChat format
- “转æ¢ä¸ºå¾®ä¿¡å ¬ä¼å·æ ¼å¼”
- “çæå¾®ä¿¡æç« “
- “å ¬ä¼å·æç”
- Applying WeChat styling to articles
Step 2: Gather Required Information
Required:
- Input Markdown file path (from user request or current directory)
ALWAYS Ask User for Theme Selection:
Use AskUserQuestion tool to present theme options to the user interactively.
Present these 3 theme options:
| Option | Theme Name | Best For |
|---|---|---|
| default | ä¸ä¸èè² | ææ¯æç« ãæç¨ãéç¨å 容 |
| orange | æ´»åæ© | è¿å¨ãç¾é£ã娱ä¹ãä¿éæ´»å¨ |
| grid | æ ¼åä¸»é¢ | 带åºå·å¾½ç« ãå¨ç»ææï¼æ¯ææ¸ æ°ç»¿/大æ°èé è² |
Exception: Skip theme selection if user explicitly specifies theme in request.
Important: If user selects “grid” theme, ask for color preference: -æ¸ æ°ç»¿ (green) – #52c41aï¼éåçæ´»æ¹å¼ãå¥åº·ãç¯ä¿
- 大æ°è (blue) – #007AFFï¼éåç§æãåå¡ãä¸ä¸å 容
Additional Options (ask if needed):
- Article title for WeChat header (default: none)
- Include WeChat header/footer (default: yes)
Step 3: Execute Conversion
Important: Always use the absolute path to the skill script:
python3 ~/.claude/skills/wechat-article/scripts/md_to_wechat.py <input.md> [output.html] [options]
ALWAYS use –preview flag to open browser with copy button:
-
Basic conversion with browser preview (RECOMMENDED):
python3 ~/.claude/skills/wechat-article/scripts/md_to_wechat.py input.md --theme <selected-theme> --preview -
With title and browser preview:
python3 ~/.claude/skills/wechat-article/scripts/md_to_wechat.py input.md --theme <theme> --title "<article-title>" --preview -
Content only (no WeChat elements) with preview:
python3 ~/.claude/skills/wechat-article/scripts/md_to_wechat.py input.md --theme <theme> --no-header-footer --preview
Note: The –preview flag will automatically open a browser page with:
- Article preview
- “å¤å¶ HTML ä»£ç ” button to copy the HTML
- Instructions for pasting into WeChat editor
- Visual preview of the styled article
Step 4: Present Results to User
Always:
- Confirm conversion completed successfully
- Show which theme was used
- Show output file location
- Display a preview of the generated HTML (first ~30 lines)
- Remind user they can copy-paste the HTML into WeChat editor
Example Interactions
Example 1: Standard workflow with theme selection and browser preview
User: "æ article.md 转æå¾®ä¿¡å
¬ä¼å·æ ¼å¼"
Claude: [Uses AskUserQuestion]
"è¯·éæ©æç« 主é¢é£æ ¼ï¼
⢠default - ä¸ä¸èè²ï¼ææ¯æç« ãæç¨ãéç¨å
容ï¼
⢠orange - æ´»åæ©ï¼è¿å¨ãç¾é£ã娱ä¹ãä¿éæ´»å¨ï¼
⢠grid - æ ¼å主é¢ï¼å¸¦åºå·å¾½ç« ãå¨ç»ææï¼æ¯ææ¸
æ°ç»¿/大æ°èé
è²ï¼"
User: [Selects] "grid"
Claude: [Uses AskUserQuestion]
"è¯·éæ©æ ¼å主é¢é
è²ï¼
⢠green - æ¸
æ°ç»¿ (#52c41a) - çæ´»æ¹å¼ãå¥åº·ãç¯ä¿
⢠blue - 大æ°è (#007AFF) - ç§æãåå¡ãä¸ä¸å
容"
User: [Selects] "blue"
Claude: [Executes] python3 ~/.claude/skills/wechat-article/scripts/md_to_wechat.py article.md --theme grid --grid-color blue --preview
Claude: â
ä½¿ç¨æ ¼å主é¢ï¼å¤§æ°èï¼è½¬æ¢æåï¼æµè§å¨å·²æå¼é¢è§é¡µé¢ï¼ç¹å»"å¤å¶ HTML 代ç "æé®å³å¯å¤å¶å°å¾®ä¿¡å
¬ä¼å·ç¼è¾å¨ã
Example 2: User specifies theme directly
User: "è½¬æ¢æå¾®ä¿¡å
¬ä¼å·æç« ï¼ç¨é»è®¤ä¸»é¢"
Claude: [Skips theme selection, user already specified]
Claude: [Executes] python3 ~/.claude/skills/wechat-article/scripts/md_to_wechat.py article.md --theme default --preview
Claude: â
使ç¨ä¸ä¸èè²ä¸»é¢è½¬æ¢æåï¼æµè§å¨å·²æå¼é¢è§é¡µé¢ã
Implementation Notes
Available Themes
The skill currently includes 3 themes:
-
default (ä¸ä¸èè²) – Professional blue theme
- Primary color: #1e6bb8
- Best for: Technical articles, tutorials, general content
-
orange (æ´»åæ©) – Vibrant orange theme
- Primary color: #e67e22
- Best for: Sports, food, entertainment, promotions
-
grid (æ ¼å主é¢) – Grid theme with number badges and animations
- Default color: #52c41a (fresh green)
- Alternative color: #007AFF (atmospheric blue)
- Features: Numbered heading badges, rotation animations, auto list nesting
- Best for: All content types, choose color based on topic
- Green: Lifestyle, health, environmental topics
- Blue: Technology, business, professional content
Dependencies
The script requires:
markdown>=3.5.0– Markdown parsingbeautifulsoup4>=4.12.0– HTML processingpygments>=2.16.0– Code syntax highlighting
Check if dependencies are installed before running. If not, install:
pip3 install markdown beautifulsoup4 pygments
Troubleshooting
Issue: Dependencies not found
Solution: Install with pip3 install markdown beautifulsoup4 pygments
Issue: Script not found
Solution: Use absolute path: ~/.claude/skills/wechat-article/scripts/md_to_wechat.py
Issue: WeChat styles not appearing Solution: Ensure user copies the entire HTML content including inline styles
Resources
scripts/md_to_wechat.py
Main conversion script. Execute with appropriate arguments based on user request.
references/themes.md
Detailed theme specifications. Consult when helping user understand theme differences.
assets/examples/sample.md
Example article demonstrating all supported features. Use for testing or showing user capabilities.