← ClaudeAtlas

lark-to-wechat-mplisted

Use when syncing a Feishu (Lark) document or Wiki page to a WeChat Official Account (微信公众号) draft box. Handles Feishu CDN image migration to WeChat CDN, Markdown-to-WeChat HTML conversion (inline styles, callout blocks), and cover thumbnail creation. Requires WeChat AppID/AppSecret pre-configured.
CookiesHaha/ash-claude-skills · ★ 2 · AI & Automation · score 73
Install: claude install-skill CookiesHaha/ash-claude-skills
# lark-to-wechat-mp Sync a Feishu doc/wiki → WeChat Official Account draft in one workflow. Images are migrated, formatting is preserved. ## Prerequisites **CRITICAL — 执行前 MUST 先用 Read 工具读取 [`../lark-shared/SKILL.md`](../lark-shared/SKILL.md)**(lark-cli 认证、权限) 1. lark-cli configured with user identity 2. WeChat config at `~/.claude/wechat-mp.json` (see Setup) 3. Current machine IP in WeChat IP Whitelist ## Setup ### 1. WeChat Config File ```bash cat > ~/.claude/wechat-mp.json << 'EOF' { "app_id": "wx...", "app_secret": "YOUR_APP_SECRET" } EOF chmod 600 ~/.claude/wechat-mp.json ``` ### 2. IP Whitelist(首次必做,只做一次) 1. 打开 [微信公众平台](https://mp.weixin.qq.com/) → 设置与开发 → 基本配置 2. **IP白名单** → 添加当前机器 IP 3. 获取当前 IP:`curl -s ifconfig.me` --- ## Workflow(每次同步执行以下步骤) ### Step 1 — 读取配置,获取 Access Token ```bash APP_ID=$(python3 -c "import json; c=json.load(open(os.path.expanduser('~/.claude/wechat-mp.json'))); print(c['app_id'])" 2>/dev/null || \ python3 -c "import json,os; c=json.load(open(os.path.expanduser('~/.claude/wechat-mp.json'))); print(c['app_id'])") APP_SECRET=$(python3 -c "import json,os; c=json.load(open(os.path.expanduser('~/.claude/wechat-mp.json'))); print(c['app_secret'])") TOKEN=$(curl -s "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${APP_ID}&secret=${APP_SECRET}" | python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])") echo "Token OK: ${TOKEN:0:20}..." ``` ### Step 2 — 拉取飞书文���(Markdown 格式) ```bash DOC_UR