Skip to content

Index

index

Skill index — load and search a remote/local skill catalog.

Classes

SkillIndexEntry dataclass

SkillIndexEntry(name: str, version: str, description: str, author: str, source: str, sha256: str, tags: list[str] = list(), required_capabilities: list[str] = list())

A single entry in the skill index catalog.

SkillIndex

SkillIndex(index_dir: str | Path)

Catalog of available skills loaded from an index.toml file.

index.toml format::

[[skills]]
name = "research"
version = "0.1.0"
description = "Research a topic"
author = "openjarvis"
source = "github.com/openjarvis/skills/research"
sha256 = "abc123"
tags = ["research"]
required_capabilities = ["network:fetch"]
Source code in src/openjarvis/skills/index.py
def __init__(self, index_dir: str | Path) -> None:
    self._index_dir = Path(index_dir)
    self._entries: dict[str, SkillIndexEntry] = {}
    self._load()
Attributes
entries property
entries: dict[str, SkillIndexEntry]

Return all entries keyed by skill name.

Functions
search
search(query: str) -> list[SkillIndexEntry]

Return entries whose name, description, or tags match query.

Matching is case-insensitive substring search across name, description, and each tag value.

Source code in src/openjarvis/skills/index.py
def search(self, query: str) -> list[SkillIndexEntry]:
    """Return entries whose name, description, or tags match *query*.

    Matching is case-insensitive substring search across name, description,
    and each tag value.
    """
    q = query.lower()
    results: list[SkillIndexEntry] = []
    for entry in self._entries.values():
        if (
            q in entry.name.lower()
            or q in entry.description.lower()
            or any(q in tag.lower() for tag in entry.tags)
        ):
            results.append(entry)
    return results
get
get(name: str) -> Optional[SkillIndexEntry]

Look up a skill by exact name, returning None if not found.

Source code in src/openjarvis/skills/index.py
def get(self, name: str) -> Optional[SkillIndexEntry]:
    """Look up a skill by exact name, returning ``None`` if not found."""
    return self._entries.get(name)