# Class SkillLoader

Deterministic skill loader implementation.

Key guarantees:

- Same role + same library state = same skill set (deterministic)
- Skills are sorted by ID before filtering for determinism
- Execution order follows dependency graph (topological sort)
- RBAC enforcement prevents unauthorized skill access

#### Implements

- ISkillLoader

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

##### Index

### Constructors

constructor

### Methods

loadForAgent
loadForTask
getAvailableSkills
validateLoadedSet

## Constructors

### constructor

- new SkillLoader(
  library: SkillLibrary,
  config?: Partial<SkillLoaderConfig>,
  logger?: ILogger,
  ): SkillLoader

  #### Parameters

  - library: SkillLibrary
  - `Optional` config: Partial<SkillLoaderConfig>
  - `Optional` logger: ILogger

  #### Returns SkillLoader

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

## Methods

### loadForAgent

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

  Loads skills for an agent based on their role. Deterministic: same role + same library = same skills.

  #### Parameters

  - agentId: string
  - role: AgentRole

  #### Returns Result<LoadedSkillSet, SkillLoaderError>

  Implementation of ISkillLoader.loadForAgent

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

### loadForTask

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

  Loads skills for a task, potentially including task-relevant skills.

  #### Parameters

  - agentId: string
  - role: AgentRole
  - taskDescription: string

  #### Returns Result<LoadedSkillSet, SkillLoaderError>

  Implementation of ISkillLoader.loadForTask

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

### getAvailableSkills

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

  Gets all skills available to a role without limits.

  #### Parameters

  - role: AgentRole

  #### Returns readonly Skill[]

  Implementation of ISkillLoader.getAvailableSkills

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

### validateLoadedSet

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

  Validates a loaded skill set for consistency.

  #### Parameters

  - set: LoadedSkillSet

  #### Returns Result<void, SkillLoaderError>

  Implementation of ISkillLoader.validateLoadedSet

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