/recoup-plugin:recoup-song-analyst-reportfrom Recoup
Generates a full analyst-grade report on a single song from its audio file, covering verdict, production, songwriting, sync potential, market comparables, and a weighted score. Requires a Recoup API key and public audio URL.
Ships in Recoup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
One song in, one analyst-grade report out. The report reads like a senior analyst's write-up: an opinionated verdict, a first listen, nine dimension cards (one line and three typed bullets each), sonic identity, production craft with seven annotated frequency bands, songwriting with timed key lines, structure, market position, comparables, sync with cut windows, scene archetypes and edit points, growth, and a seven-part weighted score. Numbers and timestamps come from a measurement of the file; what the song sounds like comes from a listening model answering 36 one-line questions; the lyric comes from word-timed transcription. You (the agent) write the prose under strict facts-only rules, a script checks every timestamp, quote, name and number, and a second script renders the page.
Scripts ship alongside this skill in scripts/ (Python 3, stdlib only unless noted). Set SKILL
to this skill's folder and run them from the folder where the outputs go.
RECOUP_API_KEY (sent as x-api-key). In a Recoup sandbox the bearer
token RECOUP_ACCESS_TOKEN works too. Never put account_id in a request body.pip3 install librosa) for the local arrangement probe, and node
for the script check in scripts/check_render.py.SKILL=/path/to/recoup-song-analyst-report # this skill's folder
API_BASE="${RECOUP_API_URL:-https://api.recoupable.dev}"; API_BASE="${API_BASE%/}"; API_BASE="${API_BASE%/api}/api"
if [ -n "$RECOUP_API_KEY" ]; then AUTH=(-H "x-api-key: $RECOUP_API_KEY")
elif [ -n "$RECOUP_ACCESS_TOKEN" ]; then AUTH=(-H "Authorization: Bearer $RECOUP_ACCESS_TOKEN")
else echo "No Recoup credentials: ask the user for an API key" >&2; fi
AUDIO_URL="https://example.com/song.mp3"
In an artist workspace, write every output to songs/{song-slug}/analysis/report/.
Steps 1–3 can run in parallel; step 3's line builder needs step 1's measurement.json.
measurement.jsonjq -n --arg audio "$AUDIO_URL" --argjson bpm "${TEMPO_HINT:-null}" \
'{audio_url: $audio, describe: false} + (if $bpm then {tempo_hint: $bpm} else {} end)' |
curl -sS -X POST "$API_BASE/songs/moments" "${AUTH[@]}" -H "Content-Type: application/json" -d @- > measurement.json
jq '{status, duration_seconds, tempo_bpm, sections: (.sections|length), moments: (.moments|length),
extended: {lufs: has("lufs"), true_peak: has("true_peak_dbtp"), key: has("key"), bands: has("band_profile"),
fingerprint: has("fingerprint"), drops: has("mute_drops"), edit_points: has("edit_points")}}' measurement.json
describe: false keeps it at the flat measurement price; the listening pass in step 2 covers
the descriptions. Send tempo_hint (a BPM from the user or the file's metadata) when known.loudness_lufs), ending (fade or
cold), named sections, moments (intro, vocal hook, chorus lift, build-up, climax, breakdown,
outro) with :06/:15/:30 cut windows on the beat grid, and a per-second energy curve.lufs, true_peak_dbtp, sample peak, crest, loudness
range, a delivery-ready flag, stereo width, key, time_signature, the seven-band
band_profile, the six-axis fingerprint, valence and arousal, mute_drops (drops and
breakdowns), a chord loop, typed edit_points and an ending detail; it also honours
tempo_hint. On a host that has not released it, those fields are absent and the report says
less: key and time signature come from the listening model (key_source: "model"), production
bands are annotated from the listening answers without shares, edit points are built from
section starts and moment cuts, and no LUFS or dBTP figure may appear in prose. Note the missing
fields once in technical.notes.answers.jsonThe 36 questions are in references/questions.json (id, profile field, one-line q). Ask
them all on one download of the audio:
jq --arg audio "$AUDIO_URL" \
'{audio_url: $audio, do_sample: false, prompts: [.[] | {id, prompt: .q, max_new_tokens: 400}]}' \
"$SKILL/references/questions.json" > batch.request.json
code=$(curl -sS -o batch.json -w '%{http_code}' -X POST "$API_BASE/songs/analyze/batch" "${AUTH[@]}" \
-H "Content-Type: application/json" -d @batch.request.json)
[ "$code" = 200 ] && jq '[.answers[] | {(.id): .response}] | add' batch.json > answers.json
jq 'length' answers.json # expect 36
Fallback when the batch route answers 404 (not released on this host): one call per question. Tell the user first: it costs about $2 a song against about $0.20 batched. Any other error (402 credits, 422 audio URL not reachable or not audio, 502 model failure) is not a reason to fall back: report it and stop.
mkdir -p answers
jq -c '.[]' "$SKILL/references/questions.json" | while read -r q; do
id=$(jq -r .id <<<"$q"); [ -s "answers/$id.json" ] && continue
jq -n --arg audio "$AUDIO_URL" --argjson q "$q" \
'{prompt: $q.q, audio_url: $audio, max_new_tokens: 400, do_sample: false}' |
curl -sS -X POST "$API_BASE/songs/analyze" "${AUTH[@]}" -H "Content-Type: application/json" -d @- > "answers/$id.json"
done
jq -n '[inputs | {(input_filename | sub(".*/"; "") | sub("\\.json$"; "")): .response}] | add' answers/*.json > answers.json
Re-ask any question whose answer is empty or an error. Keep each question exactly one line: the model follows short questions and ignores long ones.
lyrics.lines.jsonjq -n --arg audio "$AUDIO_URL" '{audio_urls: [$audio], chunk_level: "word"}' |
curl -sS -X POST "$API_BASE/content/transcribe" "${AUTH[@]}" -H "Content-Type: application/json" -d @- > transcript.json
python3 "$SKILL/scripts/lines_from_transcript.py" transcript.json measurement.json lyrics.lines.json
Add "language" to the body for a song not in English. The script splits word timestamps into
timed lines tagged with the measured section and lists the repeated lines (the hook). If the
transcript is thin (jq .word_count lyrics.lines.json under about 60 words for a song with
vocals), say so in technical.notes, leave lyrics.lines.json out of the step 5 check, and quote
only from the model's key_lines answer. An instrumental needs no lyric file. The lyric file is a
working file: quote short fragments in the report and never publish the full lyric.
context.jsonFill from verified sources only: the user, the release's own metadata, or research you can cite. A field you cannot verify stays absent; the report then says it does not know.
{
"title": "", "artists": "", "writers": "", "producers": "", "year": "", "label": "",
"file_version": "album master | radio edit | demo | ...",
"comparable_songs_confirmed": [{"title": "", "artist": "", "premise": "what the two records share"}],
"sources": ["where each fact came from"]
}
Names, years and comparable song titles in the report are checked against this file.
report.jsonYou write the report. Read references/BRIEF.md (role, facts-only rules, voice) and
references/schema.json (the report shape) in full first, then the four inputs. Then:
Write one JSON object that matches the schema. Identity fields are plain values ("key": "F major", "key_source": "measured"); disagreements between the model and the measurement
go in technical.notes.
Declare your findings. technical.findings (4–10 entries) lists every finding named in
the verdict bullets and review headings, and every image you reuse, each with its home
section and 3–14 lower-case words that name it. The checker counts each finding under all
its words and fails any named more than six times in reader prose.
Run the fact check and fix what it reports by changing the claim, never the inputs:
python3 "$SKILL/scripts/fact_check.py" report.json measurement.json answers.json context.json lyrics.lines.json
It checks that every timestamp is within 2 s of a measured point, a lyric line or a model
answer; every double-quoted lyric is in the transcript, an answer or the context; names,
year and label are in the context; tempo, duration, LUFS and true peak match the measurement;
the score adds up; every dimension card has one strength, one neutral and one risk bullet; no
figure, finding or timestamp repeats past its cap; identity fields carry no provenance; no
instrument-panel words reach reader prose; and the page reads plainly (READ lines): the
headline is one idea in at most twelve words, the subhead at most thirty, each verdict bullet
at most twenty; no timestamp or unit figure in the hero, a section headline or a dimension
summary; no sentence over thirty-six words or field averaging over twenty-six; measurement
words (LUFS, dBTP, Hz, true peak, stereo image) only in Production and the technical notes.
It also lists CLAIM lines, which never fail the check: each sentence with an absolute
("never", "every", "always", "nothing") or an intent claim ("meant for", "written for"). Every
remaining fact error in the parity rounds was one of these overstatements. Re-read each against
its source (the energy curve, the sections, the lyrics, context.json): keep an absolute only
if it holds for the whole song, and keep "reads as" or "sounds like" on anything inferred.
Stop after three passes. Whatever still cannot be anchored comes out of the prose and goes into
technical.notes as a line saying what was dropped and why.
report.html and report.txtpython3 "$SKILL/scripts/render.py" report.json measurement.json report.html --theme recoup --audio "$AUDIO_URL"
python3 "$SKILL/scripts/check_render.py" report.html # optional: tags, data block, script, contrast
python3 "$SKILL/scripts/flatten.py" report.json report.txt
m:ss becomes a play link. Fix any warning: the renderer prints, then re-render.--audio adds a sticky player that the play links seek. Leave it out when the audio URL is
private or expires; the page then shows times without playback.report.txt as a music supervisor skimming on a phone: the hero, then only the first
sentence of each section. After the hero alone you must be able to say what the song is,
whether to pitch it and for what, and the one catch with its fix; rewrite the hero until you
can. Then cut repetition, hedging and figures of speech on the skim path that the checker
cannot see.Optional local probe: python3 "$SKILL/scripts/arrangement_density.py" song.mp3 measurement.json [--slice START END] prints per-section percussive share, onset rate and band shares, to tell a
section that thins out from one that only gets quieter. It needs a local copy of the audio and
librosa.
context.json confirms them.technical.notes. Model
timestamps usually land within 2 s of the measured landmarks, the same tolerance the checker
allows.| Step | Price |
|---|---|
Measure (describe: false) | ≈ $0.01 flat |
| Listen, batched | $0.05 once + $0.001166 per second of the batch; 36 one-line questions run about 1–3 minutes, so ≈ $0.12–0.26 |
| Listen, fallback | $0.05 per call + seconds: ≈ $1.80 + $0.10–0.20 for 36 calls |
| Transcribe | small; check the current price list |
| Compose | your own model tokens, roughly $0.10–0.30 on a mid-tier model |
About $0.25–0.60 a song with the batch, about $2.00–2.30 with the fallback.
references/BRIEF.md — the composer's role, facts-only rules and voice.references/schema.json — the report JSON shape, including the score rubric.references/questions.json — the 36 listening questions.scripts/fact_check.py — the machine checks (step 5).scripts/lines_from_transcript.py — word timestamps to timed lyric lines (step 3).scripts/render.py, scripts/themes/recoup.json — the HTML page (step 6).scripts/check_render.py — page and theme checks (step 6, optional).scripts/flatten.py — the plain-text version (step 6).scripts/arrangement_density.py — optional local probe (needs librosa).references/BRIEF.md (opens in a new tab)references/questions.json (opens in a new tab)references/schema.json (opens in a new tab)scripts/arrangement_density.py (opens in a new tab)scripts/check_render.py (opens in a new tab)scripts/fact_check.py (opens in a new tab)scripts/flatten.py (opens in a new tab)scripts/lines_from_transcript.py (opens in a new tab)scripts/render.py (opens in a new tab)scripts/themes/recoup.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
music-analysis, song-report, a&r, sync-licensing, music-production
npx claudepluginhub recoupable/skills --plugin recoup-plugin132 skills in this plugin
/recoup-catalog-audit-catalogAudit a music catalog's rights, registrations, identifiers, agreements and delivery assets against supplied and accessible evidence. Use for 'audit my catalog', 'check my catalog before a sale', 'find rights or registration gaps', or 'verify this catalog after a transfer'. Produces scoped findings and remediation requirements; does not submit corrections, contact counterparties or reconcile royalty payments./recoup-catalog-estimate-valueEstimate a catalog, album, or song's value from public streaming data alone — no seller files or data room required. Use for "what's this catalog worth from public data", "ballpark this catalog", or "estimate the value of [album/song]". Wider error bars than a seller-file valuation; states its assumptions. For full diligence on a real data room use recoup-catalog-review-deal./recoup-catalog-explain-contractOther plugins' skills for the same job