CtrlK
BlogDocsLog inGet started
Tessl Logo

jbaruch/speaker-toolkit

Seven-skill presentation system: ingest talks into a rhetoric vault, run interactive clarification, generate a speaker profile, create presentations that match your documented patterns, produce the deck illustrations + thumbnail visual layer, publish talk pages to a Jekyll shownotes site, and verify a recorded screencast against its storyboard. Includes a 113-entry Presentation Patterns taxonomy (83 observable: 64 patterns + 19 antipatterns; 30 unobservable: 21 patterns + 9 antipatterns) for scoring, brainstorming, and go-live preparation.

74

Quality

93%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

ytdlp_runtime.pyskills/vault-ingress/scripts/

"""Resolve the yt-dlp console script declared by the toolkit runtime.

The project pins yt-dlp as a Python dependency. A bare ``yt-dlp`` subprocess
still resolves through ``PATH``, where an older system installation can shadow
that pin. Keep every caller on one resolution order: explicit override, the
running interpreter, its active virtual environment, the toolkit virtual
environment, then ``PATH`` as a compatibility fallback.
"""

from __future__ import annotations

import os
from pathlib import Path
import shutil
import sys


# Dependabot renews the pyproject.toml pin weekly. Every such manifest update
# must renew this runtime mirror in the same PR;
# tests/test_check_runtime.py::test_ytdlp_version_authority_is_synchronized
# enforces that the two pins stay identical.
YTDLP_REQUIRED_VERSION = "2026.8.19"
YTDLP_RESOLUTION_FAILURE_CODES = frozenset(
    {
        "ytdlp_override_invalid",
        "ytdlp_not_found",
        "ytdlp_version_unavailable",
    }
)


class YtDlpResolutionError(RuntimeError):
    """No usable yt-dlp executable, with a typed recovery code."""

    def __init__(self, code: str, message: str) -> None:
        if code not in YTDLP_RESOLUTION_FAILURE_CODES:
            raise ValueError("invalid yt-dlp resolution failure code")
        super().__init__(message)
        self.code = code


def resolve_ytdlp() -> Path:
    """Return the pinned yt-dlp console script before consulting ``PATH``."""
    override = os.environ.get("YT_DLP")
    if override:
        candidate = Path(override)
        if candidate.is_file() and os.access(candidate, os.X_OK):
            return candidate
        raise YtDlpResolutionError(
            "ytdlp_override_invalid",
            f"YT_DLP is set to {override!r}, which is not an executable file — "
            "point it at a yt-dlp binary or unset it",
        )

    candidates = [Path(sys.executable).parent / "yt-dlp"]
    virtual_env = os.environ.get("VIRTUAL_ENV")
    if virtual_env:
        candidates.append(Path(virtual_env) / "bin" / "yt-dlp")
    toolkit_root = Path(__file__).resolve().parents[3]
    candidates.append(toolkit_root / ".venv" / "bin" / "yt-dlp")

    seen: set[Path] = set()
    for candidate in candidates:
        if candidate in seen:
            continue
        seen.add(candidate)
        if candidate.is_file() and os.access(candidate, os.X_OK):
            return candidate

    found = shutil.which("yt-dlp")
    if found:
        return Path(found)
    raise YtDlpResolutionError(
        "ytdlp_not_found",
        "cannot find yt-dlp — install the pinned version with `pip install .` "
        "into the toolkit environment, or set YT_DLP to its path",
    )


def normalized_ytdlp_version(value: str) -> tuple[int, int, int] | None:
    """Normalize yt-dlp's calendar version without an external parser."""
    parts = value.strip().split(".")
    if len(parts) != 3 or any(not part.isdecimal() for part in parts):
        return None
    year, month, day = (int(part) for part in parts)
    return year, month, day

skills

vault-ingress

scripts

adherence_baseline.py

aggregate-catalog-feedback.py

apply-source-repairs.py

artifact_locator.py

artifact_metadata.py

artifact_supervisor.py

audit-pattern-catalog.py

audit-persisted-pattern-observations.py

audit-source-identities.py

batch-download-videos.py

build-contact-sheet.py

build-crop-reviewer.py

build-score-basis.py

catalog_dimension_registry.py

catalog_io.py

catalog_normalization.py

check-runtime.py

classify-pptx-evidence.py

cloud_artifacts.py

cooperative_lock.py

crop_frames.py

crop-reviewer-shell.html

crop-reviewer-shell.html.txt

crop-reviewer.js

crop-reviewer.js.txt

establish-date-provenance.py

failure_diagnostics.py

fetch-transcript.py

ingress_contract.py

local_media_contract.py

local_media_download.py

local_media_evidence.py

local_media_process.py

local_media_sampling.py

local_media_transcription.py

local_media_words.py

markdown_deck.py

migrate-tracking-database.py

mutate-tracking-database.py

pattern_evidence.py

pdf_evidence.py

persist-results.py

persisted_pattern_observations.py

pptx_catalog_selection.py

pptx_deck_facts.py

pptx_discovery_contract.py

pptx_evidence.py

pptx_talk_identity.py

pptx-extraction.py

preflight-vault.py

queue_claim_contract.py

queue-state.py

read-tracking-database.py

render-markdown-deck.py

render-vault-status.py

retained_stage.py

return_validation.py

scan-shownotes.py

source_alias_contract.py

source_identity_matching.py

summary_lock.py

sweep-pptx-talk-identity.py

tracking_database_io.py

tracking_database.py

transcript_quality.py

transcript_timing.py

validate-returns.py

vault_root_authority.py

video_evidence.py

video_integrity.py

video-slide-extraction.py

vtt-cleanup.py

write-analysis.py

ytdlp_runtime.py

SKILL.md

README.md

tile.json