Skip to content

MemTensor/skills-vote / integration/skills/skills-vote-local

skills-vote-local

Verified

Use when retrieving the most relevant skills from a local or private skill library instead of relying on network-based skill discovery.

scripts/config_validation.py

View on GitHub
from __future__ import annotations

from collections.abc import Mapping

DEFAULT_RETRIEVAL_METHOD = "agentic_search"
ALLOWED_RETRIEVAL_METHODS = {"agentic_search", "vector_search"}
PLACEHOLDER_PATH_MARKERS = (
    "/path/to/your-skill-library/",
    "/absolute/path/to/",
)

ALLOWED_CONFIG_KEYS = {
    "routing",
    "retrieval",
    "retrieval_context",
    "skill_library",
    "chroma",
    "embedding",
    "indexing",
}

ALLOWED_SECTION_KEYS = {
    "routing": {"mode", "max_passes"},
    "retrieval": {"method", "top_k"},
    "retrieval_context": {"mode"},
    "skill_library": {"include", "exclude"},
    "chroma": {"path", "collection"},
    "embedding": {
        "provider",
        "model",
        "dimensions",
        "api_key_env",
        "api_key",
        "base_url",
        "extra_headers",
    },
    "indexing": {"update_on_start"},
}


def find_unsupported_config_fields(config: Mapping[str, object]) -> list[str]:
    fields: list[str] = []
    for key in sorted(str(key) for key in config):
        if key not in ALLOWED_CONFIG_KEYS:
            fields.append(key)

    for section, allowed_keys in ALLOWED_SECTION_KEYS.items():
        value = config.get(section)
        if not isinstance(value, Mapping):
            continue
        for key in sorted(str(key) for key in value):
            if key not in allowed_keys:
                fields.append(f"{section}.{key}")

    return fields


def require_supported_config_fields(config: Mapping[str, object]) -> None:
    unsupported_fields = find_unsupported_config_fields(config)
    if unsupported_fields:
        joined = ", ".join(unsupported_fields)
        raise ValueError(f"Unsupported config field(s): {joined}")


def require_supported_skill_library_fields(
    skill_library: Mapping[str, object],
) -> None:
    allowed_keys = ALLOWED_SECTION_KEYS["skill_library"]
    unsupported_fields = [
        str(key) for key in sorted(skill_library) if str(key) not in allowed_keys
    ]
    if unsupported_fields:
        joined = ", ".join(f"skill_library.{key}" for key in unsupported_fields)
        raise ValueError(f"Unsupported config field(s): {joined}")


def contains_placeholder_path(pattern: str) -> bool:
    return any(marker in pattern for marker in PLACEHOLDER_PATH_MARKERS)


def resolve_retrieval_method(raw_method: object) -> tuple[str, str | None]:
    method = str(raw_method or DEFAULT_RETRIEVAL_METHOD).strip()
    if not method:
        method = DEFAULT_RETRIEVAL_METHOD
    if method in ALLOWED_RETRIEVAL_METHODS:
        return method, None
    warning = (
        f'Unsupported retrieval.method "{method}". '
        f'Falling back to "{DEFAULT_RETRIEVAL_METHOD}".'
    )
    return DEFAULT_RETRIEVAL_METHOD, warning
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall