Skip to content

Commit b38986b

Browse files
authored
Merge pull request #2 from DongDongBear/dongdong/feat-wechat-skill-3.30
Dongdong/feat wechat skill 3.30
2 parents 2424ed9 + f5a7c64 commit b38986b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+10189
-10
lines changed

skills/youmind-blog-cover/references/long-running-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ When a task involves polling or is expected to take more than a few seconds, **a
1616

1717
### What to Tell the User
1818

19-
After saving the content to YouMind and providing the link, tell the user (in their language):
19+
After saving the material to YouMind and providing the link, tell the user (in their language):
2020

2121
> "This may take 10-20 seconds. Would you like me to run this in the background so you can keep chatting? I'll notify you when it's done."
2222
@@ -30,7 +30,7 @@ Or, if the agent platform supports subagents (OpenClaw, Claude Code, etc.), the
3030
Never make the user wait for the entire batch to finish. Deliver results as they become available:
3131

3232
1. **Immediately after saving**: Show the YouMind material link (user can already view the video in YouMind)
33-
2. **As each result completes**: Output that transcript right away
33+
2. **As each transcript completes**: Output that transcript right away
3434
3. **After all done**: Show the summary table
3535

3636
### Implementation Note for Skill Authors

skills/youmind-deep-research/references/long-running-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ When a task involves polling or is expected to take more than a few seconds, **a
1616

1717
### What to Tell the User
1818

19-
After saving the content to YouMind and providing the link, tell the user (in their language):
19+
After saving the material to YouMind and providing the link, tell the user (in their language):
2020

2121
> "This may take 10-20 seconds. Would you like me to run this in the background so you can keep chatting? I'll notify you when it's done."
2222
@@ -30,7 +30,7 @@ Or, if the agent platform supports subagents (OpenClaw, Claude Code, etc.), the
3030
Never make the user wait for the entire batch to finish. Deliver results as they become available:
3131

3232
1. **Immediately after saving**: Show the YouMind material link (user can already view the video in YouMind)
33-
2. **As each result completes**: Output that transcript right away
33+
2. **As each transcript completes**: Output that transcript right away
3434
3. **After all done**: Show the summary table
3535

3636
### Implementation Note for Skill Authors

skills/youmind-image-generator/references/long-running-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ When a task involves polling or is expected to take more than a few seconds, **a
1616

1717
### What to Tell the User
1818

19-
After saving the content to YouMind and providing the link, tell the user (in their language):
19+
After saving the material to YouMind and providing the link, tell the user (in their language):
2020

2121
> "This may take 10-20 seconds. Would you like me to run this in the background so you can keep chatting? I'll notify you when it's done."
2222
@@ -30,7 +30,7 @@ Or, if the agent platform supports subagents (OpenClaw, Claude Code, etc.), the
3030
Never make the user wait for the entire batch to finish. Deliver results as they become available:
3131

3232
1. **Immediately after saving**: Show the YouMind material link (user can already view the video in YouMind)
33-
2. **As each result completes**: Output that transcript right away
33+
2. **As each transcript completes**: Output that transcript right away
3434
3. **After all done**: Show the summary table
3535

3636
### Implementation Note for Skill Authors

skills/youmind-slides-generator/references/long-running-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ When a task involves polling or is expected to take more than a few seconds, **a
1616

1717
### What to Tell the User
1818

19-
After saving the content to YouMind and providing the link, tell the user (in their language):
19+
After saving the material to YouMind and providing the link, tell the user (in their language):
2020

2121
> "This may take 10-20 seconds. Would you like me to run this in the background so you can keep chatting? I'll notify you when it's done."
2222
@@ -30,7 +30,7 @@ Or, if the agent platform supports subagents (OpenClaw, Claude Code, etc.), the
3030
Never make the user wait for the entire batch to finish. Deliver results as they become available:
3131

3232
1. **Immediately after saving**: Show the YouMind material link (user can already view the video in YouMind)
33-
2. **As each result completes**: Output that transcript right away
33+
2. **As each transcript completes**: Output that transcript right away
3434
3. **After all done**: Show the summary table
3535

3636
### Implementation Note for Skill Authors
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Long-Running Tasks
2+
3+
## Problem
4+
5+
YouMind API calls that involve processing (transcript extraction, image generation, document parsing, etc.) require polling and can take 10-60+ seconds. During this time, the user's main session is blocked — they can't do anything else.
6+
7+
## Solution: Subagent Pattern
8+
9+
When a task involves polling or is expected to take more than a few seconds, **always suggest running it in the background** so the main session stays responsive.
10+
11+
### When to Suggest Background Processing
12+
13+
- Any step that involves polling (checking status in a loop)
14+
- Batch operations (multiple items to process)
15+
- Any task the agent estimates will take > 10 seconds
16+
17+
### What to Tell the User
18+
19+
After saving the material to YouMind and providing the link, tell the user (in their language):
20+
21+
> "This may take 10-20 seconds. Would you like me to run this in the background so you can keep chatting? I'll notify you when it's done."
22+
23+
Or, if the agent platform supports subagents (OpenClaw, Claude Code, etc.), the agent should:
24+
1. Proactively spawn a subagent for the polling + extraction work
25+
2. Immediately return control to the user
26+
3. The subagent notifies the user when results are ready
27+
28+
### Progressive Results
29+
30+
Never make the user wait for the entire batch to finish. Deliver results as they become available:
31+
32+
1. **Immediately after saving**: Show the YouMind material link (user can already view the video in YouMind)
33+
2. **As each transcript completes**: Output that transcript right away
34+
3. **After all done**: Show the summary table
35+
36+
### Implementation Note for Skill Authors
37+
38+
In your SKILL.md workflow, structure the steps so that:
39+
- The "save to YouMind" step returns a link immediately
40+
- The "poll for result" step is clearly separated and marked as the long-running part
41+
- The agent can naturally split these into "respond now" and "background work"

skills/youmind-webpage-generator/references/long-running-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ When a task involves polling or is expected to take more than a few seconds, **a
1616

1717
### What to Tell the User
1818

19-
After saving the content to YouMind and providing the link, tell the user (in their language):
19+
After saving the material to YouMind and providing the link, tell the user (in their language):
2020

2121
> "This may take 10-20 seconds. Would you like me to run this in the background so you can keep chatting? I'll notify you when it's done."
2222
@@ -30,7 +30,7 @@ Or, if the agent platform supports subagents (OpenClaw, Claude Code, etc.), the
3030
Never make the user wait for the entire batch to finish. Deliver results as they become available:
3131

3232
1. **Immediately after saving**: Show the YouMind material link (user can already view the video in YouMind)
33-
2. **As each result completes**: Output that transcript right away
33+
2. **As each transcript completes**: Output that transcript right away
3434
3. **After all done**: Show the summary table
3535

3636
### Implementation Note for Skill Authors
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
references/environment.md
2+
toolkit/package-lock.json
3+
toolkit/node_modules/
4+
image/
5+
cover/
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules/
2+
dist/
3+
*.html
4+
config.yaml
5+
output/
6+
__pycache__/
7+
*.pyc
8+
.env
9+
clients/
10+
toolkit/package-lock.json
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# YouMind WeChat Skill
2+
3+
微信公众号 AI Skill。对 Agent 说一句话,自动跑完选题、写作、配图、排版、发布到草稿箱。
4+
5+
---
6+
7+
## 一句话能干嘛
8+
9+
| 你说 | Skill 做 |
10+
|------|----------|
11+
| `给 demo 写一篇公众号文章` | 全自动 8 步:热点 → 选题 → 写作 → SEO → 配图 → 排版 → 发到草稿箱 |
12+
| `写一篇关于高考志愿的文章` | 跳过热点,直接围绕指定主题走流程 |
13+
| `把这篇 Markdown 发到草稿箱` | 跳过写作,直接排版发布 |
14+
| `用紫色 decoration 主题预览` | 换主题换色,即时预览 |
15+
| `看看最近 7 天文章表现` | 拉数据、分析 top/flop、给下一篇建议 |
16+
| `根据我的修改学习风格` | 从你的人工改稿中提取经验,下次写得更像你 |
17+
| `创建新客户 my-brand` | 自动建目录、引导填品牌配置 |
18+
19+
---
20+
21+
## 安装
22+
23+
> 环境要求:Node.js ≥ 18、Python ≥ 3.9、已认证微信公众号(需 API 权限)
24+
25+
```bash
26+
# 1. 安装依赖
27+
cd toolkit && npm install && npm run build && cd ..
28+
pip install -r requirements.txt
29+
30+
# 2. 生成配置文件(如果 config.yaml 不存在)
31+
cp config.example.yaml config.yaml
32+
33+
# 3. 获取公网 IP(填入微信 IP 白名单,否则无法发布,详见下方「获取本机公网 IP」)
34+
curl -s https://ifconfig.me
35+
```
36+
37+
`config.yaml` 需要填写以下凭证:
38+
39+
| 字段 | 必填 | 说明 |
40+
|------|------|------|
41+
| `wechat.appid` | **** | 微信公众号 AppID |
42+
| `wechat.secret` | **** | 微信公众号 AppSecret |
43+
| `wechat.author` || 文章作者名,默认 "YouMind" |
44+
| `youmind.api_key` | 推荐 | 用于知识库搜索、联网搜索、文章归档、AI 生图 → [获取 API Key](https://youmind.com/settings/api-keys?utm_source=youmind-wechat-article) |
45+
| `image.providers.*.api_key` || 配了哪个就启用哪个(youmind / gemini / openai / doubao) |
46+
47+
### 获取 AppID / AppSecret / 配置 IP 白名单
48+
49+
> 微信开发者平台控制台:<https://developers.weixin.qq.com/platform?tab1=basicInfo&tab2=dev>
50+
51+
**第 1 步 — 进入微信开发者平台**
52+
53+
打开 [微信开发者平台](https://developers.weixin.qq.com/platform?tab1=basicInfo&tab2=dev),点击首页的 **「前往使用」** 按钮登录。
54+
55+
![步骤1:点击前往使用](image/1.png)
56+
57+
**第 2 步 — 选择公众号**
58+
59+
在「我的业务」面板中,找到并点击 **「公众号」** 进入公众号管理页。
60+
61+
![步骤2:点击公众号](image/2.png)
62+
63+
**第 3 步 — 复制 AppID、AppSecret 并配置 IP 白名单**
64+
65+
在公众号 → **基础信息** 页面:
66+
67+
1. **AppID** — 顶部「基础信息」区域直接复制,填入 `config.yaml``wechat.appid`
68+
2. **AppSecret** — 「开发密钥」区域,点击 **重置** 获取(只展示一次,请立即保存),填入 `wechat.secret`
69+
3. **API IP 白名单** — 同一区域,点击 **编辑**,将你的公网 IP 粘贴进去
70+
71+
![步骤3:AppID、AppSecret 和 IP 白名单位置](image/3.png)
72+
73+
### 获取本机公网 IP
74+
75+
家庭宽带 IP 会变,发布报 IP 错误时重新获取并更新白名单即可。
76+
77+
**macOS**
78+
79+
```bash
80+
curl -s https://httpbin.org/ip | python3 -c "import sys,json; print(json.load(sys.stdin)['origin'])"
81+
# 或者
82+
curl -s https://ifconfig.me
83+
```
84+
85+
**Windows(PowerShell)**
86+
87+
```powershell
88+
(Invoke-WebRequest -Uri "https://ifconfig.me" -UseBasicParsing).Content.Trim()
89+
# 或者
90+
(Invoke-RestMethod -Uri "https://httpbin.org/ip").origin
91+
```
92+
93+
**Linux**
94+
95+
```bash
96+
curl -s https://ifconfig.me
97+
# 或者
98+
curl -s https://httpbin.org/ip | python3 -c "import sys,json; print(json.load(sys.stdin)['origin'])"
99+
```
100+
101+
> **提示**:拿到 IP 后,回到上面第 3 步的「API IP 白名单」→ 编辑,粘贴保存即可。
102+
103+
---
104+
105+
## 使用技巧
106+
107+
### 两种运行模式
108+
109+
- **自动模式**(默认):全程自动跑,只在生成配图前问一次图片风格偏好
110+
- **交互模式**:说"让我来选题" / "交互模式",会在选题、框架、配图、主题环节暂停让你选
111+
112+
### 主题系统
113+
114+
4 款内置主题,搭配任意 HEX 色值:
115+
116+
| 主题 | 风格 | 适合 |
117+
|------|------|------|
118+
| `simple` | 简约干净 | 日常推送、知识科普 |
119+
| `center` | 居中排版 | 短篇、金句、情感 |
120+
| `decoration` | 装饰线条 | 品牌感强的内容 |
121+
| `prominent` | 大标题 | 深度长文、观点输出 |
122+
123+
<!-- TODO: 主题对比截图 -->
124+
125+
想要更深的定制?用 Theme DSL 写一个自定义主题 JSON,放到 `clients/{client}/themes/` 下,发布时加 `--custom-theme` 即可。
126+
127+
### 配图降级链
128+
129+
Skill 按以下顺序尝试生成配图,任何一环成功就继续,全挂也不中断流程:
130+
131+
```
132+
AI 生图(你配的 provider)→ Nano Banana Pro 图库搜索 → CDN 预制封面下载 → 只输出 prompt
133+
```
134+
135+
### 多客户管理
136+
137+
每个客户一个目录,互不干扰:
138+
139+
```
140+
clients/demo/
141+
├── style.yaml # 品牌调性、目标读者、禁用词
142+
├── playbook.md # 写作手册(自动生成或手写)
143+
├── history.yaml # 已发布记录(去重用)
144+
├── corpus/ # 历史语料
145+
├── lessons/ # 人工改稿经验
146+
└── themes/ # 专属主题
147+
```
148+
149+
对 Agent 说 `创建新客户 xxx` 即可自动初始化。
150+
151+
### 让文章越写越像你
152+
153+
1. **喂语料**:往 `clients/{client}/corpus/` 里放 20+ 篇你的历史文章,跑 `build-playbook` 生成写作手册
154+
2. **改稿学习**:发布后手动改,然后说"根据我的修改学习风格"——Skill 会提取差异存到 `lessons/`
155+
3. **手册迭代**:每积累 5 条经验,自动刷新 `playbook.md`
156+
157+
### 流程不会断
158+
159+
每一步都有 fallback。热点抓不到就联网搜,联网搜也挂就问你;图生不出来就搜图库;发布失败就生成本地 HTML。单步失败只会跳过并标注,不会卡死。
160+
161+
---
162+
163+
## 常见问题
164+
165+
**发布报 IP 错误** — 公网 IP 变了。重跑 `curl -s https://ifconfig.me` 拿新 IP,更新微信白名单(详见上方「获取本机公网 IP」章节)。
166+
167+
**图片生成失败** — 不影响发布。Skill 会自动走降级链。想用特定 provider 就在 `config.yaml` 里填对应 key。
168+
169+
**文章有 AI 味** — 在 `style.yaml` 里写清楚你的调性;多喂历史语料建 playbook;发布后改稿再跑"学习风格"。三管齐下效果最好。
170+
171+
**怎么自定义排版?** — 三个层级:① 对话里指定颜色字号 → ② 写 Theme DSL JSON → ③ 搭配设计类 Skill 深度定制。
172+
173+
---
174+
175+
## 许可证
176+
177+
MIT

0 commit comments

Comments
 (0)