setAgent

View as MarkdownOpen in Claude

Attach this skill to an AgentBase. Called by the SkillManager during agent.addSkill() before setup() runs, so getAgent() is safe from within setup() and tool handlers.

Normally not called directly. If you are implementing a custom skill loader that bypasses addSkill(), call this yourself before invoking setup().

Parameters

agent
AgentBaseRequired

The agent instance that owns this skill.

Returns

void

Example

1import { AgentBase, SkillBase } from '@signalwire/sdk';
2
3class InlineSkill extends SkillBase { /* ... */ }
4
5const agent = new AgentBase({ name: 'demo' });
6const skill = new InlineSkill();
7skill.setAgent(agent);
8await skill.setup();