بنقرة واحدة
process-library
// Skill for processing footage (video clips, sounds, photos, etc). Use this when creating a new library, adding new footage (videos) to an existing library, or resuming processing on an existing library.
// Skill for processing footage (video clips, sounds, photos, etc). Use this when creating a new library, adding new footage (videos) to an existing library, or resuming processing on an existing library.
| name | process-library |
| description | Skill for processing footage (video clips, sounds, photos, etc). Use this when creating a new library, adding new footage (videos) to an existing library, or resuming processing on an existing library. |
This skill is the main thread's playbook for the Setup and Analyze Video workflow steps. Use it whenever the user wants to:
It orchestrates the full transcribe-audio → contact sheets → summaries pipeline. The mechanics of each analysis step live in skills/analyze-video/SKILL.md; this skill calls into them.
Before any library setup, check if libraries/settings.yaml exists. If not, copy from template:
cp templates/settings_template.yaml libraries/settings.yaml
If no previous settings.yaml was present, use AskUserQuestion to ask the user to confirm or change their defaults (editor and whisper_model).
Editor options (label shown to user → value to save):
fcpxpremiereresolvewhisper_model options:
transcript_refinement)Save the shortcode (fcpx / premiere / resolve) to libraries/settings.yaml, not the long-form name — downstream export expects the shortcode.
Note: transcript_refinement is a per-library setting, not global. Ask about it during library setup (Step 3 below), not here.
Check if a library already exists:
ruby lib/buttercut/library.rb <name> exists # exits 0 if it does, 1 if not
If it exists:
video_count, incomplete_count, and the list of incomplete clips with their missing fields):
ruby lib/buttercut/library.rb <name> summary
If the directory exists but exists returns 1 (library.yaml missing):
transcripts/, cuts/, etc.) and inform the user of the current state.If no library directory exists:
To list libraries by recency (for "find a recent library to resume" prompts):
ruby lib/buttercut/library.rb list
Ask the user these questions one at a time — never all at once.
What do you want to call this project library?
Where are the video files located?
What language is spoken in these videos?
AskUserQuestion with options: "English", "Spanish", and a free-text fallback for other languages.en, es, fr) behind the scenes when needed for transcription.Can I proofread the transcripts after they're generated?
AskUserQuestion with this exact question: "Can I proofread the transcripts after they're generated? I'll use the video's context to fix mistakes."transcript_refinement in library.yaml (true for Yes, false for No). Default to true if the user skips.Read the editor from libraries/settings.yaml — you'll pass it into the create call next.
Library.create is the one operation that doesn't have a plain CLI form (kwarg-heavy). Run it via ruby -e. It creates the directory tree (transcripts/, contact_sheets/, summaries/, cuts/, plans/), ffprobes each video for duration, and writes library.yaml in one call:
ruby -e "require_relative 'lib/buttercut/library'; \
Library.create('my-library', \
language: 'en', \
editor: 'fcpx', \
transcript_refinement: true, \
video_paths: ['/abs/foo.mov', '/abs/bar.mov'])"
Each video entry starts with empty transcript, contact_sheet, and summary — empty means "todo", a filename means "done."
If the user later drags in more clips:
ruby lib/buttercut/library.rb <name> add_videos /abs/new1.mov /abs/new2.mov
Then re-run the analyze steps for just the new clips.
Before starting analysis, ask the user (via AskUserQuestion): "Processing can take a while — want me to keep your computer awake until it's done?" Options: "Yes (Recommended)" and "No".
If yes, start caffeinate in the background:
caffeinate -i -w $$ &
CAFFEINATE_PID=$!
This prevents idle sleep for the lifetime of the shell. Store the PID — you'll kill it in Step 9 after processing and backup are finished.
Inform the user: "Library setup complete. Found [N] videos ([total size]). Starting footage analysis..."
Follow skills/analyze-video/SKILL.md end-to-end. That skill covers audio transcripts (parallel sub-agents), contact sheets (deterministic), summaries (Sonnet sub-agents, batched + rolling), and the post-analysis footage-understanding pass.
Progressively update footage_summary as transcripts come in — 1-3 sentences covering subjects, locations, activities, visual style:
ruby lib/buttercut/library.rb <name> update_metadata footage_summary "subjects/locations/activities/visual style"
The full understanding pass at the end of analyze-video is where this gets refined.
Analyze ALL videos before offering to create rough cuts.
Before reporting analysis complete, confirm the library passes the same gate the cut skill uses:
ruby lib/buttercut/library.rb <name> ready
If it exits non-zero, run ruby lib/buttercut/library.rb <name> summary to list the incomplete clips, finish the missing artifacts (loop back into whichever analyze-video step owns them), and re-run ready until it passes. Don't claim analysis is done while Library.ready? is false.
After all analysis completes, automatically create a backup using the backup-library skill, scoped to just the library you processed: ruby lib/buttercut/backup_libraries.rb --library <library-name>. This writes a single archive under ~/Documents/buttercut-video-editor-backups/<library-name>/ (or wherever backups_dir in libraries/settings.yaml points). If backups_dir isn't set yet, the script silently uses the default — don't prompt during process-library.
If you started caffeinate in Step 5, kill it now:
kill $CAFFEINATE_PID 2>/dev/null
tmp/ directory inside the buttercut project root is used for all temporary files. Create subdirectories as needed and delete after use.templates/library_template.yaml. If anything's missing or renamed, run ruby lib/buttercut/library.rb migrate to migrate all libraries at once. See AGENTS.md → Critical Principles for the migration trigger list.Build a cut from a library — scene, selects, roughcut, or custom task. Starts by asking what kind of cut the user wants, then works with them to determine what they want to create. Always exports a file for Final Cut, Premiere, or Resolve at the end. Use when the user asks for a "roughcut", "sequence", "scene", "selects", or any other cut-shaped output.
Full footage analysis pipeline — audio transcripts, contact sheets, and Sonnet-written summaries. Produces every artifact the cut skill reads. Orchestrated from the main thread.
Backs up user libraries and all their contents (external video excluded). This skill can also be useful when you need to restore a library.
Builds a contact sheet from a video clip — evenly spaced frames laid out in a single grid image, each with its hh:mm:ss timestamp burned in. Use when the user asks for a "contact sheet", "grid", "film strip", or wants a one-image overview of part of a clip.
Exports all dialogue from every clip in a library into a single text file. One clip per block — filename, then its spoken words. Use when the user asks for a "full transcript", "full script", or wants all the dialogue from a library in one place.
Reset a library's visual analysis (contact sheets, summaries, legacy visual_transcripts) and re-run the current analyze-video pipeline on it. Keeps audio transcripts, cuts, plans, and library metadata. Use when a library was processed under the older pipeline and the user wants to bring it onto the contact-sheet-based one.