import os
from pathlib import Path
from dotenv import load_dotenv


def load_unified_env():
    skills_root = Path(__file__).resolve().parent.parent
    env_path = skills_root / ".env"
    if env_path.exists():
        load_dotenv(env_path)
        return
    legacy = Path.home() / ".config" / "opencode" / ".env"
    if legacy.exists():
        load_dotenv(legacy)
