From codex-imagegen
Generate short text-to-video clips via Aliyun DashScope's async video synthesis API (e.g. `happyhorse-1.0-t2v`, Wan series). Trigger when the user asks to create, generate, or make a video / animation / clip / 视频 from a text description — and they have not specified a different generator (Sora, Runway, Pika, Kling, Luma, etc.). Also trigger when the user mentions DashScope, 通义万相, 阿里视频生成, or `happyhorse` / Wan video models.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codex-imagegen:dashscope-videogenThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generates short videos from a text prompt using Aliyun DashScope's async video synthesis endpoint. The bundled `videogen.py` owns submission, polling, key resolution, and download — Claude just chooses parameters and invokes it.
Generates short videos from a text prompt using Aliyun DashScope's async video synthesis endpoint. The bundled videogen.py owns submission, polling, key resolution, and download — Claude just chooses parameters and invokes it.
The script needs DASHSCOPE_API_KEY. Resolution order:
DASHSCOPE_API_KEY exported in the current shell.~/.claude/skill-env/dashscope-videogen.env (the persistent local file the skill writes — outside any source tree, chmod 600).If neither is set, the script exits with code 2 and a clear message. Never hard-code, log, or commit a key. Never write the key into a file inside this skill folder or any other git-tracked path — only set-key (which writes to ~/.claude/skill-env/) is acceptable.
Run python3 ~/.claude/skills/dashscope-videogen/videogen.py check-key.
If it reports MISSING, ask the user once, in plain language, for their DashScope API key (link them to https://dashscope.console.aliyun.com/apiKey if they don't know where to find it).
When they paste it, persist it:
python3 ~/.claude/skills/dashscope-videogen/videogen.py set-key sk-XXXXXXXX
The script writes to ~/.claude/skill-env/dashscope-videogen.env (chmod 600) and prints a masked confirmation. Future Claude sessions reuse it automatically.
Then proceed with the actual generation request.
If the user prefers not to persist, they can export DASHSCOPE_API_KEY=... in their shell instead — the script picks up the env var first.
python3 ~/.claude/skills/dashscope-videogen/videogen.py generate <output.mp4> "<prompt>" \
[--model happyhorse-1.0-t2v] \
[--resolution 720P] \
[--ratio 16:9] \
[--duration 5]
<output.mp4> — absolute or workspace-relative path. Default to the current working directory; do not write to /tmp unless the user asks.<prompt> — pass the user's prompt verbatim unless they asked for refinement. The API accepts Chinese and English.parameters block. Defaults match the most common request (720P, 16:9, 5s, happyhorse-1.0-t2v).The script:
X-DashScope-Async: enable.task_id and a one-liner showing how to resume if polling is interrupted./api/v1/tasks/{task_id} every 10s. Status transitions: PENDING → RUNNING → SUCCEEDED (typical 60–120s for a 5s/720P clip).<output.mp4>.Allow up to ~5 minutes wall-clock. Don't kill it early.
videogen.py check-key. Skip this if you've just used the skill in this session.video.mp4, cardboard_city.mp4). Don't invent random names.videogen.py generate via Bash. The script streams progress lines (task_status=RUNNING, then SUCCEEDED).ls -lh <output.mp4>). The video URL the API returns is presigned and short-lived; the local mp4 is the deliverable.video_url in your reply — it leaks via screenshots and expires anyway.If the polling step is interrupted (network drop, user Ctrl-C, timeout) but you still have the task_id printed at submission time:
python3 ~/.claude/skills/dashscope-videogen/videogen.py resume <task_id> <output.mp4>
This skips submission and goes straight to poll-then-download. Useful if the user comes back later — DashScope retains finished tasks for a while.
HTTP 401 / InvalidApiKey — the saved key is wrong or revoked. Run set-key again with a fresh key. Do not retry silently.HTTP 429 / throttling — back off and tell the user; do not auto-retry hard.task_status=FAILED — the response body usually contains code / message (e.g. DataInspectionFailed for prompt content). Surface those fields verbatim to the user and adjust the prompt; do not try to bypass content policy.resume <task_id> to keep polling without resubmitting.ModuleNotFoundError — should not happen, the script uses only the Python stdlib. If it does, check the user has Python 3.8+.happyhorse-1.0-t2v returns a watermarked mp4 (..._watermark.mp4). That's a model-side decision — mention it to the user if relevant; do not attempt to strip it.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub rancheng/my_claude_skills --plugin codex-imagegen