Skip to navigation

addSkillByName

View as MarkdownOpen in Claude

Look up a skill class by name in the global SkillRegistry, instantiate it, and add it to the agent via addSkill. Fails closed like addSkill.

Parameters

skillName
SkillNameOrStringRequired

Registered skill name (read from the target class’s SKILL_NAME). The SkillName union lists the 19 built-in names for editor autocompletion; any other string resolves against skills you registered yourself.

params
SkillConfig

Optional configuration forwarded to the skill constructor.

Returns

Promise<this> — the agent for method chaining.

Example

const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
agent.setPromptText('You are a helpful assistant.');
await agent.addSkillByName('datetime');
await agent.addSkillByName('web_search', { num_results: 3 });