使用并自定义 Codex 营销技能——面向 AI Agent 的 YouTube 研究、Readwise 集成、架构图生成、视频制作以及社交媒体发布工作流。
Codex 营销技能集 (Codex Marketing Skills)
技能来源于 ara.so — 营销技能集合。
专为 AI 编程 Agent 设计的可共享营销与创作者工作流技能精选集合。涵盖 YouTube 研究、Readwise 搜索/导出、可视化架构图生成、动态图形/视频制作、社交媒体发布以及品牌合作研究自动化。
功能特性
Codex Marketing Skills 提供了开箱即用的技能模块,使 AI Agent 能够:
- YouTube Researcher:搜索频道、拉取逐字稿、分析黄金开场(Hook)与创作者风格
- Readwise CLI Control:查询 Reader 保存内容与 Readwise 划线标注,以用于内容研究
- Excalidraw Diagrams:生成可编辑的可视化架构图和流程图
- Paper MCP Integration:编辑 Paper 看板并创建精美演示文稿
- Remotion/HyperFrames:构建动态图形、发布视频、字幕以及渲染资产
- Gen Media:搜索 fal.ai 模型并生成/编辑图像和视频
- Brand Deal Researcher:扫描赞助邮件、排重合作机会、调研品牌背景
- Buffer Publisher:撰写并在多渠道定时发布社交媒体帖子
每个技能的设计均无缝兼容 Codex、Claude Code、Cursor 以及类似的 AI Agent。
安装指南
克隆代码仓库
git clone https://github.com/rbrown101010/codex-marketing-skills.git
cd codex-marketing-skills
安装技能
将所需的技能文件夹复制到 Agent 的技能目录中:
# 适用于 Codex
mkdir -p "$HOME/.codex/skills"
cp -R skills/youtube-researcher "$HOME/.codex/skills/"
# 适用于 Claude Code(根据需要调整路径)
cp -R skills/youtube-researcher "$HOME/.claude/skills/"
配置 Secret / 密钥
每个技能都需要特定的 API 密钥或身份验证。请设置环境变量或使用系统的密钥管理器:
# YouTube Researcher
export SUPADATA_API_KEY="your_key_here"
export SERPAPI_KEY="your_key_here"
# Buffer Publisher
export BUFFER_API_KEY="your_key_here"
# Gen Media
export FAL_KEY="your_key_here"
切勿将密钥提交到仓库中。 请参考项目中的 docs/requirements.md 以获取完整的配置检查清单。
技能概览
1. YouTube Researcher
位置:skills/youtube-researcher
需求:SUPADATA_API_KEY, SERPAPI_KEY
功能描述:搜索 YouTube 频道、提取逐字稿、分析视频黄金开场(Hook),并根据创作者风格生成基于事实的 AI 回复。
核心工作流:
import os
import requests
SUPADATA_API_KEY = os.getenv("SUPADATA_API_KEY")
SERPAPI_KEY = os.getenv("SERPAPI_KEY")
def search_youtube_channel(channel_id, query):
"""搜索特定 YouTube 频道中匹配查询的视频。"""
url = f"https://serpapi.com/search"
params = {
"engine": "youtube",
"search_query": f"{query} site:youtube.com/c/{channel_id}",
"api_key": SERPAPI_KEY
}
response = requests.get(url, params=params)
return response.json()
def get_transcript(video_id):
"""获取 YouTube 视频的逐字稿。"""
url = f"https://api.supadata.ai/v1/youtube/transcript/{video_id}"
headers = {"Authorization": f"Bearer {SUPADATA_API_KEY}"}
response = requests.get(url, headers=headers)
return response.json()
# 示例:分析创作者的开场白风格
results = search_youtube_channel("veritasium", "physics")
for video in results.get("video_results", [])[:3]:
transcript = get_transcript(video["id"])
first_30_sec = [t for t in transcript if t["start"] < 30]
print(f"Hook for {video['title']}:")
print(" ".join([t["text"] for t in first_30_sec]))
2. Readwise CLI Control
位置:skills/readwise-cli-control
需求:已安装并完成身份验证的 Readwise CLI
功能描述:搜索并导出 Readwise 及 Reader 中的划线标注,以用于内容研究。
常用命令:
# 搜索划线标注
readwise search "marketing frameworks"
# 导出特定书籍的划线标注
readwise export --book "Building a Second Brain" --format markdown
# 列出最新的 Reader 保存内容
readwise reader list --limit 20
Python 集成:
import subprocess
import json
def search_readwise(query):
"""搜索 Readwise 划线标注。"""
result = subprocess.run(
["readwise", "search", query, "--format", "json"],
capture_output=True,
text=True
)
return json.loads(result.stdout)
# 示例:查找关于“storytelling”的所有划线标注
highlights = search_readwise("storytelling")
for h in highlights[:5]:
print(f"{h['text']} — {h['title']}")
3. Excalidraw Diagrams
位置:skills/excalidraw-diagrams
需求:已安装 excalidraw-cli
功能描述:通过代码或自然语言生成可编辑的 Excalidraw 图表。
常用命令:
# 从 JSON 定义生成图表
excalidraw-cli create diagram.json --output funnel.excalidraw
# 导出为 PNG
excalidraw-cli export funnel.excalidraw --format png --output funnel.png
Python 工作流:
import json
import subprocess
def create_excalidraw_diagram(elements, output_path):
"""从元素定义创建 Excalidraw 图表。"""
diagram_def = {
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": elements
}
with open("temp_diagram.json", "w") as f:
json.dump(diagram_def, f)
subprocess.run([
"excalidraw-cli", "create", "temp_diagram.json",
"--output", output_path
])
# 示例:创建一个简单的漏斗图
elements = [
{"type": "rectangle", "x": 100, "y": 50, "width": 200, "height": 60, "text": "Awareness"},
{"type": "rectangle", "x": 100, "y": 150, "width": 180, "height": 60, "text": "Interest"},
{"type": "rectangle", "x": 100, "y": 250, "width": 160, "height": 60, "text": "Purchase"}
]
create_excalidraw_diagram(elements, "marketing_funnel.excalidraw")
4. Paper MCP
位置:skills/paper-mcp, skills/paper-deck-style
需求:Paper 桌面应用,运行中的本地 MCP 服务端
功能描述:通过编程方式编辑 Paper 看板并创建演示文稿。
核心操作(通过 MCP 协议):
import requests
MCP_SERVER = "http://localhost:8080"
def create_paper_card(board_id, title, content):
"""在 Paper 看板上创建新卡片。"""
response = requests.post(
f"{MCP_SERVER}/boards/{board_id}/cards",
json={"title": title, "content": content}
)
return response.json()
def get_board_cards(board_id):
"""检索看板中的所有卡片。"""
response = requests.get(f"{MCP_SERVER}/boards/{board_id}/cards")
return response.json()
# 示例:创建营销活动规划看板
board_id = "campaign-q4-2026"
create_paper_card(board_id, "Audience", "Target: SaaS founders, 30-45, technical background")
create_paper_card(board_id, "Channels", "LinkedIn, YouTube, email newsletter")
5. Remotion 与 HyperFrames
位置:plugin-workflows/remotion, plugin-workflows/hyperframes
需求:Node.js、Remotion CLI、HyperFrames 插件
功能描述:通过编程方式创建动态图形、发布视频以及字幕叠加。
常用命令:
# 渲染 Remotion 合成文件
npx remotion render src/index.ts LaunchVideo output.mp4
# 在浏览器中预览
npx remotion preview src/index.ts
React/Remotion 示例:
// src/LaunchVideo.jsx
import { useCurrentFrame, useVideoConfig, interpolate } from 'remotion';
export const LaunchVideo = () => {
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
const opacity = interpolate(frame, [0, 30], [0, 1], { extrapolateRight: 'clamp' });
return (
<div style={{ flex: 1, justifyContent: 'center', alignItems: 'center', opacity }}>
<h1 style={{ fontSize: 100 }}>New Product Launch</h1>
</div>
);
};
HyperFrames GSAP 动画示例:
// plugin-workflows/hyperframes-gsap/animate.js
import gsap from 'gsap';
export function animateCTA(element) {
gsap.timeline()
.from(element, { scale: 0.8, opacity: 0, duration: 0.5 })
.to(element, { scale: 1.05, duration: 0.3, yoyo: true, repeat: 1 });
}
6. Gen Media
位置:skills/genmedia
需求:genmedia CLI,FAL_KEY 环境变量
功能描述:搜索并运行 fal.ai 模型进行图像/视频生成。
常用命令:
# 列出可用模型
genmedia list
# 生成图像
genmedia run fal-ai/flux/schnell --prompt "product shot of a coffee mug on a desk" --output mug.png
# 生成视频
genmedia run fal-ai/ltx-video --prompt "camera pan over a modern office" --duration 5 --output office.mp4
Python 封装示例:
import os
import subprocess
FAL_KEY = os.getenv("FAL_KEY")
def generate_image(prompt, model="fal-ai/flux/schnell", output="output.png"):
"""使用 fal.ai 模型生成图像。"""
subprocess.run([
"genmedia", "run", model,
"--prompt", prompt,
"--output", output,
"--api-key", FAL_KEY
])
return output
# 示例:创建缩略图
thumbnail = generate_image(
"bold text 'Marketing Automation' over abstract tech background",
output="thumbnail.png"
)
print(f"Thumbnail saved to {thumbnail}")
7. Brand Deal Researcher
位置:skills/brand-deal-researcher
需求:Gmail API 访问权限,Calendar 插件(可选)
功能描述:扫描收到的商务赞助邮件、去重合作机会、调研品牌背景并输出结构化总结。
工作流:
import os
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
def fetch_brand_deal_emails():
"""获取主题包含 'sponsorship' 或 'partnership' 的未读邮件。"""
creds = Credentials.from_authorized_user_file('token.json', ['https://www.googleapis.com/auth/gmail.readonly'])
service = build('gmail', 'v1', credentials=creds)
query = "is:unread (subject:sponsorship OR subject:partnership OR subject:collaboration)"
results = service.users().messages().list(userId='me', q=query).execute()
messages = results.get('messages', [])
deals = []
for msg in messages:
full_msg = service.users().messages().get(userId='me', id=msg['id']).execute()
subject = next(h['value'] for h in full_msg['payload']['headers'] if h['name'] == 'Subject')
snippet = full_msg['snippet']
deals.append({"subject": subject, "snippet": snippet, "id": msg['id']})
return deals
# 示例:打印所有新品牌合作机会
deals = fetch_brand_deal_emails()
for deal in deals:
print(f"New opportunity: {deal['subject']}")
print(f"Preview: {deal['snippet']}\n")
8. Buffer Publisher
位置:skills/buffer-publisher
需求:BUFFER_API_KEY
功能描述:检查 Buffer 账号状态、创建草稿、将帖子加入队列以及安排内容定时发布。
核心 API 调用:
import os
import requests
BUFFER_API_KEY = os.getenv("BUFFER_API_KEY")
BASE_URL = "https://api.bufferapp.com/1"
def get_profiles():
"""列出所有已连接的社交账号 Profile。"""
response = requests.get(
f"{BASE_URL}/profiles.json",
params={"access_token": BUFFER_API_KEY}
)
return response.json()
def create_post(profile_id, text, scheduled_at=None):
"""创建新的 Buffer 帖子(进队列或定时)。"""
data = {
"profile_ids[]": profile_id,
"text": text,
"access_token": BUFFER_API_KEY
}
if scheduled_at:
data["scheduled_at"] = scheduled_at
endpoint = f"{BASE_URL}/updates/create.json"
else:
endpoint = f"{BASE_URL}/updates/create.json"
response = requests.post(endpoint, data=data)
return response.json()
# 示例:定时发布一条 LinkedIn 帖子
profiles = get_profiles()
linkedin_profile = next(p for p in profiles if p["service"] == "linkedin")
post = create_post(
linkedin_profile["id"],
"Excited to share our new marketing automation toolkit! 🚀",
scheduled_at="2026-05-25T10:00:00Z"
)
print(f"Post scheduled: {post['id']}")
常见设计模式
技能串联组合
结合多种技能实现端到端工作流:
# 1. 从 Readwise 研究内容灵感
highlights = search_readwise("content marketing")
# 2. 分析竞争对手的 YouTube 视频
competitor_videos = search_youtube_channel("competitor", "content strategy")
# 3. 生成可视化策略架构图
create_excalidraw_diagram(strategy_elements, "strategy.excalidraw")
# 4. 为 Buffer 创建社交媒体帖子
for idea in content_ideas:
create_post(linkedin_profile["id"], idea["text"])
错误处理
时刻检查缺少凭据和 API 返回错误的情况:
import os
import sys
def ensure_env_var(name):
value = os.getenv(name)
if not value:
print(f"Error: {name} environment variable not set.", file=sys.stderr)
sys.exit(1)
return value
BUFFER_API_KEY = ensure_env_var("BUFFER_API_KEY")
速率限制(Rate Limiting)
通过添加延迟来遵守 API 的速率限制:
import time
for video in video_list:
transcript = get_transcript(video["id"])
process_transcript(transcript)
time.sleep(1) # 避免超出速率限制
故障排查
"API key not found"
请确保在运行前已设置环境变量:
echo $BUFFER_API_KEY # 应当打印出你的 Key
export BUFFER_API_KEY="your_key_here"
"Skill not loaded by agent"
确认技能文件夹存放位置正确:
ls "$HOME/.codex/skills/youtube-researcher"
# 应当显示 SKILL.md 及相关文件
CLI 工具提示 "Permission denied"
全局安装 CLI 工具或确保其已添加到 PATH 环境变量中:
which excalidraw-cli
npm install -g excalidraw-cli
MCP 服务端无响应
检查 Paper 桌面应用是否正常运行以及 MCP 服务端是否已启动:
curl http://localhost:8080/health
# 应当返回 {"status": "ok"}
Readwise CLI 身份验证失败
如果 Readwise 命令执行失败,请重新进行身份验证:
readwise logout
readwise login
进阶文档
- 完整配置检查清单:
docs/requirements.md - 各技能独立 README 文件位于各
skills/子目录下 - 插件工作流说明位于
plugin-workflows/目录下
贡献指南
本项目为团队私有仓库。如需添加新技能:
- 在
skills/目录下创建一个名称清晰的文件夹 - 包含一个列明需求和示例的 README 文件
- 在主仓库表格中添加一项说明
- 切勿提交 Secret 或 API 密钥
开源协议:未指定协议(私有仓库)






