tag-collection
БесплатноБез исполняемых скриптовНе проверенApply metadata tags, embed artwork, and organize media files with consistent naming
от jmagly★ 233 звезды на GitHubОб этом скилле
/tag-collection
Apply metadata tags, embed artwork, and organize media files with consistent naming conventions.
Purpose
Automate the metadata curation workflow for audio and video collections:
- Scan files in a directory
- Look up canonical metadata from MusicBrainz
- Apply tags using opustags (Opus) or ffmpeg (MP4/MP3)
- Embed cover artwork
- Rename files to follow naming conventions
- Organize into proper directory structures
Parameters
Required
<collection_path>: Path to directory containing media files to process
Optional
--artist <name>: Filter to specific artist (speeds up processing)--dry-run: Show what would be done without making changes--artwork-dir <path>: Path to canonical artwork directory (default:./artwork)--force: Overwrite existing tags and files without prompting--skip-artwork: Skip artwork embedding (metadata only)--skip-rename: Apply tags but don't rename files--skip-organize: Apply tags and rename but don't move files
Workflow
1. Scan Files
# Find all supported media files
opus_files=$(find "$collection_path" -type f -name "*.opus")
mp4_files=$(find "$collection_path" -type f -name "*.mp4")
mp3_files=$(find "$collection_path" -type f -name "*.mp3")
2. Parse Filenames
Extract artist, title, album from existing filenames using common patterns:
Artist - Title.extArtist - Album - Track# - Title.extTrack# - Title.ext(when artist is provided via --artist)
# Example parsing
filename="Joni Mitchell - Both Sides Now.opus"
artist=$(echo "$filename" | sed -E 's/^([^-]+) - .*/\1/' | xargs)
title=$(echo "$filename" | sed -E 's/^[^-]+ - ([^.]+)\..*/\1/' | xargs)
3. Lookup Metadata
Query MusicBrainz API for canonical metadata:
# URL-encode artist and title
artist_encoded=$(echo "$artist" | jq -sRr @uri)
title_encoded=$(echo "$title" | jq -sRr @uri)
# Query API
mbdata=$(curl -s "https://musicbrainz.org/ws/2/recording/?query=artist:${artist_encoded}%20AND%20recording:${title_encoded}&fmt=json" \
-H "User-Agent: MediaCurator/1.0")
# Extract metadata
album=$(echo "$mbdata" | jq -r '.recordings[0].releases[0].title')
year=$(echo "$mbdata" | jq -r '.recordings[0].releases[0].date[:4]')
tracknumber=$(echo "$mbdata" | jq -r '.recordings[0].releases[0].media[0].track-offset + 1')
genre=$(echo "$mbdata" | jq -r '.recordings[0].releases[0].release-group.primary-type')
# Rate limit: 1 request per second
sleep 1
4. Fetch Artwork
Download cover artwork from MusicBrainz Cover Art Archive:
# Get release MBID
mbid=$(echo "$mbdata" | jq -r '.recordings[0].releases[0].id')
# Download front cover
curl -s "https://coverartarchive.org/release/${mbid}/front" -o "/tmp/cover-${mbid}.jpg"
# Fallback to fanart.tv if CAA unavailable
if [ ! -f "/tmp/cover-${mbid}.jpg" ]; then
curl -s "https://webservice.fanart.tv/v3/music/${mbid}?api_key=${FANART_API_KEY}" | \
jq -r '.albums."'"$mbid"'".albumcover[0].url' | \
xargs curl -s -o "/tmp/cover-${mbid}.jpg"
fi
5. Apply Tags
Use appropriate tool based on file format:
Opus Files (opustags):
opustags "$file" \
--set "TITLE=$title" \
--set "ARTIST=$artist" \
--set "ALBUM=$album" \
--set "ALBUMARTIST=$artist" \
--set "TRACKNUMBER=$tracknumber" \
--set "DATE=$year" \
--set "GENRE=$genre" \
--set-cover "/tmp/cover-${mbid}.jpg" \
-o "${file}.tagged"
mv "${file}.tagged" "$file"
MP4 Files (ffmpeg):
ffmpeg -i "$file" -i "/tmp/cover-${mbid}.jpg" \
-map 0 -map 1 -c copy \
-disposition:v:1 attached_pic \
-metadata title="$title" \
-metadata artist="$artist" \
-metadata album="$album" \
-metadata date="$year" \
-metadata genre="$genre" \
"${file}.tagged.mp4"
mv "${file}.tagged.mp4" "$file"
MP3 Files (ffmpeg):
ffmpeg -i "$file" -i "/tmp/cover-${mbid}.jpg" \
-map 0 -map 1 -c copy \
-id3v2_version 3 \
-metadata title="$title" \
-metadata artist="$artist" \
-metadata album="$album" \
-metadata date="$year" \
-metadata genre="$genre" \
-metadata:s:v title="Album cover" \
-metadata:s:v comment="Cover (front)" \
"${file}.tagged.mp3"
mv "${file}.tagged.mp3" "$file"
6. Rename Files
Apply naming convention based on file type:
Audio Files: {Artist}/{Album}/{Track#} - {Title}.{ext}
# Construct new filename
new_filename=$(printf "%02d - %s.opus" "$tracknumber" "$title")
new_path="${artist}/${album}/${new_filename}"
# Show rename operation
echo "RENAME: $file -> $new_path"
# Execute if not dry-run
if [ "$dry_run" != "true" ]; then
mkdir -p "$(dirname "$new_path")"
mv "$file" "$new_path"
fi
Video Files: {Artist}/{Collection}/{Title} [{Quality}].{ext}
# Detect video quality
quality=$(ffprobe -v error -select_streams v:0 \
-show_entries stream=height -of default=noprint_wrappers=1:nokey=1 \
"$file")
quality_label="${quality}p"
# Construct new filename
new_filename="${tit
Установить tag-collection в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл tag-collection?
Apply metadata tags, embed artwork, and organize media files with consistent naming
Как установить скилл tag-collection?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tag-collection запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic