home / skills / yangliu2060 / smith--skills / viral-post-creator

viral-post-creator skill

/viral-post-creator

This skill helps you create viral social media posts with AI-generated copy and optional automated publishing to major platforms.

npx playbooks add skill yangliu2060/smith--skills --skill viral-post-creator

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
9.9 KB
---
name: viral-post-creator
description: AI生成病毒式社交媒体帖子,使用即梦MCP生成配图,使用Playwright MCP自动发布到Facebook/Instagram等平台。
---

# 病毒式帖子生成器

AI 生成高互动的社交媒体帖子,自动生成配图,可选自动发布到 Facebook/Instagram。

## 触发条件

当用户说以下内容时启动此技能:
- "生成病毒帖子"
- "帮我发Facebook"
- "viral post"
- "社交媒体发帖"
- "自动发帖"

## 依赖的 MCP 服务

此技能需要以下 MCP 服务:

| MCP | 用途 | 必需 |
|-----|------|------|
| **jimeng-mcp-server** | AI 生成配图 | 可选 |
| **playwright** | 自动发布到社交平台 | 可选 |
| **slack** | 发布成功后发送通知 | 可选 |

如未启用相关 MCP,技能将只生成内容,不执行发布。通知功能默认使用本地文件记录。

## 工作流程

```
┌─────────────────────┐
│   输入主题/目标      │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│   AI 生成帖子文案    │
│   (多版本供选择)     │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│   jimeng MCP        │
│   生成配图           │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│   用户确认内容       │
│   选择发布平台       │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│   Playwright MCP    │
│   自动登录并发布     │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│   保存记录          │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│   发送通知          │
│ (邮件/Slack/本地)   │
└─────────────────────┘
```

## 执行步骤

### 步骤 1:获取创作需求

询问用户:
- **主题**: 帖子关于什么?
- **目标平台**: Facebook / Instagram / Twitter / 小红书
- **目标**: 品牌曝光 / 引流 / 互动 / 带货
- **风格**: 幽默 / 专业 / 励志 / 情感
- **是否需要配图**: 是 / 否

### 步骤 2:AI 生成帖子文案

**生成提示词**:

```
你是一位社交媒体爆款内容专家,擅长创作高互动帖子。

【创作需求】
- 主题: {topic}
- 平台: {platform}
- 目标: {goal}
- 风格: {style}

【{platform} 帖子特点】
- Facebook: 可长文,故事型表现好,互动问题结尾
- Instagram: 视觉优先,标签重要,简洁有力
- Twitter/X: 简短犀利,话题性强,易于转发
- 小红书: 生活化,种草感,emoji丰富

【爆款公式】
1. 钩子开头(3秒抓住注意力)
2. 价值输出(干货/情感/故事)
3. 互动收尾(提问/投票/挑战)

【输出要求】
生成3个版本供选择:
- 版本A: 偏理性/干货
- 版本B: 偏感性/故事
- 版本C: 偏互动/话题

每个版本包含:
1. 帖子正文
2. 推荐标签 (3-5个)
3. 配图建议 (描述画面)
4. 最佳发布时间

【输出格式】
## 版本 A: [风格标签]
**正文**:
...

**标签**: #tag1 #tag2 #tag3

**配图建议**: 描述适合的图片画面

**发布时间**: 周X 上午/下午 X点
```

### 步骤 3:生成配图 (使用 jimeng MCP)

如果用户选择生成配图,使用即梦 MCP:

**调用方式**:
```
使用 jimeng-mcp-server 的图片生成功能:
- 根据帖子内容生成配图提示词
- 调用文生图接口
- 获取生成的图片 URL
```

**配图提示词转换**:
```
将"配图建议"转换为即梦AI提示词:
- 原描述: "一个人在咖啡馆专注工作的场景"
- 转换后: "现代简约咖啡馆,年轻人专注使用笔记本电脑,
  柔和自然光,浅景深,温暖色调,写实摄影风格"
```

### 步骤 4:用户确认

展示生成内容供用户确认:

```markdown
## 📝 帖子预览

**平台**: Facebook
**文案**:
[帖子内容]

**标签**: #话题1 #话题2

**配图**: [显示生成的图片]

---

请确认:
1. ✅ 确认发布
2. ✏️ 修改文案
3. 🖼️ 重新生成配图
4. ❌ 取消
```

### 步骤 5:自动发布 (使用 Playwright MCP)

用户确认后,使用 Playwright 自动发布:

**Facebook 发布流程**:
```javascript
// Playwright MCP 操作步骤

1. 打开 Facebook
   browser_navigate({ url: "https://facebook.com" })

2. 检查登录状态(如已登录则跳过)
   - 如未登录,提示用户手动登录
   - 等待登录完成

3. 导航到发帖区域
   browser_click({ element: "创建帖子" 或 "What's on your mind?" })

4. 输入帖子内容
   browser_type({ text: "{post_content}" })

5. 上传配图(如有)
   browser_click({ element: "添加照片" })
   browser_upload_file({ file: "{image_path}" })

6. 发布
   browser_click({ element: "发布" 或 "Post" })

7. 确认发布成功
   browser_snapshot() // 截图确认
```

**Instagram 发布流程**:
```javascript
1. 打开 Instagram
   browser_navigate({ url: "https://instagram.com" })

2. 点击创建
   browser_click({ element: "+" 创建按钮 })

3. 选择图片
   browser_upload_file({ file: "{image_path}" })

4. 添加滤镜(可选)
   browser_click({ element: "下一步" })

5. 输入文案
   browser_type({ text: "{post_content}\n\n{hashtags}" })

6. 分享
   browser_click({ element: "分享" })
```

### 步骤 6:保存记录

发布成功后保存记录:

```json
{
  "post_id": "fb_20251229_001",
  "platform": "Facebook",
  "content": "帖子内容...",
  "hashtags": ["#tag1", "#tag2"],
  "image_url": "https://...",
  "published_at": "2025-12-29T10:30:00Z",
  "status": "success"
}
```

### 步骤 7:发送通知(可选)

发布完成后,可选择发送通知:

**方式 A - 邮件通知**:

如果用户配置了邮件服务,发送通知邮件:

```markdown
主题: ✅ 帖子发布成功 - {platform}

发布详情:
- 平台: {platform}
- 时间: {published_at}
- 帖子链接: {post_url}

内容预览:
{content_preview}...

---
由 viral-post-creator 技能自动发送
```

**方式 B - Slack 通知**:

如果用户配置了 Slack MCP,发送到指定频道:

```
📢 帖子发布成功!

平台: {platform}
时间: {published_at}
链接: {post_url}

内容: {content_preview}...
```

**方式 C - 本地通知文件**:

默认保存通知记录到本地文件:

```
~/.claude/cache/viral-posts/notifications.log
```

**通知配置**:

用户可在首次使用时设置通知偏好:
- 是否启用通知: 是/否
- 通知方式: 邮件/Slack/本地文件
- 邮箱地址(如选择邮件)
- Slack 频道(如选择 Slack)

## 使用示例

### 示例 1:生成并手动发布

```
用户: 帮我生成一个关于年终总结的Facebook帖子

Claude:
1. 生成3个版本的帖子
2. 用户选择版本B
3. 使用即梦生成配图
4. 输出完整内容供用户复制发布
```

### 示例 2:全自动发布

```
用户: 帮我自动发布一条Instagram帖子,主题是新年祝福

Claude:
1. 生成帖子内容
2. 生成配图
3. 用户确认
4. 使用Playwright自动发布
5. 截图确认发布成功
```

### 示例 3:批量生成

```
用户: 帮我生成下周5天的Facebook帖子

Claude:
1. 规划5天的主题
2. 批量生成帖子
3. 保存到文件
4. 可选择定时发布
```

## 病毒帖子模板库

### 模板 1:反直觉观点

```
90%的人都搞错了:

[常见误区]

真相是:

[反直觉真相]

这就是为什么 [结论]

同意吗?评论区说说你的看法 👇
```

### 模板 2:数字清单

```
我花了 [时间] 研究 [主题]

这是我学到的 [N] 件事:

1️⃣ [要点1]
2️⃣ [要点2]
3️⃣ [要点3]
4️⃣ [要点4]
5️⃣ [要点5]

保存这条,你会用到的 🔖
```

### 模板 3:Before/After

```
3个月前 vs 现在

Before: [旧状态]
After: [新状态]

改变我的关键:

[关键行动1]
[关键行动2]
[关键行动3]

你的改变是什么?分享一下 ✨
```

### 模板 4:争议话题

```
我知道这很有争议,但是...

[争议观点]

原因:

1. [论点1]
2. [论点2]
3. [论点3]

转发给你的朋友,看看他们怎么想 🔄
```

## 发布时间建议

| 平台 | 最佳时间 | 次佳时间 |
|------|---------|---------|
| Facebook | 周三 11:00 | 周一-周五 9:00-15:00 |
| Instagram | 周二 11:00 | 周一-周五 11:00-13:00 |
| Twitter | 周三 9:00 | 工作日 8:00-10:00 |
| 小红书 | 周日 21:00 | 每天 12:00, 21:00 |

## 数据存储

- 帖子记录:`~/.claude/cache/viral-posts/`
- 生成的图片:`~/.claude/cache/viral-posts/images/`
- 发布日志:`~/.claude/cache/viral-posts/publish-log.json`

## 依赖工具

- **Claude AI**: 生成帖子文案
- **jimeng-mcp-server**: 生成配图 (可选)
- **playwright MCP**: 自动发布 (可选)
- **Slack MCP**: 发送通知 (可选)
- **Write**: 保存记录

## 注意事项

### 自动发布安全
- 首次使用需手动登录社交平台
- Playwright 会保存登录状态
- 建议在发布前人工确认内容
- 避免频繁发布触发平台限制

### 平台规则
- 遵守各平台社区规范
- 避免敏感/争议内容
- 图片需符合版权要求
- 标签数量适度

### 最佳实践
- 生成多个版本,选择最佳
- 配图要与内容匹配
- 发布后关注互动数据
- 根据反馈优化内容策略

## 原始来源

改编自 n8n 模板:
- 模板ID: 8756
- 原名: Generate Viral Facebook Posts with Gemini 2.0 & AI Image Generation
- 链接: https://n8n.io/workflows/8756

Overview

This skill creates high-engagement social media posts using AI and can optionally generate images and auto-publish to platforms like Facebook and Instagram. It produces multiple copy variants, image prompts, hashtag suggestions and publication timing. The skill supports optional MCP services for image generation (jimeng) and automated publishing (Playwright), and records activity with optional notifications.

How this skill works

You provide a topic, target platform, goal and tone. The skill generates three post versions (rational, narrative, interactive) with tags, image descriptions and best posting time. If enabled, it converts image descriptions into prompts for jimeng MCP to produce images. After user confirmation, Playwright MCP can log in and publish posts automatically, then save a record and send optional notifications.

When to use it

  • When you need a ready-to-post, high-engagement social update.
  • When you want AI-generated visuals matched to the copy.
  • When you need multi-variant copy to A/B test.
  • When you want to automate posting to Facebook or Instagram.
  • When you need a repeatable workflow for batch post generation.

Best practices

  • Always review and edit generated copy before publishing to ensure brand voice and compliance.
  • Generate multiple versions and A/B test to learn what resonates with your audience.
  • Enable image generation only when visuals are necessary and check copyrights for produced assets.
  • Perform the first automated publish manually to confirm Playwright login and selectors.
  • Log published posts and monitor engagement to refine prompts and timing.

Example use cases

  • Create a New Year greeting post with image and auto-publish to Instagram after confirmation.
  • Generate five days of Facebook posts in one batch for a content calendar and save them for scheduled publishing.
  • Produce three headline styles for a product launch: data-driven, story-led, and engagement-first, plus image suggestions.
  • Auto-publish an announcement and receive a Slack or local notification with a confirmation screenshot.
  • Use templates like listicles, before/after, or contrarian hooks to quickly create engaging variations.

FAQ

What happens if MCP services are not enabled?

If jimeng or Playwright MCPs are unavailable, the skill still generates copy, tags and image descriptions; image creation and auto-publishing are skipped.

How are images generated and stored?

Image prompts are converted for the jimeng MCP image API; generated images are saved in the local cache folder and returned as URLs for preview or upload.

Is manual confirmation required before publishing?

Manual confirmation is recommended and the default flow shows a preview for approval; automated publish runs after you confirm.