Skip to content

sergebulaev/youtube-skills

youtube-marketing

Verified

Plan, write, and publish for YouTube and YouTube Shorts. Use when the user wants high-CTR video titles, an SEO description with chapters and links, a first-30-seconds retention script (or a 3-second Shorts hook), a designer-ready thumbnail brief, a community-tab post or poll, or a weekly upload plan. The user supplies the video; the skills produce the title, description, hook, and thumbnail brief, then on approval upload and schedule via the Publora API.

scripts/check_security_boundaries.py

View on GitHub
#!/usr/bin/env python3
"""Three trust boundaries this bundle is not allowed to reopen.

Reported against the linkedin bundle (sergebulaev/linkedin-skills#68) and
present here in the same shape, because these clients share an ancestor.

1. **A project .env may not name an executable.** load_env() once copied every
   variable it found into the environment, and the DIY tier reads
   YOUTUBE_SKILLS_CUSTOM_POSTER from there and runs it through subprocess. A .env
   that arrives with a clone, or lands in a parent directory, was therefore a
   command this bundle would execute. Only credentials load now.
2. **No module may load a .env behind load_env's back.** A direct load_dotenv()
   call reopens boundary 1 for whatever imports it.
3. **Authenticated requests may not follow redirects.** The Publora key rides a
   custom header and the Apify token rides a query parameter; requests strips
   Authorization across hosts but not either of those, so a redirect hands the
   credential, and on POST the body, to whoever answered.

Run from the repo root:

    python3 scripts/check_security_boundaries.py
"""
import pathlib
import re
import sys

ROOT = pathlib.Path(__file__).resolve().parent.parent
ENV = ROOT / "lib" / "_env.py"
POSTER = "YOUTUBE_SKILLS_CUSTOM_POSTER"
CLIENTS = ("publora_client.py", "apify_client.py", "youtube_client.py", "pixfaro_client.py")
DOTENV_CALL = re.compile(r"load_dotenv\s*\(")
CALL = re.compile(r"((?:self\._session|requests)\.(?:get|post|put|delete)\()")


def call_bodies(source: str):
    """(offset, body) for every HTTP call, parens matched so multi-line is fine."""
    for match in CALL.finditer(source):
        depth, i = 1, match.end()
        while depth and i < len(source):
            if source[i] == "(":
                depth += 1
            elif source[i] == ")":
                depth -= 1
            i += 1
        yield match.start(), source[match.end():i - 1]


def main() -> int:
    problems = []

    env = ENV.read_text(encoding="utf-8")
    if "_DOTENV_VARIABLES" not in env:
        problems.append(
            "lib/_env.py has no _DOTENV_VARIABLES allowlist, so a project .env can set "
            "anything, including the command the DIY tier executes.")
    if DOTENV_CALL.search(env):
        problems.append(
            "lib/_env.py calls load_dotenv(), which loads every variable in the file. "
            "Read the allowlisted names with dotenv_values() instead.")
    if POSTER in env:
        problems.append(
            f"lib/_env.py names {POSTER}. The variable the bundle executes must come "
            f"from the launch environment, never from a file on disk.")

    for path in sorted((ROOT / "scripts").glob("*.py")) + sorted((ROOT / "lib").glob("*.py")):
        if path.name in ("_env.py", pathlib.Path(__file__).name):
            continue
        if DOTENV_CALL.search(path.read_text(encoding="utf-8")):
            problems.append(
                f"{path.relative_to(ROOT)} calls load_dotenv() directly, which bypasses the "
                f"allowlist in lib/_env.py. Import from lib instead.")

    for name in CLIENTS:
        path = ROOT / "lib" / name
        if not path.is_file():
            continue
        source = path.read_text(encoding="utf-8")
        for offset, body in call_bodies(source):
            if "allow_redirects" not in body:
                line = source[:offset].count("\n") + 1
                problems.append(
                    f"lib/{name}:{line}: an authenticated request without "
                    f"allow_redirects=False. A redirect would forward the credential.")

    if problems:
        print("Security boundaries:\n" + "\n".join("  " + p for p in problems))
        return 1

    print("OK: .env cannot name an executable, nothing loads it behind load_env, and no "
          "authenticated request follows redirects.")
    return 0


if __name__ == "__main__":
    sys.exit(main())
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall