# Interface ISkillDependencyGraph

Interface for skill dependency graph operations.

interface ISkillDependencyGraph {
addSkill(skillId: string, version?: number): void;
addDependency(dependency: SkillDependency): Result<void, DependencyError>;
removeDependency(skillId: string, dependsOn: string): boolean;
getDependencies(skillId: string): readonly SkillDependency[];
getDependents(skillId: string): readonly string[];
getExecutionOrder(
skillIds: readonly string[],
): Result<readonly string[], DependencyError>;
hasCircularDependency(skillId: string): boolean;
validateGraph(): Result<void, DependencyError>;
getSkillCount(): number;
hasSkill(skillId: string): boolean;
}

#### Implemented by

- SkillDependencyGraph

- Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:65

##### Index

### Methods

addSkill
addDependency
removeDependency
getDependencies
getDependents
getExecutionOrder
hasCircularDependency
validateGraph
getSkillCount
hasSkill

## Methods

### addSkill

- addSkill(skillId: string, version?: number): void

  Adds a skill node to the graph

  #### Parameters

  - skillId: string
  - `Optional` version: number

  #### Returns void

  - Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:67

### addDependency

- addDependency(dependency: SkillDependency): Result<void, DependencyError>

  Adds a dependency edge between skills

  #### Parameters

  - dependency: SkillDependency

  #### Returns Result<void, DependencyError>

  - Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:69

### removeDependency

- removeDependency(skillId: string, dependsOn: string): boolean

  Removes a dependency edge

  #### Parameters

  - skillId: string
  - dependsOn: string

  #### Returns boolean

  - Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:71

### getDependencies

- getDependencies(skillId: string): readonly SkillDependency[]

  Gets all dependencies for a skill

  #### Parameters

  - skillId: string

  #### Returns readonly SkillDependency[]

  - Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:73

### getDependents

- getDependents(skillId: string): readonly string[]

  Gets all skills that depend on a given skill

  #### Parameters

  - skillId: string

  #### Returns readonly string[]

  - Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:75

### getExecutionOrder

- getExecutionOrder(
  skillIds: readonly string[],
  ): Result<readonly string[], DependencyError>

  Gets execution order using topological sort

  #### Parameters

  - skillIds: readonly string[]

  #### Returns Result<readonly string[], DependencyError>

  - Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:77

### hasCircularDependency

- hasCircularDependency(skillId: string): boolean

  Checks if adding a dependency would create a cycle

  #### Parameters

  - skillId: string

  #### Returns boolean

  - Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:79

### validateGraph

- validateGraph(): Result<void, DependencyError>

  Validates the entire graph for consistency

  #### Returns Result<void, DependencyError>

  - Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:81

### getSkillCount

- getSkillCount(): number

  Gets the number of skills in the graph

  #### Returns number

  - Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:83

### hasSkill

- hasSkill(skillId: string): boolean

  Checks if a skill exists in the graph

  #### Parameters

  - skillId: string

  #### Returns boolean

  - Defined in packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:85