split-flac-album
Skill4 starsChanged 11 days agoMITView on GitHub
Split a single-FLAC album (one file per album) into individual tracks using an existing .cue sheet. Tags each track with number/title/artist/album/year/genre and embeds cover art (auto-detected in the album folder, or asked from the user if ambiguous). Use when the user says "split album", "split into tracks", or hands you an album folder with .flac + .cue + cover image. Do NOT use for albums already split into per-track files (plain re-tagging), for quality measurement (audio-measure), or for restoration (release-restore).
In this repository6 other files it gives its agents.
- add-lyricsSkill
- audio-measureSkill
- music-careSkill
- phone-musicSkill
- release-restoreSkill
- trackerSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 47
If files ended up in subdirs (due to /), move them up:
- Very specific: line 82
Locate the cover image — don't assume a fixed name: Search the album directory and its Covers/ subfolder for a likely front-cover image.
- Very specific: line 90
If the candidate list is ambiguous (multiple plausible front covers, e.g.
- Distinctive: line 92
After the cover file is chosen:
- Very specific: line 102
Prefer a small image (~100-200 KB) — front_.jpg or folder.jpg — over multi-MB scans.
- Very specific: line 103
If a track already has embedded art (e.g.
- Distinctive: line 107
After split is complete, remove the original single-file FLAC and its associated files (cue, log, accurip, txt, dr):
- Very specific: line 122
Only the per-track NN - Title.flac files and the cover image remain
- Distinctive: line 125
Prefer a small cover thumbnail (~100-200 KB) for embedding.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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.
Files
Split FLAC Album
Split a single-FLAC-per-album into individual tagged tracks with cover art.
Requirements
shntool,cuetag,flac,metaflac,ffmpeg— all must be installed. shntool/cuetag are Unix tools: easy on Linux, finicky on Windows/macOS — there an agent can substituteffmpeg -ss/-toper CUE index for splitting and write tags with mutagen; the steps below assume the standard tools.- Album directory must contain:
- One
.flacfile (whole album) - One
.cuefile (track listing) - Some cover image (any name/place — see Step 5)
- One
Process
1. Split by CUE
cd "/path/to/album/dir"
shntool split -f "*.cue" -o flac -t "%n - %t" "*.flac"This creates 01 - Song Title.flac, 02 - Song Title.flac etc.
2. Fix filenames with problematic characters
Some track titles contain / (e.g. "Gary Moore feat. Ozzy Osbourne / Led Clones"). Replace with -:
for f in */*.flac; do
dir=$(dirname "$f")
base=$(basename "$f")
newbase=$(echo "$base" | sed 's:/: - :g')
if [ "$base" != "$newbase" ]; then
mv "$f" "$dir/$newbase"
fi
doneIf files ended up in subdirs (due to /), move them up:
for d in */; do
if [ -d "$d" ]; then
mv "$d"*.flac . 2>/dev/null || true
rmdir "$d" 2>/dev/null || true
fi
done3. Tag from CUE (track number, title, artist)
cuetag "*.cue" *.flac4. Set album-level tags (album, year, genre)
Parse from the CUE file or set manually:
album=$(grep '^TITLE ' "*.cue" | head -1 | sed 's/^TITLE "\(.*\)"/\1/')
year=$(grep 'REM DATE' "*.cue" | sed 's/REM DATE \(.*\)/\1/')
genre=$(grep 'REM GENRE' "*.cue" | sed 's/REM GENRE "\(.*\)"/\1/')
for f in [0-9]*.flac; do
metaflac --set-tag="ALBUM=$album" \
--set-tag="DATE=$year" \
--set-tag="GENRE=$genre" "$f"
done5. Embed cover art
Locate the cover image — don't assume a fixed name. Search the album directory and its Covers/ subfolder for a likely front-cover image. Use the first match of this priority list:
Covers/front_.jpgfolder.jpgorcover.jpgCovers/front.jpgfront.jpg,Front.jpg,cover.jpg,Cover.jpg- Any
*.jpginCovers/that looks like a front cover (preferfront*, then a single small file; avoidback*,cd*,disc*,in*,mx*, and numbered booklet scans like1 001.jpg)
If the candidate list is ambiguous (multiple plausible front covers, e.g. several front* variants), ask the user which file to embed (use the Question tool), showing the candidates.
After the cover file is chosen:
# skip tracks that were already tagged in Step 4 or Step 3
for f in [0-9]*.flac; do
metaflac --import-picture-from="$cover_file" "$f"
doneNotes:
- Prefer a small image (~100-200 KB) —
front_.jpgorfolder.jpg— over multi-MB scans; large images bloat every track. If only big scans exist, either use the smallest, optionally downscale withffmpegfirst, or ask the user. - If a track already has embedded art (e.g. from a prior run), you can re-embed the chosen cover with
--import-picture-from, it replaces the first picture block.
6. Clean up original single-file sources
After split is complete, remove the original single-file FLAC and its associated files (cue, log, accurip, txt, dr):
rm -f "$flac_file" "$cue_file" "${flac_file%.flac}.log" "${flac_file%.flac}.accurip" "${flac_file%.flac}.txt" foo_dr.txt7. Verify
ffprobe -v quiet -show_entries format_tags -of default=noprint_wrappers=1 "01 - Song Title.flac"Notes
- Original single-FLAC, CUE, LOG, ACCURIP, TXT and
foo_dr.txtare deleted after successful split - Only the per-track
NN - Title.flacfiles and the cover image remain - Tracks with no INDEX 00 pregap: INDEX 01 is the audio start (correct)
- Tracks with INDEX 00 + INDEX 01: shntool handles the pregap automatically
- Prefer a small cover thumbnail (~100-200 KB) for embedding; ask the user if only large scans are available
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
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.

