# Interface ISkillLoader

Interface for the skill loader.

interface ISkillLoader {
loadForAgent(
agentId: string,
role: AgentRole,
): Result<LoadedSkillSet, SkillLoaderError>;
loadForTask(
agentId: string,
role: AgentRole,
taskDescription: string,
): Result<LoadedSkillSet, SkillLoaderError>;
getAvailableSkills(role: AgentRole): readonly Skill[];
validateLoadedSet(set: LoadedSkillSet): Result<void, SkillLoaderError>;
}

#### Implemented by

- SkillLoader

- Defined in packages/nexus-agents/src/agents/skills/skill-loader-types.ts:117

##### Index

### Methods

loadForAgent
loadForTask
getAvailableSkills
validateLoadedSet

## Methods

### loadForAgent

- loadForAgent(
  agentId: string,
  role: AgentRole,
  ): Result<LoadedSkillSet, SkillLoaderError>

  Loads skills for an agent based on their role. Returns skills in dependency-aware execution order.

  #### Parameters

  - agentId: string

    Unique identifier of the agent

  - role: AgentRole

    Role of the agent

  #### Returns Result<LoadedSkillSet, SkillLoaderError>

  Result with LoadedSkillSet or SkillLoaderError

  - Defined in packages/nexus-agents/src/agents/skills/skill-loader-types.ts:126

### loadForTask

- loadForTask(
  agentId: string,
  role: AgentRole,
  taskDescription: string,
  ): Result<LoadedSkillSet, SkillLoaderError>

  Loads skills for a specific task based on role and task description. May include additional task-relevant skills beyond role defaults.

  #### Parameters

  - agentId: string

    Unique identifier of the agent

  - role: AgentRole

    Role of the agent

  - taskDescription: string

    Description of the task to execute

  #### Returns Result<LoadedSkillSet, SkillLoaderError>

  Result with LoadedSkillSet or SkillLoaderError

  - Defined in packages/nexus-agents/src/agents/skills/skill-loader-types.ts:140

### getAvailableSkills

- getAvailableSkills(role: AgentRole): readonly Skill[]

  Gets all skills available to a specific role. Does not apply per-agent limits or task filtering.

  #### Parameters

  - role: AgentRole

    Role to get available skills for

  #### Returns readonly Skill[]

  Array of skills available to the role

  - Defined in packages/nexus-agents/src/agents/skills/skill-loader-types.ts:153

### validateLoadedSet

- validateLoadedSet(set: LoadedSkillSet): Result<void, SkillLoaderError>

  Validates a loaded skill set for consistency.

  #### Parameters

  - set: LoadedSkillSet

    The loaded skill set to validate

  #### Returns Result<void, SkillLoaderError>

  Result with void on success or SkillLoaderError on failure

  - Defined in packages/nexus-agents/src/agents/skills/skill-loader-types.ts:161