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

import { AgentBase, SkillBase } from '@signalwire/sdk';
class InlineSkill extends SkillBase { /* ... */ }
const agent = new AgentBase({ name: 'demo' });
const skill = new InlineSkill();
skill.setAgent(agent);
await skill.setup();