media-use
Agent Media OS — resolve any media need (BGM, SFX, image, icon) into a frozen local file + ledger record. One verb (`resolve`) handles the full cascade — project cache, global cache, HeyGen catalog search, freeze, register. Keeps search noise on disk, hands the agent a path. Use when a composition needs background music, sound effects, images, or icons.
- License 许可
- MIT
- 最近更新
- 2026-10-11
- Stars
- ★ 74
- Forks
- 1
01 前言 Front Matter
- name
- media-use
- description
- Agent Media OS — resolve any media need (BGM, SFX, image, icon) into a frozen local file + ledger record. One verb (`resolve`) handles the full cascade — project cache, global cache, HeyGen catalog search, freeze, register. Keeps search noise on disk, hands the agent a path. Use when a composition needs background music, sound effects, images, or icons.
02 资源文件 18
- 其他.gitignore17 B
- 脚本scripts/eval.mjs14.5 KB
- 脚本scripts/lib/adopt.mjs3.5 KB
- 脚本scripts/lib/bgm-provider.mjs650 B
- 脚本scripts/lib/brand-provider.mjs1.6 KB
- 脚本scripts/lib/cache.mjs3.2 KB
- 脚本scripts/lib/freeze.mjs1.1 KB
- 脚本scripts/lib/heygen-search.mjs1.8 KB
- 脚本scripts/lib/image-provider.mjs1.4 KB
- 脚本scripts/lib/index-gen.mjs1.9 KB
- 脚本scripts/lib/manifest.mjs2.4 KB
- 脚本scripts/lib/manifest.test.mjs8.4 KB
- 脚本scripts/lib/probe.mjs1.3 KB
- 脚本scripts/lib/probe.test.mjs1.6 KB
- 脚本scripts/lib/providers.mjs759 B
- 脚本scripts/lib/sfx-provider.mjs700 B
- 脚本scripts/resolve.mjs7.7 KB
- 脚本scripts/resolve.test.mjs7.5 KB
03 SKILL.md 正文
media-use
Resolve media needs into frozen local files. One verb, four types, zero context noise.
When to use
Call resolve whenever a composition needs media — background music, sound effects, images, or icons. media-use searches the HeyGen catalog, downloads the best match, freezes it locally, and registers it in a manifest. The agent gets back one line; all search noise stays on disk.
Resolve
node <SKILL_DIR>/scripts/resolve.mjs --type <type> --intent "<description>" --project <dir>
Returns one line: resolved <id> → <path> (<type>, <metadata>)
Types
| Type | What it finds | Provider |
|---|---|---|
bgm |
Background music | HeyGen audio catalog (10k+ tracks) |
sfx |
Sound effects | Bundled 19-file library + HeyGen catalog |
image |
Photos, backgrounds | HeyGen asset search (75k+ vectors) |
icon |
Icons, logos | HeyGen asset search (type=icon) |
Examples
# Background music
node <SKILL_DIR>/scripts/resolve.mjs --type bgm --intent "upbeat tech launch" --project .
# → resolved bgm_001 → .media/audio/bgm/bgm_001.mp3 (bgm, 25s)
# Sound effect
node <SKILL_DIR>/scripts/resolve.mjs --type sfx --intent "whoosh" --project .
# → resolved sfx_001 → .media/audio/sfx/sfx_001.mp3 (sfx, 0.57s)
# Image
node <SKILL_DIR>/scripts/resolve.mjs --type image --intent "gradient tech background" --project .
# → resolved image_001 → .media/images/image_001.jpg (image)
# Icon
node <SKILL_DIR>/scripts/resolve.mjs --type icon --intent "rocket" --project .
# → resolved icon_001 → .media/images/icon_001.png (icon, transparent)
Flags
| Flag | Description |
|---|---|
--type, -t |
Media type: bgm, sfx, image, icon |
--intent, -i |
What you need (natural language) |
--entity, -e |
Entity name for cache matching (optional) |
--project, -p |
Project directory (default: .) |
--adopt |
Bulk-import existing assets/ into manifest |
--json |
Output JSON instead of one-line result |
How it works
- Check project
.media/manifest.jsonlfor exact-prompt match - Scan existing
assets/directory for unregistered files matching the need - Check global cache
~/.media/for reusable asset - Search via provider (HeyGen audio catalog, HeyGen asset search)
- Freeze file to
.media/<type>/, register in manifest, regenerateindex.md
The agent gets back one line. Candidates, scores, provenance stay on disk.
Adopt existing projects
Most HyperFrames projects already have assets in assets/. media-use adopts them:
node <SKILL_DIR>/scripts/resolve.mjs --adopt --project .
# → adopted 9 assets from assets/
# bgm_001 → assets/bgm/mango-fizz.mp3 (bgm, 146.6s)
# image_001 → assets/images/avatar.jpg (image, 400×400)
ffprobe extracts real duration and dimensions. During resolve, unregistered files in assets/ matching the intent are adopted on the fly.
Reading the inventory
After resolve or adopt, read .media/index.md for the full inventory:
# .media · 4 assets
id type dur dims path description
bgm_001 bgm 25s — .media/audio/bgm/bgm_001.mp3 upbeat tech launch
sfx_001 sfx 0.6s — .media/audio/sfx/sfx_001.mp3 whoosh
image_001 image — 1920×1080 .media/images/image_001.jpg gradient tech background
icon_001 icon — 200×200 .media/images/icon_001.png rocket
Cross-project reuse
Assets are cached automatically on resolve. Subsequent resolves for the same prompt hit the global cache at ~/.media/ — no re-download, no provider call. Promote an asset explicitly with organize --promote <id> to make it reusable across all projects.
Files
.media/manifest.jsonl— machine SSOT, one JSON record per line.media/index.md— agent-readable table (id, type, dur, dims, path, description)~/.media/— global cross-project reuse cache (content-addressed, SHA-256)
CLI tools used
| Tool | Purpose | Required? |
|---|---|---|
ffprobe |
Probe duration, dimensions, codec on adopt | Yes |
heygen |
Audio catalog, asset search | For providers |
Install the heygen CLI (single static binary, no runtime) and authenticate:
curl -fsSL https://static.heygen.ai/cli/install.sh | bash # installs latest to ~/.local/bin
heygen update # if already installed: needs >= v0.1.6
export HEYGEN_API_KEY=<your-key> # or: heygen auth login --key <key>
Requires heygen >= v0.1.6 — the providers tag requests with the allowlisted --headers 'X-HeyGen-Client-Source: media-use' flag, added in v0.1.6. asset search is a pre-launch command hidden from heygen --help, but it runs. Without a heygen on PATH (or a valid key) the providers print a one-line diagnostic to stderr and resolve falls through to "no provider could resolve".
04 同仓库更多 Skills
external-shot-continuity
External continuity review method for long-form video projects.
independent-story-workflow
Create a three-part story document without paid media generation.
suno-song
Instruction helper: write a singable original Suno song from Bitwize (verbatim copy), then call suno.generate. Trigger: 原创歌曲, 写歌, Suno lyrics, $suno-song. Not a workflow.
short-drama-workflow
Workflow for producing plot-dense short dramas with character and location reference sheets, complete 15-second Seedance segments, native dialogue, parallel multi-reference T2V generation, duration validation, and final assembly. Use for 爽文短剧、都市反转短剧、对白短剧、连续多段短剧,或用户明确调用 $short-drama-workflow. Do not use for product-centered scenario advertisements.
seedance2
Workflow: 即梦 Seedance 视频创意工作台。图+文案→看图分析→文案扩写→运镜→API生成。 触发词:即梦、Seedance、seedance、视频提示词、AI视频、运镜、短剧广告、$seedance2.
product-voiceover-narration
Design concise native voiceover for commercial product-video segments and bind each spoken line to verified selling points, visible actions, and exact timeline ranges. Use when a product advertisement should introduce the product through narration, when Seedance 2.0 should generate picture and voice together, or when product shots need coordinated narration, music, and sound direction. Do not synthesize a separate voice track and never invent product claims.