| SkillRegistry | R Documentation |
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, recursive = FALSE)
pathOptional path to scan for skills on creation.
recursiveWhether to scan subdirectories when path is provided.
A new SkillRegistry object.
scan_skills()Scan a directory for skill folders containing SKILL.md files.
SkillRegistry$scan_skills(path, recursive = FALSE, remember = TRUE)
pathPath to the directory to scan.
recursiveWhether to scan subdirectories. Default FALSE.
rememberWhether this root should be remembered for refresh().
The registry object (invisibly), for chaining.
refresh()Re-scan remembered skill roots so updates on disk become visible.
SkillRegistry$refresh(clear = TRUE)
clearIf TRUE, clears currently loaded skills before re-scanning.
The registry object (invisibly).
list_roots()List skill roots remembered by this registry.
SkillRegistry$list_roots()
A data frame with root path and recursive flag.
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.
resolve_skill_name()Resolve a skill name or alias to its canonical name.
SkillRegistry$resolve_skill_name(name)
nameSkill name or alias.
Canonical skill name or NULL.
find_closest_skill_name()Find the closest matching canonical skill name for fuzzy recovery.
SkillRegistry$find_closest_skill_name(name)
nameSkill name or alias candidate.
Canonical skill name or NULL.
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.
find_relevant_skills()Find relevant skills for a user query and optional file paths.
SkillRegistry$find_relevant_skills( query = NULL, file_paths = character(0), cwd = NULL, limit = 3L )
queryOptional user query text.
file_pathsOptional character vector of file paths.
cwdOptional working directory for path matching.
limitMaximum number of results to return.
Data frame of matching skills sorted by score.
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.
print()Print a summary of the registry.
SkillRegistry$print()
clone()The objects of this class are cloneable with this method.
SkillRegistry$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.