Agent Skillsopensquilla/opensquilla › openrouter-video-generator

openrouter-video-generator

GitHub

为AwesomeWebpageMetaSkill生成视频资产。通过OpenRouter异步API提交任务,轮询状态并下载MP4至指定目录。严格遵循配置读取与API调用规范,避免误用聊天接口导致报错或费用损失。

src/opensquilla/skills/bundled/openrouter-video-generator/SKILL.md opensquilla/opensquilla

Trigger Scenarios

需要为网页生成本地视频资源 AwesomeWebpageMetaSkill执行video生成步骤

Install

npx skills add opensquilla/opensquilla --skill openrouter-video-generator -g -y
More Options

Non-standard path

npx skills add https://github.com/opensquilla/opensquilla/tree/main/src/opensquilla/skills/bundled/openrouter-video-generator -g -y

Use without installing

npx skills use opensquilla/opensquilla@openrouter-video-generator

指定 Agent (Claude Code)

npx skills add opensquilla/opensquilla --skill openrouter-video-generator -a claude-code -g -y

安装 repo 全部 skill

npx skills add opensquilla/opensquilla --all -g -y

预览 repo 内 skill

npx skills add opensquilla/opensquilla --list

SKILL.md

Frontmatter
{
    "name": "openrouter-video-generator",
    "homepage": "",
    "metadata": {
        "opensquilla": {
            "risk": "high",
            "requires": {
                "env": [],
                "config": [
                    "awesome_webpage.openrouter.api_key",
                    "awesome_webpage.openrouter.api_key_env",
                    "awesome_webpage.openrouter.base_url",
                    "awesome_webpage.openrouter.models.video_generation",
                    "awesome_webpage.output_dir"
                ]
            },
            "capabilities": [
                "network-write",
                "filesystem-read",
                "filesystem-write"
            ]
        }
    },
    "entrypoint": {
        "env": {
            "{{ with.api_key_env | default('OPENROUTER_API_KEY') }}": "{{ with.api_key | default('') }}"
        },
        "args": [
            "--model",
            "{{ with.model | default('bytedance\/seedance-2.0-fast') }}",
            "--base-url",
            "{{ with.base_url | default('https:\/\/openrouter.ai\/api\/v1') }}",
            "--api-key-env",
            "{{ with.api_key_env | default('OPENROUTER_API_KEY') }}",
            "--output-dir",
            "{{ with.output_dir }}",
            "--filename",
            "{{ with.filename | default('intro.mp4') }}",
            "--duration",
            "{{ with.duration | default(10) }}",
            "--aspect-ratio",
            "{{ with.aspect_ratio | default('16:9') }}"
        ],
        "parse": "text",
        "stdin": "{{ with.prompt | default(inputs.user_message) }}",
        "command": "python {baseDir}\/scripts\/openrouter_video.py",
        "timeout": 420
    },
    "provenance": {
        "origin": "opensquilla-original",
        "license": "Apache-2.0",
        "maintained_by": "OpenSquilla"
    },
    "description": "Generate or declare a configured OpenRouter video asset for AwesomeWebpageMetaSkill. Use only when the meta skill needs a local webpage video and the provider, model, API key, and output directory come from config.",
    "user-invocable": false,
    "disable-model-invocation": true
}

OpenRouter Video Generator

Create a short browser-playable video asset for AwesomeWebpageMetaSkill. This is an adapter around the configured OpenRouter video model, not a place to choose providers or invent model ids.

Meta-Skill Entrypoint

Meta-skills should run this skill as skill_exec. The entrypoint is a deterministic Python adapter around OpenRouter's async video endpoint; it uses an explicit with.api_key value by injecting it into the configured with.api_key_env child process environment variable, writes the MP4 under the supplied output directory, and prints either VIDEO_READY: or a single failure label. Do not spawn an LLM sub-agent just to generate video.

Contract

  • Read provider settings from config.awesome_webpage.openrouter.
  • Resolve the API key from awesome_webpage.openrouter.api_key; if empty, use the environment variable named by awesome_webpage.openrouter.api_key_env.
  • Use only awesome_webpage.openrouter.models.video_generation as the model.
  • Use only awesome_webpage.output_dir as the output root.
  • Save generated files under project/assets/video/.
  • Return a media manifest with local path, MIME type, duration if known, provenance, and replacement notes.

OpenRouter Video API Contract (hard rule)

OpenRouter video models are exposed through an async job endpoint, not the chat-completions endpoint. Hitting /chat/completions with a video model id returns HTTP 500 and burns the full per-attempt budget. Do not attempt it.

  • Submit: POST {base_url}/videos with JSON body {"model": "<video_generation>", "prompt": "<text>", "duration": <int>}. Optional fields: resolution, aspect_ratio, frame_images, input_references, provider, callback_url. Do NOT send messages or modalities — those are chat-only and will be rejected.
  • Response (immediate): {"id": "...", "polling_url": "...", "status": "pending"}.
  • Poll: GET the polling_url with the same Authorization: Bearer ... header every 8-15 seconds until status becomes one of completed | failed | cancelled | expired. Cap the loop at ~5 minutes per clip; treat anything beyond that as VIDEO_GENERATION_FAILED.
  • Download (only on completed): take the first URL from unsigned_urls, GET it with the same bearer token, and save the body to <output_dir>/project/assets/video/<slug>.mp4. Set MIME to video/mp4.
  • Terminal-failure statuses map to VIDEO_GENERATION_FAILED; include the job id and a replacement-slot path so the page can render a clean placeholder.

Typical successful job completes in 60-120 s for short clips; do not abort before that window.

Failure Labels

Return one of these labels instead of silently skipping video:

  • VIDEO_CONFIG_NEEDED: model, API key, base URL, or output directory is missing.
  • VIDEO_MODEL_UNSUPPORTED: the configured model cannot return a local browser-playable asset in this environment.
  • VIDEO_GENERATION_FAILED: the provider call failed after a concrete attempt.

When returning a failure label, also return a replacement slot such as project/assets/video/replace-with-topic-intro.mp4 and enough prompt/context for a later repair pass.

Output Requirements

  • Prefer .mp4 with video/mp4; .webm is acceptable when browser playable.
  • Keep clips short, usually 8-20 seconds.
  • Do not use remote embeds unless config explicitly allows them.
  • Do not hardcode OpenRouter model names, API keys, or output directories.

On success: VIDEO_READY manifest line (required)

After every successful download, end your reply with one single-line JSON record per file so AwesomeWebpageMetaSkill can collect and bind the asset:

VIDEO_READY: {"local_path": "project/assets/video/<slug>.mp4", "mime": "video/mp4", "duration_s": <int_or_null>, "resolution": "<WxH_or_null>", "prompt_preview": "<first 80 chars>"}
  • One VIDEO_READY: line per video file. No trailing prose on that line.
  • local_path MUST be the relative path project/assets/video/.... Do NOT emit an absolute path here.
  • On failure, emit one of VIDEO_CONFIG_NEEDED, VIDEO_MODEL_UNSUPPORTED, or VIDEO_GENERATION_FAILED as a single-line label with the replacement-slot path so the page can render a placeholder.

Version History

  • 7f72a32 Current 2026-07-05 18:39

Same Skill Collection

src/opensquilla/skills/bundled/advanced-dubbing-studio/SKILL.md
src/opensquilla/skills/bundled/ai-video-script/SKILL.md
src/opensquilla/skills/bundled/audio-cog/SKILL.md
src/opensquilla/skills/bundled/awesome-webpage-image-download/SKILL.md
src/opensquilla/skills/bundled/awesome-webpage-research/SKILL.md
src/opensquilla/skills/bundled/AwesomeWebpageMetaSkill/SKILL.md
src/opensquilla/skills/bundled/cron/SKILL.md
src/opensquilla/skills/bundled/docx/SKILL.md
src/opensquilla/skills/bundled/filesystem/SKILL.md
src/opensquilla/skills/bundled/git-diff/SKILL.md
src/opensquilla/skills/bundled/github/SKILL.md
src/opensquilla/skills/bundled/history-explorer/SKILL.md
src/opensquilla/skills/bundled/html-coder/SKILL.md
src/opensquilla/skills/bundled/html-to-pdf/SKILL.md
src/opensquilla/skills/bundled/http-fetch/SKILL.md
src/opensquilla/skills/bundled/latex-compile/SKILL.md
src/opensquilla/skills/bundled/memory/SKILL.md
src/opensquilla/skills/bundled/music-and-singing-studio/SKILL.md
src/opensquilla/skills/bundled/nano-banana-pro-openrouter/SKILL.md
src/opensquilla/skills/bundled/nano-banana-pro/SKILL.md
src/opensquilla/skills/bundled/nano-pdf/SKILL.md
src/opensquilla/skills/bundled/paper-abstract-author/SKILL.md
src/opensquilla/skills/bundled/paper-citation-planner/SKILL.md
src/opensquilla/skills/bundled/paper-experiment-stub/SKILL.md
src/opensquilla/skills/bundled/paper-outline-author/SKILL.md
src/opensquilla/skills/bundled/paper-preference-planner/SKILL.md
src/opensquilla/skills/bundled/paper-refbib-stub/SKILL.md
src/opensquilla/skills/bundled/paper-revision-author/SKILL.md
src/opensquilla/skills/bundled/paper-section-author/SKILL.md
src/opensquilla/skills/bundled/paper-source-curator/SKILL.md
src/opensquilla/skills/bundled/pptx/SKILL.md
src/opensquilla/skills/bundled/seedance-2-prompt/SKILL.md
src/opensquilla/skills/bundled/skill-creator-linter/SKILL.md
src/opensquilla/skills/bundled/skill-creator-proposals/SKILL.md
src/opensquilla/skills/bundled/skill-creator-smoke-test/SKILL.md
src/opensquilla/skills/bundled/srt-from-script/SKILL.md
src/opensquilla/skills/bundled/stack-trace-generic-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-go-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-js-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-python-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-rust-probe/SKILL.md
src/opensquilla/skills/bundled/subtitle-burner/SKILL.md
src/opensquilla/skills/bundled/swe-bench/SKILL.md
src/opensquilla/skills/bundled/text-file-read/SKILL.md
src/opensquilla/skills/bundled/title-card-image/SKILL.md
src/opensquilla/skills/bundled/video-merger/SKILL.md
src/opensquilla/skills/bundled/video-still-animator/SKILL.md
src/opensquilla/skills/bundled/voice-clone-lab/SKILL.md
src/opensquilla/skills/bundled/voice-conversion-studio/SKILL.md
src/opensquilla/skills/bundled/voiceover-studio/SKILL.md
src/opensquilla/skills/bundled/weather/SKILL.md
src/opensquilla/skills/bundled/web-search/SKILL.md
src/opensquilla/skills/bundled/xlsx/SKILL.md
src/opensquilla/skills/exp/meta-arxiv-daily-digest-deck/SKILL.md
src/opensquilla/skills/exp/meta-codereview-current-diff/SKILL.md
src/opensquilla/skills/exp/meta-compliance-audit-bundle/SKILL.md
src/opensquilla/skills/exp/meta-diagram-triangulation/SKILL.md
src/opensquilla/skills/exp/meta-github-pr-watch-digest/SKILL.md
src/opensquilla/skills/exp/meta-issue-to-pr-autopilot/SKILL.md
src/opensquilla/skills/exp/meta-knowledge-base-bootstrap/SKILL.md
src/opensquilla/skills/exp/meta-migration-assistant/SKILL.md
src/opensquilla/skills/exp/meta-multi-format-export-pack/SKILL.md
src/opensquilla/skills/exp/meta-pdf-intelligence/SKILL.md
src/opensquilla/skills/exp/meta-pdf-reformat-pipeline/SKILL.md
src/opensquilla/skills/exp/meta-pre-commit-quality-gate/SKILL.md
src/opensquilla/skills/exp/meta-scheduled-morning-digest/SKILL.md
src/opensquilla/skills/exp/meta-security-review-bundle/SKILL.md
src/opensquilla/skills/exp/meta-spreadsheet-insight/SKILL.md
src/opensquilla/skills/exp/meta-stack-trace-investigator/SKILL.md
src/opensquilla/skills/exp/meta-travel-planner/SKILL.md
src/opensquilla/skills/exp/meta-web-to-pdf-briefing/SKILL.md
tests/_fixtures/meta-paper-write-handwritten.SKILL.md
src/opensquilla/skills/bundled/code-task/SKILL.md
src/opensquilla/skills/bundled/deep-research/SKILL.md
src/opensquilla/skills/bundled/meta-kid-project-planner/SKILL.md
src/opensquilla/skills/bundled/meta-paper-write/SKILL.md
src/opensquilla/skills/bundled/meta-short-drama/SKILL.md
src/opensquilla/skills/bundled/meta-skill-creator/SKILL.md
src/opensquilla/skills/bundled/multi-search-engine/SKILL.md
src/opensquilla/skills/bundled/pdf-toolkit/SKILL.md
src/opensquilla/skills/bundled/skill-creator/SKILL.md
src/opensquilla/skills/bundled/sub-agent/SKILL.md
src/opensquilla/skills/bundled/summarize/SKILL.md
src/opensquilla/skills/bundled/tmux/SKILL.md
src/opensquilla/skills/exp/meta-long-running-build-watchdog/SKILL.md
src/opensquilla/skills/bundled/paper-plot-stub/SKILL.md
src/opensquilla/skills/exp/meta-content-publish-pipeline/SKILL.md
src/opensquilla/skills/exp/meta-home-it-rescue/SKILL.md
src/opensquilla/skills/exp/meta-meeting-to-workflow/SKILL.md
src/opensquilla/skills/exp/meta-research-to-slide-deck/SKILL.md
src/opensquilla/skills/exp/meta-sales-lead-researcher/SKILL.md

Metadata

Files
0
Version
7f72a32
Hash
259c97b7
Indexed
2026-07-05 18:39

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-09 05:30
浙ICP备14020137号-1 $Гость$