agentleFS
nebrassnebrass/hve-video-director/CLAUDE.md

hve-video-director

CLAUDE.md97 starsChanged 11 days agoMITView on GitHub

This repo is an agent skill (hve-video-director) that runs on both Claude Code and GitHub Copilot CLI, not a typical application. The "source" is prompt content (markdown) plus Python helper scripts. There is no build system or lint config; pure-stdlib helper tests live under test/. The skill is consumed by future agent sessions that invoke /hve-video-director <video request> (or use intent on Copilot CLI). The SKILL.md frontmatter includes Claude Code extensions; Copilot CLI reads name/description and also honors allowed-tools. Invocation…

  • Reads credentials
  • Installs packages

The file

We split this CLAUDE.md into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Treat it as a record, not a fixture.

    line 43
  2. Very specific:

    Every Python helper here is now pure standard library — no pip install, no requests, no network.

    line 212
  3. Very specific:

    Run the stdlib tests with bash test/run.sh.

    line 246
  4. Very specific:

    When testing skill changes locally, the global install path is ~/.claude/skills/hve-video-director/ (Claude Code) or …

    line 443

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) — and GitHub Copilot CLI, which also reads CLAUDE.md — when working with code in this repository.

What this repo is

This repo is an agent skill (hve-video-director) that runs on both Claude Code and GitHub Copilot CLI, not a typical application. The "source" is prompt content (markdown) plus Python helper scripts. There is no build system or lint config; pure-stdlib helper tests live under test/. The skill is consumed by future agent sessions that invoke /hve-video-director <video request> (or use intent on Copilot CLI). The SKILL.md frontmatter includes Claude Code extensions; Copilot CLI reads name/description and also honors allowed-tools. Invocation correctness lives in the body, not runtime-specific frontmatter.

The renderer is HyperFrames (HTML + GSAP, rendered via headless Chromium). React/Remotion are no longer used.

Prompt-driven requests. A new request determines subject, scenario, detail, and result. Discovery narrows to that request; it does not turn every demo into a product tour or every promo into a tutorial. Original request/source provenance lives as single-line JSON strings in project-plan.md outside the exact Creative Brief; context.md is the completed discovery interpretation, never an intake placeholder. Its optional approved scenario inventory owns requirement IDs; the storyboard's one Scenario Coverage prose table maps them to frames and actual evidence. Frames carry their own required content, not the full inventory/brief, and IDs are not on-screen copy. Missing approved coverage requires repair or an explicit user scope change.

Bind source to invocation cwd (or explicit --source-dir) and output separately (--output-dir). Project-local skill homes resolve relative to the bound source and yield absolute tool paths; generated-file/render commands stay in output. Keep canonical home order and shell guards intact. Legacy/no-request projects and artifact-only resumes gain no new scenario/source prerequisite.

Two things to keep distinct:

  • This repo — the skill definition (SKILL.md, reasoning/, grammar/, workflows/, templates/, patterns/, sub-agents/, scripts/, design-systems/, compat/). Edits here change behavior for all users.
  • Generated video projects — created by the skill at runtime in {project-dir}/. They contain project-plan.md, .hve/brief-state.json, context.md, storyboard.md (the official HyperFrames storyboard shape since M4 — see below), DESIGN.md, public/screenshots/, scenes/*.html, index.html (root HyperFrames composition), voiceover.mp3, out/final.mp4, and — only while a Studio review round is open — .hyperframes/frame-comments.json. None of them lives in this repo.

Language consent is schema-versioned. New briefs confirm text_language and narration_language separately after provider/model capability discovery; there is no fixed language shortlist. The checked .hve/language-profile.json maps canonical locales to native TTS/ASR codes and carries an opaque speech_fingerprint. Authored text follows its locale, narration/captions follow the spoken locale, and captured UI/code are not translated. Historical schema-1 inspection preserves original consent and bytes; new generation needs an explicit language upgrade, not an inferred default. A text-only locale change stales story work but does not change the speech identity.

example/ is the committed reference build — the source artifacts of one real end-to-end run against the HyperFrames-first pipeline (a 60s promo the skill made about itself), with every per-phase approval given by a human. Media is gitignored; the MP4 ships as a Release asset.

Treat it as a record, not a fixture. Never hand-edit a file in it to make a point, and never regenerate it from a partial run: it is only worth anything while every byte is what the pipeline actually emitted. A replacement is a human-in-the-loop run — real TTS, music licensing, a headless-Chromium render, and this skill's own per-phase approvals, which no agent may self-grant (ADR-001). Do not fabricate one, and do not add a directory that only looks like the output of a real run. example/.hve/brief-state.json is the consent record that makes the claim checkable: validate_brief.py --project-dir example status must report complete, confirmed and unstale.

A tool that audits live projects will find things in it, and that is the record working, not failing. keys-audit reports four findings today — frames 2 and 7 carry capabilities: —, and frame 6 carries motion: — with no blueprint:, all of which reasoning/scene-analysis.md already forbade in the commit that added the storyboard. A run the pipeline produced and a human approved is allowed to contain a defect no gate of the day could see; that is most of what a record is for. Findings against example/ are adjudicated, never repaired. They are pinned by frame and rule in the accepted-findings table of test/unit/test_keys_audit.py, so a new one fails and forces the decision — and test/unit/test_example_consent.py digests every committed artifact, so the cheaper answer is not available. Those two land and stay together: pinning a finding without hashing the record turns a red light into an incentive to edit the record, and the consent record cannot detect that (it fingerprints the brief table, and the storyboard is deliberately outside every fingerprint — measured: two words silences two findings while status stays green).

Architecture

SKILL.md is the orchestrator prompt. It loads first, decides the entry mode (new / continue / jump), and dispatches to one of six phase workflows. Each phase has a user-approval checkpoint before advancing.

SKILL.md (orchestrator)
  ├─ reasoning/ + grammar/              → the 16-stage reasoning pipeline (read by Phases 0, 1, 3, 4)
  ├─ workflows/phase-0-discovery.md     → produces context.md
  ├─ workflows/phase-1-storytelling.md  → produces storyboard.md
  ├─ workflows/phase-2-capture.md       → produces public/screenshots/ (via Chrome DevTools MCP)
  ├─ workflows/phase-3-design.md        → produces DESIGN.md + scenes/*.html (registry blocks
  │    └─ sub-agents/scene-builder-delta.md    first, then one ephemeral frame packet per scene,
  │                                            each packet carrying this builder-role delta)
  ├─ workflows/phase-4-production.md    → produces the seam ledger + root index.html composition
  │                                       (via hyperframes skill); seams are stamped from the ledger
  │                                       (SEAM_STAMP) and enforced numerically by SEAM_VERIFIER
  └─ workflows/phase-5-audio.md         → narration via the media-use engine or confirmed local TTS,
                                          plus the chosen music bed + SFX,
                                          then the confirmed-track mix, reviewed captions,
                                          and out/final.mp4 (npx hyperframes render)

reasoning/ and grammar/ are first-class skill directories, not documentation. They hold the reasoning layer the phases run on, and a phase workflow points at them instead of restating them. reasoning/scene-analysis.md is the per-frame instrument (the question set, the director keys it emits onto each storyboard frame, and — single-sourced, ADR-008 — the cognitive-load budgets; no other file may restate one of those numbers). reasoning/capability-catalog.md owns and versions the capability-tag vocabulary and turns a frame's derived tags into a runtime. The four grammars supply the vocabulary those stages choose from: grammar/camera.md (camera moves, two tiers), grammar/motion.md (motion principles), grammar/metaphors.md (concept → picture), and grammar/three-taxonomy.md (when a frame earns Three.js, and how to record rejecting it).

The grammars decide WHEN and WHY; the HyperFrames ecosystem owns HOW. This repo never becomes the author of record for upstream mechanism text (ADR-002). Three forms are legal and only one is not: a pointer citation (upstream motion by bare rule name or bare blueprint id, resolved through RULES_INDEX / BLUEPRINT_INDEX; everything else by capability SYMBOL through compat/ecosystem.md, ADR-007); mechanical inlining at dispatch time (copying a recipe body into an ephemeral frame packet — see below); and an additive local constraint that narrows what upstream permits. A committed restatement of upstream mechanism is the illegal one. Capability derivation is mechanical, never a taste call (ADR-005), and a user's explicit creative instruction still overrides any derived verdict (ADR-001, user_directed: true).

Scene builders receive a frame packet, and nothing else (M5). A packet is assembled at dispatch time in Phase 3 Step 3.3, regenerated on every run, written to scratch and never committed. It carries exactly five things: (1) that one frame's storyboard block verbatim, director keys included; (2) the project's DESIGN.md; (3) the bodies of the recipes the frame cites, read from the installed skill at that moment and pasted in — the legal inlining above, which is what frees the builder from resolving a citation itself; (4) the builder role, FRAME_WORKER_CORE followed by sub-agents/scene-builder-delta.md; (5) canvas size, the captions flag, and the exact paths of the bound capture artifacts. Plus the starting point — a templates/scene-*.html skeleton or a block already installed from the registry.

Two boundaries are easy to erode by being helpful:

  • A packet never carries a reasoning/ or grammar/ file (ADR-004), nor another frame's block nor film-wide storyboard state. Those files produced the director keys; the keys are the conclusion, and shipping the derivation next to them is exactly what makes builder context unbounded. Adding "just a little" grammar context is the regression this rule exists to stop.
  • A builder returns one scene HTML file and runs no CLI. lint / check / the seam gate all operate on the assembled project, so a builder running them reads other files and comes back falsely green. Phase 4 runs them and re-dispatches with a concrete finding.

Dispatch is a behavioral contract, not a preference: build inline up to ~6 short frames, and beyond that give each worker 2–3 frames (never one), start all workers in a single wave, and allow one retry per frame and only with a concrete finding. The measurement behind the ~6 threshold is upstream's — DISPATCH_ECONOMICS, cited by symbol from Step 3.4 and never restated here. An earlier version stated the numbers locally "once", which is still a copy: the test is whether an upstream re-measurement makes a committed file wrong, and it did. Registry-first governs what a packet starts from: check REGISTRY_CATALOG and install with npx hyperframes add before hand-authoring; a tested block beats a hand-built scene, and hand-authoring covers only the gap.

The storyboard is the official format. The brief deliberately is not. M4 adopted STORYBOARD_FORMAT for the generated storyboard.md: YAML frontmatter, one ## Frame N — Title section per frame, - key: value metadata bullets, free prose below them. Frames are 1-based while scene files stay 0-based, so frame 1's src is scenes/00-…. Adopting the shape buys the upstream parser, the Studio contact-sheet review, and the structured .hyperframes/frame-comments.json feedback channel. Everything the official key set has no home for — the director keys, the capture bindings, this skill's own frontmatter fields — rides along as ordinary bullets and is preserved verbatim under the parser's extra. That preservation is the load-bearing assumption of the whole format; the STORYBOARD_EXTRA_KEYS behavior probe in compat/ecosystem.md guards it, and as of M4 it is automated in bash test/run.sh. Local shape doc: templates/storyboard.md.

BRIEF_FORMAT (BRIEF.md) was NOT adopted, and that is a decision, not an omission. Its companion BRIEF_CONTRACT derives a collaborative/autonomous run shape and explicitly skips questions the request already answers. This skill's consent doctrine is the opposite — recommend, never preselect; never infer an answer the user did not give (ADR-001) — so adopting the brief would import a contract that contradicts the skill's central promise. project-plan.md therefore remains this skill's Creative Brief and the single record of the levers the user owns. The storyboard is different only because it is a description of the film, not a consent record. Two consequences that are easy to undo by accident:

  • Never write mode: into storyboard frontmatter. Upstream reserves that key for the interaction mode of the run-shape contract above. The content mode lives in content_mode.
  • Never re-point scripts/validate_brief.py at BRIEF.md. A milestone that wants the official brief must replace the consent doctrine first, which is an ADR-001 change reviewed as such.

No generated project is ever stranded or rewritten. Nothing is gated on the storyboard's shape: a project written before M4 still resumes. validate_brief.py storyboard --json reports which shape a project is in, and migrate-storyboard converts one only when the user asks, preserving the original alongside the converted file. Migration is additive; a legacy line with no official home becomes an extra bullet rather than a guessed value.

Phase prerequisites are enforced in jump mode — see SKILL.md. When editing workflows, preserve the file-presence contract:

  • Phase 1 needs context.md
  • Phase 2 needs context.md + storyboard.md
  • Phase 3 needs capture artifacts (public/screenshots/ and/or public/clips/)
  • Phase 4 needs context + storyboard + DESIGN.md + scenes/*.html
  • Phase 5 needs index.html (root composition), a passing seam gate (SEAM_VERIFIER — re-run it when scenes are re-timed to the voiceover), and passing npx hyperframes lint + npx hyperframes check
  • Tutorial content mode prefers public/clips/ but degrades to stills with a warning when clips are absent (warn-don't-block, spec §7.3); only missing captions is a hard check in tutorial mode

External dependencies the skill calls out to:

  • mcp__chrome-devtools__* for app capture (Phase 2)
  • The hyperframes skill for HTML/GSAP authoring rules (Phases 3 + 4)
  • The media-use skill's audio mechanisms — AUDIO_ENGINE runs ElevenLabs narration and delegated BGM/SFX, while a confirmed Kokoro voice uses TTS_LOCAL directly with the checked native language. TRANSCRIBE / CAPTIONS_AUTHORING / TRANSCRIPT_HANDLING supply caption data. Both selected voice routes need composition-absolute timing from the assembled track with the separately checked ASR code/model. Delegation stops at generation: the exact-track confirmation, the caption review state machine, the verified mix recipes, and render approval stay here (ADR-001). Provider/model/catalog contracts are TTS_LANGUAGE_DISCOVERY and TTS_PROVIDER_ADAPTER; no fixed voice/language count or request-field model override is assumed
  • There is no gsap companion skill — it is not installed in any skills home and is not an ecosystem skill. GSAP choreography guidance (timeline registration, the property contract, ease families, stagger) is GSAP_ADAPTER + EASING_AND_STAGGER in hyperframes-animation. scripts/check_requirements.sh still probes for a gsap skill and reports it as a recommended check that degrades gracefully when absent, which is harmless; do not re-add it to prose.
  • npx hyperframes CLI for init, add (pull catalog blocks — registry-first scene planning in Phase 3, seams and furniture in Phase 4), lint, preview, check (required final gate; inspect/validate/layout are deprecated aliases), snapshot (still PNGs at chosen times — Phase 4's by-eye checks, e.g. footage legibility, have no programmatic gate), render, doctor (render-environment diagnostics, Phase 5), transcribe (preferred voiceover-timing verifier in Phase 5; falls back to standalone Whisper if unavailable), and tts (used in Phase 5 when the user explicitly confirms a local Kokoro voice)
  • mcp__chrome-devtools__screencast_* + resize_page for Phase-2 web-clip capture (experimental, feature-detected — needs --experimentalScreencast=true; falls back to screenshots), and optional asciinema+agg for CLI clip recording (otherwise the authored-terminal path)
  • mcp__chrome-devtools__list_pages + select_page for the explicit authenticated-session path. The user must first connect the MCP to running Chrome with Chrome 144+ --autoConnect (preferred) or the dedicated-profile --browser-url fallback; attached capture never navigates and follows patterns/authenticated-browser-capture.md — with one carve-out: a user-recorded flow replayed after the Phase-2 whole-flow consent may perform exactly its own recorded steps (ADR-011; § Recorded-flow exception in that pattern).
  • scripts/generate_voiceover.py → the voiceover-section assembler, and only that, since M6. --assemble-only places already-synthesized vo_section_NN.mp3 files at their exact start times, separates them with silence, pads to VIDEO_DURATION and warns on overrun; both audio paths use it, whoever synthesized the sections. The flag is now optional (assembly is the only mode) and kept accepted so every invocation already written into a workflow keeps working. M6 removed the ElevenLabs acquisition path and its Whisper verification pass; the file is pure stdlib, needs no API key and no network, and timing verification is a separate Phase-5 step against the assembled voiceover.mp3. Do not delete this file — retiring ElevenLabs did not retire assembly
  • scripts/verify_vo_sections.py → proves each narration section belongs to the exact script and synthesis settings. prepare validates the request/profile before clearing both assets/voice/NN.wav and vo_section_NN.mp3, then binds the pending round to every prepared ID and the complete canonical request. All non-BGM/SFX settings and complete line records are hashed; check writes only missing lines, preserving their metadata, to audio_request.retry.json. Keep the canonical request intact. seal rejects edits after prepare and seals media/script hashes, settings and the profile's speech identity in schema-2 .hve/vo-sections.json. Changed language/voice/model/settings and old text-only proofs need full prepare/synthesis; subset retries preserve only proven same-identity takes. Local/user-supplied attestations do not waive a new language binding. Skill-resident and never copied; the copied generate_voiceover.py reads only repo-owned opaque identities, media/script hashes and pending state, never an engine schema (ADR-009). It refuses a missing/mismatched profile or an unbound seal, and never repairs one by deleting the profile. Pure stdlib. Upstream failure mechanics are AUDIO_ENGINE_PARTIAL_FAILURE.
  • scripts/caption_gen.py → preserves legacy ASR voiceover.srt/.vtt drafts and implements draft → human review → approve → finalize → validate. New drafts canonicalize the narration locale; all three delivery/review commands accept --expected-language, always explicit in new workflows. A mismatch fails before writes without relabelling approved cues. Approval still fingerprints exact speech/speaker/sound cues; final sidecars and deterministic state publish as one rollback-protected set. ICU grapheme/word handling preserves marks, emoji clusters, RTL text and unspaced-script joining; global width/rate ceilings do not certify every language's readability. Python stdlib with required ffprobe and the sibling Node helper below.
  • scripts/language_tools.mjs → dependency-free locale and Unicode word/grapheme operations using the already-required full-ICU Node runtime. Caption and brief helpers invoke it with argv/JSON stdin; keep it beside those scripts. Missing capabilities, unsupported segmentation and malformed output fail explicitly rather than selecting English.
  • scripts/capture_screen.py → fixed-duration, silent native desktop/region capture orchestrator (pure stdlib). Uses macOS screencapture, Windows gdigrab, X11 x11grab, or feature-detected Wayland wf-recorder; WSL and unavailable Wayland return explicit recording handoffs. It trims through sibling stitch_clip.py, validates duration/frame count within one frame, and uses <clip>.capture.pending + fingerprinted <clip>.capture.json state so failed retakes preserve prior valid media but cannot count as complete.
  • scripts/mix_clip_audio.py → mixes one clip's own audio into the canonical soundtrack (trim → speed → loudnorm → volume → placement, then a sidechain duck under the clip). Pure stdlib, argv-only ffmpeg. Validates its inputs, refuses a placement whose audio would be truncated at the film's end, and replaces the soundtrack atomically only on success — a failed run leaves it byte-identical
  • scripts/motion_register.py → reports whether a scene's motion expresses more than one emotion: it flags when most of a scene's tweens share one ease across near-identical durations (resolving an ease held in a var EASE = "…" constant, which is the form the failure actually takes). Phase 4 Step 4.7 runs it after ANIMATION_MAP and it is not a second one — pacing is ANIMATION_MAP's and this reports no pacing verdict (ADR-003 bans a parallel validator). Report-never-gate: a scene built from one repeated element looks monotonous by this measure and is right. Pure stdlib, reads only
  • scripts/stitch_clip.py → canonical normalizer/stitcher for raw captures (CFR30, H.264 High/yuv420p, even dimensions, no audio, +faststart) via the ffmpeg concat filter (pure stdlib)
  • scripts/replay_flow.py → the mechanical half of recorded browse-flow capture (ADR-011): plan validates a DevTools Recorder JSON export and emits the humanized pacing schedule plus a sanitized consent brief (typed values hidden, URLs stripped of query/fragment, secret-like values flagged); arm writes <clip>.replay.pending markers; cut cuts per-frame clips from the one master screencast take through stitch_clip.py segments and publishes each atomically with a fingerprinted <clip>.replay.json sidecar carrying the clip-local pointer track; check is the resume predicate (unchanged recording hash, media fingerprint, request match — a re-recorded flow stales every cut). Its pacing-profile block is the single owner of every humanization number; patterns/recorded-flow-capture.md states the law in prose and cites the block, and nothing may restate a value. Pure stdlib; only cut needs ffprobe/ffmpeg
  • scripts/validate_brief.py → parses the exact project-plan.md Creative Brief table, consent-migrates legacy plans with empty placeholders, confirms revision-bound story/audio fingerprints, atomically writes .hve/brief-state.json, stamps phases, and rejects stale prerequisites. Python stdlib plus the sibling language_tools.mjs above: any non-legacy brief resolves its locales through that helper, so status and the language commands need a working full-ICU Node runtime and hard-fail without one. It also reads storyboard.md — read-only, and deliberately outside every fingerprint, because the storyboard describes the film while the brief records consent: storyboard --json reports the shape and frames, vo-budget estimates how long each frame's voiceover takes to speak against that frame's duration and owns those timing numbers (Phase 1 runs it before storyboard approval; it reports and never gates, because the user owns the narration — ADR-001), keys-audit checks the director keys a storyboard carries against the closed key contract, the catalog vocabulary and the hero-beat row of the budget table — which it parses, never hard-codes (ADR-008/C6) — and reports runtime_rejected: denials but never unspent budget, scores nothing, and like vo-budget reports rather than gates, and migrate-storyboard converts a pre-adoption file only on request and preserves the original alongside it
  • scripts/check_requirements.sh → verifies the toolchain (node/python/ffmpeg/chrome-headless-shell/hyperframes CLI + companion skills + env vars). The Node gate is version and capability: it runs the sibling language_tools.mjs on an RTL locale, so a small-icu build that clears node --version is reported blocked here rather than failing at the first Phase-1 language call. Probing through the helper is deliberate — restating its Intl requirements in the gate is how the two drift. Default, --json, and --plan are side-effect-free; report modes never use online npx probes. --fix=<id,id> runs only selected safe user-scoped actions (chrome-shell, hyperframes-skill, whisper), while bare --fix retains all-safe behavior. System/sudo/environment actions are printed, never run. Its SKILL_HOMES line must stay in lock-step with the canonical list in SKILL.md (same parity rule as the Phase 3/5 resolvers).

templates/ files are copied into generated projects; the scene-*.html skeletons double as the starting point a frame packet ships when no registry block covers the archetype. sub-agents/ holds role deltas for dispatched builders — today just the scene builder. patterns/ files are referenced for visual techniques — transition-catalog.md maps moments to transition families under SEAM_LAW (the seam rationale that used to live in a local pattern file is now upstream: the vector law in motion-doctrine, render-side compositing and edge artifacts in seam-craft via SEAM_RENDER_MECHANICS; the repo keeps only the narrowing clipPath/3D bans in SKILL.md § DON'Ts), and cli-terminal-capture.md documents the asciinema + agg workflow for the optional real-terminal-clip path (the dependency-free authored-terminal path uses templates/scene-terminal.html; the asciinema clip path uses templates/scene-terminal-clip.html).

Working with the skill scripts

The media scripts run inside generated video projects; validate_brief.py runs from the installed skill against a generated project via --project-dir.

M6 retired the local narration fallback only. It removed generate_voiceover.py's ElevenLabs half, and it retired search_music.py — which has since been restored, because Freesound search is the default music path: a real recording has an author, a stable URL and an auditable licence that a generated bed does not. Phase 5's audio path is the media-use engine (AUDIO_ENGINE); with no engine, narration is npx hyperframes tts on an explicitly confirmed local voice, while the music bed follows the brief's music_strategy and is not engine-gated — freesound still searches, and only delegated needs the engine. generate_voiceover.py itself survives and must not be deleted: --assemble-only is the section assembler both paths use, and removing the file would break the delegated path too.

Every Python helper here is now pure standard library — no pip install, no requests, no network. They invoke platform tools and ffmpeg/ffprobe with argv (caption_gen.py uses ffprobe for the final-audio duration). Caption/brief Unicode operations also invoke the sibling Node helper with JSON stdin; Node is an existing platform prerequisite, not a new package. None invokes a shell. (check_requirements.sh is the exception by design: its consented --fix actions run npx --yes skills add.)

# Voiceover-section assembly — used by both audio paths, whoever synthesized the
# sections. Reads vo_section_NN.mp3, writes voiceover.mp3. No API key needed.
python3 scripts/generate_voiceover.py --assemble-only

# Reviewed caption delivery (after the final soundtrack exists)
# Restore NARRATION_LANGUAGE from the checked profile, not the text locale.
python3 scripts/caption_gen.py draft --language "$NARRATION_LANGUAGE"
python3 scripts/caption_gen.py approve --expected-language "$NARRATION_LANGUAGE"  # after user approval
python3 scripts/caption_gen.py finalize --expected-language "$NARRATION_LANGUAGE"
python3 scripts/caption_gen.py validate --expected-language "$NARRATION_LANGUAGE"

# Fixed-duration silent native desktop/region capture
python3 scripts/capture_screen.py --duration 6 --region 100,80,1280,720 \
  -o public/clips/scene-02-dashboard.mp4

# Normalize / stitch a capture into the Phase-2 clip contract
python3 scripts/stitch_clip.py raw.mp4 -o public/clips/scene-02-dashboard.mp4

# Validate/confirm the stable Creative Brief and phase fingerprints
python3 /path/to/hve-video-director/scripts/validate_brief.py \
  --project-dir /path/to/generated-project status --json
# Legacy plans only, after explicit user consent
python3 /path/to/hve-video-director/scripts/validate_brief.py \
  --project-dir /path/to/generated-project migrate

Run the stdlib tests with bash test/run.sh; the suite covers brief validation/fingerprints, question-contract integration, mocked platform capture, and a synthetic ffmpeg normalization integration test when ffmpeg/ffprobe are installed.

scripts/check_requirements.sh probes FREESOUND_API_KEY — the only environment variable a script in this repo reads (search_music.py), and freesound is the recommended music strategy, so an unset key is a Phase-5 failure chosen in Phase 1. test/unit/test_requirements_coverage.py enforces the general rule: every env var read under scripts/ must be both probed and reported. It exists because the reverse assertion outlived its premise — a test required that no Freesound check exist, written when M6 retired search_music.py, and stayed green after the script came back.

scripts/check_requirements.sh accepts both ELEVENLABS_API_KEY and ELEVEN_LABS_API_KEY (back-compat). Since M6 no script in this repo reads either one — the key serves the delegated engine's ElevenLabs route, which is the only path that still consumes it.

Editing rules — DON'Ts that are easy to violate

These are enforced verbally in the ## DON'Ts section of SKILL.md — except the seam rules, which SEAM_VERIFIER enforces numerically. If you modify workflows or patterns, do not reintroduce them:

  • No jitter (shaking, vibrating motion).
  • No 360° scene spins. Subtle rotateY ≤ 8° / rotateX ≤ 4° / rotateZ ≤ 4° on mockups only. Always name the axis a limit governs.
  • Seams belong to SEAM_LAW, not to this repo. The vector law (axis/direction/speed/phase), the ban on a scene authoring its own exit — only the closing scene may animate out — and the fact that a crossfade carries nothing across the cut (a dissolve, not a seam) are motion-doctrine's, stamped by SEAM_STAMP and checked by SEAM_VERIFIER. The numeric gate is authoritative where local prose disagrees; fix the seam ledger, not the assertion. It still never overrides the user's confirmed transition style — it governs execution, not choice (ADR-001).
  • Additive seam bans this repo keeps (narrowing only, never overriding the law): no clipPath-driven inter-scene wipe (anti-aliased black sliver at the boundary; render-side rules are SEAM_RENDER_MECHANICS) and no 3D/perspective transforms as a seam effect — a Z seam is a signed scale change.
  • Never animate display, visibility, or call .play() inside a timeline. Breaks HyperFrames' deterministic seek; use opacity + pointer-events.
  • Never animate <img> dimensions directly. Wrap the <img> in a non-timed <div> and animate the wrapper's transform. Direct dimension tweens trigger layout recompute that breaks deterministic seek.
  • Never use tl.from() for opacity tweens. GSAP records the end-state at registration; if the CSS rest is opacity:0 the recorded end is opacity:0 (the tween goes nowhere), and under stagger later instances re-hide elements earlier ones revealed. Always use tl.fromTo(target, {opacity:0,...}, {opacity:1,...}, pos).
  • Never ship a partly wired <video> in a clip scene. The runtime frame-syncs only videos carrying data-start. lint catches a bare one — media_missing_data_start and media_missing_id are both errors on the pinned CLI, and check skips the browser when lint errors. What no rule covers is a partly wired video: there is no lint code for data-media-start or for a media element's data-track-index, so a video with id and data-start but the wrong offset plays the wrong footage with every gate green. The whole contract is id + data-start="0" + data-duration (loader's crossfade-extended window, not the bare clip length) + data-media-start (storyboard Clip in) + data-track-index="0" — see workflows/phase-3-design.md § Clip scene.

Common edits

  • Add a voice → the voice contract is stated in three places and all three must agree: the ## ElevenLabs Voice IDs table in SKILL.md, the ## Voices table in README.md, and the picker the user actually answers in workflows/phase-1-storytelling.md (plus its worked elevenlabs:<name>:<id> example). A voice added to the tables but not the picker can never be chosen; one added to the picker but not the tables records an id nothing documents. test/unit/test_voice_parity.py enforces the three-way agreement. Those IDs are the user-facing contract that the brief's voice field spells out and the media-use engine's ElevenLabs route synthesizes; no script in this repo resolves them any more.
  • Change the scene-builder contract → sub-agents/scene-builder-delta.md is the role text every frame packet ships, and it is a delta: it only re-points conventions of FRAME_WORKER_CORE and adds local law, so anything already stated upstream does not belong in it. Change the packet's shape (what the five items are, what is forbidden in one) in workflows/phase-3-design.md Step 3.3, the dispatch rules in Step 3.4, and re-dispatch in workflows/phase-4-production.md Step 4.6 — those three plus the delta must stay consistent, and SKILL.md § Pipeline summarizes them. Two invariants a change may not quietly drop: a packet carries no reasoning/ or grammar/ file (ADR-004), and recipe bodies are inlined at dispatch and never written into a committed file (ADR-002). If a runtime has no dispatch capability, the builds run inline — see SKILL.md § Runtime Compatibility.
  • Change the audio path → Phase 5's primary generator is the media-use audio engine, wired in workflows/phase-5-audio.md; confirmed Kokoro narration uses TTS_LOCAL directly with its native language and a separate ASR code/model. Its capabilities (AUDIO_ENGINE, BGM, SFX, TRANSCRIBE, TTS_LOCAL, CAPTIONS_AUTHORING, TRANSCRIPT_HANDLING) are cited by symbol and resolved through compat/ecosystem.md, so an upstream relayout is a one-row edit there, never a workflow edit. The delegation seam is fixed: generation may move, but the exact-track music confirmation, scripts/caption_gen.py's review contract, the verified mix recipes, and render approval are this skill's governance (ADR-001) and are never handed to the engine. M6 removed the local acquisition fallbacks, so there is nothing left to fall back to for synthesis or music search: with no engine, narration is npx hyperframes tts on a confirmed local voice and the bed is user-provided. generate_voiceover.py --assemble-only stays on both paths — never fold it into the engine, and never delete the file while doing audio work. Language choices come from the actual model/voice catalog (TTS_LANGUAGE_DISCOVERY), not a curated voice list's size. Keep request/profile/preparation/section seals coherent; settings changes cannot reuse unchanged-text takes, and neither attestations nor the assembler's explicit unverified override are workflow repairs. Captions always compare the confirmed narration locale, not the authored-text locale; review remains mandatory for every language.
  • Change a transition → edit that seam's row in the seam ledger, then re-stamp and re-verify (SEAM_STAMP → SEAM_VERIFIER). Never hand-tune easing at the boundary until the gate goes green: the mechanics are motion-doctrine's (SEAM_LAW, row schema SEAM_GATE_REFERENCE), the named seam techniques and their parameters are cut-the-curve's (CUT_CATALOG), and the numeric gate outranks any prose in this repo. The ledger's location and its place in the Phase-4 order are in workflows/phase-4-production.md; patterns/transition-catalog.md only maps moments to families. This repo adds nothing but the narrowing bans in SKILL.md § DON'Ts.
  • Change phase logic → edit the relevant workflows/phase-N-*.md; update the prerequisite list in SKILL.md if a new required file is introduced.
  • Change the Creative Brief schema → update templates/project-plan.md, scripts/validate_brief.py, workflow field names, and validator tests together. Story fields stale Phase 1–5; only final_music_track is audio-only and stales Phase 5. visual_ceiling is derived | flat and is a ceiling, never a request: flat bars three/html-in-canvas/typegpu film-wide, and derived grants nothing — capability derivation still decides alone (ADR-005). Never add a value meaning "prefer 3D"; that inverts the rule the reasoning layer exists to enforce. It is brief-only and must not enter storyboard frontmatter. The ceiling filters the candidate set after derivation, so a barred frame still records runtime_rejected: — suppressing derivation instead would erase the evidence that 3D was ever warranted. music_strategy's vocabulary is freesound | delegated | user-provided | none, and each pins final_music_track.source differently — the exact Freesound URL, a provenance URI, the literal user-provided, or nothing at all. A delegated bed (retrieved from a provider catalog or generated locally by another skill) has no public page to link and an expiring download URL, so its source is a single-line <skill-name>:<capability>?mode=<retrieve|generate>&query=<url-encoded request>#sha256=<64 hex>: who produced it, by which route actually taken, from which request, and which bytes came out (shasum -a 256 <path> re-checks it offline, years later). prompt= substitutes for query= on a generation; exactly one of the two is required. Never record a delegated track as user-provided — that repurposes a Phase-1 answer given before any candidate existed and erases the only machine-checked provenance the brief carries. The exact-track confirmation gates the mix on every strategy, delegated included.
  • Change the storyboard format → templates/storyboard.md is the shape doc copied into generated projects; reasoning/scene-analysis.md owns the director keys; STORYBOARD_FORMAT (through compat/ecosystem.md) owns the official keys, which this repo does not restate. A new local key must not collide with an official one — test/unit/test_storyboard_extra_keys.py fails if it does, because a colliding bullet is reinterpreted as upstream's field instead of preserved under extra. Adding a director key is an architecture change (the key set is closed at fifteen); adding a capture binding also means updating workflows/phase-1-storytelling.md, the Phase-2/3 readers, and the legacy mapping table in templates/storyboard.md so migrate-storyboard keeps round-tripping.
  • Change the recorded-flow replay contract → the coupled surfaces are: the format/pacing/ledger law in patterns/recorded-flow-capture.md; the take recipe and Step 2.1b consent in workflows/phase-2-capture.md; the recording/recording_steps rows in templates/storyboard.md § Capture and clip keys (scraped by validate_brief.py load_frame_vocabulary and by test_director_keys.py — template rows and the workflow lines that write the bullets must land together); the continue/jump predicates in SKILL.md (replay_flow.py check); the pointer-track consumption in workflows/phase-3-design.md § Clip scene; and the attached-session carve-out in patterns/authenticated-browser-capture.md. Pacing numbers live only in replay_flow.py's profile block (test-asserted). The storyboard legacy mapping table is deliberately untouched: these keys never had a legacy spelling, so there is nothing to round-trip. The two screencast behavior probes (SCREENCAST_POINTER_ABSENCE, SCREENCAST_CONCURRENT_CAPTURE) live in compat/ecosystem.md § Behavior probes.
  • Adjust prerequisite checks → update scripts/check_requirements.sh and its stdlib tests. SKILL.md Phase -1 consumes --json only for direct/default new mode with no project-plan.md; explicit continue/jump skip it.
  • Add a user-interaction prompt in a workflow → write it as a neutral {"questions":[...]} block (the runtime-agnostic schema), introduced by plain prose ("ask the user…", "present selectable options…"). Never name a picker tool (AskUserQuestion, ask_user) or write a literal tool call inside a workflow — the per-runtime binding for the question schema, Skill(<name>), and multiSelect lives in one place: SKILL.md § Runtime Compatibility. This is the "name actions, not tools" rule that keeps the phase content portable; a tool name hard-coded in a phase body is a portability regression. (Qualified MCP names like mcp__chrome-devtools__* are not a violation — they're identical across runtimes; the rule targets names that differ per runtime.)
  • Change where the skill can be installed ($SKILL_HOMES) → SKILL.md § Runtime Compatibility holds the canonical search list. The SKILL_HOMES="…" line appears at seven sites; six of them are markdown blocks that also carry the SKILL_ROOT=… bootstrap and the zsh portability guard — the canonical block itself, the SKILL.md prereq probe, the SKILL_DIR resolver of workflows/phase-3-design.md, both resolvers of workflows/phase-4-production.md (DOCTRINE_SKILL_DIR, Step 4.5; ANIM_SKILL_DIR, Step 4.7), and the SKILL_DIR + MEDIA_SKILL_DIR block of workflows/phase-5-audio.md. The seventh is scripts/check_requirements.sh, which shares only the SKILL_HOMES line: it carries a bash shebang and every call site invokes it under bash, so it word-splits correctly and must not be given the guard (setopt is not a bash builtin). Shell state can't cross the agent's separate bash calls, so the list is re-stated at each bootstrap point rather than sourced. The | delimiter plus IFS='|' preserves skill paths containing spaces. The guard line is load-bearing, not decoration: zsh neither word-splits an unquoted $SKILL_HOMES nor tolerates an unmatched "$home"/*/ glob, so a resolver without it silently resolves to empty and every workflow reads that as "companion skill not installed". Keep all SKILL_HOMES lines byte-identical, and keep the guard identical with them; verify with:
    grep -rho 'SKILL_HOMES="[^"]*"' SKILL.md workflows/*.md scripts/check_requirements.sh | sort -u | wc -l   # must print 1
  • Add a camera move / motion principle / visual metaphor → edit the relevant grammar/ file (camera.md, motion.md, metaphors.md, or three-taxonomy.md) and declare the entry's capability tags in its own row — that declaration is what stage 13 unions, so an entry with no tags is invisible to runtime selection. The tag vocabulary is owned and versioned by reasoning/capability-catalog.md: use its spellings, never invent one, and a genuinely new tag needs a catalog row plus a runtime that serves it before a grammar entry may declare it. Cite upstream vocabulary by bare rule name (coordinate-target-zoom), bare blueprint id (camera-journey), or capability SYMBOL — never an upstream file path, and never a restated mechanism (compat/ecosystem.md § Citing upstream vocabulary; the bare, extension-less form is what keeps the citation legal under test/unit/test_compat_pointers.py). Budget numbers stay in reasoning/scene-analysis.md — cite the table, never copy a number.
  • Write down how upstream behaves (as opposed to where its files live) → the moment you write "the renderer/runtime/engine actually does X, so do Y" — or catch yourself explaining a failure with every gate passes and the output is still wrong — stop and answer one question: name the upstream file that says X. If you can, cite it by SYMBOL and delete your sentence; a committed restatement of upstream mechanism is ADR-002's one illegal form. If you cannot, you have found undocumented upstream behavior, and ADR-002 § Precedence is what makes your sentence legal — but only as the narrowing imperative a builder must obey, and only once it is a ### SYMBOL row in compat/ecosystem.md § Behavior probes carrying a - **Local text.** field naming the file you just edited. test/unit/test_probe_local_text.py checks a row's shape; nothing checks that you wrote one, which is why this bullet is the mechanism and you are the only one holding the knowledge. Two scars: the -g 30 -keyint_min 30 GOP pin landed with the renderer's own warning quoted in its PR body and stayed unregistered for five days (now CLIP_KEYFRAME_DENSITY); and the bare-<video> DON'T asserted "every gate passes green" across seven files when lint errors on it — nobody had read the CLI.
  • Change an ecosystem dependency (an upstream HyperFrames skill, a file inside one, or the npx hyperframes CLI surface) → edit compat/ecosystem.md and nothing else. Note this bullet is about paths and flags; behavior is the bullet above, and reading this one as covering both is how an imperative ends up in a workflow with no probe. Intra-skill file paths for ecosystem skills live there and nowhere else in the repo; every other file names the skill plus the capability SYMBOL and lets that map resolve the path. Skill names are stable public API — name them freely anywhere. Enforced by test/unit/test_compat_pointers.py. To take an upstream update: npx hyperframes skills update → bash test/run.sh → commit skills-lock.json only when green (full procedure, incl. the pointer sweep and behavior probes, in compat/ecosystem.md § Pin and update policy). Cadence: milestone boundaries or monthly, whichever comes first.
  • Edit an agent instruction file (CLAUDE.md, .github/copilot-instructions.md, AGENTS.md) → they are deliberately not copies of each other: the Copilot file is a condensed rewrite for that runtime and AGENTS.md is a discovery note. What they must share is facts, so test/unit/test_instruction_parity.py checks each one against the repository — every scripts/…/workflows/… path it names must exist, every companion skill it names must be real, and no file may require a deprecated gate. It exists because this drifted twice: the Copilot mirror kept requiring lint|inspect|validate after check replaced it (M0), then described search_music.py and a gsap skill after both were gone (M6). Neither was visible in a diff of the two files, because the other file was correct.
  • Bump skill metadata → frontmatter at top of SKILL.md (especially allowed-tools if a new MCP tool is needed).
  • Bump the GSAP version → gsap-pin.json is the authority. Ten authored <script> tags carry the version and its Subresource Integrity hash as literals (a template is copied verbatim into a generated project, so it cannot read a variable), which makes single-sourcing a matter of naming the authority rather than removing the copies: test/unit/test_gsap_pin.py holds every copy to the pin, and CI re-fetches the pinned version to confirm the hash actually belongs to it. A hash that does not match its version is refused by the browser and every scene renders with no animation — silent until npx hyperframes check at the Phase 4/5 gate; a missing crossorigin="anonymous" fails the same way, because SRI on a cross-origin script requires CORS. Edit gsap-pin.json, recompute, propagate to templates/scene-*.html and the skeletons in workflows/phase-3-design.md + workflows/phase-4-production.md, then bash test/run.sh. example/index.html and CHANGELOG.md are records and deliberately do not track the pin:
    V=3.x.y   # new version — set it in gsap-pin.json too
    curl -sL https://cdn.jsdelivr.net/npm/gsap@$V/dist/gsap.min.js | openssl dgst -sha384 -binary | base64

Installation paths users invoke

# Recommended — the skills CLI auto-detects the agent and resolves its skills home:
npx skills add nebrass/hve-video-director                                   # project install
npx skills add nebrass/hve-video-director --global                         # global (Claude Code default)
npx skills add nebrass/hve-video-director --agent github-copilot --global  # global for Copilot CLI

# Fallback — manual git clone into the agent's skills home:
git clone https://github.com/nebrass/hve-video-director.git ~/.claude/skills/hve-video-director

The repo ships a Claude Code plugin manifest at root (.claude-plugin/plugin.json + marketplace.json, source ./) plus a root AGENTS.md. Other agents (GitHub Copilot CLI, OpenCode, Pi, Codex, Cursor) need no manifest — they discover the skill by directory convention from the homes npx skills add writes into (.agents/skills/, .claude/skills/, etc.). See AGENTS.md for the per-agent scan paths.

When testing skill changes locally, the global install path is ~/.claude/skills/hve-video-director/ (Claude Code) or ~/.copilot/skills/hve-video-director/ (GitHub Copilot CLI).

Git / release conventions

Commits follow Conventional Commits (feat, fix, docs, style, refactor, chore). Recent history shows feat(audio):, docs:, style(readme):, fix(readme): — match the existing scope style. License is MIT.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.