Skip to content

garroshub/MixCut-Skill

mixcut

Verified

Create short mixed-cut videos from YouTube clips with automated analysis, clipping, and professional subtitle processing.

FileKindSize
SKILL.mdskill md4.3 KB
scripts/check_dependencies.pyscript966 B
scripts/process_mixcut.pyscript16.8 KB
scripts/skill_loader.pyscript1.9 KB
scripts/utils.pyscript7.9 KB

scripts/skill_loader.py

View on GitHub
import os
import sys
from pathlib import Path


def get_skill_path(skill_name):
    """
    Resolve the path of a sibling skill.
    Prioritizes environment variable OPENCODE_SKILLS_ROOT.
    Falls back to relative path resolution.
    """
    # 1. Check environment variable
    root = os.environ.get("OPENCODE_SKILLS_ROOT")
    if root:
        path = Path(root) / skill_name
        if path.exists():
            return path

    # 2. Check relative path (assuming we are in skills/mixcut/scripts)
    # Base dir is skills/mixcut
    current_script = Path(__file__).resolve()
    # mixcut/scripts -> mixcut -> skills (parent of mixcut)
    # If mixcut is in a "skills" folder
    skills_root = current_script.parent.parent.parent

    path = skills_root / skill_name
    if path.exists():
        return path

    # 3. Check nested skills (e.g. mixcut/skills/skill_name)
    # This supports the structure where dependencies are vendored inside
    nested_path = current_script.parent.parent / "skills" / skill_name
    if nested_path.exists():
        return nested_path

    raise FileNotFoundError(
        f"Skill {skill_name} not found. Please ensure it is installed in the same directory as mixcut or in mixcut/skills."
    )


def load_skill_module(skill_name, module_name, script_dir="scripts"):
    """
    Dynamically load a module from a skill.
    """
    skill_path = get_skill_path(skill_name)

    # Determine the directory containing the python files
    # Some skills have them in root, some in scripts/
    target_dir = skill_path
    if (skill_path / script_dir).exists():
        target_dir = skill_path / script_dir
    elif (skill_path / f"{skill_name}.py").exists():
        target_dir = skill_path

    target_dir_str = str(target_dir)

    if target_dir_str in sys.path:
        sys.path.remove(target_dir_str)
    sys.path.insert(0, target_dir_str)

    return __import__(module_name)
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated 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: 194kUpdated Claude CodeCodexVerifiedInstall