What does localcut do?
Based on the
video-useskill by Browser Use (MIT). Principles, hard rules, cut craft, grading, animation and anti-pattern sections are adapted from it; tooling, workflow, memory and styles are localcut's. See the repository README for what was taken and what changed.
Tooling (always use these)
Every tool is a localcut subcommand. The binary is localcut on PATH (linked to ~/.local/bin by the
installer) or <repo>/.venv/bin/localcut, where <repo> is the parent of this skill folder. If neither works,
the install is incomplete: follow <repo>/INSTALL.md. Run localcut doctor at the start of a session.
Run commands from the project's edit dir or pass --edit-dir.
| Command | What it does |
|---|---|
localcut init <videos_dir> --style <name> | create <videos_dir>/edit/ with project.toml, cut.yaml, project.md |
localcut ingest | transcribe every source (Qwen3-ASR-1.7B fp16 + forced aligner, on-device, zh/en/mixed) + shot detection + takes_packed.md (all cached) |
localcut scenes <video|dir> | shots, 3 frames per shot (one every 8 s in long takes), contact sheets edit/scenes/*_sheet.jpg |
localcut beats <music> | tempo, beats, bar starts, energy sections |
localcut plan | cut.yaml → frame-exact, beat-synced edl.json; flags repeated shots / order problems |
localcut render --draft / --final | per-segment extract → concat → subtitles → music bed (transcript-driven ducking) → loudness. Output format from project.toml |
localcut verify <render> | self-check report + cuts.jpg + captions.jpg |
localcut sheet | cut sheet (markdown table) for the user's notes |
localcut export fcpxml | Resolve/FCP timeline referencing the originals (speed, freeze, volume included) |
localcut cover <video> --at T --title … | 3:4 cover |
localcut timeline <video> <t0> <t1> | filmstrip + waveform for a range (decision-point drill-down) |
localcut grade <in> -o <out> / --list-presets | try a grade on a clip |
localcut pack | rebuild takes_packed.md from transcripts |
localcut style list / style new <name> [--from <videos>] | list styles / learn a user style from reference videos |
localcut config show --explain / config paths | merged settings and where each comes from |
localcut review | local review app for the user (loopback only): project switcher / new project + ingest, player + cut sheet + time-coded comments + approvals |
localcut feedback [--done ID …] | read the user's comments / approval gates; mark comments done after addressing them |
Configuration is centralised. Layers, later wins: built-in defaults → style(s) named in the project
(<name>.toml + rationale <name>.md, from the user's styles dir or the built-in styles/ next to this
skill's parent folder) → user config ~/.config/localcut/config.toml → edit/project.toml.
localcut config show --explain prints every setting and the layer that set it; localcut config paths
prints where everything lives. Never hard-code paths, models, encoders or fonts in project files.
What belongs where
- Built-in
styles/(the repository): generic, sourced platform knowledge only. Never personal taste. - User area
~/.config/localcut/:preferences.md(the user's cross-project taste),styles/(the user's own styles, e.g. learned from creators they like vialocalcut style new <name> --from <videos>),references/(analyses),config.toml(standing settings). - Project
edit/:project.toml(this film's settings),project.md(this film's notes and decisions).
Starting a project
localcut init <footage_dir> [--style <name>].--styleis optional: runlocalcut style listand pick the closest; if none fits (e.g. a YouTube vlog and onlyxiaohongshu-vlogexists), init without a style, set output/music inproject.toml, and offer to create a style with the user later.- Sources are the video files directly inside
<footage_dir>(subfolders are not scanned). For nested day folders, ask the user whether to flatten (symlink) into one folder or init one project per folder. - Ingest time (M3 Pro, measured): transcription ≈ 4 s per minute of audio; shot detection ≈ 1/3 of real time
for 4K60 (≈ 8 min for 24 min of footage). For more than a few minutes of footage, run
localcut ingestin the background and tell the user how long to expect.
cut.yaml (what you write)
One entry per segment in output order; times are SOURCE seconds. localcut plan turns it into edl.json.
grade: base # default grade preset from the style
segments:
- src: "0349" # file stem or unique suffix (DJI_..._0349_D.MP4 → "0349")
in: 213.6
out: 215.3
type: dialogue # dialogue (fixed, may breathe into pauses to land the next anchor on a bar)
# | broll (end snaps to beat / bar, never past max_out) | fixed (exact)
label: "fire — success" # shows in cut sheet, FCPXML, verify
subs: [[214.0, 214.8, "成功了!", "We did it!"]] # [src_t0, src_t1, Chinese, English]; "" allowed
captions: [{style: Title, text: "Line 1\\N{\\fs32}Line 2", at: 0.3, dur: 3.6, fade: [500, 400]}]
# optional: max_out, anchor (start on a bar), bars (exactly N bars), speed, gain_db, mute, hold (freeze s),
# fit: blur|black|crop (orientation mismatch; prefer a matching-orientation shot when one exists), grade (preset or raw filter), quiet_music (duck music to quiet_db)
Caption styles: Sub, SubEN, Title, Day, Genre, Quote, Credits, End. Full reference: <repo>/README.md → "cut.yaml".
Dialogue subs come from the transcript words (edit/transcripts/<stem>.json); fix mis-heard words by hand.
Network
Install-time downloads are Homebrew, PyPI and the Hugging Face models. During editing, ask the user before any
download: music (CC0 / CC BY sources such as incompetech.com; record it in edit/music/LICENSE.md), animation
engines (npx HyperFrames / Remotion), fonts. Never upload footage or transcripts anywhere.
Mandatory workflow
- Never modify, move, rename or delete source footage. Everything is written under
<videos_dir>/edit/. - On start: read
~/.config/localcut/preferences.mdandedit/project.md(obey both; the project wins on conflict), the style files named inproject.toml, and the matching SOP insops/. Summarise the last session in one sentence. - Propose the plan in plain language and wait for approval before cutting.
- Draft first (
--draft, 720p). Runlocalcut verifyand look at its images before showing anything. Then suggest the user review it inlocalcut review(they can comment at exact moments and approve gates). When the user says they are done reviewing (or asks to "apply my review comments in "), and at the start of every later turn, runlocalcut feedback: address each open comment (they carry the segment and the source time), thenlocalcut feedback --done <ids>; respect gate states (don't start the final beforedraftis approved). - After approval:
--final, verify again,export fcpxml, cover. - Record every preference the user states, immediately, in the right layer: this film →
edit/project.md; the user's general taste →~/.config/localcut/preferences.md; a user style → that style's files. Never write personal preferences into built-in styles. Ask if the scope is unclear. - You cannot hear. Measure audio and say what needs the user's ears.
- Speak the user's language; explain each editing term once in one sentence.
Principle
- LLM reasons from raw transcript + on-demand visuals. The only derived artifact that earns its keep is a packed phrase-level transcript (
takes_packed.md). Everything else — filler tagging, retake detection, shot classification, emphasis scoring — you derive at decision time. - Audio is primary, visuals follow. Cut candidates come from speech boundaries and silence gaps. Drill into visuals only at decision points.
- Ask → confirm → execute → iterate → persist. Never touch the cut until the user has confirmed the strategy in plain English.
- Generalize. Do not assume what kind of video this is. Look at the material, ask the user, then edit.
- Artistic freedom is the default. Every specific value, preset, font, color, duration, pitch structure, and technique in this document is a worked example from one proven video — not a mandate. Read them to understand what's possible and why each worked. Then make your own taste calls based on what the material actually is and what the user actually wants. The only things you MUST do are in the Hard Rules section below. Everything else is yours.
- Invent freely. If the material calls for a technique not described here — split-screen, picture-in-picture, lower-third identity cards, reaction cuts, speed ramps, freeze frames, crossfades, match cuts, L-cuts, J-cuts, speed ramps over breath, whatever — build it. The helpers are ffmpeg and PIL. They can do anything the format supports. Do not wait for permission.
- Verify your own output before showing it to the user. If you wouldn't ship it, don't present it.
Hard Rules (production correctness — non-negotiable)
These are the things where deviation produces silent failures or broken output. They are not taste, they are correctness. Memorize them.
- Subtitles are applied LAST in the filter chain, after every overlay. Otherwise overlays hide captions. Silent failure.
- Per-segment extract → lossless
-c copyconcat, not single-pass filtergraph. Otherwise you double-encode every segment when overlays are added. - 30ms audio fades at every segment boundary (
afade=t=in:st=0:d=0.03,afade=t=out:st={dur-0.03}:d=0.03). Otherwise audible pops at every cut. - Overlays use
setpts=PTS-STARTPTS+T/TBto shift the overlay's frame 0 to its window start. Otherwise you see the middle of the animation during the overlay window. - Subtitle files (ASS) use output-timeline offsets:
output_time = word.start - segment_start + segment_offset. Otherwise captions misalign after segment concat. - Never cut inside a word. Snap every cut edge to a word boundary from the transcript.
- Pad every cut edge. Working window: 30–200ms. Forced-aligner timestamps drift ~50–100ms — padding absorbs the drift. Tighter for fast-paced, looser for cinematic.
- Word-level ASR only. Never SRT/phrase mode (loses sub-second gap data).
- Cache transcripts per source. Never re-transcribe unless the source file itself changed.
- Parallel sub-agents for multiple animations. Never sequential. Spawn N at once via the
Agenttool; total wall time ≈ slowest one. - Strategy confirmation before execution. Never touch the cut until the user has approved the plain-English plan.
- All session outputs in
<videos_dir>/edit/. Never write inside the localcut repository.
Everything else in this document is a worked example. Deviate whenever the material calls for it.
Cut craft (techniques)
- Audio-first. Candidate cuts from word boundaries and silence gaps.
- Preserve peaks. Laughs, punchlines, emphasis beats. Extend past punchlines to include reactions — the laugh IS the beat.
- Speaker handoffs benefit from air between utterances. Common values: 400–600ms. Less for fast-paced, more for cinematic. Taste call.
- Audio events as signals.
(laughs),(sighs),(applause)mark beats. Extend past them. - Silence gaps are cut candidates. Silences ≥400ms are usually the cleanest. 150–400ms phrase boundaries are usable with a visual check. <150ms is unsafe (mid-phrase).
- Example cut padding (the launch video shipped with this): 50ms before the first kept word, 80ms after the last. Tighter for montage energy, looser for documentary. Stay in the 30–200ms working window (Hard Rule 7).
- Never reason audio and video independently. Every cut must work on both tracks.
The packed transcript (primary reading view)
localcut pack reads all transcripts/*.json and produces one markdown file where each take is a list of phrase-level lines, each prefixed with its [start-end] time range. Phrases break on any silence ≥ 0.5s OR speaker change. This is the artifact the editor sub-agent reads to pick cuts — it gives word-boundary precision from text alone at 1/10 the tokens of raw JSON.
Example line:
## C0103 (duration: 43.0s, 8 phrases)
[002.52-005.36] S0 Ninety percent of what a web agent does is completely wasted.
[006.08-006.74] S0 We fixed this.
Editor sub-agent brief (for multi-take selection)
When the task is "pick the best take of each beat across many clips," spawn a dedicated sub-agent with a brief shaped like this. The structure is load-bearing; the pitch-shape example is not.
You are editing a <type> video. Pick the best take of each beat and
assemble them chronologically by beat, not by source clip order.
INPUTS:
- takes_packed.md (time-annotated phrase-level transcripts of all takes)
- Product/narrative context: <2 sentences from the user>
- Speaker(s): <name, role, delivery style note>
- Expected structure: <pick an archetype or invent one>
- Verbal slips to avoid: <list from the pre-scan pass>
- Target runtime: <seconds>
Common structural archetypes (pick, adapt, or invent):
- Tech launch / demo: HOOK → PROBLEM → SOLUTION → BENEFIT → EXAMPLE → CTA
- Tutorial: INTRO → SETUP → STEPS → GOTCHAS → RECAP
- Interview: (QUESTION → ANSWER → FOLLOWUP) repeat
- Travel / event: ARRIVAL → HIGHLIGHTS → QUIET MOMENTS → DEPARTURE
- Documentary: THESIS → EVIDENCE → COUNTERPOINT → CONCLUSION
- Music / performance: INTRO → VERSE → CHORUS → BRIDGE → OUTRO
- Or invent your own.
RULES:
- Start/end times must fall on word boundaries from the transcript.
- Pad cut boundaries (working window 30–200ms).
- Prefer silences ≥ 400ms as cut targets.
- Unavoidable slips are kept if no better take exists. Note them in "reason".
- If over budget, revise: drop a beat or trim tails. Report total and self-correct.
OUTPUT (JSON array, no prose):
[{"source": "C0103", "start": 2.42, "end": 6.85, "beat": "HOOK",
"quote": "...", "reason": "..."}, ...]
Return the final EDL and a one-line total runtime check.
Color grade (when requested)
Your job is to reason about the image, not apply a preset. Look at a frame (via localcut timeline), decide what's wrong, adjust one thing, look again.
Mental model is ASC CDL. Per channel: out = (in * slope + offset) ** power, then global saturation. slope → highlights, offset → shadows, power → midtones.
Example filter chains (localcut grade has --list-presets; use them as starting points or mix your own):
warm_cinematic— retro/technical, subtle teal/orange split, desaturated. Shipped in a real launch video. Safe for talking heads.neutral_punch— minimal corrective: contrast bump + gentle S-curve. No hue shifts.none— straight copy. Default when the user hasn't asked.
For anything else — portraiture, nature, product, music video, documentary — invent your own chain. localcut grade --filter '<raw ffmpeg>' accepts any filter string.
Hard rules: apply per-segment during extraction (not post-concat, which re-encodes twice). Never go aggressive without testing skin tones.
Animations (when requested)
Animations match the content and the brand. Get the palette, font, and visual language from the conversation — never assume a default. If the user hasn't told you, propose a palette in the strategy phase and wait for confirmation before building anything.
Tool options:
Pick the engine per animation slot. Do not default to Remotion just because the animation is web-adjacent.
- HyperFrames — Browser-native HTML/CSS/GSAP video compositions: product UI motion, website-to-video or mockup-to-video captures, kinetic typography, landing-page/storyboard promos, data-driven UI states, transparent WebM overlays, and clips that need deterministic frame capture plus HyperFrames lint/validate/render checks. Best when the animation should be authored and verified like a web composition instead of a React component tree.
- Remotion — React/CSS compositions with component state, reusable React primitives, or an existing Remotion brand system. Best when the user specifically asks for React/Remotion or when React composition is the simpler authoring model.
- PIL + PNG sequence + ffmpeg — simple overlay cards: counters, typewriter text, single bar reveals, progressive draws. Fast to iterate, any aesthetic you want. The launch video used this.
For HyperFrames slots, scaffold the slot inside edit/animations/slot_<id>/ with npx --yes hyperframes init . --example blank --non-interactive --skip-skills, build the HTML composition there, run the HyperFrames checks that fit the slot (lint, validate, and a draft render when practical), then produce the final overlay video with npx --yes hyperframes render . -o render.mp4 or --format webm -o render.webm when alpha is required. Point the EDL overlay file at the actual rendered path.
For Remotion slots, keep the Remotion project isolated inside the same slot directory, scaffold with npx create-video@latest or install Remotion locally there, render the composition to render.mp4 with the project-local remotion render command, and verify duration and dimensions with ffprobe.
None is mandatory. Invent hybrids if useful (e.g., PIL background with a HyperFrames or Remotion layer on top).
Duration rules of thumb, context-dependent:
- Sync-to-narration explanations. A viewer needs to parse the content at 1×. Rough floor 3s, typical 5–7s for simple cards, 8–14s for complex diagrams. The launch video shipped at 5–7s per simple card.
- Beat-synced accents (music video, fast montage). 0.5–2s is fine — they're visual accents, not information. The "readable at 1×" rule becomes "recognizable at 1×", not "fully parseable."
- Hold the final frame ≥ 1s before the cut (universal).
- Over voiceover: total duration ≥
narration_length + 1s(universal). - Never parallel-reveal independent elements — the eye can't track two new things at once. One thing, pause, next thing.
Animation payoff timing (rule for sync-to-narration): get the payoff word's timestamp. Start the overlay reveal_duration seconds earlier so the landing frame coincides with the spoken payoff word. Without this sync the animation feels disconnected.
Easing (universal — never linear, it looks robotic):
def ease_out_cubic(t): return 1 - (1 - t) ** 3
def ease_in_out_cubic(t):
if t < 0.5: return 4 * t ** 3
return 1 - (-2 * t + 2) ** 3 / 2
ease_out_cubic for single reveals (slow landing). ease_in_out_cubic for continuous draws.
Typing text anchor trick: center on the FULL string's width, not the partial-string width — otherwise text slides left during reveal.
Example palette (the launch video — one aesthetic among infinite):
- Background
(10, 10, 10)near-black - Accent
#FF5A00/(255, 90, 0)orange - Labels
(110, 110, 110)dim gray - Font: Menlo Bold at
/System/Library/Fonts/Menlo.ttc(index 1) - ≤ 2 accent colors, ~40% empty space, minimal chrome
- Result: terminal / retro tech feel
This is one style. If the brand is warm and serif, use that. If it's colorful and playful, use that. If the user handed you a style guide, follow it. If they didn't, propose one and confirm.
Fonts fail silently. A web font that didn't load renders in a fallback face with no error — the video ships in "almost Arial". In HyperFrames/Remotion, await the font load and then assert it: if (!document.fonts.check('700 76px "Inter"')) throw new Error(...). In PIL, pass an explicit font path; never rely on the default.
Worked example — "show the edit" hook (a launch video for this tool). Instead of a title card, the first 3s visualize the editing itself: each transcript word pops in on its timestamp, with bars under it drawn from the real audio envelope; a filler ("ummm") grows letter by letter while it is spoken, turns orange and is cut out on screen at the same frame the audio cuts, and the next line lands immediately. It works because the picture is driven by the same data as the sound — one composition (Remotion) reads frame-exact word/envelope JSON produced in Python, so nothing can drift. Use the idea whenever the story is "we removed something": make the removal visible.
Parallel sub-agent brief — each animation is one sub-agent spawned via the Agent tool. Each prompt is self-contained (sub-agents have no parent context). Include:
- One-sentence goal: "Build ONE animation: [spec]. Nothing else."
- Absolute output path (
<edit>/animations/slot_<id>/render.mp4) - Exact technical spec: resolution, fps, codec, pix_fmt, CRF, duration
- Style palette as concrete values (RGB tuples, hex, or reference to a design system)
- Font path with index
- Frame-by-frame timeline (what happens when, with easing)
- Anti-list ("no chrome, no extras, no titles unless specified")
- Code pattern reference (copy helpers inline, don't import across slots)
- Deliverable checklist (script, render, verify duration via ffprobe, report)
- "Do not ask questions. If anything is ambiguous, pick the most obvious interpretation and proceed."
One sub-agent = one file (unique filenames, parallel agents don't overwrite each other).
Music and sound effects (when requested)
Sound is where generated videos sound cheap. Worked rules from launch edits:
- Fewer effects. Every effect is tied to something visible (a cut, a landing, a click). ~20 stock whooshes/risers/impacts in 18s reads as generic; ~8 reads as designed.
- Hit on the frame. Most effects have an attack (silence or a build before the transient). Measure it (first sample above ~-30 dBFS of the peak) and start the file
attackseconds before the visible contact frame. - Duck music under speech (roughly -12 to -15 dB relative to its music-only level), and ramp it out before a stinger or end card instead of letting its own tail decay under your CTA.
- Master once: mix to PCM, then two-pass loudnorm (-14 LUFS, true peak ≤ -1 dBTP) on the final mix. Then measure per section (see Self-eval).
- Music taste is the user's call. Generated music defaults to "hype"; offer two contrasting beds and let the user listen. Don't claim a mix sounds good — you can only measure it.
Anti-patterns
Things that consistently fail regardless of style:
- Hierarchical pre-computed codec formats with USABILITY / tone tags / shot layers. Over-engineering. Derive from the transcript at decision time.
- Hand-tuned moment-scoring functions. The LLM picks better than any heuristic you'll write.
- Phrase-level / SRT transcripts. Loses sub-second gap data. Always word-level.
- Uploading footage to cloud ASR. localcut is local-only.
- Burning subtitles into base before compositing overlays. Overlays hide them. (Hard Rule 1.)
- Single-pass filtergraph when you have overlays. Double re-encodes. Use per-segment extract → concat.
- Linear animation easing. Looks robotic. Always cubic.
- Unverified web fonts. A failed load silently falls back to a system face. Assert the font loaded before rendering.
- Stock SFX on every transition. Tie each effect to a visible event; cap the count.
- Hard audio cuts at segment boundaries. Audible pops. (Hard Rule 3.)
- Typing text centered on the partial string. Text slides left as it grows.
- Sequential sub-agents for multiple animations. Always parallel.
- Editing before confirming the strategy. Never.
- Re-transcribing cached sources. Immutable outputs of immutable inputs.
- Assuming what kind of video it is. Look first, ask second, edit last.