Home / All Skills / Content & Media Creation / media-use
Content & Media Creation · heygen-com/hyperframes

media-use

Agent Media OS, the single skill for every media need in a HyperFrames project. Resolve BGM, SFX, image, icon, brand logo, voice, color grade, or LUT into a frozen local file or paste-ready block + ledger record (one verb, `resolve`); generate via TTS / music / image models when the catalog misses; produce voiceover, transcription, captions, and background removal through one shared audio engine; operate on media (cut / reframe / transform); and reuse assets across projects. Also use for vague feedback that real footage looks dark, flat, boring, should feel retro/camcorder/print/ASCII, needs privacy, or needs a media reveal.

L4 High-Privilege · Graded auth & full auditV1 Commit-PinnedExecute CommandNetwork AccessWrite FileDual-pass Audit
Author heygen-comGitHub heygen-com/hyperframes ↗Stars 48297License Apache-2.0(仓库根 LICENSE,GitHub API spdx Apache-2.0)Commit b8328f9573
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

The core is a 'single-verb' CLI architecture: SKILL.md unifies all eight types of media needs (BGM, SFX, image, icon, logo, voice, color grade, and LUT) into a single `resolve` command, where the agent converts user intent into `--intent`, persists search noise directly to disk, and outputs only a single line of results.

skills/media-use/SKILL.md
```bash node <SKILL_DIR>/scripts/resolve.mjs --type <type> --intent "<description>" --project <dir> ``` Returns one line: `resolved <id> → <path> (<type>, <metadata>)`. All search noise stays on disk.
What is happening here: Abstracting asset lookup into a single invocation of type + intent; the actual implementation is handled by skills/media-use/scripts/resolve.mjs and its lib/ directory (provider cascade, candidates, adopt, and manifest are all driven by lib/), rather than mere prompt-based promises.

Lookup-type capabilities (bgm/sfx/image/icon/voice) default to the HeyGen catalog free-usage path, requiring pre-installation and OAuth login via the heygen CLI along with a `--doctor` self-check, without which they will not function.

skills/media-use/SKILL.md
First run: install and sign in to the `heygen` CLI (the free-usage path), then verify with `node <SKILL_DIR>/scripts/resolve.mjs --doctor`.
Authenticity of capabilities depends on an external CLI and account: BGM relies on 'HeyGen catalog, 10k+ tracks' and image on 'HeyGen asset search, 75k+ vectors' (per the SKILL.md table); embedded setup/login steps include `heygen auth login --oauth` from references/setup-providers.md.

Generation capabilities operate on a dual-track system of 'cloud default + local optional': BGM generation uses Google Lyria (requires $GOOGLE_API_KEY/$GEMINI_API_KEY) with fallback to local MusicGen; voice uses HeyGen TTS or local Kokoro; image uses local mflux; video uses local LTX—all executed via lib/ scripts.

skills/media-use/audio/scripts/lyria-recipe.py
Generate BGM using Google Lyria RealTime API. Usage: python lyria-recipe.py --output <path> --duration <seconds> [tuning flags] Requires: $GOOGLE_API_KEY or $GEMINI_API_KEY environment variable (treated as aliases).
Comments in bgm.mjs align with this: 'Lyria (cloud, $GEMINI_API_KEY/$GOOGLE_API_KEY + google-genai) preferred'; local models are installed via pip/uv (mflux==0.9.6, parakeet-mlx, git clone ltx-2-mlx), detailed in the setup-providers.md tool table.

Logo resolution follows the chain 'svgl → simple-icons → GitHub avatar → domain favicon', strictly avoiding hand-drawn marks; these are real providers performing network requests (logo-provider.mjs).

skills/media-use/scripts/lib/logo-provider.mjs
https://api.svgl.app https://cdn.jsdelivr.net/npm/simple-icons
SKILL.md defines the `logo` type as 'official brand marks (svgl → simple-icons → GitHub avatar → favicon; never redrawn)'—outbound endpoints are third-party CDNs and icon services.

Media operations (cut, reframe, transform, duck, loudness, subtitle chunking, error diffusion, HEVC) are implemented via custom Node scripts + ffmpeg; for instance, freeze.mjs enforces SSRF protections on 'freezing remote URLs' (blocking localhost, private subnets, and link-local addresses).

skills/media-use/scripts/lib/freeze.mjs
/^(localhost|.*\.local|.*\.internal|127\.|10\.|0\.|169\.254\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.|\[?(::1|::ffff:127\.|f[cd][0-9a-f]{2}:|fe80:))/i;
The accompanying freeze.test.mjs in the same directory contains assertions against whitelists for youtube/vimeo/x and blocks internal addresses like http://169.254.169.254/a.mp4, turning the SSRF defense into testable code.

Cross-project memory/caching is implemented through real filesystem structures: project-level `.media/` + global `~/.media/` (content-addressed via SHA-256), with preferences and full recipes persisted across project and global tiers, managed via prefs.mjs/recipe.mjs.

skills/media-use/references/memory.md
- `.media/manifest.jsonl`: machine SSOT, one JSON record per line - `~/.media/`: global cross-project reuse cache (content-addressed, SHA-256)
This forms the foundational implementation for the claim 'reuse assets across projects' in SKILL.md: first list reusable assets with `--candidates`, then import from global cache using `--reuse <sha>` (resolve.md Flags table).

Telemetry is enabled by default but deliberately coarse-grained: PostHog events contain only media type/source/provider without intent text or file paths, featuring opt-out switches via DO_NOT_TRACK / HYPERFRAMES_NO_TELEMETRY / CI / dev, and sharing identity configuration in ~/.hyperframes/config.json with the hyperframes CLI.

skills/media-use/references/meta.md
It records only the media TYPE, the resolution SOURCE, and the winning PROVIDER: never the intent text, file names, or paths, and `$ip:null` so no IP is stored. Best-effort and non-blocking (a resolve never waits on or fails from telemetry).
Implemented in scripts/lib/telemetry.mjs: `POSTHOG_HOST = "https://us.i.posthog.com"`, writing to ~/.hyperframes/config.json (anonymousId/telemetryNoticeShown); this is the skill's only outbound data pathway enabled by default.

2Core Capabilities

01Single-command resolve for 8 media types: Unified entry point for bgm/sfx/image/icon/logo/voice/grade/lut searches
02Asset generation: Fallback generation via TTS, music, and image models when catalog lookups fail (HeyGen TTS, Lyria/MusicGen, mflux, LTX)
03Shared audio engine: Voiceover, transcription, captions, and background noise removal (audio/ engine + heygen-tts + parakeet/whisper)
04Media operations and transcoding: cut, reframe, transform, exact error diffusion, HEVC, ducking, and loudness normalization
05Cross-project reuse and memory: Reuse global caches via --candidates/--reuse, and persist user preferences with prefs/recipe
06Media expressiveness opportunity pass: Single pass-through scan + single confirmation prompt; grounded, opinionated, never silently mutates

3External Dependencies

KindDependency / Endpoint
cliheygen CLI(HeyGen,OAuth free-usage / api-key)
cliffmpeg/ffprobe(adopt 探测、signalstats、cut、duck bake、loudnorm)
climflux-generate / parakeet-mlx / ltx-2-mlx / codex(本地或订阅生成器,opt-in)
apiHeyGen REST API
apiGoogle Lyria RealTime(BGM 生成,google-genai)
apiElevenLabs TTS(可选,tts.mjs 分支)
networkPostHog 遥测
networklogo 源:svgl / simple-icons(jsdelivr) / GitHub 头像 / DuckDuckGo favicon
networkLUT CDN
network本地模型下载/安装(Hugging Face、uv/pip、git)
package@hyperframes CLI 内联能力(Kokoro TTS、remove-background 等)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Graded/per-use authorization, sandbox recommended
For Administrators
Approval workflow, rollback support, full audit
Evidence & Triggers (File Paths & Excerpts)
  • scripts/: Executes local scripts or commands: node <SKILL_DIR>/scripts/resolve.mjs (for each --type; executed directly by agent)
  • 网络端点: Declares external network access: api.heygen.com/v3 (catalog/TTS/avatar, with X-HeyGen-Client-Source: media-use attribution)
  • 本地工作目录: File read/write and artifact output: Project `.media/`: manifest.jsonl, index.md, preferences.json, recipes/<name>/, and local asset persistence
Audit Notes: Surface area centers on media-use: reading multi-source credentials (environment variable API keys, local .env files, ~/.heygen credentials, OAuth sessions), making outbound calls to multiple third-party endpoints (HeyGen API, Google Lyria, PostHog telemetry, logo CDNs, model downloads), and installing third-party local models on demand via pip/uv/git. Mitigations: defaults to HeyGen free-usage OAuth, local models are strictly opt-in, supports full network isolation via --local-only, SSRF prevention is covered by unit tests, telemetry can be disabled and is coarse-grained, and paid calls require prior agent confirmation. Trigger condition: scripts and outbound calls execute only when the user requests resolve/generate/operate media tasks.

5Second-Pass Verification

  • [ok] external_deps 中每个 CLI/API/网络端点的调用点真实存在 — 逐一反查:heygen CLI(setup-providers.md 安装/登录段)、ffmpeg(工具表)、Lyria(lyria-recipe.py 头部 docstring + bgm.mjs lyriaConfigured)、PostHog(telemetry.mjs 常量)、logo 源(logo-provider.mjs URL 常量)、LUT CDN(luts/index.json 记录)均有源码落点。
  • [ok] 安全结论有无漏网网络调用 — URL 全量扫描覆盖 scripts/audio/luts/references;未发现扫描范围外的域;遥测为默认唯一自发性外发,opt-out 与注释一致。
  • [ok] 凭证读取面是否如描述(env/.env/~/.heygen) — heygen.mjs 头注释与 loadEnvFromDir 实现(walk ≤5 dirs、shell env 优先)与描述一致;audio/scripts/lib/{heygen,tts,bgm}.mjs 分别读 HEYGEN/ELEVENLABS/GEMINI key。
  • [ok] SSRF 防护声称 — freeze.mjs 第 57 行正则实际拦截 localhost/*.local/*.internal/127./10./169.254./192.168./172.16-31 与 IPv6 环回;freeze.test.mjs 同时断言拦截内网样例。
  • [ok] 是否有将远程内容当指令/可执行代码的路径 — 下载资产均为数据文件(audio/image/cube);脚本为随包源码;未发现下载即执行路径。
  • [ok] 功能声明夸大检查(media treatments、10k+ 曲库、75k+ 向量) — 目录规模数字来自 HeyGen 服务端宣称(SKILL.md 表格原文),skill 侧可验证的是调用点与回退链存在;『produce voiceover…background removal』对应 audio/ 引擎脚本与 provider 表。超出本地可验证的部分按供应商宣称标注。

6Verdict & Scenarios

  • Unifies 8 types of media demands into a single auditable resolve verb, with all implementations backed by testable Node/Python code rather than prompt assertions
  • Highest security engineering standards in its ecosystem: SSRF protection written into tested code, .env parsing without overwriting existing environments, and coarse-grained telemetry that can be toggled off with a single switch
  • Pragmatic tiering combining default free tiers with optional local models; RAM classification allows a runnable subset even on low-spec hardware
  • Disciplined media expressiveness advice: Grounded, single-confirmation workflow that never silently modifies assets, preventing the agent from unilaterally adding content
  • Clear cost guardrails: Agent-initiated paid generation requires explicit user confirmation and attaches client attribution headers
  • Best for: Ideal for agent sessions within HyperFrames projects (or any HTML-to-video workflow) requiring finding, generating, modifying, and remembering media assets: product videos, explainer videos, and creative work needing BGM/SFX/voiceover/icons. Also serves as an excellent blueprint for developers studying how a skill orchestrates provider APIs, local models, memory, and telemetry into a testable CLI.
    Not for: Not suitable for completely isolated, zero-network, or zero-credential environments (should use --local-only with pre-installed local models, or choose pure orchestration skills without external providers); not suitable for users unwilling to allow any outbound telemetry or account association (telemetry requires manual opt-out); not suitable for lightweight scenarios treating media processing as secondary and needing only prompt guidance (strictly requires CLI, account, and ffmpeg dependencies).
    Install Agent-Ready
    ① Verified Mirror 2026-09-09
    Option A · Direct DownloadDownload media-use.tar.gz
    sha256: e19482b5849526de…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit b8328f9573.