# Function initializeAgentSkills

Skills module exports (Voyager-style skill library) - Issue #528 Split from agents.ts for file size compliance (Issue #285)

- initializeAgentSkills(
  agent: IAgent,
  loader: ISkillLoader,
  ): Result<void, SkillLoaderError>

  Initializes skills for an agent during agent setup.

  Loads the appropriate skills for the agent's role and validates the loaded skill set for consistency. This should be called during agent initialization to ensure skills are ready for task execution.

  #### Parameters

  - agent: IAgent

    The agent to initialize skills for

  - loader: ISkillLoader

    The skill loader to use

  #### Returns Result<void, SkillLoaderError>

  Result with void on success or SkillLoaderError on failure

  #### Example

      const agent = createAgent({ id: 'agent-1', role: 'code_expert' });
      const loader = createSkillLoader(library);

      const result = initializeAgentSkills(agent, loader);
      if (!result.ok) {
        console.error('Failed to initialize skills:', result.error);
      }

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