Function: exportToolAsSkillPack()
exportToolAsSkillPack(
tool,outputDir):Promise<{capabilityPath:string;skillPath:string; }>
Defined in: packages/agentos/src/cognition/emergent/SkillExporter.ts:499
Exports an emergent tool as a full skill pack (SKILL.md + CAPABILITY.yaml).
Creates a directory named after the tool under outputDir, containing both
files. This directory structure is compatible with the
capability manifest scanner and can be placed in any scan directory
(~/.wunderland/capabilities/, ./.wunderland/capabilities/, etc.) for
automatic discovery. The tool's name must be a safe folder name and its
folder must resolve inside outputDir, and below outputDir the files are
written through no link and only into regular files; otherwise nothing is
written.
Parameters
tool
The emergent tool to export.
outputDir
string
Base directory where the skill subdirectory will be created.
Returns
Promise<{ capabilityPath: string; skillPath: string; }>
Absolute paths to the written SKILL.md and CAPABILITY.yaml files.
Throws
If the tool's name is not a safe folder name
or its folder would lie outside outputDir. Nothing is written.
Throws
If a link, a second name or anything but a regular file is at the tool's folder or at either file. Nothing is written.
Throws
If the filesystem writes fail (permissions, disk full, etc.).
Example
const { skillPath, capabilityPath } = await exportToolAsSkillPack(
myTool,
'/home/user/.wunderland/capabilities',
);
// skillPath => "/home/user/.wunderland/capabilities/my-tool/SKILL.md"
// capabilityPath => "/home/user/.wunderland/capabilities/my-tool/CAPABILITY.yaml"