R6 class that manages a collection of skills. Provides methods to:
Scan directories for SKILL.md files
Cache skill metadata (Level 1)
Retrieve skills by name
Generate prompt sections for LLM context
new()Create a new SkillRegistry, optionally scanning a directory.
SkillRegistry$new(path = NULL)pathOptional path to scan for skills on creation.
A new SkillRegistry object.
scan_skills()Scan a directory for skill folders containing SKILL.md files.
SkillRegistry$scan_skills(path, recursive = FALSE)pathPath to the directory to scan.
recursiveWhether to scan subdirectories. Default FALSE.
The registry object (invisibly), for chaining.
get_skill()Get a skill by name.
SkillRegistry$get_skill(name)nameThe name of the skill to retrieve.
The Skill object, or NULL if not found.
has_skill()Check if a skill exists in the registry.
SkillRegistry$has_skill(name)nameThe name of the skill to check.
TRUE if the skill exists, FALSE otherwise.
list_skills()List all registered skills with their names and descriptions.
SkillRegistry$list_skills()A data.frame with columns: name, description.
count()Get the number of registered skills.
SkillRegistry$count()Integer count of skills.
generate_prompt_section()Generate a prompt section listing available skills. This can be injected into the system prompt.
SkillRegistry$generate_prompt_section()Character string with formatted skill list.
clone()The objects of this class are cloneable with this method.
SkillRegistry$clone(deep = FALSE)deepWhether to make a deep clone.