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
stringRequired

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

params
SkillConfig

Optional configuration forwarded to the skill constructor.

Returns

Promise<this> — the agent for method chaining.

Example

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