agentleFS
zkmakezkmake/skills/skills/media/optimize-audio/SKILL.md

optimize-audio

Skill2 starsChanged 58 days agoMITView on GitHub

Shrink audio files (mp3, wav, ogg, m4a, flac) by re-encoding with ffmpeg at lower bitrates / fewer channels. Use when the user wants to reduce audio file size, compress audio, optimize mp3/wav/etc for the web, or mentions an audio file being too large.

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If missing, stop and tell the user:

    line 16
  2. Distinctive:

    Do not proceed until they confirm.

    line 25
  3. Distinctive:

    Always include one "sweet spot" (~60% size reduction, near-transparent).

    line 38
  4. Very specific:

    Run all encodes in parallel within one Bash call (&& chain) to save time.

    line 70
  5. Very specific:

    Check the repo for an audio registry (e.g.

    line 75
  6. Distinctive:

    Don't git add until the user confirms the preview sounds acceptable.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

optimize-audio

Re-encode audio via ffmpeg to cut file size. Offer a few bitrate/channel options, preview them, then replace the original with the user's pick.

Preflight: ffmpeg

command -v ffmpeg >/dev/null || echo "MISSING"

If missing, stop and tell the user:

ffmpeg is required. Install it:

Let me know once it's installed.

Do not proceed until they confirm.

Workflow

  1. Inspect the source — report current size + codec + bitrate + channels + duration:
    ls -lh <file>
    ffprobe -v error -show_entries stream=codec_name,sample_rate,channels,bit_rate -show_entries format=duration,bit_rate <file>
  2. Generate 3–4 options into /tmp/<basename>-test/ spanning quality tiers. Pick defaults from the source:
    • Current bitrate is a ceiling — don't re-encode higher.
    • Skip options that would make the file larger.
    • Always include one "sweet spot" (~60% size reduction, near-transparent).
  3. Present a comparison table with size, % savings, and a one-line tradeoff per option. Recommend one explicitly. Give the user the /tmp/... paths and tell them macOS Finder hides /tmp (Cmd+Shift+G to navigate, or open /tmp/<basename>-test/).
  4. Replace on approval — copy the chosen preview over the original. Use an absolute path for cp (shell cwd can drift between Bash calls).

Option presets

Use casePresetTypical savings vs 256k stereo
Ambient / background music loop96k stereo mp3~60%
Speech / narration64k mono mp3~75%
Short SFX (<2s)96k mono mp3—
Need smallest with good quality64k opus (.ogg)~70% (check player/browser support first)
Transparent fallback128k stereo mp3~50%

ffmpeg commands

# mp3, N kbps, stereo (N = 64/96/128/192)
ffmpeg -y -i in.mp3 -b:a 96k -ac 2 out.mp3

# mp3, N kbps, mono
ffmpeg -y -i in.mp3 -b:a 64k -ac 1 out.mp3

# opus in ogg container (best quality/size, but check codec support)
ffmpeg -y -i in.mp3 -c:a libopus -b:a 64k out.ogg

# aac in m4a (good for Safari-first pipelines)
ffmpeg -y -i in.mp3 -c:a aac -b:a 96k out.m4a

Run all encodes in parallel within one Bash call (&& chain) to save time.

Notes

  • Opus/ogg: verify the app's audio library supports it before recommending (Howler.js does, but needs a format hint on Safari).
  • Check the repo for an audio registry (e.g. audio.ts) — if the file extension changes, the import path changes too.
  • Don't git add until the user confirms the preview sounds acceptable.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.