Skip to content

zenstory-ai/video-recap-skills / skills/video-recap

video-recap

Verified

把一段或多集视频做成带画框字幕的中文解说成片或纯原声高光短片。用户提供 .mp4 / .mov / .mkv / .webm,要求做影视解说、短剧二创、加旁白配音、跨集混剪或导出剪映草稿时使用;串联完成看片识台词、定主线与留原声、按台词停顿切镜头、写词检查、TTS 配音与混音加字幕。触发词:视频解说、影视解说、视频旁白、生成解说、视频 recap、video recap、voiceover、narration、recap。

FileKindSize
SKILL.mdskill md18.4 KB
assets/dashboard/app.jsscript16.2 KB
assets/dashboard/index.htmlother867 B
assets/dashboard/styles.cssother22.6 KB
assets/dashboard/tokens.cssother8.9 KB
assets/dashboard/views.jsscript31.4 KB
references/audio-modes.mdmarkdown3.6 KB
references/config-playbook.mdmarkdown8.1 KB
references/creative-editing-playbook.mdmarkdown12.3 KB
references/data-schema.mdmarkdown34.6 KB
references/index-tts.mdmarkdown2.1 KB
references/jianying/LICENSE.duo-videoother1.0 KB
references/jianying/SOURCE.mdmarkdown703 B
references/jianying/empty_draft_meta_info.jsonconfig1.7 KB
references/jianying/empty_jy_material_video.jsonconfig1.8 KB
references/jianying/empty_jy_meta_material_value.jsonconfig358 B
references/jianying/empty_jy_project_info.jsonconfig3.6 KB
references/jianying/empty_jy_segment.jsonconfig1.3 KB
references/jianying/empty_jy_text_styles.jsonconfig440 B
references/jianying/empty_yj_material_audio.jsonconfig865 B
references/jianying/empty_yj_material_text.jsonconfig2.4 KB
references/packaging.mdmarkdown6.8 KB
references/promotional-copy.mdmarkdown4.1 KB
references/prompt-templates.mdmarkdown2.0 KB
references/research-guide.mdmarkdown2.7 KB
references/resource-library.mdmarkdown12.1 KB
references/shot-review.mdmarkdown4.8 KB
scripts/agent_text.pyscript2.7 KB
scripts/artifacts.pyscript972 B
scripts/asr.pyscript12.5 KB
scripts/asr_timing_evidence.pyscript4.2 KB
scripts/assemble.pyscript31.0 KB
scripts/assemble_constants.pyscript894 B
scripts/assembly_contract.pyscript10.3 KB
scripts/assembly_settings.pyscript3.8 KB
scripts/audio_automation.pyscript6.6 KB
scripts/audio_mix.pyscript18.5 KB
scripts/briefing/__init__.pyscript101 B
scripts/briefing/builder.pyscript31.1 KB
scripts/briefing/context.pyscript6.1 KB
scripts/briefing/timeline.pyscript23.0 KB
scripts/codec_peak.pyscript5.1 KB
scripts/cut.pyscript148 B
scripts/cut_cli.pyscript12.4 KB
scripts/cut_contract.pyscript13.3 KB
scripts/cut_qc.pyscript1.9 KB
scripts/cut_render.pyscript13.2 KB
scripts/dashboard/__init__.pyscript159 B
scripts/dashboard/data.pyscript24.6 KB
scripts/dashboard/io.pyscript7.1 KB
scripts/dashboard/runs.pyscript21.8 KB
scripts/dashboard/templates.pyscript9.6 KB
scripts/dashboard_server.pyscript9.3 KB
scripts/detect.pyscript22.2 KB
scripts/doctor.pyexecutablescript12.9 KB
scripts/entry_suggestion.pyscript4.6 KB
scripts/export_jianying.pyscript5.6 KB
scripts/extract.pyscript2.5 KB
scripts/final_qc.pyscript19.0 KB
scripts/frame_grid.pyscript10.6 KB
scripts/jianying/__init__.pyscript49 B
scripts/jianying/builders.pyscript11.3 KB
scripts/jianying/model.pyscript2.7 KB
scripts/jianying/optional.pyscript1012 B
scripts/jianying/schema.pyscript2.5 KB
scripts/jianying/templates.pyscript1.0 KB
scripts/jianying/timeline_contract.pyscript5.8 KB
scripts/jianying/tracks.pyscript2.0 KB
scripts/jianying/writer.pyscript7.8 KB
scripts/lib.pyscript29.6 KB
scripts/library.pyscript31.1 KB
scripts/lint_summary.pyscript5.0 KB
scripts/loudness.pyscript14.7 KB
scripts/materials.pyscript22.1 KB
scripts/media.pyscript18.8 KB
scripts/narration_audio.pyscript13.5 KB
scripts/narration_lint.pyscript24.1 KB
scripts/narrative_selection.pyscript8.9 KB
scripts/packaging.pyscript6.1 KB
scripts/packaging_fonts.pyscript12.0 KB
scripts/packaging_plates.pyscript31.2 KB
scripts/packaging_studio.pyscript34.1 KB
scripts/providers/__init__.pyscript72 B
scripts/providers/fish_audio.pyscript3.1 KB
scripts/providers/index_tts.pyscript8.8 KB
scripts/recap.pyscript183 B
scripts/recap_cli.pyscript6.9 KB
scripts/recap_inspect.pyscript16.5 KB
scripts/recap_runner.pyscript22.0 KB
scripts/recap_runtime.pyscript11.8 KB
scripts/recap_source.pyscript1.8 KB
scripts/recap_stage_qc.pyscript2.7 KB
scripts/recap_timeline.pyscript7.7 KB
scripts/render_preflight.pyscript1.7 KB
scripts/resources/__init__.pyscript200 B
scripts/resources/lock.pyscript6.8 KB
scripts/resources/project_binding.pyscript16.1 KB
scripts/sentence_boundaries.pyscript28.8 KB
scripts/sentence_gate.pyscript8.6 KB
scripts/sfx_mix.pyscript14.6 KB
scripts/shot_review.pyscript18.9 KB
scripts/source_subtitles.pyscript7.2 KB
scripts/speech_ownership.pyscript9.3 KB
scripts/storyboard.pyscript21.8 KB
scripts/subtitles/__init__.pyscript56 B
scripts/subtitles/core.pyscript19.0 KB
scripts/subtitles/render.pyscript8.0 KB
scripts/timeline.pyscript8.2 KB
scripts/timeline_emit.pyscript5.4 KB
scripts/tts_audio.pyscript9.6 KB
scripts/tts_cache.pyscript4.5 KB
scripts/understand.pyscript171 B
scripts/understanding_brief.pyscript6.3 KB
scripts/understanding_cache.pyscript8.0 KB
scripts/understanding_runner.pyscript9.8 KB
scripts/understanding_storyboard.pyscript11.9 KB
scripts/validate.pyscript5.7 KB
scripts/visual_render.pyscript10.1 KB
scripts/vlm.pyscript16.4 KB
scripts/voiceover.pyscript28.0 KB

scripts/doctor.py

View on GitHub
#!/usr/bin/env python3
"""Environment doctor for the video-recap skill bundle.

The pipeline runs on ffmpeg + MiMo for understanding; voiceover may explicitly use
MiMo, Fish Audio, or a privately configured Index TTS endpoint.
"""
from __future__ import annotations

import argparse
import json
import os
import shutil
import sys
import urllib.parse
from pathlib import Path

from lib import (
    CONFIG,
    TTS_PROVIDERS,
    broken_homebrew_ffmpeg_full_path,
    env_bool,
    ffmpeg_filters,
    prefer_homebrew_ffmpeg_full,
)


SCRIPT_DIR = Path(__file__).resolve().parent
# index-tts is checked as hard failures below; these providers only need a key.
TTS_KEY_HINTS = {
    "mimo-tts": "MIMO_TTS_API_KEY or MIMO_API_KEY",
    "fish-audio": "FISH_API_KEY",
}


def _command_path(name: str) -> str | None:
    return shutil.which(name)


def _asr_status() -> dict[str, object]:
    configured = bool(CONFIG["mimo_asr_api_key"])
    return {
        "configured": configured,
        "available": configured,
        "mimo_asr_model": CONFIG["mimo_asr_model"],
        "mimo_asr_api_url": CONFIG["mimo_asr_api_url"],
        "mimo_asr_api_url_source": CONFIG["mimo_asr_api_url_source"],
        "mimo_asr_language": CONFIG["mimo_asr_language"],
        "mimo_asr_env_var": CONFIG["mimo_asr_env_var"],
        "note": "ASR uses MiMo (mimo-v2.5-asr); set MIMO_API_KEY, or run with --skip-asr.",
    }


def _index_tts_status() -> dict[str, object]:
    """Validate private Index settings locally without exposing or contacting them."""
    endpoint = os.environ.get("INDEX_TTS_ENDPOINT", "")
    voice = os.environ.get("INDEX_TTS_VOICE", "").strip()
    has_forbidden_control = any(
        ord(char) < 32 or ord(char) == 127 for char in endpoint
    )
    try:
        parsed = urllib.parse.urlsplit(endpoint) if endpoint else None
        port = parsed.port if parsed else None
    except ValueError:
        parsed = None
        port = None
    endpoint_format_valid = bool(
        parsed
        and not has_forbidden_control
        and parsed.scheme in {"http", "https"}
        and parsed.hostname
        and "@" not in parsed.netloc
        and not parsed.query
        and not parsed.fragment
        and (port is None or 1 <= port <= 65535)
    )
    return {
        "index_tts_endpoint_set": bool(endpoint),
        "index_tts_endpoint_format_valid": endpoint_format_valid,
        "index_tts_voice_set": bool(voice),
        "index_tts_configured": endpoint_format_valid and bool(voice),
        "connectivity_checked": False,
        "validation_scope": "offline configuration only; connectivity and acoustic quality not checked",
    }


def build_report(*, tts_provider: str | None = None) -> dict[str, object]:
    filters = ffmpeg_filters()
    ffmpeg_path = _command_path("ffmpeg") or ""
    ffprobe_path = _command_path("ffprobe") or ""
    mimo_tts_configured = bool(CONFIG["mimo_tts_api_key"])
    fish_tts_configured = bool(CONFIG["fish_api_key"])
    index_tts = _index_tts_status()
    if tts_provider is not None and str(tts_provider).strip():
        raw_provider = str(tts_provider)
    elif "TTS_PROVIDER" in os.environ:
        raw_provider = os.environ.get("TTS_PROVIDER") or "auto"
    else:
        raw_provider = str(CONFIG.get("tts_provider") or "auto")
    requested_tts_provider = (raw_provider.strip() or "auto").lower()
    effective_tts_provider = requested_tts_provider
    if requested_tts_provider == "auto":
        effective_tts_provider = (
            "mimo-tts" if mimo_tts_configured or not fish_tts_configured else "fish-audio"
        )
    if effective_tts_provider == "fish-audio":
        tts_configured = fish_tts_configured
        tts_model = CONFIG["fish_tts_model"]
    elif effective_tts_provider == "index-tts":
        tts_configured = index_tts["index_tts_configured"]
        tts_model = "provider-managed"
    else:
        tts_configured = mimo_tts_configured
        tts_model = CONFIG["mimo_tts_model"]
    subtitle_filter = "subtitles" in filters
    burn_explicit = "BURN_SUBTITLES" in os.environ and env_bool("BURN_SUBTITLES", True)
    if not ffmpeg_path:
        subtitle_delivery = "unavailable"
    elif subtitle_filter:
        subtitle_delivery = "burned"
    else:
        # The default burn degrades to the .srt sidecar; an explicit request fails fast.
        subtitle_delivery = "fails_explicit_burn" if burn_explicit else "sidecar_srt"
    checks = {
        "system_tools": {
            "ffmpeg": bool(ffmpeg_path),
            "ffmpeg_path": ffmpeg_path,
            "ffprobe": bool(ffprobe_path),
            "ffprobe_path": ffprobe_path,
            "ffmpeg_subtitles_filter": subtitle_filter,
            "ffmpeg_ass_filter": "ass" in filters,
            "burn_subtitles_ready": bool(ffmpeg_path and subtitle_filter),
            "subtitle_delivery": subtitle_delivery,
        },
        "tts": {
            "provider": effective_tts_provider,
            "requested_provider": requested_tts_provider,
            "mimo_tts_configured": mimo_tts_configured,
            "mimo_tts_api_url": CONFIG["mimo_tts_api_url"],
            "mimo_tts_api_url_source": CONFIG["mimo_tts_api_url_source"],
            "mimo_tts_model": CONFIG["mimo_tts_model"],
            "mimo_tts_model_source": CONFIG["mimo_tts_model_source"],
            "mimo_tts_voice": CONFIG["mimo_tts_voice"],
            "mimo_tts_voice_source": CONFIG["mimo_tts_voice_source"],
            "fish_tts_configured": fish_tts_configured,
            "fish_tts_api_url": CONFIG["fish_tts_api_url"],
            "fish_tts_model": CONFIG["fish_tts_model"],
            "fish_tts_reference_id_set": bool(CONFIG["fish_tts_reference_id"]),
            "fish_tts_reference_id_source": CONFIG["fish_tts_reference_id_source"],
            **index_tts,
            "model": tts_model,
            "available": tts_configured,
        },
        "asr": _asr_status(),
        "api_config": {
            "api_provider": CONFIG["api_provider"],
            "api_url": CONFIG["api_url"],
            "api_url_source": CONFIG["api_url_source"],
            "api_env_var": CONFIG["api_env_var"],
            "api_key_set": bool(CONFIG["api_key"]),
            "vlm_model": CONFIG["vlm_model"],
            "vlm_model_source": CONFIG["vlm_model_source"],
            "vlm_workers": CONFIG["vlm_workers"],
        },
        "python": {
            "executable": sys.executable,
            "version": sys.version.split()[0],
        },
    }

    failures: list[str] = []
    warnings: list[str] = []
    tools = checks["system_tools"]
    for name in ("ffmpeg", "ffprobe"):
        if not tools[name]:
            failures.append(f"Missing system tool: {name}")
    if requested_tts_provider not in TTS_PROVIDERS:
        failures.append(
            "TTS_PROVIDER must be one of: " + ", ".join(TTS_PROVIDERS)
        )
    elif requested_tts_provider == "index-tts":
        if not index_tts["index_tts_endpoint_set"]:
            failures.append("INDEX_TTS_ENDPOINT is not set")
        elif not index_tts["index_tts_endpoint_format_valid"]:
            failures.append(
                "INDEX_TTS_ENDPOINT must be an http/https URL with a hostname and no credentials, query, or fragment"
            )
        if not index_tts["index_tts_voice_set"]:
            failures.append("INDEX_TTS_VOICE is not set")
    broken_full = (
        broken_homebrew_ffmpeg_full_path(ffmpeg_path)
        if subtitle_delivery in {"sidecar_srt", "fails_explicit_burn"}
        else None
    )
    full_hint = (
        f" (detected broken ffmpeg-full at {broken_full}; run `brew reinstall ffmpeg-full`)"
        if broken_full
        else ""
    )
    if subtitle_delivery == "sidecar_srt":
        warnings.append(
            "ffmpeg lacks subtitles/libass filter; the default run will not burn subtitles and "
            "delivers a .srt sidecar instead (explicit --burn-subtitles fails): "
            f"install an ffmpeg build with libass to burn them{full_hint}"
        )
    elif subtitle_delivery == "fails_explicit_burn":
        warnings.append(
            "ffmpeg lacks subtitles/libass filter and BURN_SUBTITLES asks for burn-in, so runs "
            "will stop at preflight: unset BURN_SUBTITLES to get a .srt sidecar, pass "
            f"--no-burn-subtitles, or install an ffmpeg build with libass{full_hint}"
        )
    if not checks["api_config"]["api_key_set"]:
        failures.append("MIMO_API_KEY is not set; the default ASR / VLM path requires MiMo")
    if not tts_configured and effective_tts_provider in TTS_KEY_HINTS:
        warnings.append(
            f"TTS provider {effective_tts_provider} not configured: "
            f"set {TTS_KEY_HINTS[effective_tts_provider]} before voiceover"
        )
    if not checks["asr"]["available"]:
        warnings.append("ASR not configured (MIMO_API_KEY); pipeline can run with --skip-asr")
    return {
        "ok": not failures,
        "repo_root": str(SCRIPT_DIR.parents[2]),
        "checks": checks,
        "failures": failures,
        "warnings": warnings,
    }


def _status_icon(ok: bool, *, warning: bool = False) -> str:
    if ok:
        return "✓"
    return "!" if warning else "✗"


def _print_human(report: dict) -> None:
    checks = report["checks"]
    print("video-recap doctor")
    print(f"Repo root: {report['repo_root']}")

    system = checks["system_tools"]
    print("\n[system]")
    print(f"{_status_icon(system['ffmpeg'])} ffmpeg: {system['ffmpeg_path'] or 'not found'}")
    print(f"{_status_icon(system['ffprobe'])} ffprobe: {system['ffprobe_path'] or 'not found'}")
    print(
        f"{_status_icon(system['ffmpeg_subtitles_filter'], warning=True)} "
        f"ffmpeg subtitles/libass filter: "
        f"{'available' if system['ffmpeg_subtitles_filter'] else 'missing'}"
        f" (subtitles: {system['subtitle_delivery']})"
    )

    api = checks["api_config"]
    print("\n[api]")
    print(f"✓ API provider: {api['api_provider']}")
    print(f"✓ API URL: {api['api_url']} (source: {api['api_url_source']})")
    print(
        f"{_status_icon(api['api_key_set'])} "
        f"{api['api_env_var']}: {'set' if api['api_key_set'] else 'not set'}"
    )
    print(f"✓ VLM model: {api['vlm_model']} (source: {api['vlm_model_source']})")
    print(f"✓ VLM_WORKERS: {api['vlm_workers']}")

    asr = checks["asr"]
    print("\n[asr]")
    print(
        f"{_status_icon(asr['available'], warning=True)} "
        f"MiMo ASR: {'configured' if asr['available'] else 'not configured'} "
        f"(key: {asr['mimo_asr_env_var']})"
    )
    print(f"✓ ASR model: {asr['mimo_asr_model']}")
    print(f"✓ ASR API URL: {asr['mimo_asr_api_url']} (source: {asr['mimo_asr_api_url_source']})")
    print(f"✓ ASR language: {asr['mimo_asr_language']}")
    if not asr["available"]:
        print(f"  note: {asr['note']}")

    tts = checks["tts"]
    print("\n[tts]")
    print(
        f"{_status_icon(tts['available'])} {tts['provider']}: "
        f"{'configured' if tts['available'] else 'not configured'}"
    )
    print(f"✓ TTS model: {tts['model']}")
    if tts["provider"] == "fish-audio":
        print(
            "✓ TTS voice reference ID: "
            f"{'set' if tts['fish_tts_reference_id_set'] else 'not set'} "
            f"(source: {tts['fish_tts_reference_id_source']})"
        )
        print(f"✓ TTS API URL: {tts['fish_tts_api_url']}")
    elif tts["provider"] == "index-tts":
        print(
            f"{_status_icon(tts['index_tts_endpoint_format_valid'])} "
            "Index TTS endpoint: "
            f"{'configured with valid format' if tts['index_tts_endpoint_format_valid'] else 'missing or invalid'}"
        )
        print(
            f"{_status_icon(tts['index_tts_voice_set'])} Index TTS voice: "
            f"{'configured' if tts['index_tts_voice_set'] else 'not set'}"
        )
        print(f"! Validation scope: {tts['validation_scope']}")
    else:
        print(f"✓ TTS voice: {tts['mimo_tts_voice']} (source: {tts['mimo_tts_voice_source']})")
        print(f"✓ TTS API URL: {tts['mimo_tts_api_url']} (source: {tts['mimo_tts_api_url_source']})")

    if report["warnings"]:
        print("\nWarnings:")
        for warning in report["warnings"]:
            print(f"- {warning}")
    if report["failures"]:
        print("\nStatus: FAILED")
        for failure in report["failures"]:
            print(f"- {failure}")
    else:
        print("\nStatus: OK")


def main() -> int:
    parser = argparse.ArgumentParser(description="Check video-recap runtime prerequisites.")
    parser.add_argument("--json", action="store_true", help="Print machine-readable JSON")
    parser.add_argument(
        "--tts-provider",
        choices=TTS_PROVIDERS,
        default=None,
        help="override the TTS provider for this preflight report",
    )
    args = parser.parse_args()
    prefer_homebrew_ffmpeg_full()

    report = build_report(tts_provider=args.tts_provider)
    if args.json:
        print(json.dumps(report, ensure_ascii=False, indent=2))
        return 0 if report["ok"] else 1

    _print_human(report)
    return 0 if report["ok"] else 1


if __name__ == "__main__":
    raise SystemExit(main())
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall