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/dashboard_server.py

View on GitHub
#!/usr/bin/env python3
"""Strictly read-only local dashboard over libraries, projects and recap runs.

    python3 scripts/dashboard_server.py --root <dir> [--port 0] [--open]

Serves ``assets/dashboard/`` and a small GET-only JSON API built by ``dashboard.data``.
Always binds to 127.0.0.1, checks Host / Origin against the bound port (DNS-rebinding guard),
answers every method other than GET / HEAD with 405, and serves only files that resolve
inside ``--root``. Nothing here writes to disk. Runs in the foreground until Ctrl+C.
"""
from __future__ import annotations

import argparse
import json
import re
import sys
import webbrowser
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from urllib.parse import parse_qs, urlsplit

import dashboard.data as dashboard_data
import dashboard.io as dashboard_io
from dashboard.io import Refused

ASSET_DIR = Path(__file__).resolve().parent.parent / "assets" / "dashboard"
ASSETS = {
    "/": ("index.html", "text/html; charset=utf-8"),
    "/index.html": ("index.html", "text/html; charset=utf-8"),
    "/tokens.css": ("tokens.css", "text/css; charset=utf-8"),
    "/styles.css": ("styles.css", "text/css; charset=utf-8"),
    "/app.js": ("app.js", "text/javascript; charset=utf-8"),
    "/views.js": ("views.js", "text/javascript; charset=utf-8"),
}
API = {
    "/api/overview": lambda root, query: dashboard_data.overview(root),
    "/api/search": lambda root, query: dashboard_data.search(root, _param(query, "q")),
    "/api/library": lambda root, query: dashboard_data.library_detail(root, _path(query)),
    "/api/project": lambda root, query: dashboard_data.project_detail(root, _path(query)),
    "/api/run": lambda root, query: dashboard_data.run_detail(root, _path(query)),
}
SECURITY_HEADERS = {
    "Content-Security-Policy": ("default-src 'self'; media-src 'self'; img-src 'self' data:; "
                                "object-src 'none'; base-uri 'none'; frame-ancestors 'none'; "
                                "form-action 'none'"),
    "X-Content-Type-Options": "nosniff",
    "Referrer-Policy": "no-referrer",
    "Cache-Control": "no-store",
    "Cross-Origin-Resource-Policy": "same-origin",
}
RANGE_RE = re.compile(r"^bytes=(\d*)-(\d*)$")
CHUNK = 64 * 1024


def _param(query: dict, name: str):
    return (query.get(name) or [None])[0]


def _path(query: dict) -> str:
    rel = _param(query, "path")
    if rel is None:
        raise Refused(400, "缺少 path 参数")
    return rel


def _parse_range(header: str, size: int):
    """``(start, end)`` inclusive for a single byte range, None for a full response,
    or ``"invalid"`` when the range cannot be satisfied."""
    if not header:
        return None
    match = RANGE_RE.match(header.strip())
    if not match or (not match[1] and not match[2]):
        return "invalid"
    if not match[1]:
        length = int(match[2])
        if length == 0 or size == 0:
            return "invalid"
        return max(size - length, 0), size - 1
    start = int(match[1])
    end = int(match[2]) if match[2] else size - 1
    if start >= size or end < start:
        return "invalid"
    return start, min(end, size - 1)


class DashboardHandler(BaseHTTPRequestHandler):
    server_version = "video-recap-dashboard"
    sys_version = ""
    _head = False

    # Every method other than GET / HEAD lands here (http.server dispatches ``do_<METHOD>``).
    def __getattr__(self, name):
        if name.startswith("do_"):
            return self._method_not_allowed
        raise AttributeError(name)

    def _method_not_allowed(self):
        # Drain a small request body so the client reads the 405 instead of a reset socket.
        length = self.headers.get("Content-Length", "0")
        if length.isdigit() and 0 < int(length) <= 1024 * 1024:
            self.rfile.read(int(length))
        self._send_json(405, {"error": "只读 dashboard:只允许 GET / HEAD"}, extra={"Allow": "GET, HEAD"})

    def do_GET(self):
        self._dispatch(head=False)

    def do_HEAD(self):
        self._dispatch(head=True)

    def log_message(self, format, *args):  # noqa: A002 - signature fixed by http.server
        sys.stderr.write(f"[dashboard] {self.address_string()} {format % args}\n")

    # --- guards --------------------------------------------------------------------------
    def _host_allowed(self) -> bool:
        allowed = self.server.allowed_hosts
        host = (self.headers.get("Host") or "").strip().lower()
        if host not in allowed:
            return False
        origin = self.headers.get("Origin")
        if origin is not None and origin.strip().lower() not in {f"http://{h}" for h in allowed}:
            return False
        # Browsers label cross-site subresource requests (<img>, <video>) even without Origin.
        site = (self.headers.get("Sec-Fetch-Site") or "").strip().lower()
        return site not in {"cross-site", "same-site"}

    # --- responses -----------------------------------------------------------------------
    def _start(self, status: int, content_type: str, length: int, extra=None):
        self.send_response(status)
        self.send_header("Content-Type", content_type)
        self.send_header("Content-Length", str(length))
        for key, value in {**SECURITY_HEADERS, **(extra or {})}.items():
            self.send_header(key, value)
        self.end_headers()

    def _send_bytes(self, status: int, body: bytes, content_type: str, extra=None):
        self._start(status, content_type, len(body), extra)
        if not self._head:
            self.wfile.write(body)

    def _send_json(self, status: int, payload, extra=None):
        body = json.dumps(payload, ensure_ascii=False).encode("utf-8")
        self._send_bytes(status, body, "application/json; charset=utf-8", extra)

    def _send_media(self, path: Path):
        size = path.stat().st_size
        content_type = dashboard_io.MEDIA_TYPES[path.suffix.lower()]
        span = _parse_range(self.headers.get("Range", ""), size)
        if span == "invalid":
            self._send_bytes(416, b"", content_type, {"Content-Range": f"bytes */{size}"})
            return
        start, end = span or (0, size - 1)
        length = max(end - start + 1, 0)
        extra = {"Accept-Ranges": "bytes"}
        if span:
            extra["Content-Range"] = f"bytes {start}-{end}/{size}"
        self._start(206 if span else 200, content_type, length, extra)
        if self._head or not length:
            return
        with path.open("rb") as handle:
            handle.seek(start)
            remaining = length
            while remaining:
                chunk = handle.read(min(CHUNK, remaining))
                if not chunk:
                    break
                self.wfile.write(chunk)
                remaining -= len(chunk)

    def _dispatch(self, head: bool):
        self._head = head
        if not self._host_allowed():
            self._send_json(403, {"error": "Host / Origin 不是本机回环地址"})
            return
        parts = urlsplit(self.path)
        query = parse_qs(parts.query, keep_blank_values=True)
        root = self.server.root
        try:
            if parts.path in ASSETS:
                name, content_type = ASSETS[parts.path]
                self._send_bytes(200, (ASSET_DIR / name).read_bytes(), content_type)
            elif parts.path == "/api/media":
                self._send_media(dashboard_io.media_path(root, _path(query)))
            elif parts.path in API:
                self._send_json(200, API[parts.path](root, query))
            else:
                self._send_json(404, {"error": "未知地址"})
        except Refused as exc:
            self._send_json(exc.status, {"error": exc.message})
        except (BrokenPipeError, ConnectionResetError):
            pass
        except Exception as exc:  # noqa: BLE001 - one bad request must not stop the server
            self.log_message("error on %s: %r", self.path, exc)
            self._send_json(500, {"error": f"内部错误: {type(exc).__name__}"})


class DashboardServer(ThreadingHTTPServer):
    daemon_threads = True

    def __init__(self, root: Path, port: int):
        super().__init__(("127.0.0.1", port), DashboardHandler)
        self.root = root
        bound = self.server_address[1]
        self.allowed_hosts = {f"127.0.0.1:{bound}", f"localhost:{bound}"}


def make_server(root, port: int = 0) -> DashboardServer:
    root = Path(root).expanduser().resolve()
    if not root.is_dir():
        raise SystemExit(f"--root 不是目录: {root}")
    return DashboardServer(root, port)


def main(argv=None):
    ap = argparse.ArgumentParser(description="video-recap 只读 dashboard:浏览资源库、项目与运行,不修改任何文件。")
    ap.add_argument("--root", required=True, help="要浏览的目录(资源库、项目、work_dir 都在它下面发现)")
    ap.add_argument("--port", type=int, default=0, help="端口,默认 0 = 随机空闲端口")
    ap.add_argument("--open", action="store_true", help="启动后用默认浏览器打开")
    args = ap.parse_args(argv)
    server = make_server(args.root, args.port)
    url = f"http://127.0.0.1:{server.server_address[1]}/"
    print(f"只读 dashboard: {url}  (root: {server.root};Ctrl+C 退出)", flush=True)
    if args.open:
        webbrowser.open(url)
    try:
        server.serve_forever()
    except KeyboardInterrupt:
        pass
    finally:
        server.server_close()
    return 0


if __name__ == "__main__":
    sys.exit(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