# Class SkillLibrary

Voyager-style skill library for storing and retrieving executable skills.

- Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:43

##### Index

### Constructors

constructor

### Methods

addSkill
getSkill
getSkillByName
searchSkills
recordExecution
recordExecutionWithOptions
getSkillsByCategory
getTopPerformingSkills
getMostUsedSkills
findRelevantSkills
updateSkill
removeSkill
getStatistics
getConfig

## Constructors

### constructor

- new SkillLibrary(
  config?: Partial<SkillLibraryConfig>,
  logger?: ILogger,
  ): SkillLibrary

  #### Parameters

  - config: Partial<SkillLibraryConfig> = {}
  - `Optional` logger: ILogger

  #### Returns SkillLibrary

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:48

## Methods

### addSkill

- addSkill(options: CreateSkillOptions): Skill

  Adds a new skill to the library.

  #### Parameters

  - options: CreateSkillOptions

  #### Returns Skill

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:61

### getSkill

- getSkill(skillId: string): SkillWithMetrics | undefined

  Retrieves a skill by ID.

  #### Parameters

  - skillId: string

  #### Returns SkillWithMetrics | undefined

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:105

### getSkillByName

- getSkillByName(name: string): SkillWithMetrics | undefined

  Retrieves a skill by name.

  #### Parameters

  - name: string

  #### Returns SkillWithMetrics | undefined

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:116

### searchSkills

- searchSkills(query: SkillQuery): SkillSearchResult

  Searches for skills matching a query.

  #### Parameters

  - query: SkillQuery

  #### Returns SkillSearchResult

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:128

### recordExecution

- recordExecution(
  skillId: string,
  status: SkillExecutionStatus,
  input: Record<string, unknown>,
  output?: string,
  errorMessage?: string,
  ): void

  Records a skill execution (legacy signature).

  #### Parameters

  - skillId: string
  - status: SkillExecutionStatus
  - input: Record<string, unknown>
  - `Optional` output: string
  - `Optional` errorMessage: string

  #### Returns void

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:148

### recordExecutionWithOptions

- recordExecutionWithOptions(options: RecordExecutionOptions): void

  Records a skill execution with options object.

  #### Parameters

  - options: RecordExecutionOptions

  #### Returns void

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:167

### getSkillsByCategory

- getSkillsByCategory(category: string): readonly SkillWithMetrics[]

  Gets all skills in a category.

  #### Parameters

  - category: string

  #### Returns readonly SkillWithMetrics[]

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:188

### getTopPerformingSkills

- getTopPerformingSkills(limit?: number): readonly SkillWithMetrics[]

  Gets the most successful skills.

  #### Parameters

  - limit: number = 10

  #### Returns readonly SkillWithMetrics[]

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:193

### getMostUsedSkills

- getMostUsedSkills(limit?: number): readonly SkillWithMetrics[]

  Gets the most frequently used skills.

  #### Parameters

  - limit: number = 10

  #### Returns readonly SkillWithMetrics[]

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:198

### findRelevantSkills

- findRelevantSkills(
  taskDescription: string,
  limit?: number,
  ): readonly SkillWithMetrics[]

  Finds skills relevant to a task description.

  #### Parameters

  - taskDescription: string
  - limit: number = 5

  #### Returns readonly SkillWithMetrics[]

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:205

### updateSkill

- updateSkill(
  skillId: string,
  updates: Partial<CreateSkillOptions>,
  ): Skill | undefined

  Updates an existing skill.

  #### Parameters

  - skillId: string
  - updates: Partial<CreateSkillOptions>

  #### Returns Skill | undefined

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:214

### removeSkill

- removeSkill(skillId: string): boolean

  Removes a skill from the library.

  #### Parameters

  - skillId: string

  #### Returns boolean

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:235

### getStatistics

- getStatistics(): LibraryStatistics

  Gets library statistics.

  #### Returns LibraryStatistics

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:254

### getConfig

- getConfig(): SkillLibraryConfig

  Gets the current configuration.

  #### Returns SkillLibraryConfig

  - Defined in packages/nexus-agents/src/agents/skills/skill-library.ts:262