Skip to content

mgiovani/ai-arsenal / skills/anything-to-skill

anything-to-skill

Verified

Turns a docs site, local folder, PDF or book, YouTube video, playlist or channel, or a topic into a source-grounded, token-efficient agent skill (hub SKILL.md, sectioned references, INDEX, evals), and can compact it into a lean expert skill. Use for "make a skill from these docs", "turn this channel into a skill". Not for a skill from your own description (use create-skill), improving one (use improve-skill) or finding third-party skills (use find-skills).

FileKindSize
SKILL.mdskill md29.0 KB
assets/templates/SKILL.md.tmplother53 B
assets/templates/evals.json.tmplother41 B
assets/templates/trigger-eval.json.tmplother9 B
evals/evals.jsonconfig6.2 KB
evals/trigger-eval.jsonconfig1.9 KB
references/compaction.mdmarkdown5.8 KB
references/evals.mdmarkdown2.9 KB
references/extending.mdmarkdown2.6 KB
references/generated-skill-layout.mdmarkdown7.1 KB
references/interview.mdmarkdown2.7 KB
references/judge.mdmarkdown3.5 KB
references/sources.mdmarkdown11.1 KB
scripts/a2s.pyexecutablescript520 B
scripts/anything_to_skill/__init__.pyscript0 B
scripts/anything_to_skill/cli.pyscript17.5 KB
scripts/anything_to_skill/compact/__init__.pyscript0 B
scripts/anything_to_skill/compact/brief.pyscript8.2 KB
scripts/anything_to_skill/compact/freeze.pyscript3.5 KB
scripts/anything_to_skill/compact/gate.pyscript2.8 KB
scripts/anything_to_skill/compact/layout.pyscript1.6 KB
scripts/anything_to_skill/compact/swap.pyscript3.8 KB
scripts/anything_to_skill/compact/verify.pyscript15.4 KB
scripts/anything_to_skill/core/__init__.pyscript0 B
scripts/anything_to_skill/core/models.pyscript3.1 KB
scripts/anything_to_skill/core/sanitize.pyscript2.1 KB
scripts/anything_to_skill/core/ssrf.pyscript1.8 KB
scripts/anything_to_skill/core/store.pyscript13.8 KB
scripts/anything_to_skill/core/tokens.pyscript147 B
scripts/anything_to_skill/core/workspace.pyscript4.7 KB
scripts/anything_to_skill/emit/__init__.pyscript0 B
scripts/anything_to_skill/emit/link.pyscript612 B
scripts/anything_to_skill/emit/templates.pyscript398 B
scripts/anything_to_skill/emit/verify.pyscript9.7 KB
scripts/anything_to_skill/emit/write.pyscript21.0 KB
scripts/anything_to_skill/laya/__init__.pyscript0 B
scripts/anything_to_skill/laya/apply.pyscript3.1 KB
scripts/anything_to_skill/laya/brain.pyscript6.9 KB
scripts/anything_to_skill/laya/client.pyscript2.2 KB
scripts/anything_to_skill/laya/factcheck.pyscript10.5 KB
scripts/anything_to_skill/laya/judge.pyscript6.8 KB
scripts/anything_to_skill/laya/questions.pyscript2.1 KB
scripts/anything_to_skill/plan/__init__.pyscript0 B
scripts/anything_to_skill/plan/brief.pyscript8.1 KB
scripts/anything_to_skill/plan/index.pyscript912 B
scripts/anything_to_skill/plan/pack.pyscript16.6 KB
scripts/anything_to_skill/plan/priority.pyscript5.0 KB
scripts/anything_to_skill/plan/tree.pyscript19.1 KB
scripts/anything_to_skill/scan/__init__.pyscript0 B
scripts/anything_to_skill/scan/credentials.pyscript1.1 KB
scripts/anything_to_skill/scan/injection.pyscript1.9 KB
scripts/anything_to_skill/scan/quotes.pyscript8.4 KB
scripts/anything_to_skill/scan/unicode.pyscript691 B
scripts/anything_to_skill/sources/__init__.pyscript1.2 KB
scripts/anything_to_skill/sources/local/__init__.pyscript0 B
scripts/anything_to_skill/sources/local/convert.pyscript4.6 KB
scripts/anything_to_skill/sources/local/detect.pyscript178 B
scripts/anything_to_skill/sources/local/run.pyscript4.5 KB
scripts/anything_to_skill/sources/local/walk.pyscript1.1 KB
scripts/anything_to_skill/sources/web/__init__.pyscript0 B
scripts/anything_to_skill/sources/web/browser.pyscript4.2 KB
scripts/anything_to_skill/sources/web/detect.pyscript144 B
scripts/anything_to_skill/sources/web/discover.pyscript21.4 KB
scripts/anything_to_skill/sources/web/extract.pyscript13.0 KB
scripts/anything_to_skill/sources/web/fetch.pyscript8.7 KB
scripts/anything_to_skill/sources/web/frontier.pyscript9.5 KB
scripts/anything_to_skill/sources/web/run.pyscript12.6 KB
scripts/anything_to_skill/sources/web/throttle.pyscript7.3 KB
scripts/anything_to_skill/sources/youtube/__init__.pyscript0 B
scripts/anything_to_skill/sources/youtube/asr.pyscript1.5 KB
scripts/anything_to_skill/sources/youtube/captions.pyscript2.4 KB
scripts/anything_to_skill/sources/youtube/detect.pyscript313 B
scripts/anything_to_skill/sources/youtube/frames.pyscript3.8 KB
scripts/anything_to_skill/sources/youtube/funnel.pyscript7.4 KB
scripts/anything_to_skill/sources/youtube/listing.pyscript5.8 KB
scripts/anything_to_skill/sources/youtube/run.pyscript21.5 KB
scripts/anything_to_skill/sources/youtube/vtt.pyscript3.3 KB
scripts/convert_docling.pyexecutablescript513 B
scripts/crawl_brain.pyexecutablescript637 B
scripts/ingest_local.pyexecutablescript463 B
scripts/ingest_web.pyexecutablescript593 B
scripts/ingest_youtube.pyexecutablescript533 B
scripts/judge.pyexecutablescript481 B
scripts/transcribe.pyexecutablescript689 B
scripts/verify_laya.pyexecutablescript925 B
scripts/youtube_brain.pyexecutablescript598 B

scripts/anything_to_skill/sources/youtube/frames.py

View on GitHub
import importlib.util
import re
import shutil
import subprocess
import tempfile
from collections.abc import Callable
from pathlib import Path
from typing import Any

from anything_to_skill.sources.youtube.listing import YtDlpError, ytdlp

_CUE_PHRASE = re.compile(
    r'as you can see|this slide|on (?:the )?screen|this diagram|the diagram|'
    r'this code|the code here|look at this|here we have',
    re.IGNORECASE,
)
MIN_GAP_S = 10
MAX_FRAMES = 24
FFMPEG_TIMEOUT_S = 60
PHASH_DISTANCE = 5
_STEM = re.compile(r'-(\d+)$')


def frame_timestamps(
    chapters: list[dict],
    cues: list[tuple[float, str]],
    cap: int = MAX_FRAMES,
) -> list[float]:
    """Chapter starts first (they mark topic changes), then cue phrases, spaced apart."""
    wanted = [c['start_time'] + 1 for c in chapters]
    wanted += [at + 1 for at, line in cues if _CUE_PHRASE.search(line)]
    picked: list[float] = []
    for ts in wanted:
        if len(picked) < cap and all(abs(ts - p) >= MIN_GAP_S for p in picked):
            picked.append(ts)
    return sorted(picked)


def seconds_of(path: Path) -> int:
    """Frames are named <prefix>-<seconds>.png; this reads the timestamp back."""
    return int(_STEM.search(path.stem).group(1))  # type: ignore[union-attr]


def _phash(path: Path) -> Any:
    import imagehash  # noqa: PLC0415  # pyright: ignore[reportMissingImports]
    from PIL import Image  # noqa: PLC0415  # pyright: ignore[reportMissingImports]

    with Image.open(path) as img:
        return imagehash.phash(img)


def dedupe(paths: list[Path], hash_fn: Callable[[Path], Any] = _phash) -> list[Path]:
    """Drop stills whose perceptual hash is within PHASH_DISTANCE of one already kept."""
    kept: list[tuple[Path, object]] = []
    for path in paths:
        digest = hash_fn(path)
        if any(digest - other <= PHASH_DISTANCE for _, other in kept):
            path.unlink()
        else:
            kept.append((path, digest))
    return [p for p, _ in kept]


def extract_frames(
    url: str, timestamps: list[float], out_dir: Path, prefix: str = 'frame'
) -> list[Path]:
    """Low-res download plus ffmpeg stills at timestamps, near-duplicates removed by pHash."""
    if not shutil.which('ffmpeg'):
        raise YtDlpError('ffmpeg is required for --frames but was not found on PATH')
    if not (importlib.util.find_spec('imagehash') and importlib.util.find_spec('PIL')):
        raise YtDlpError(
            '--frames needs pillow and imagehash: run through ingest_youtube.py'
        )
    out_dir.mkdir(parents=True, exist_ok=True)
    stills: list[Path] = []
    with tempfile.TemporaryDirectory() as tmp:
        ytdlp(
            [
                '--no-playlist',
                '-f',
                'bv[height<=480]/b[height<=480]/w',
                '-o',
                str(Path(tmp) / 'video.%(ext)s'),
            ],
            url,
            timeout=1800,
        )
        video = next(Path(tmp).glob('video.*'))
        for ts in sorted(timestamps):
            still = out_dir / f'{prefix}-{int(ts):05d}.png'
            try:
                done = subprocess.run(
                    [
                        'ffmpeg',
                        '-loglevel',
                        'error',
                        '-y',
                        '-ss',
                        str(ts),
                        '-i',
                        str(video),
                        '-frames:v',
                        '1',
                        str(still),
                    ],
                    capture_output=True,
                    check=False,
                    timeout=FFMPEG_TIMEOUT_S,
                )
            except subprocess.TimeoutExpired:  # a corrupt download can hang ffmpeg
                continue
            if done.returncode == 0 and still.exists():
                stills.append(still)
    return dedupe(stills)
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall