Automatically generate high-quality AI content and publish it to a WeChat Official Account. Intelligently select content type by time slot (8:00 AM = new tool introduction, 12:00 PM = practical tutorial, 6:00 PM = industry news), filter out useless information (funding, market cap, personnel noise, etc.), and produce engaging, realistic headlines. Target readers: AI developers, AI product managers, AI founders. Produce one high-quality article per run. Use when the user says 'generate AI article', 'write today's WeChat article', or 'auto-publish AI content'. Reuses skills wechat-tech-writer, wechat-article-formatter, wechat-draft-publisher.
自动搜索最新AI资讯、智能选题、生成高质量文章并发布到微信公众号草稿箱。内容专注对AI开发者、产品经理、创业者有价值的高质量信息。
架构说明:本系统复用以下 skills:
wechat-tech-writer:负责文章内容生成wechat-article-formatter:负责格式化为微信HTMLwechat-draft-publisher:负责发布到草稿箱本系统专注于:热点获取、智能选题、时间策略、发布调度。
⚠️ 硬性要求 - 封面图必须从封面库选择:
canvas-design 或任何其他方式生成封面图scripts/select_cover.py 从封面库选择封面assets/covers/当用户说以下类似话术时触发:
from datetime import datetime
from scripts.title_generator import get_time_slot_type, TIME_SLOT_CONTENT
# 获取当前时间和目标类型
target_type, time_slot = get_time_slot_type()
time_info = TIME_SLOT_CONTENT[time_slot]
print(f"当前时间: {datetime.now().strftime('%H:%M')}")
print(f"时段: {time_slot}")
print(f"内容类型: {time_info['description']}")
print(f"内容重点: {time_info['focus']}")
print(f"目标读者: {time_info['target_audience']}")
时间段映射:
morning → 新工具/新模型介绍afternoon → 实战教程/技巧evening → 行业动态/深度分析# 确认当前日期
date_str=$(date +"%Y年%m月%d日")
echo "今天是: $date_str"
# 获取热点
cd /home/ubuntu/.claude/skills/ai-content-publisher
python3 scripts/fetch_hotspots.py
热点来源:
重要:只获取48小时内的热点,确保内容是最新的。
python3 scripts/selector.py
选题策略:
选中话题保存到:cache/selected_topic.json
from scripts.title_generator import generate_title
# 读取选中的话题
import json
with open('cache/selected_topic.json', 'r') as f:
topic = json.load(f)
# 生成标题(会根据内容类型自动选择合适的模板)
generated_title = generate_title(topic, topic['content_type'])
print(f"生成标题: {generated_title}")
标题生成原则:
使用 wechat-tech-writer 的 generate.py 脚本生成文章:
# 标准模式(默认)
python3 /home/ubuntu/wechat_article_skills/wechat-tech-writer/generate.py \
--topic "$TOPIC_TITLE" \
--url "$TOPIC_URL" \
--type "$CONTENT_TYPE" \
--output "$OUTPUT_DIR" \
--mode standard
# 深度模式(5000字专题文章)
python3 /home/ubuntu/wechat_article_skills/wechat-tech-writer/generate.py \
--topic "$TOPIC_TITLE" \
--url "$TOPIC_URL" \
--type "$CONTENT_TYPE" \
--output "$OUTPUT_DIR" \
--mode deep
模式说明:
standard:2000-3000字,标准科普文章(定时任务使用)deep:5000字,深度分析文章(手动触发特殊需求时使用)将生成的文章保存到:
output/{日期}/article/
├── article.md
# 根据内容类型从封面库选择封面
python3 scripts/select_cover.py "$CONTENT_TYPE" "output/{日期}/article/"
封面选择规则:
new_tool → tool_*.png(蓝色AI工具、深色编码、橙色生产力)tutorial → tutorial_*.png(绿色学习)industry_news → news_*.png(蓝色数据、紫色分析)封面复制为:output/{日期}/article/cover.png
⚠️ 严禁:
/canvas-design 生成封面select_cover.py 失败,必须报错退出使用 wechat-article-formatter 转换:
python3 /home/ubuntu/.claude/skills/wechat-article-formatter/convert.py \
--input output/{日期}/article/article.md \
--theme tech \
--output output/{日期}/article/article_wechat.html
使用 wechat-draft-publisher 发布:
python3 /home/ubuntu/.claude/skills/wechat-draft-publisher/publisher.py \
--title "{文章标题}" \
--content output/{日期}/article/article_wechat.html \
--cover output/{日期}/article/cover.png \
--author "阳桃AI干货"
使用 xiaohongshu-publisher 发布精简版:
# 1. 复制封面图到Docker挂载目录
cp output/{日期}/article/cover.png /home/ubuntu/xiaohongshu-mcp/docker/images/xhs_cover_{日期}.png
# 2. 通过API发布到小红书
curl -s -X POST http://localhost:18060/api/v1/publish \
-H "Content-Type: application/json" \
-d '{
"title": "{压缩标题(≤20字)}",
"content": "{精简正文(≤1000字,保留核心要点)}",
"images": ["/app/images/xhs_cover_{日期}.png"],
"tags": ["AI", "编程工具"]
}'
内容精简规则:
注意:Docker服务必须运行在 http://localhost:18060
✅ AI内容生成完成(双平台发布)
生成时间:{当前时间}
内容类型:{类型}
【微信公众号】
标题:{完整标题}
字数:{字数}字
状态:已发布到草稿箱
Media ID:{media_id}
【小红书】
标题:{压缩标题}
字数:{压缩字数}字
状态:已发布
链接:小红书App查看
---
请前往微信公众号后台查看草稿:
https://mp.weixin.qq.com
| 要素 | 说明 | 示例 | |------|------|------| | 具体数字 | "3个技巧"、"5步搞定" | "3步用LangChain搭建AI应用" | | 直接利益 | "让...效率提升..." | "Claude Code:让开发者效率提升3倍" | | 明确具体 | 不模糊,有针对性 | "OpenAI o3:AI开发者需要知道的3个变化" | | 适当长度 | 避免被截断 | 微信限制64字节(约20个汉字) | | 符合实际 | 标题与内容匹配 | 不夸大、不模糊 |
工具介绍类:
{工具名}:让{benefit}的AI助手发布!{工具名},{core_feature}{tool_name}:{benefit}的完整指南教程类:
{action}:用{tool}实现{goal}{number}步教你{action}(附代码)手把手教你:用{tool}{action}行业动态类:
{event}:{impact}需要知道的事{event}发布,{target_audience}如何应对解读{event}:{core_change}技巧总结类:
{number}个{skill}技巧,让{benefit}提升{skill}的{number}个方法{skill}进阶:{number}个实用技巧❌ 不要用:
✅ 应该用:
output/
└── {日期}/
└── article/
├── article.md # 原始文章
├── cover.png # 封面图(从封面库选择,⚠️ 禁止生成)
└── article_wechat.html # 微信HTML格式
cache/ ├── hotspots.json # 原始热点 └── selected_topic.json # 选中的话题(单个)
## 定时任务配置
### Crontab 配置
```bash
# 编辑定时任务
crontab -e
# 添加以下内容(早8点、中午12点、晚上6点)
0 8,12,18 * * * cd /home/ubuntu && claude skill ai-content-publisher >> /var/log/ai-content.log 2>&1
┌───────────── 分钟 (0-59)
│ ┌────────── 小时 (0-23)
│ │ ┌────── 日期 (1-31)
│ │ │ ┌─── 月份 (1-12)
│ │ │ │ ┌ 星期 (0-7)
│ │ │ │ │
* * * * * 命令
0 8,12,18 * * * = 每天 8:00、12:00、18:00 执行>> /var/log/ai-content.log = 日志追加到文件2>&1 = 错误也重定向到日志⚠️ 封面图强制要求:
assets/covers/)/canvas-design 生成封面日期检查:所有搜索操作前必须先确认当前日期
时效性:只使用48小时内的热点
时间段策略:根据时间自动选择合适的内容类型
质量第一:宁可少发,也要保证质量
标题规范:吸引人但不标题党
草稿箱发布:先保存到草稿箱,用户可人工审核后正式发布
npx skills add solar-luna/ai-content-publisher下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Generate or edit images via Gemini 3 Pro Image (Nano Banana Pro).
Batch-generate images via OpenAI Images API. Random prompt sampler + `index.html` gallery.
Generate spectrograms and feature-panel visualizations from audio with the songsee CLI.
Extract frames or short clips from videos using ffmpeg.
Search GIF providers with CLI/TUI, download results, and extract stills/sheets.
Category:media-generate