nexus-agents - v2.80.0
    Preparing search index...

    Function initializeAgentSkills

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

    • 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

      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);
      }