wechat-article-publisher▌
iamzifei/wechat-article-publisher-skill · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Publish Markdown or HTML articles to WeChat Official Account drafts via API.
- ›Supports both Markdown and HTML file formats with automatic conversion; HTML preserves original formatting
- ›Two article types available: standard news format and image-focused newspic (小绿书) mode
- ›Requires WECHAT_API_KEY environment variable and authorized WeChat account on wx.limyai.com
- ›Publishes to drafts only (user manually publishes in WeChat admin panel); includes account listing and error handling for
WeChat Article Publisher
Publish Markdown or HTML content to WeChat Official Account drafts via API, with automatic format conversion.
Prerequisites
- WECHAT_API_KEY environment variable set (from .env file)
- Python 3.9+
- Authorized WeChat Official Account on wx.limyai.com
Scripts
Located in ~/.claude/skills/wechat-article-publisher/scripts/:
wechat_api.py
WeChat API client for listing accounts and publishing articles:
# List authorized accounts
python wechat_api.py list-accounts
# Publish from markdown file
python wechat_api.py publish --appid <wechat_appid> --markdown /path/to/article.md
# Publish from HTML file (preserves formatting)
python wechat_api.py publish --appid <wechat_appid> --html /path/to/article.html
# Publish with custom options
python wechat_api.py publish --appid <appid> --markdown /path/to/article.md --type newspic
parse_markdown.py
Parse Markdown and extract structured data (optional, for advanced use):
python parse_markdown.py <markdown_file> [--output json|html]
Workflow
Strategy: "API-First Publishing"
Unlike browser-based publishing, this skill uses direct API calls for reliable, fast publishing.
- Load WECHAT_API_KEY from environment
- List available WeChat accounts (if user hasn't specified)
- Detect file format (Markdown or HTML) and parse accordingly
- Call publish API to create draft in WeChat
- Report success with draft details
Supported File Formats:
.mdfiles → Parsed as Markdown, converted by WeChat API.htmlfiles → Sent as HTML, formatting preserved
Step-by-Step Guide
Step 1: Check API Key
Before any operation, verify the API key is available:
# Check if .env file exists and contains WECHAT_API_KEY
cat .env | grep WECHAT_API_KEY
If not set, remind user to:
- Copy
.env.exampleto.env - Set their
WECHAT_API_KEYvalue
Step 2: List Available Accounts
Get the list of authorized WeChat accounts:
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py list-accounts
Output example:
{
"success": true,
"data": {
"accounts": [
{
"name": "我的公众号",
"wechatAppid": "wx1234567890",
"username": "gh_abc123",
"type": "subscription",
"verified": true,
"status": "active"
}
],
"total": 1
}
}
Important:
- If only one account, use it automatically
- If multiple accounts, ask user to choose
- Note the
wechatAppidfor publishing
Step 3: Publish Article
For Markdown files:
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py publish \
--appid <wechatAppid> \
--markdown /path/to/article.md
For HTML files (preserves formatting):
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py publish \
--appid <wechatAppid> \
--html /path/to/article.html
For 小绿书 (image-text mode):
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py publish \
--appid <wechatAppid> \
--markdown /path/to/article.md \
--type newspic
Success response:
{
"success": true,
"data": {
"publicationId": "uuid-here",
"materialId": "uuid-here",
"mediaId": "wechat-media-id",
"status": "published",
"message": "文章已成功发布到公众号草稿箱"
}
}
Step 4: Report Result
After successful publishing:
- Confirm the draft was created
- Remind user to review and publish manually in WeChat admin panel
- Provide any relevant IDs for reference
API Reference
Authentication
All API requests require the X-API-Key header:
X-API-Key: WECHAT_API_KEY
Get Accounts List
POST https://wx.limyai.com/api/openapi/wechat-accounts
Publish Article
POST https://wx.limyai.com/api/openapi/wechat-publish
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| wechatAppid | string | Yes | WeChat AppID |
| title | string | Yes | Article title (max 64 chars) |
| content | string | Yes | Article content (Markdown/HTML) |
| summary | string | No | Article summary (max 120 chars) |
| coverImage | string | No | Cover image URL |
| author | string | No | Author name |
| contentFormat | string | No | 'markdown' (default) or 'html' |
| articleType | string | No | 'news' (default) or 'newspic' |
Error Codes
| Code | Description |
|---|---|
| API_KEY_MISSING | API key not provided |
| API_KEY_INVALID | API key invalid |
| ACCOUNT_NOT_FOUND | Account not found or unauthorized |
| ACCOUNT_TOKEN_EXPIRED | Account authorization expired |
| INVALID_PARAMETER | Invalid parameter |
| WECHAT_API_ERROR | WeChat API call failed |
| INTERNAL_ERROR | Server error |
Critical Rules
- NEVER auto-publish - Only save to drafts, user publishes manually
- Check API key first - Fail fast if not configured
- List accounts first - User may have multiple accounts
- Handle errors gracefully - Show clear error messages
- Preserve original content - Don't modify user's markdown unnecessarily
Supported Formats
Markdown Files (.md)
- H1 header (# ) → Article title
- H2/H3 headers (##, ###) → Section headers
- Bold (text)
- Italic (text)
- Links text
- Blockquotes (> )
- Code blocks (
...) - Lists (- or 1.)
- Images
→ Auto-uploaded to WeChat
HTML Files (.html)
<title>or<h1>→ Article title- All HTML formatting preserved (styles, tables, etc.)
<img>tags → Images auto-uploaded to WeChat- First
<p>→ Auto-extracted as summary - Supports inline styles and rich formatting
HTML Title Extraction Priority:
<title>tag content- First
<h1>tag content - "Untitled" as fallback
HTML Content Extraction:
- If
<body>exists, uses body content - Otherwise, strips
<html>,<head>,<!DOCTYPE>and uses remaining content
Article Types
news (普通文章)
- Standard WeChat article format
- Full Markdown/HTML support
- Rich text with images
newspic (小绿书/图文消息)
- Image-focused format (like Instagram posts)
- Maximum 20 images extracted from content
- Text content limited to 1000 characters
- Images auto-uploaded to WeChat
Example Flow
Markdown File
User: "把 ~/articles/ai-tools.md 发布到微信公众号"
# Step 1: Verify API key
cat .env | grep WECHAT_API_KEY
# Step 2: List accounts
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py list-accounts
# Step 3: Publish (assuming single account with appid wx1234567890)
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py publish \
--appid wx1234567890 \
--markdown ~/articles/ai-tools.md
# Step 4: Report
# "文章已成功发布到公众号草稿箱!请登录微信公众平台预览并发布。"
HTML File
User: "把这个HTML文章发布到公众号:~/articles/newsletter.html"
# Step 1: Verify API key
cat .env | grep WECHAT_API_KEY
# Step 2: List accounts
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py list-accounts
# Step 3: Publish HTML (auto-detects format)
python ~/.claude/skills/wechat-article-publisher/scripts/wechat_api.py publish \
--appid wx1234567890 \
--html ~/articles/newsletter.html
# Step 4: Report
# "文章已成功发布到公众号草稿箱!HTML格式已保留。请登录微信公众平台预览并发布。"
Error Handling
API Key Not Found
Error: WECHAT_API_KEY environment variable not set.
Solution: Ask user to set up .env file with their API key.
Account Not Found
Error: ACCOUNT_NOT_FOUND - 公众号不存在或未授权
Solution: Ask user to authorize their account on wx.limyai.com.
Token Expired
Error: ACCOUNT_TOKEN_EXPIRED - 公众号授权已过期
Solution: Ask user to re-authorize on wx.limyai.com.
WeChat API Error
Error: WECHAT_API_ERROR - 微信接口调用失败
Solution: May be temporary issue, retry or check WeChat service status.
Best Practices
Why use API instead of browser automation?
- Reliability: Direct API calls are more stable than browser automation
- Speed: No browser startup, page loading, or UI interactions
- Simplicity: Single command to publish
- Portability: Works on any system with Python (no macOS-only dependencies)
Content Guidelines
- Images: Use public URLs when possible; local images will be uploaded
- Title: Keep under 64 characters
- Summary: Auto-extracted from first paragraph if not provided
- Cover: First image in markdown becomes cover if not specified
Workflow Efficiency
Minimal workflow (1 command):
- list-accounts → get appid → publish → done
Full workflow (with verification):
1. Check .env → list accounts → confirm with user
2. Publish with options → report result
Troubleshooting
Q: How do I get a WECHAT_API_KEY?
A: Register and authorize your WeChat account at wx.limyai.com to get your API key.
Q: Can I publish to multiple accounts?
A: Yes, use list-accounts to see all authorized accounts, then specify the target --appid.
Q: Images not showing in WeChat?
A: Ensure images are accessible URLs. Local images are auto-uploaded but may fail if path is incorrect.
Q: Title is too long?
A: WeChat limits titles to 64 characters. The script will use the first 64 chars of H1.
Q: What's the difference between news and newspic?
A: news is standard article format; newspic (小绿书) is image-focused with limited text.
How to use wechat-article-publisher on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add wechat-article-publisher
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches wechat-article-publisher from GitHub repository iamzifei/wechat-article-publisher-skill and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate wechat-article-publisher. Access the skill through slash commands (e.g., /wechat-article-publisher) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.4★★★★★70 reviews- ★★★★★Chen Sharma· Dec 28, 2024
I recommend wechat-article-publisher for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Ira Flores· Dec 12, 2024
Registry listing for wechat-article-publisher matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Chaitanya Patil· Dec 8, 2024
wechat-article-publisher fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Ira Okafor· Dec 8, 2024
Useful defaults in wechat-article-publisher — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Piyush G· Nov 27, 2024
wechat-article-publisher is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Zaid Menon· Nov 27, 2024
Registry listing for wechat-article-publisher matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Chinedu Perez· Nov 19, 2024
wechat-article-publisher reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Diego Kim· Nov 11, 2024
wechat-article-publisher has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Yusuf Patel· Nov 7, 2024
Solid pick for teams standardizing on skills: wechat-article-publisher is focused, and the summary matches what you get after install.
- ★★★★★Ira Ramirez· Nov 7, 2024
wechat-article-publisher has been reliable in day-to-day use. Documentation quality is above average for community skills.
showing 1-10 of 70