Skip to content

gooseworks-ai/goose-skills / skills/video/video-production-harness

video-production-harness

Verified

Full video production sequence with script review, actual ingredient choices, controlled generation, editing, evidence-based quality review, polish, captions and delivery. A host binding supplies project storage, authentic approvals, provider access and billing.

FileKindSize
SKILL.mdskill md6.0 KB
auto-fix-from-review-notes.mdmarkdown6.5 KB
auto-refine.mdmarkdown5.3 KB
brainstorm.mdmarkdown3.2 KB
capabilities.mdmarkdown13.6 KB
create-clips.mdmarkdown15.0 KB
create-design-brief.mdmarkdown13.4 KB
create-storyboard.mdmarkdown8.8 KB
edit-clip.mdmarkdown6.4 KB
edit-video.mdmarkdown12.8 KB
lock-character.mdmarkdown12.2 KB
lock-script.mdmarkdown8.7 KB
orchestrator.mdmarkdown10.9 KB
polish.mdmarkdown9.2 KB
preflight-audit.mdmarkdown6.2 KB
promote.mdmarkdown3.2 KB
references/check-severity.mdmarkdown9.7 KB
references/creative-contract-and-review.mdmarkdown11.4 KB
references/creator-grammar.mdmarkdown6.7 KB
references/editorial-review.mdmarkdown6.4 KB
references/genres/ai-creator-ugc.mdmarkdown2.7 KB
references/genres/chat-ui.mdmarkdown2.2 KB
references/genres/hypermotion.mdmarkdown1.4 KB
references/genres/motion-graphics.mdmarkdown1.5 KB
references/genres/narrator-montage.mdmarkdown3.1 KB
references/genres/product-demo.mdmarkdown2.0 KB
references/hook-compatibility.mdmarkdown2.8 KB
references/libraries-look-and-rubric.mdmarkdown6.0 KB
references/product-scale-and-world.mdmarkdown4.2 KB
references/quality-tier.mdmarkdown9.4 KB
references/recipe-format.mdmarkdown7.1 KB
references/review-script-shortform.mdmarkdown11.7 KB
references/shot-routing.mdmarkdown14.9 KB
references/specialist-handoff.mdmarkdown4.7 KB
references/speech-and-route-qualification.mdmarkdown10.1 KB
references/talking-actor.mdmarkdown6.6 KB
release.jsonconfig22.1 KB
review-video.mdmarkdown15.0 KB
scripts/assemble.pyscript11.1 KB
scripts/assemble_sources.pyscript5.7 KB
scripts/assembly_timeline.pyscript11.4 KB
scripts/check_recipe.pyscript9.6 KB
scripts/final_grade.pyscript2.9 KB
scripts/final_measure.pyscript14.1 KB
scripts/final_measure_parts.pyscript14.6 KB
scripts/pack_recipe.pyscript11.3 KB
scripts/qc_evidence.pyscript15.0 KB
scripts/reference_rate.pyscript4.3 KB
scripts/reference_shots.pyscript13.1 KB
scripts/timeline_rules.pyscript10.8 KB
skill.meta.jsonconfig820 B
states/edit-to-delivery.mdmarkdown8.2 KB
states/setup-and-script.mdmarkdown10.8 KB
states/storyboard-and-clips.mdmarkdown8.1 KB
wrap-session.mdmarkdown5.9 KB

scripts/assemble_sources.py

View on GitHub
"""Source probing and the legacy clip-list timeline for assemble.py."""
import hashlib
import json
import math
from pathlib import Path
import subprocess
import sys

_SCRIPTS = str(Path(__file__).resolve().parent)
if _SCRIPTS not in sys.path:
    sys.path.insert(0, _SCRIPTS)
from assembly_timeline import FORMAT  # noqa: E402


def run(args):
    subprocess.run(args, check=True, capture_output=True, text=True, timeout=600)


def probe(file):
    return json.loads(subprocess.check_output(['ffprobe','-v','error','-show_streams','-show_format','-of','json',str(file)],text=True,timeout=60))


def file_sha256(source):
    with Path(source).open('rb') as handle:
        digest = hashlib.sha256()  # file_digest needs Python 3.11; stay 3.9-safe
        for chunk in iter(lambda: handle.read(1024 * 1024), b''):
            digest.update(chunk)
        return digest.hexdigest()


def source_record(path, start, end, speed=1, asset_id=None):
    source=Path(path).resolve()
    return {'asset_id':asset_id or source.name,'sha256':file_sha256(source),'path':str(source),'in_ms':start,'out_ms':end,'speed':speed}


def legacy_timeline(plan):
    """Preserve known legacy sound; unresolved intent never becomes a content pass."""
    segments,cues,issues,position=[],[],[],0
    voice=plan.get('voice_path'); mode=plan.get('speech_mode'); soundtrack=plan.get('soundtrack_modes')
    if mode is None:
        issues.append('Legacy speech mode is unresolved; audio_strategy does not prove its speech source')
    if soundtrack is None:
        issues.append('Legacy soundtrack is unresolved; empty transcription never authorizes muting')
    for number,clip in enumerate(plan.get('clips',[]),1):
        duration=float(clip['duration_s'])
        if not math.isfinite(duration) or duration<=0:
            raise ValueError('Every clip needs a finite positive duration')
        length=round(duration*1000); excerpt=clip.get('source_excerpt') or {}
        start=excerpt.get('start_ms',clip.get('source_in_ms',0)); speed=clip.get('speed',1)
        if not isinstance(speed,(int,float)) or isinstance(speed,bool) or not math.isfinite(speed) or not 0.25<=speed<=4:
            raise ValueError('Source speed must be finite and between 0.25 and 4')
        end=excerpt.get('end_ms',round(start+length*speed))
        source=source_record(clip['path'],start,end,speed,excerpt.get('asset_id',clip.get('asset_id')))
        if excerpt and source['sha256']!=excerpt.get('analysis_revision'):
            raise ValueError('Saved original bytes changed; review the selection again')
        if excerpt and abs((end-start)/speed-length)>1:
            raise ValueError('Saved source bounds differ from final duration')
        info=probe(source['path']); has_audio=any(s['codec_type']=='audio' for s in info['streams'])
        choice=clip.get('native_audio')
        if choice is None and excerpt.get('audio_mode') in ('original','muted'):
            choice='preserve' if excerpt['audio_mode']=='original' else 'muted'
        if voice and has_audio and choice!='muted':
            raise ValueError('External narration cannot implicitly replace native audio, including generated speech. Supply a reviewed source-linked plan.')
        if choice is None:
            choice='preserve' if has_audio else 'muted'
            issues.append(f'Clip {number}: available source sound preserved; its role requires review')
        if choice not in ('preserve','muted'):
            raise ValueError('native_audio must be preserve or muted')
        segment_mode=clip.get('speech_mode',mode); depicts=clip.get('depicts_speech')
        if segment_mode=='native_dialogue' and choice!='preserve':
            raise ValueError('A native-speaking source cannot be muted or replaced by separate narration')
        if depicts is True and segment_mode in ('none','narration'):
            raise ValueError('A speaking face needs linked native speech or an exact audio-driven lip-sync plan')
        if depicts is None:
            issues.append(f'Clip {number}: whether the picture depicts speech is unresolved')
        segment={'id':str(clip.get('id',f'clip-{number}')),'scene_id':str(clip.get('scene_id',f'scene-{number}')),
                 'start_ms':position,'end_ms':position+length,'video':source,'speech_mode':segment_mode,
                 'depicts_speech':depicts,'native_audio':choice}
        for key in ('speech_driver','intent'):
            if clip.get(key): segment[key]=clip[key]
        segments.append(segment)
        if has_audio and choice=='preserve':
            cues.append({'id':f'native-{number}','role':'native_dialogue' if segment_mode=='native_dialogue' else 'source_ambience',
                         'source':source,'start_ms':position,'end_ms':position+length,'gain_db':0,'loop':False,
                         **({'intent':clip['intent']} if clip.get('intent') else {})})
        position+=length
    for key,role in (('voice_path','narration'),('music_path','music')):
        if not plan.get(key): continue
        seconds=float(probe(plan[key])['format']['duration']); end=min(round(seconds*1000),position)
        if not math.isfinite(seconds) or end<=0: raise ValueError(f'{key} has no usable duration')
        cues.append({'id':f'legacy-{role}','role':role,'source':source_record(plan[key],0,end),
                     'start_ms':0,'end_ms':end,'gain_db':plan.get(f'{role}_gain_db',0),'loop':False})
        issues.append(f'Legacy {role}: natural length retained without automatic loop, ducking or padding; placement and mix need review')
    return {'format':FORMAT,'creative_contract_revision':plan.get('creative_contract_revision'),'duration_ms':position,
            'speech_mode':mode,'soundtrack_modes':soundtrack,'segments':segments,'audio_cues':cues,
            'pauses':plan.get('pauses',[]),'required_cue_ids':plan.get('required_cue_ids',[])},issues
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall