Diogenesoftoronto/keating / video/keating-surface-tour/.agents/skills/media-use
media-use
FlaggedAgent 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.
scripts/lib/bundled-sfx-provider.mjs
View on GitHubimport { existsSync, readFileSync } from "node:fs";
import { extname, join } from "node:path";
const LIB_DIR =
process.env.HYPERFRAMES_MEDIA_USE_SFX_DIR ||
join(import.meta.dirname, "..", "..", "audio", "assets", "sfx");
export const BUNDLED_SFX_RECOVERY_COMMAND = "npx hyperframes skills update media-use";
export class BundledSfxAssetsError extends Error {
constructor(health) {
super(
`bundled SFX assets are missing or incomplete (${health.detail}). Repair the installed media-use skill: ${health.fix}`,
);
this.name = "BundledSfxAssetsError";
this.code = health.code;
this.fix = health.fix;
}
}
function unhealthy(detail) {
return {
ok: false,
code: "bundled_sfx_assets_missing",
detail,
fix: BUNDLED_SFX_RECOVERY_COMMAND,
};
}
export function inspectBundledSfxAssets(libraryDir = LIB_DIR) {
const manifestPath = join(libraryDir, "manifest.json");
if (!existsSync(manifestPath)) return unhealthy(`manifest not found: ${manifestPath}`);
let manifest;
try {
manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
} catch {
return unhealthy(`manifest is not valid JSON: ${manifestPath}`);
}
if (!manifest || typeof manifest !== "object" || Array.isArray(manifest)) {
return unhealthy(`manifest must contain an object: ${manifestPath}`);
}
const entries = Object.entries(manifest);
if (entries.length === 0) return unhealthy(`manifest contains no SFX entries: ${manifestPath}`);
for (const [key, entry] of entries) {
if (!entry?.file || typeof entry.file !== "string") {
return unhealthy(`manifest entry "${key}" has no file`);
}
const assetPath = join(libraryDir, entry.file);
if (!existsSync(assetPath)) return unhealthy(`asset not found: ${assetPath}`);
}
return {
ok: true,
count: entries.length,
detail: `${entries.length} bundled SFX asset${entries.length === 1 ? "" : "s"} available`,
fix: "",
};
}
const normalize = (value) =>
String(value)
.toLowerCase()
.replace(/[^a-z0-9]+/g, " ")
.trim();
export function extensionForBundledSfxFile(filename) {
return extname(filename) || ".mp3";
}
function score(intent, key, entry) {
const query = normalize(intent);
const name = normalize(key);
if (query === name) return 100;
if (query.includes(name) || name.includes(query)) return 50;
const haystack = new Set(normalize(`${key} ${entry.description || ""}`).split(/\s+/));
return query.split(/\s+/).filter((token) => token && haystack.has(token)).length;
}
export const bundledSfxProvider = {
async search(intent, ctx = {}) {
const libraryDir = ctx.libraryDir || LIB_DIR;
const health = inspectBundledSfxAssets(libraryDir);
if (!health.ok) throw new BundledSfxAssetsError(health);
const manifest = JSON.parse(readFileSync(join(libraryDir, "manifest.json"), "utf8"));
const ranked = Object.entries(manifest)
.map(([key, entry]) => ({ key, entry, score: score(intent, key, entry) }))
.filter(({ entry, score }) => entry?.file && score > 0)
.sort((a, b) => b.score - a.score || a.key.localeCompare(b.key));
const best = ranked[0];
if (!best) return null;
const localPath = join(libraryDir, best.entry.file);
return {
localPath,
ext: extensionForBundledSfxFile(best.entry.file),
source: "bundled",
metadata: {
description: best.entry.description || best.key,
duration: best.entry.duration ?? null,
provider: "bundled.sfx",
provenance: { library_key: best.key },
},
};
},
};
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |