loadSkillByName

View as MarkdownOpen in Claude

Look up a registered skill class by name in the global SkillRegistry, construct an instance, and add it via addSkill. Returns [false, message] if the name is not registered, the instantiation fails, or addSkill throws.

Parameters

skillName
stringRequired

Registered skill name (read from the target class’s SKILL_NAME).

config
SkillConfig

Optional configuration forwarded to the skill constructor.

Returns

Promise<[boolean, string]>[true, ''] on success, [false, errorMessage] otherwise.

Example

1const [ok, err] = await agent.skillManager.loadSkillByName('datetime');
2if (!ok) throw new Error(err);