Communitygithub.com

apoto/resonal-workflow

MV engineering workflow. From master audio, cover image, LYRICS.md (and optional background loop video), use tools/make_mv.sh to create an MV with lyrics (16:9 main, 9:16 short, thumbnail), get user feedback, fix issues, and set approved_at in song.json when done.

What is resonal-workflow?

This skill implements a complete MV production pipeline for music projects. It takes finalized master audio, cover art, and lyrics, and uses a shell script (`tools/make_mv.sh`) to generate a lyric video in three formats: a 16:9 main video, a 9:16 short vertical version, and a thumbnail. The workflow is iterative: after the initial render, the user reviews the output and requests changes (lyric timing, font size, colors, background, etc.), which the agent applies by modifying configuration files, lyrics, or templates and re-running the script. Finally, once the user approves, the skill records the approval timestamp in `song.json` and moves to the next step. It also supports optional features like background loop video generation (via Kling MCP or other providers), scene-based image switching, and full style customization using a 18-axis system or a direction library. The skill is designed for the `apoto/resonal-workflow` ecosystem and is invoked whenever the user says "Make an MV", "Create a video", or when lyric timing or visual adjustments are needed.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/apoto/resonal-workflow/tree/HEAD/.claude/skills/music-video

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

MV (Create → Review → Fix → OK)

Prerequisites

  • The master audio is a finalized <Title>.wav (mastering step completed first). Do not use audio.wav.
  • First read templates/mv/README.md (how to create the project, role of each script, how to fix).
  • Do not write custom commands for tasks that already exist. Use the template scripts.
  • Credit text comes from workflow.config.json's credits. Do not copy it into the video side.

Choose a Visual Style (Optional)

  • Only do this if the user says "I want to choose the MV style", "I want it more elaborate", or "I want a different style". If nothing is said, skip this and proceed to steps 0 & 1 (make_mv.sh = the default style). Do not proactively suggest this every time.
  • Use the skill mv-styles to write the selection table and 18 axes into songs/<song folder>/STYLE-SELECTION.md, and let the user choose which style to adopt.
  • If the chosen style is the default (spectrum-still), go to steps 0 & 1. Otherwise, follow the instructions in styles/<chosen style>/README.md to create the MV, then merge into step 2.

0. Background Loop Video (Optional)

Determined by node engine/config.js providers.video's use field. If bg_loop.mp4 already exists in the song folder, skip to step 1.

  • none: Skip (background is the static cover image).
  • kling-mcp: Create it with the following steps:
    1. Generation costs money. Before starting, ask the user "May I create one ~5 second loop video from cover.png?" and get approval before proceeding.
    2. Verify the Kling MCP connection and account using that MCP's check tool. If not connected, stop and inform the user.
    3. Use the image-to-video tool, passing songs/<song folder>/cover.png as both the start and end image (aligning start and end makes the seam invisible). Write the prompt in English, describing only small movements (hair, light, particles)—no large motion. Audio off.
    4. Only submit one generation at a time. Do not auto-retry on failure or timeout. Report the result and let the user decide whether to retry or change the prompt.
    5. Save the resulting video as songs/<song folder>/bg_loop.mp4, then extract the first and last frames and view them with Read:
      ffmpeg -y -i "songs/<song folder>/bg_loop.mp4" -frames:v 1 /tmp/loop_first.jpg
      ffmpeg -y -sseof -0.1 -i "songs/<song folder>/bg_loop.mp4" -frames:v 1 /tmp/loop_last.jpg
      
    6. If a watermark is present, inform the user to check Kling's terms of service to see if it can be used as-is or removed. Do not modify it without confirming the terms.
  • other: Create it according to the note instructions, and place it at songs/<song folder>/bg_loop.mp4. If it costs money, ask the user before creating. If the steps are unclear, ask the user.
  • If creating a separate vertical version, name it bg_loop_vertical.mp4 (if missing, the horizontal version is center-cropped). For placement details, see "Background Loop Video" in templates/mv/README.md.

1. Create (Once)

./tools/make_mv.sh "songs/<song folder>"
  • This script runs in one pass: lyric timing extraction → tempo measurement → image/loop video preparation → lyric synchronization → rendering → inspection. The project for the song is created under projects/<slug>/, and is recorded in song.json's mv_project entry.
  • If whisper cannot align a line (e.g., ad-libs), inform the user about that line, get their approval, then re-run with --allow-unaligned (which estimates timing from neighboring lines).
  • If the tempo estimation is off by a factor of 2 (double/half), constrain the range with --bpm <min> <max> (the actual measured BPM is written by make_mv.sh to profile/ledger.md).
  • Lyric timing extraction (whisper) and rendering may take tens of minutes. Run long processes in the background and wait for them to finish.
  • Do not trust the exit code; verify the outputs:
    ls -la "songs/<song folder>/<Title>.mp4" "songs/<song folder>/<Title> (Short).mp4" "songs/<song folder>/thumbnail.jpg"
    ffprobe -v error -show_entries format=duration -of csv=p=0 "songs/<song folder>/<Title>.mp4"
    
  • If the script stops mid-way, read the last error in the output, identify which stage (lyric timing, tempo, image, rendering, inspection) failed, and then fix it.

2. User Review (Human Step)

  • If providers.notify is slack, make_mv.sh also sends the video to Slack.
  • Ask the user with the following message and then stop:
    The MV is ready.
    - Main: songs/<song folder>/<Title>.mp4
    - Short: songs/<song folder>/<Title> (Short).mp4
    - Thumbnail: songs/<song folder>/thumbnail.jpg
    Please watch it and tell me if it's OK or what you'd like to fix. Examples:
    - Lyric timing is off (at around X minutes X seconds)
    - Font is too large/too small/hard to read
    - Want to change colors, background, or character visibility
    
  • Only the first time you ask for review on this song, add the following extra line at the end of the above message (do not add it for subsequent reviews or for other songs): You can freely modify this from here. Pick from 18 axes (how lyrics appear, character movement, background, camera, beat hits) and a direction library (direction-library/), and I'll rewrite the template and recreate the MV. If you're happy as is, just say OK.
  • If the user says nothing beyond OK, proceed to steps 3 & 4 as before. Do not re-suggest.

3. Fix

When the user tells you what to fix, propose 2–3 options for how to fix it, let them choose, then apply the fix. The fix location depends on scope: "only this song" or "from the next song onward too". If not specified, ask:

ScopeFix Location
This song onlyprojects/<slug>/ (input/song.config.ts, src/) and the song folder (LYRICS.md, scenes.json, etc.)
From next song onward (default style)Also fix templates/mv/. Does not affect already-created song projects = also apply to this song
From next song onward (style)Fix styles/<name>/ (skill mv-styles "Add or modify a style")
Save as a new visual styleAdd to styles/ using skill mv-styles "Add or modify a style"
Config values (text, names, volume, etc.)workflow.config.json (skill setup config change)

Common fixes and how to apply them:

IssueFix
Lyric timing is offChange line breaks in LYRICS.md's "Lyrics (for display)" and re-run make_mv.sh (lyrics.json is overwritten each time)
Font too large/small/overflows① Split long "Lyrics (for display)" lines into two (font size is determined by line length) ② Change font size settings in projects/<slug>/input/song.config.ts
Hard to read① Increase text outline/shadow ② Darken the background (both in song.config.ts or style)
Want to change colors① Change the style's color palette ② Specify colors that match the cover image
Want to change background/character① Replace cover.png ② Re-cut out the character ③ Make the background move or stop (step 0 – to stop, remove bg_loop.mp4)
Want different background per section / multiple imagesSee "Scene switching" below
Credit textFix workflow.config.json's credits
  • Check projects/<slug>/README.md to find which file contains which setting. Do not write settings that don't exist.
  • After fixing, re-run make_mv.sh, then extract a frame of the fixed part and view it with Read before showing to the user:
    ffmpeg -y -ss <seconds> -i "songs/<song folder>/<Title>.mp4" -frames:v 1 /tmp/check.jpg
    
  • You can iterate as many times as needed. After each fix, ask for review using the message from step 2.

Scene Switching (Multiple Images)

Switch background images per section (format in templates/mv/README.md "Scene switching").

  1. Determine the sections. For each section, align the start second (from projects/<slug>/input/lyrics.json) to the nearest beat before it (from input/beats.json). For interludes, start from the end of the previous line.
  2. Show a table of section background proposals, and get approval for the number of new images to generate (generation costs money): | Section | Seconds (beat-aligned) | Background | Image (new / existing & reuse) |
    • You can reuse the same image for identical sections in verse 1 and verse 2. The first section should reuse the cover.
    • Derive image ideas from BRIEF.md and LYRICS.md (depict the scene's situation rather than a close-up of the lyric object).
  3. Write the prompt into songs/<song folder>/scenes/<NN>_<name>.txt. Append a common suffix to all prompts: same world, art style, light as the cover, no people (if no character), no text, no letters, no typography, 16:9 landscape.
  4. Generate one image at a time, view it with Read, then proceed to the next. Pass the cover as a reference image to keep style consistent:
    ./tools/gen_image.sh "$(cat "songs/<song folder>/scenes/<NN>_<name>.txt")" "songs/<song folder>/scenes/<NN>_<name>.png" "songs/<song folder>/cover.png"
    
    If an image doesn't match, stop and consult the user (do not auto-retry).
  5. Write songs/<song folder>/scenes.json, then run ./tools/make_mv.sh.
  6. Extract frames from the start and middle of each section and view with Read (check switching works and the main subject is in frame).

3b. Remake (Only When the User Wants)

The template is a starting point. If the user wants to change the visual style more drastically than simple fixes (step 3):

  1. Ask how they want to choose: "Decide axis by axis" or "Pick from the direction library".
    • Axes: For each axis they want to change, consult the 18 axes in mv-styles skill's references/axes.md. Only ask about axes they mention.
    • Library: Filter direction-library/INDEX.md by emotion/timing, show 2–3 candidates with a one-line description, and let them choose.
  2. Write the selected choices per section into songs/<song folder>/DIRECTION.md (axes as axisCode=value, directions as slug).
  3. Modify projects/<slug>/ (the project created from templates/mv) in input/song.config.ts and src/. Insert direction values exactly as specified in the library record. Only modify templates/mv if the user says "from the next song onward" (because it's the starting point for the next song).
  4. Re-create with ./tools/make_mv.sh "songs/<song folder>", extract frames of the changed sections and view, then show to the user with the message from step 2, along with the "Quality check" from the used direction record.
  • If they want to switch to a completely different style, go back to "Choose a Visual Style (Optional)".

4. When OK

node -e 'const f=process.argv[1],fs=require("fs"),j=JSON.parse(fs.readFileSync(f));j.approved_at=new Date().toLocaleDateString("sv-SE");fs.writeFileSync(f,JSON.stringify(j,null,2)+"\n")' "songs/<song folder>/song.json"
./next.sh "<song folder>"
  • Do not set approved_at before hearing the user's OK.

Related Skills