Communitygithub.com

媒体使用

Agent 媒体操作系统 — 将任何媒体需求(BGM、音效、图片、图标)解析为冻结的本地文件 + 台账记录。一个动词(`resolve`)处理完整级联:项目缓存、全局缓存、HeyGen 目录搜索、冻结、注册。把搜索噪音留在磁盘上,给 Agent 一个路径。当创作需要背景音乐、音效、图片或图标时使用。

媒体使用 是什么?

这是一个用于 AI Agent(如 Claude Code、Cursor、Codex)的媒体解析技能,提供一个统一的动词 `resolve` 来将创作中的媒体需求转化为本地冻结文件,并记录在台账中。它能处理四种媒体类型:背景音乐 (bgm)、音效 (sfx)、图片 (image) 和图标 (icon)。其价值在于将媒体搜索、下载、缓存、注册的复杂流水线简化为一个命令,Agent 只需获得一个返回行,所有搜索噪音(候选、评分、来源)都保留在磁盘上,不会被 Agent 的上下文干扰。该技能支持五步级联:先检查项目缓存 `.media/manifest.jsonl` 的精确匹配,接着扫描 `assets/` 目录的未注册文件,然后检查全局缓存 `~/.media/`,再通过 HeyGen 的音频目录和资产搜索 API 进行在线搜索,最后将文件冻结到 `./media/` 并注册。跨项目重用时,后续相同 prompt 会命中全局缓存,无需重复下载。它还支持 `--adopt` 批量导入现有项目的 `assets/` 目录,并自动通过 `ffprobe` 提取媒体属性。该技能要求 `heygen` CLI 版本 >= v0.1.6 和 `ffprobe`。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Jo5i4swastaken/Skills-Locker/tree/HEAD/skills/media-use

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

媒体使用 是做什么的?

将媒体需求解析为冻结的本地文件。一个动词,四种类型,零上下文噪音。

何时使用

当创作需要媒体时调用 resolve — 背景音乐、音效、图片或图标。媒体使用技能会搜索 HeyGen 目录,下载最佳匹配,在本地冻结,并在清单中注册。Agent 只返回一行;所有搜索噪音都保留在磁盘上。

解析

node <SKILL_DIR>/scripts/resolve.mjs --type <type> --intent "<description>" --project <dir>

返回一行:resolved <id> → <path> (<type>, <metadata>)

类型

类型查找内容提供者
bgm背景音乐HeyGen 音频目录(10k+ 首曲目)
sfx音效捆绑的 19 文件库 + HeyGen 目录
image照片、背景HeyGen 资产搜索(75k+ 矢量图)
icon图标、徽标HeyGen 资产搜索(type=icon)

示例

# 背景音乐
node <SKILL_DIR>/scripts/resolve.mjs --type bgm --intent "upbeat tech launch" --project .
# → resolved bgm_001 → .media/audio/bgm/bgm_001.mp3 (bgm, 25s)

# 音效
node <SKILL_DIR>/scripts/resolve.mjs --type sfx --intent "whoosh" --project .
# → resolved sfx_001 → .media/audio/sfx/sfx_001.mp3 (sfx, 0.57s)

# 图片
node <SKILL_DIR>/scripts/resolve.mjs --type image --intent "gradient tech background" --project .
# → resolved image_001 → .media/images/image_001.jpg (image)

# 图标
node <SKILL_DIR>/scripts/resolve.mjs --type icon --intent "rocket" --project .
# → resolved icon_001 → .media/images/icon_001.png (icon, transparent)

标志

标志描述
--type, -t媒体类型:bgm, sfx, image, icon
--intent, -i你需要的描述(自然语言)
--entity, -e用于缓存匹配的实体名称(可选)
--project, -p项目目录(默认: .)
--adopt批量导入现有 assets/ 到清单
--json输出 JSON 而非单行结果

工作原理

  1. 检查项目 .media/manifest.jsonl 是否有精确提示匹配
  2. 扫描现有 assets/ 目录,查找未注册但符合需求的文件
  3. 检查全局缓存 ~/.media/ 中是否有可复用资产
  4. 通过提供者(HeyGen 音频目录、HeyGen 资产搜索)进行搜索
  5. 将文件冻结到 .media/<type>/,在清单中注册,重新生成 index.md

Agent 返回 一行。候选、评分、来源保留在磁盘上。

适配现有项目

大多数 HyperFrames 项目已在 assets/ 中有资源。媒体使用技能可以适配它们:

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 提取真实的时长和尺寸。在解析过程中,assets/ 中与意图匹配的未注册文件会被动态适配。

读取清单

解析或适配后,读取 .media/index.md 获取完整清单:

# .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

跨项目复用

资产在解析时会被自动缓存。后续对相同提示的解析会命中全局缓存 ~/.media/ — 无需重新下载,无需调用提供者。使用 organize --promote <id> 显式提升资产,使其可在所有项目中复用。

文件

  • .media/manifest.jsonl — 机器单一事实来源,每行一个 JSON 记录
  • .media/index.md — Agent 可读表(id, type, dur, dims, path, description)
  • ~/.media/ — 全局跨项目复用缓存(按内容寻址,SHA-256)

使用的 CLI 工具

工具用途必需?
ffprobe适配时探测时长、尺寸、编解码器是
heygen音频目录、资产搜索用于提供者

安装 heygen CLI(单个静态二进制文件,无运行时)并验证身份:

curl -fsSL https://static.heygen.ai/cli/install.sh | bash   # 安装最新版本到 ~/.local/bin
heygen update                                               # 如果已安装:需要 >= v0.1.6
export HEYGEN_API_KEY=<your-key>                            # 或者:heygen auth login --key <key>

要求 heygen >= v0.1.6 — 提供者使用白名单标志 --headers 'X-HeyGen-Client-Source: media-use'(自 v0.1.6 起添加)来标记请求。asset search 是一个预发布命令,在 heygen --help 中隐藏,但可以运行。如果在 PATH 上没有 heygen(或没有有效密钥),提供者会向 stderr 打印一行诊断信息,解析将回退为“没有提供者能解析”。

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

Jo5i4swastaken/Skills-Locker

Implements the "100% Retrieval Strategy" by Vercel. Injects a compressed docs index into AGENTS.md/CLAUDE.md to guarantee the agent always uses your global skills and best practices.

Jo5i4swastaken/Skills-Locker

Premium brand-kit image generation skill for creating high-end brand-guidelines boards, logo systems, identity decks, and visual-world presentations. Trained for minimalist, cinematic, editorial, dark-tech, luxury, cultural, security, gaming, developer-tool, and consumer-app brand systems. Optimized for intentional logo concepting, refined composition, sparse typography, strong symbolic meaning, premium mockups, art-directed imagery, and flexible grid layouts.

Jo5i4swastaken/Skills-Locker

Rewrite text to make ideas and sentences clearer and easier to understand. Use when the user wants to simplify prose, untangle a tangled sentence, reduce jargon, sharpen vague claims, or make writing accessible to a wider audience. Works on any text: docs, emails, blog posts, reports, marketing copy, slide bullets, academic prose. TRIGGER on phrases like: "make this clearer", "clarify this", "simplify this", "rewrite for clarity", "plain language", "reduce jargon", "make it easier to understand", "untangle this", "explain this simply", "tighten this up", "make this readable". Returns the rewritten text only — no diff, no commentary.

Jo5i4swastaken/Skills-Locker

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

Jo5i4swastaken/Skills-Locker

Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing.

Jo5i4swastaken/Skills-Locker

Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.

Jo5i4swastaken/Skills-Locker

Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.

Jo5i4swastaken/Skills-Locker

Author a HyperFrames slideshow composition — a presentation, pitch deck, or interactive deck with discrete slides, fragment reveals, branching sequences, and hotspot navigation. Use as an intent check when the user asks for a presentation, pitch deck, slide deck, interactive deck, or page-to-deck conversion that might be a slideshow; if the user did not explicitly ask for a slideshow / slide show, confirm before authoring.

Jo5i4swastaken/Skills-Locker

When the user wants help creating, scheduling, or optimizing social media content for LinkedIn, Twitter/X, Instagram, TikTok, Facebook, or other platforms, or wants to do social listening and engagement triage. Also use when the user mentions 'LinkedIn post,' 'Twitter thread,' 'social media,' 'content calendar,' 'social scheduling,' 'engagement,' 'viral content,' 'what should I post,' 'repurpose this content,' 'tweet ideas,' 'LinkedIn carousel,' 'social media strategy,' 'grow my following,' 'TikTok video,' 'Reels,' 'Shorts,' 'video script,' 'video hook,' 'short-form video,' 'create a reel,' 'social listening,' 'brand mentions,' 'competitor monitoring,' 'top posts to comment on,' 'find people asking for,' 'carousel,' 'slide-by-slide,' or 'document post.' Use this for social media content creation, repurposing, scheduling, short-form video scripting, and social listening. For broader content strategy, see content-strategy. For paid ads, see ad-creative. For earned media, see public-relations.

Jo5i4swastaken/Skills-Locker

Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies, getSession, getUser, getClaims, RLS); Supabase CLI or MCP server; schema changes, migrations, security audits, Postgres extensions (pg_graphql, pg_cron, pg_vector).

Jo5i4swastaken/Skills-Locker

Watch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.

相关技能