R6 class representing a skill with progressive loading capabilities. A Skill consists of:
Level 1: YAML frontmatter (name, description) - always loaded
Level 2: SKILL.md body (detailed instructions) - on demand
Level 3: R scripts (executable code) - executed by agent
nameThe unique name of the skill (from YAML frontmatter).
descriptionA brief description of the skill (from YAML frontmatter).
pathThe directory path containing the skill files.
new()Create a new Skill object by parsing a SKILL.md file.
Skill$new(path)pathPath to the skill directory (containing SKILL.md).
A new Skill object.
Character string containing the skill instructions.
execute_script()Execute an R script from the skill's scripts directory (Level 3). Uses callr for safe, isolated execution.
Skill$execute_script(script_name, args = list())script_nameName of the script file (e.g., "normalize.R").
argsNamed list of arguments to pass to the script.
The result from the script execution.
list_scripts()List available scripts in the skill's scripts directory.
Skill$list_scripts()Character vector of script file names.
list_resources()List available reference files in the skill's references directory.
Skill$list_resources()Character vector of reference file names.
read_resource()Read content of a reference file from the references directory.
Skill$read_resource(resource_name)resource_nameName of the reference file.
Character string containing the resource content.
get_asset_path()Get the absolute path to an asset in the assets directory.
Skill$get_asset_path(asset_name)asset_nameName of the asset file or directory.
Absolute path string.
clone()The objects of this class are cloneable with this method.
Skill$clone(deep = FALSE)deepWhether to make a deep clone.