primus.skills.repository module

Frontmatter-aware repository for operational agent skills.

class primus.skills.repository.InvalidSkillFile(path: str, reason: str)

Bases: object

A skill file that could not be indexed.

__init__(path: str, reason: str) → None
path: str
reason: str
exception primus.skills.repository.InvalidSkillKeyError

Bases: ValueError

Raised when a caller asks for an unsafe or unknown skill id.

class primus.skills.repository.Skill(metadata: dict[str, ~typing.Any], body: str, path: str, resources: list[str] = <factory>)

Bases: object

A single resolved skill entry.

__init__(metadata: dict[str, ~typing.Any], body: str, path: str, resources: list[str] = <factory>) → None
body: str
property id: str
metadata: dict[str, Any]
path: str
resources: list[str]
class primus.skills.repository.SkillListResult(entries: list[dict[str, ~typing.Any]]=<factory>, invalid: list[InvalidSkillFile] = <factory>)

Bases: object

Result of a SkillRepository.list_skills() call.

__init__(entries: list[dict[str, ~typing.Any]]=<factory>, invalid: list[InvalidSkillFile] = <factory>) → None
entries: list[dict[str, Any]]
invalid: list[InvalidSkillFile]
class primus.skills.repository.SkillRepository(root_dir: str)

Bases: object

Index repo-local operational skills rooted at skills/.

Only */SKILL.md files are indexed. The stable public id is derived from the containing folder name, so renaming frontmatter display names does not break console references.

__init__(root_dir: str) → None
get_skill(skill_id: str, *, mode: str | None = None) → Skill

Return the full body for one skill id.

list_skills(*, query: str | None = None, tags: Iterable[str] | None = None, mode: str | None = None) → SkillListResult

Return metadata summaries for matching skills.

property root: str