Video Sourcing Skill
Use this skill when the user asks to find, compare, or analyze social videos (YouTube, TikTok, Instagram, Twitter/X), or explicitly invokes /video_sourcing.
This workflow expects host runtime execution (sandbox mode off).
The runner auto-bootstraps a pinned runtime from Memories-ai-labs/video-sourcing-agent@v0.2.3 when VIDEO_SOURCING_AGENT_ROOT is not set.
Triggering
Run this workflow when either condition is true:
- 1. Message starts with
/video_sourcing. - The user asks for video sourcing/trend/creator/brand analysis and wants concrete video links.
If /video_sourcing is used with no query body, ask for the missing query.
Execution contract
- 1. Resolve query text:
-
/video_sourcing ... => strip
/video_sourcing and use remaining text.
- Free-form => use user message as query.
- 2. Default to compact mode:
-
--event-detail compact
- 3. If user asks for debugging/raw payloads:
- Switch to INLINECODE8
/video_sourcing deterministic path
- 1. Build command with required args:
-
<skill_dir>/scripts/run_video_query.sh --query "<query>" --event-detail <compact|verbose> --ux-mode three_message --progress-gate-seconds 10
- 2. Start with
exec using background: true. - Poll with
process using action: "poll" every 2-4 seconds until process exits. - Parse NDJSON output and render only these events:
-
started => send:
Starting video sourcing...
-
ux_progress => send concise middle progress updates from
summary (throttled by runner)
Send each
ux_progress as a separate assistant message in Telegram.
- terminal event (
complete,
clarification_needed,
error) => send final message as-is
- 5. Do not forward raw
progress, tool_call, or tool_result events for /video_sourcing. - Do not rewrite final answer tone/style; preserve the user's existing OpenClaw personality behavior.
Behavior target for /video_sourcing:
- 1. Fast run (<10s): 2 messages (
started, terminal). - Longer run (>=10s): recurring throttled
ux_progress updates, then terminal.
Free-form path (non-strict)
- 1. Keep existing flexible behavior.
- Build command without forcing
three_message mode:
-
<skill_dir>/scripts/run_video_query.sh --query "<query>" --event-detail <compact|verbose>
- 3. Stream useful progress updates and final response naturally.
Final response format
When terminal event is complete:
- 1. One short paragraph conclusion.
- Top 3 video references only by default:
-
title
-
url
- one-line relevance note
- 3.
Tools used: ... with a compact status summary.
If fewer than 3 videos exist, show all available references.
When terminal event is clarification_needed:
- 1. Ask the clarification question directly.
- Treat this as the final response for the current run.
When terminal event is error:
- 1. Send concise failure reason.
- Include one actionable next step.
Safety and fallback
- 1. If script fails due to missing env/tooling, explain exact missing piece (for example
VIDEO_SOURCING_AGENT_ROOT, uv, or API key env var). - If
VIDEO_SOURCING_AGENT_ROOT is unset, the runner uses managed path:
-
~/.openclaw/data/video-sourcing-agent/v0.2.3
- 3.
VIDEO_SOURCING_AGENT_ROOT remains an advanced override for local development. - Keep response concise and action-oriented.
- Never fabricate video URLs or metrics.
视频来源获取技能
当用户要求查找、比较或分析社交媒体视频(YouTube、TikTok、Instagram、Twitter/X),或明确调用 /video_sourcing 时,使用此技能。
此工作流期望在主机运行时环境中执行(沙箱模式关闭)。
当未设置 VIDEOSOURCINGAGENT_ROOT 时,运行器会自动从 Memories-ai-labs/video-sourcing-agent@v0.2.3 引导一个固定的运行时。
触发条件
满足以下任一条件时运行此工作流:
- 1. 消息以 /video_sourcing 开头。
- 用户要求进行视频来源获取/趋势/创作者/品牌分析,并希望获得具体的视频链接。
如果使用 /video_sourcing 但未附带查询内容,则询问缺失的查询信息。
执行约定
- 1. 解析查询文本:
- /video
sourcing ... => 去除 /videosourcing 并使用剩余文本。
- 自由格式 => 将用户消息作为查询内容。
- 2. 默认使用紧凑模式:
- --event-detail compact
- 3. 如果用户要求调试/原始数据:
- 切换为 --event-detail verbose
/video_sourcing 确定性路径
- 1. 使用必需参数构建命令:
-
dir>/scripts/runvideoquery.sh --query <查询内容> --event-detail --ux-mode threemessage --progress-gate-seconds 10
- 2. 使用 exec 启动,设置 background: true。
- 每2-4秒使用 process 轮询(action: poll),直到进程退出。
- 解析 NDJSON 输出,仅渲染以下事件:
- started => 发送:正在启动视频来源获取...
- ux_progress => 从 summary 发送简洁的中间进度更新(由运行器限流)
在 Telegram 中将每个 ux_progress 作为独立的助手消息发送。
- 终端事件(complete、clarification_needed、error)=> 按原样发送最终消息
- 5. 对于 /videosourcing,不转发原始的 progress、toolcall 或 tool_result 事件。
- 不重写最终回答的语气/风格;保留用户现有的 OpenClaw 个性行为。
/video_sourcing 的行为目标:
- 1. 快速运行(<10秒):2条消息(started,终端消息)。
- 较长运行(>=10秒):循环发送限流的 ux_progress 更新,然后发送终端消息。
自由格式路径(非严格模式)
- 1. 保持现有的灵活行为。
- 构建命令时不强制使用 three_message 模式:
- dir>/scripts/runvideo_query.sh --query <查询内容> --event-detail
- 3. 自然地流式传输有用的进度更新和最终响应。
最终响应格式
当终端事件为 complete 时:
- 1. 一段简短的结论。
- 默认仅显示前3个视频参考:
- 标题
- URL
- 一行相关性说明
- 3. 使用的工具:... 附带紧凑的状态摘要。
如果视频少于3个,则显示所有可用的参考。
当终端事件为 clarification_needed 时:
- 1. 直接提出需要澄清的问题。
- 将此作为当前运行的最终响应。
当终端事件为 error 时:
- 1. 发送简洁的失败原因。
- 包含一个可操作的下一步建议。
安全与回退
- 1. 如果脚本因缺少环境/工具而失败,说明具体缺失的内容(例如 VIDEOSOURCINGAGENTROOT、uv 或 API 密钥环境变量)。
- 如果未设置 VIDEOSOURCINGAGENTROOT,运行器使用托管路径:
- ~/.openclaw/data/video-sourcing-agent/v0.2.3
- 3. VIDEOSOURCINGAGENT_ROOT 仍作为本地开发的高级覆盖选项。
- 保持响应简洁且以行动为导向。
- 绝不虚构视频 URL 或指标。