Files
skills_repo/event-publisher/SKILL.md
jeremygan2021 f5117a90d1 first commit
2026-03-04 19:24:05 +08:00

132 lines
4.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: event-publisher
description: |
活动创建发布一条龙助手:创意选题 → 文案生成 → 海报生成(含Logo) → 活动发布
Triggers when 用户提到:
- "发布活动"、"创建活动"
- "活动海报"、"活动文案"
- "生成海报"、"上传活动"
- "过年游园"、"春节活动"
---
## 快速使用
### 1. 收集活动信息
AI 会询问以下信息(或用户直接提供):
- 活动主题
- 活动时间
- 活动地点
- 其他要求
### 2. 生成活动文案 (Robust Step)
使用脚本生成标准化的Markdown文案确保格式正确。
```bash
# 用法
./scripts/generate_content.sh "<活动主题>" "<时间>" "<地点>" "<其他信息>"
# 示例
./scripts/generate_content.sh "春节游园会" "2月12日" "市中心广场" "包含灯谜和美食"
```
> 输出:`assets/春节游园会_活动文案.md`
### 3. 海报生成 (自动加Logo + 保存提示词)
生成海报,脚本会自动:
1. 调用豆包生成提示词
2. 生成3张豆包变体 + 1张Nanobanana创意图
3. **自动添加 quant-speed Logo**
4. **自动保存每个图片的完整提示词** (.txt文件)
```bash
# 用法
./scripts/generate_image.sh all "<活动文案内容>" "<活动名称>"
# 示例(读取上一步生成的文件内容)
content=$(cat "assets/春节游园会_活动文案.md")
./scripts/generate_image.sh all "$content" "春节游园会"
```
### 4. 上传图片并发布活动
用户选择一张满意的图片(例如 `春节游园会_豆包版1_xxx.jpg`),然后发布。
```bash
# 完整流程:上传图片 + 发布活动
./scripts/upload_event.sh all \
"<图片文件路径>" \
"<标题>" \
"<描述文件路径>" \
"<开始时间>" \
"<结束时间>" \
"<地点>"
# 示例
./scripts/upload_event.sh all \
"./assets/春节游园会_豆包版1_20240304.jpg" \
"2024新春游园会" \
"./assets/春节游园会_活动文案.md" \
"2026-03-15T10:00:00Z" \
"2026-03-15T16:00:00Z" \
"市中心广场"
```
## 工作流程
```
1. 用户提供信息
2. 脚本生成文案 (generate_content.sh) → 得到 .md 文件
3. 脚本生成海报 (generate_image.sh)
→ AI生成提示词
→ 生成图片
→ 自动叠加Logo (add_logo.py)
→ 保存提示词 (.txt)
4. 用户选择图片
5. 脚本发布活动 (upload_event.sh)
→ 上传图片到OSS
→ 读取 .md 文件作为 description
→ 发布 API
6. 返回活动ID ✅
```
## API配置
| 服务 | API | 状态 |
|------|-----|------|
| 豆包图片生成 | doubao-seedream-5-0-260128 | ✅ |
| 豆包文本生成 | doubao-seed-2-0-pro-260215 | ✅ |
| Nanobanana | gemini-3-pro-image-preview | ✅ |
| 图片上传OSS | data.tangledup-ai.com/upload | ✅ |
| 活动发布 | market.quant-speed.com | ✅ |
## 文件结构
```
event-publisher/
├── SKILL.md # 本文件
├── .env # 环境变量
├── assets/ # 资源目录
│ ├── quant-speed.svg # Logo文件
│ ├── xxx_活动文案.md # 生成的文案
│ ├── xxx.jpg # 生成的海报
│ └── xxx.jpg.txt # 对应的提示词文件
└── scripts/
├── generate_content.sh # [新增] 文案生成脚本
├── generate_prompt.sh # 提示词生成脚本
├── generate_image.sh # 图片生成脚本 (含Logo处理)
├── add_logo.py # [新增] Logo添加脚本
└── upload_event.sh # 上传发布脚本
```
## Common Gotchas
- **Logo叠加**: 确保 `assets/quant-speed.svg` 存在。脚本依赖 `rsvg-convert``python3-pil`
- **文案生成**: 推荐使用 `generate_content.sh` 而不是让AI直接在对话中输出以保证Markdown格式的准确性。
- **提示词保存**: 每个图片都会对应一个同名的 `.txt` 文件,记录了完整的 Prompt 和 Model 信息。
- **活动时间**: 发布时请使用 ISO 8601 格式:`2026-03-15T10:00:00Z`