agents-skills
Classes
SkillComposer
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:54
Composes skills to solve complex tasks.
Constructors
Constructor
new SkillComposer(
library,
config?,
logger?
): SkillComposer;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:59
Parameters
library
config?
Partial<SkillComposerConfig> = {}
logger?
Returns
Methods
compose()
compose(request): SkillComposition | null;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:68
Creates a composition plan for a task.
Parameters
request
Returns
SkillComposition | null
getConfig()
getConfig(): SkillComposerConfig;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:149
Gets the current configuration.
Returns
validateComposition()
validateComposition(composition): CompositionValidation;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:102
Validates that a composition is executable.
A zero-step composition is reported invalid rather than valid: the step
loop below never runs, so errors.length === 0 would report “executable”
having checked nothing, and executing it would do nothing (#4585).
Parameters
composition
Returns
SkillDependencyGraph
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:67
Skill dependency graph implementation using adjacency list. Supports topological sorting, cycle detection, and version constraints.
Implements
Constructors
Constructor
new SkillDependencyGraph(): SkillDependencyGraph;
Returns
Methods
addDependency()
addDependency(dependency): Result<void, DependencyError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:88
Adds a dependency edge between two skills.
Parameters
dependency
Returns
Result<void, DependencyError>
Implementation of
ISkillDependencyGraph.addDependency
addSkill()
addSkill(skillId, version?): void;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:75
Adds a skill node to the graph.
Parameters
skillId
string
version?
number = 1
Returns
void
Implementation of
ISkillDependencyGraph.addSkill
getDependencies()
getDependencies(skillId): readonly SkillDependency[];
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:151
Gets all dependencies for a skill.
Parameters
skillId
string
Returns
readonly SkillDependency[]
Implementation of
ISkillDependencyGraph.getDependencies
getDependents()
getDependents(skillId): readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:157
Gets all skills that depend on a given skill.
Parameters
skillId
string
Returns
readonly string[]
Implementation of
ISkillDependencyGraph.getDependents
getExecutionOrder()
getExecutionOrder(skillIds): Result<readonly string[], DependencyError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:163
Gets execution order for given skills using Kahn’s algorithm.
Parameters
skillIds
readonly string[]
Returns
Result<readonly string[], DependencyError>
Implementation of
ISkillDependencyGraph.getExecutionOrder
getSkillCount()
getSkillCount(): number;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:229
Gets the number of skills in the graph.
Returns
number
Implementation of
ISkillDependencyGraph.getSkillCount
hasCircularDependency()
hasCircularDependency(skillId): boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:178
Checks if a skill has a circular dependency.
Parameters
skillId
string
Returns
boolean
Implementation of
ISkillDependencyGraph.hasCircularDependency
hasSkill()
hasSkill(skillId): boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:234
Checks if a skill exists in the graph.
Parameters
skillId
string
Returns
boolean
Implementation of
ISkillDependencyGraph.hasSkill
removeDependency()
removeDependency(skillId, dependsOn): boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:134
Removes a dependency edge between two skills.
Parameters
skillId
string
dependsOn
string
Returns
boolean
Implementation of
ISkillDependencyGraph.removeDependency
validateGraph()
validateGraph(): Result<void, DependencyError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:186
Validates the entire graph for consistency.
Returns
Result<void, DependencyError>
Implementation of
ISkillDependencyGraph.validateGraph
SkillLibrary
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:43
Voyager-style skill library for storing and retrieving executable skills.
Constructors
Constructor
new SkillLibrary(config?, logger?): SkillLibrary;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:48
Parameters
config?
Partial<SkillLibraryConfig> = {}
logger?
Returns
Methods
addSkill()
addSkill(options): Skill;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:61
Adds a new skill to the library.
Parameters
options
Returns
findRelevantSkills()
findRelevantSkills(taskDescription, limit?): readonly SkillWithMetrics[];
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:205
Finds skills relevant to a task description.
Parameters
taskDescription
string
limit?
number = 5
Returns
readonly SkillWithMetrics[]
getConfig()
getConfig(): SkillLibraryConfig;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:262
Gets the current configuration.
Returns
getMostUsedSkills()
getMostUsedSkills(limit?): readonly SkillWithMetrics[];
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:198
Gets the most frequently used skills.
Parameters
limit?
number = 10
Returns
readonly SkillWithMetrics[]
getSkill()
getSkill(skillId): SkillWithMetrics | undefined;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:105
Retrieves a skill by ID.
Parameters
skillId
string
Returns
SkillWithMetrics | undefined
getSkillByName()
getSkillByName(name): SkillWithMetrics | undefined;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:116
Retrieves a skill by name.
Parameters
name
string
Returns
SkillWithMetrics | undefined
getSkillsByCategory()
getSkillsByCategory(category): readonly SkillWithMetrics[];
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:188
Gets all skills in a category.
Parameters
category
string
Returns
readonly SkillWithMetrics[]
getStatistics()
getStatistics(): LibraryStatistics;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:254
Gets library statistics.
Returns
getTopPerformingSkills()
getTopPerformingSkills(limit?): readonly SkillWithMetrics[];
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:193
Gets the most successful skills.
Parameters
limit?
number = 10
Returns
readonly SkillWithMetrics[]
recordExecution()
recordExecution(
skillId,
status,
input,
output?,
errorMessage?
): void;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:148
Records a skill execution (legacy signature).
Parameters
skillId
string
status
input
Record<string, unknown>
output?
string
errorMessage?
string
Returns
void
recordExecutionWithOptions()
recordExecutionWithOptions(options): void;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:167
Records a skill execution with options object.
Parameters
options
Returns
void
removeSkill()
removeSkill(skillId): boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:235
Removes a skill from the library.
Parameters
skillId
string
Returns
boolean
searchSkills()
searchSkills(query): SkillSearchResult;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:128
Searches for skills matching a query.
Parameters
query
Returns
updateSkill()
updateSkill(skillId, updates): Skill | undefined;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:214
Updates an existing skill.
Parameters
skillId
string
updates
Partial<CreateSkillOptions>
Returns
Skill | undefined
SkillLoader
Defined in: packages/nexus-agents/src/agents/skills/skill-loader.ts:75
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
Constructors
Constructor
new SkillLoader(
library,
config?,
logger?
): SkillLoader;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader.ts:81
Parameters
library
config?
Partial<SkillLoaderConfig>
logger?
Returns
Methods
getAvailableSkills()
getAvailableSkills(role): readonly Skill[];
Defined in: packages/nexus-agents/src/agents/skills/skill-loader.ts:281
Gets all skills available to a role without limits.
Parameters
role
Returns
readonly Skill[]
Implementation of
ISkillLoader.getAvailableSkills
loadForAgent()
loadForAgent(agentId, role): Result<LoadedSkillSet, SkillLoaderError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader.ts:97
Loads skills for an agent based on their role. Deterministic: same role + same library = same skills.
Parameters
agentId
string
role
Returns
Result<LoadedSkillSet, SkillLoaderError>
Implementation of
loadForTask()
loadForTask(
agentId,
role,
taskDescription
): Result<LoadedSkillSet, SkillLoaderError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader.ts:215
Loads skills for a task, potentially including task-relevant skills.
Parameters
agentId
string
role
taskDescription
string
Returns
Result<LoadedSkillSet, SkillLoaderError>
Implementation of
validateLoadedSet()
validateLoadedSet(set): Result<void, SkillLoaderError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader.ts:297
Validates a loaded skill set for consistency.
Parameters
set
Returns
Result<void, SkillLoaderError>
Implementation of
ISkillLoader.validateLoadedSet
Interfaces
CompositionStep
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:254
A single step in a skill composition.
Properties
inputBinding
readonly inputBinding: Record<string, InputBinding>;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:262
How to bind input (from context or previous step)
purpose
readonly purpose: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:264
Description of what this step achieves
skillId
readonly skillId: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:258
Skill to execute
skillName
readonly skillName: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:260
Skill name (for readability)
stepNumber
readonly stepNumber: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:256
Step number (1-indexed)
CompositionValidation
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:374
Result of validating a composition.
Properties
errors
readonly errors: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:378
Validation errors
valid
readonly valid: boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:376
Whether the composition is valid
warnings
readonly warnings: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:380
Warnings (not blocking)
CreateSkillOptions
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:200
Options for creating a new skill.
Properties
category
readonly category: SkillCategory;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:206
Category
code
readonly code: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:210
The executable code
complexity
readonly complexity: SkillComplexity;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:208
Complexity level
dependencies?
readonly optional dependencies?: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:216
Dependencies on other skills
description
readonly description: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:204
Detailed description
examples?
readonly optional examples?: readonly SkillExample[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:220
Usage examples
name
readonly name: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:202
Human-readable name
outputType
readonly outputType: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:214
Output type description
parameters
readonly parameters: readonly SkillParameter[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:212
Input parameters
tags?
readonly optional tags?: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:218
Search tags
DependencyError
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:52
Dependency error with code and context.
Properties
code
readonly code: DependencyErrorCode;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:53
context?
readonly optional context?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:55
message
readonly message: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:54
InputBinding
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:270
Input binding for a composition step.
Properties
key
readonly key: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:274
Key in context or step number
source
readonly source: "literal" | "context" | "previous-step";
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:272
Source of the input value
value?
readonly optional value?: unknown;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:276
Literal value (if source is ‘literal’)
ISkillDependencyGraph
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:65
Interface for skill dependency graph operations.
Methods
addDependency()
addDependency(dependency): Result<void, DependencyError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:69
Adds a dependency edge between skills
Parameters
dependency
Returns
Result<void, DependencyError>
addSkill()
addSkill(skillId, version?): void;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:67
Adds a skill node to the graph
Parameters
skillId
string
version?
number
Returns
void
getDependencies()
getDependencies(skillId): readonly SkillDependency[];
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:73
Gets all dependencies for a skill
Parameters
skillId
string
Returns
readonly SkillDependency[]
getDependents()
getDependents(skillId): readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:75
Gets all skills that depend on a given skill
Parameters
skillId
string
Returns
readonly string[]
getExecutionOrder()
getExecutionOrder(skillIds): Result<readonly string[], DependencyError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:77
Gets execution order using topological sort
Parameters
skillIds
readonly string[]
Returns
Result<readonly string[], DependencyError>
getSkillCount()
getSkillCount(): number;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:83
Gets the number of skills in the graph
Returns
number
hasCircularDependency()
hasCircularDependency(skillId): boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:79
Checks if adding a dependency would create a cycle
Parameters
skillId
string
Returns
boolean
hasSkill()
hasSkill(skillId): boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:85
Checks if a skill exists in the graph
Parameters
skillId
string
Returns
boolean
removeDependency()
removeDependency(skillId, dependsOn): boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:71
Removes a dependency edge
Parameters
skillId
string
dependsOn
string
Returns
boolean
validateGraph()
validateGraph(): Result<void, DependencyError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:81
Validates the entire graph for consistency
Returns
Result<void, DependencyError>
ISkillLoader
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:117
Interface for the skill loader.
Methods
getAvailableSkills()
getAvailableSkills(role): readonly Skill[];
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:153
Gets all skills available to a specific role. Does not apply per-agent limits or task filtering.
Parameters
role
Role to get available skills for
Returns
readonly Skill[]
Array of skills available to the role
loadForAgent()
loadForAgent(agentId, role): Result<LoadedSkillSet, SkillLoaderError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:126
Loads skills for an agent based on their role. Returns skills in dependency-aware execution order.
Parameters
agentId
string
Unique identifier of the agent
role
Role of the agent
Returns
Result<LoadedSkillSet, SkillLoaderError>
Result with LoadedSkillSet or SkillLoaderError
loadForTask()
loadForTask(
agentId,
role,
taskDescription
): Result<LoadedSkillSet, SkillLoaderError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:140
Loads skills for a specific task based on role and task description. May include additional task-relevant skills beyond role defaults.
Parameters
agentId
string
Unique identifier of the agent
role
Role of the agent
taskDescription
string
Description of the task to execute
Returns
Result<LoadedSkillSet, SkillLoaderError>
Result with LoadedSkillSet or SkillLoaderError
validateLoadedSet()
validateLoadedSet(set): Result<void, SkillLoaderError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:161
Validates a loaded skill set for consistency.
Parameters
set
The loaded skill set to validate
Returns
Result<void, SkillLoaderError>
Result with void on success or SkillLoaderError on failure
LibraryStatistics
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:360
Library statistics.
Properties
overallSuccessRate
readonly overallSuccessRate: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:363
skillsByCategory
readonly skillsByCategory: Record<string, number>;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:364
skillsByComplexity
readonly skillsByComplexity: Partial<Record<SkillComplexity, number>>;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:365
totalExecutions
readonly totalExecutions: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:362
totalSkills
readonly totalSkills: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:361
LoadedSkillSet
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:71
Represents a loaded set of skills for an agent. Includes execution order based on dependencies.
Properties
agentId
readonly agentId: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:73
ID of the agent this skill set was loaded for
agentRole
readonly agentRole: AgentRole;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:75
Role of the agent
executionOrder
readonly executionOrder: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:79
Execution order (skill IDs) based on dependency graph
loadedAt
readonly loadedAt: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:83
When the skill set was loaded
missingRequired
readonly missingRequired: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:81
Required skills that could not be loaded
skills
readonly skills: readonly Skill[];
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:77
Skills that were successfully loaded
RecordExecutionOptions
Defined in: packages/nexus-agents/src/agents/skills/skill-helpers.ts:25
Options for recording an execution.
Properties
context?
readonly optional context?: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-helpers.ts:31
errorMessage?
readonly optional errorMessage?: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-helpers.ts:30
input
readonly input: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/skills/skill-helpers.ts:28
output?
readonly optional output?: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-helpers.ts:29
skillId
readonly skillId: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-helpers.ts:26
status
readonly status: SkillExecutionStatus;
Defined in: packages/nexus-agents/src/agents/skills/skill-helpers.ts:27
RoleSkillMapping
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:24
Maps an agent role to its required and optional skill categories. Defines which skills should be loaded for agents of a specific role.
Properties
maxSkills?
readonly optional maxSkills?: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:32
Maximum number of skills to load for this role (overrides default)
optionalCategories?
readonly optional optionalCategories?: readonly SkillCategory[];
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:30
Categories that may be loaded if available
requiredCategories
readonly requiredCategories: readonly SkillCategory[];
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:28
Categories that must be loaded for this role
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:26
The agent role this mapping applies to
Skill
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:52
A single skill in the library.
Extended by
Properties
capabilities?
readonly optional capabilities?: SkillCapabilities;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:82
Security capabilities (optional, for controlled execution)
category
readonly category: SkillCategory;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:60
Category for organization
code
readonly code: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:64
The executable code (function body)
complexity
readonly complexity: SkillComplexity;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:62
Complexity level
createdAt
readonly createdAt: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:76
When the skill was created
dependencies
readonly dependencies: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:70
Skills this depends on (for composition)
description
readonly description: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:58
Detailed description of what the skill does
examples
readonly examples: readonly SkillExample[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:74
Usage example(s)
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:54
Unique identifier
name
readonly name: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:56
Human-readable name
outputType
readonly outputType: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:68
Expected output type description
parameters
readonly parameters: readonly SkillParameter[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:66
Input parameter definitions
provenance?
readonly optional provenance?: SkillProvenance;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:86
Provenance tracking (optional, for audit trail)
rbac?
readonly optional rbac?: SkillRBAC;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:84
Role-based access control (optional, for permission enforcement)
tags
readonly tags: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:72
Keywords for search/retrieval
updatedAt
readonly updatedAt: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:78
When the skill was last modified
version
readonly version: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:80
Version number for tracking changes
SkillAttestation
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:151
Records the authorization of a skill execution.
Properties
authorizationMethod
readonly authorizationMethod: AuthorizationMethod;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:163
How authorization was determined
authorized
readonly authorized: boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:161
Whether execution was authorized
executorId
readonly executorId: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:155
ID of the agent executing the skill
inputHash
readonly inputHash: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:159
SHA-256 hash of the input parameters
skillId
readonly skillId: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:153
ID of the skill being executed
timestamp
readonly timestamp: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:157
When the attestation was created
SkillCapabilities
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:64
Skill capabilities define what a skill can do and its execution constraints.
Properties
maxExecutionTime
readonly maxExecutionTime: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:68
Maximum execution time in milliseconds
permissions
readonly permissions: readonly SkillPermission[];
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:66
Permissions granted to the skill
sandboxed
readonly sandboxed: boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:70
Whether the skill runs in a sandboxed environment
SkillComposerConfig
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:27
Configuration for skill composition.
Properties
complexityMatchWeight
readonly complexityMatchWeight: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:37
Weight for complexity match in scoring
maxCandidateSkills
readonly maxCandidateSkills: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:29
Maximum skills to consider for composition
maxCompositionSteps
readonly maxCompositionSteps: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:31
Maximum steps in a composition
minConfidence
readonly minConfidence: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:33
Minimum confidence threshold for compositions
successRateWeight
readonly successRateWeight: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:35
Weight for skill success rate in scoring
SkillComposition
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:240
A composed skill plan.
Properties
confidence
readonly confidence: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:248
Confidence in this composition (0-1)
description
readonly description: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:244
Overall description
estimatedComplexity
readonly estimatedComplexity: SkillComplexity;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:246
Estimated complexity
steps
readonly steps: readonly CompositionStep[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:242
Skills to execute in order
SkillCompositionRequest
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:226
Skill composition request.
Properties
context?
readonly optional context?: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:230
Available context
maxComplexity?
readonly optional maxComplexity?: SkillComplexity;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:232
Preferred complexity limit
maxSkillCount?
readonly optional maxSkillCount?: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:234
Maximum number of skills to compose
taskDescription
readonly taskDescription: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:228
Task description to solve
SkillDependency
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:28
Represents a dependency edge between two skills.
Properties
dependsOn
readonly dependsOn: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:32
ID of the skill being depended upon
minVersion?
readonly optional minVersion?: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:36
Minimum version of the dependency required (optional)
skillId
readonly skillId: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:30
ID of the skill that has the dependency
type
readonly type: SkillDependencyType;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:34
Type of dependency relationship
SkillExample
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:108
Example usage of a skill.
Properties
description
readonly description: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:110
Description of what this example demonstrates
expectedOutput
readonly expectedOutput: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:114
Expected output
input
readonly input: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:112
Input values
SkillExecution
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:120
Record of a skill execution.
Properties
context?
readonly optional context?: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:136
Context in which the skill was used
endTime
readonly endTime: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:126
When the execution ended
errorMessage?
readonly optional errorMessage?: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:134
Error message (if failed)
input
readonly input: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:130
Input provided
output?
readonly optional output?: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:132
Output produced (if successful)
skillId
readonly skillId: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:122
ID of the skill executed
startTime
readonly startTime: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:124
When the execution started
status
readonly status: SkillExecutionStatus;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:128
Execution status
SkillLibraryConfig
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:305
Configuration for the skill library.
Properties
enablePruning
readonly enablePruning: boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:313
Enable automatic skill pruning
executionsBeforeEvaluation
readonly executionsBeforeEvaluation: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:311
Number of executions before evaluating retention
maxHistoryPerSkill
readonly maxHistoryPerSkill: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:317
Maximum execution history entries per skill
maxSkills
readonly maxSkills: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:307
Maximum skills to store
minSuccessesForPromotion
readonly minSuccessesForPromotion: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:324
Minimum successful executions before promoting the skill as a belief into the shared substrate (Phase 6 of #2792). Default 5. Skills below this threshold are still tracked locally; promotion only fires once the signal stabilizes.
minSuccessRateForRetention
readonly minSuccessRateForRetention: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:309
Minimum success rate to keep skill (0-1)
skillPromoter?
readonly optional skillPromoter?: SkillPromoter;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:330
Optional promotion bridge to the shared belief store. When set,
SkillLibrary fires the callback whenever a skill crosses the
minSuccessesForPromotion threshold. Default: undefined (no-op).
trackExecutionHistory
readonly trackExecutionHistory: boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:315
Whether to track detailed execution history
SkillLoaderConfig
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:50
Configuration for the skill loader.
Properties
defaultMaxSkills
readonly defaultMaxSkills: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:54
Default maximum skills per agent if not specified in mapping
enforceDependencies
readonly enforceDependencies: boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:58
Whether to enforce dependency ordering
enforceRBAC
readonly enforceRBAC: boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:56
Whether to enforce RBAC checks during loading
fallbackBehavior
readonly fallbackBehavior: FallbackBehavior;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:60
Behavior when required skills are missing
mappings
readonly mappings: readonly RoleSkillMapping[];
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:52
Role-to-skill category mappings
SkillLoaderError
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:104
Skill loader error with code and context.
Properties
code
readonly code: SkillLoaderErrorCode;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:105
context?
readonly optional context?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:107
message
readonly message: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:106
SkillMetrics
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:142
Skill performance metrics.
Properties
avgExecutionTimeMs
readonly avgExecutionTimeMs: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:148
Average execution time in milliseconds
executionCount
readonly executionCount: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:144
Total number of executions
lastExecutedAt?
readonly optional lastExecutedAt?: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:152
Last execution time
successCount
readonly successCount: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:146
Number of successful executions
successRate
readonly successRate: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:150
Success rate (0-1)
SkillParameter
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:92
Parameter definition for a skill.
Properties
defaultValue?
readonly optional defaultValue?: unknown;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:102
Default value if not required
description
readonly description: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:98
Parameter description
name
readonly name: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:94
Parameter name
required
readonly required: boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:100
Whether the parameter is required
type
readonly type: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:96
Type description
SkillProvenance
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:124
Tracks the origin and modification history of a skill.
Properties
createdAt
readonly createdAt: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:128
When the skill was created
createdBy
readonly createdBy: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:126
Identifier of who created the skill
modifiedAt?
readonly optional modifiedAt?: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:132
When the skill was last modified
modifiedBy?
readonly optional modifiedBy?: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:130
Identifier of who last modified the skill
signature?
readonly optional signature?: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:136
Cryptographic signature for verification
version
readonly version: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:134
Version number (increments on modification)
SkillQuery
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:166
Query options for skill retrieval.
Properties
category?
readonly optional category?: SkillCategory;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:170
Filter by category
complexity?
readonly optional complexity?: SkillComplexity;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:172
Filter by complexity
limit?
readonly optional limit?: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:178
Maximum number of results
minSuccessRate?
readonly optional minSuccessRate?: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:176
Minimum success rate
search?
readonly optional search?: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:168
Search in name and description
sortBy?
readonly optional sortBy?: "name" | "createdAt" | "successRate" | "executionCount";
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:180
Sort by field
sortOrder?
readonly optional sortOrder?: "asc" | "desc";
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:182
Sort direction
tags?
readonly optional tags?: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:174
Filter by tags (any match)
SkillRBAC
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:89
Role-based access control for skill execution.
Properties
allowedRoles
readonly allowedRoles: readonly AgentRole[];
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:91
Roles that are allowed to execute this skill
deniedRoles?
readonly optional deniedRoles?: readonly AgentRole[];
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:93
Roles that are explicitly denied (takes precedence over allowed)
requiresAttestation
readonly requiresAttestation: boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:95
Whether execution requires attestation even for allowed roles
SkillSearchResult
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:188
Result of a skill search.
Properties
query
readonly query: SkillQuery;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:194
Query that produced this result
skills
readonly skills: readonly SkillWithMetrics[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:190
Matching skills with metrics
totalCount
readonly totalCount: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:192
Total number of matches (before limit)
SkillSecurityError
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:185
Security error with code and context.
Properties
code
readonly code: SecurityErrorCode;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:186
context?
readonly optional context?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:188
message
readonly message: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:187
SkillStore
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:371
In-memory skill storage structure.
Properties
executions
executions: Map<string, SkillExecution[]>;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:373
metrics
metrics: Map<string, SkillMetrics>;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:374
skills
skills: Map<string, Skill>;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:372
SkillWithMetrics
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:158
A skill with its execution metrics.
Extends
Properties
capabilities?
readonly optional capabilities?: SkillCapabilities;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:82
Security capabilities (optional, for controlled execution)
Inherited from
category
readonly category: SkillCategory;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:60
Category for organization
Inherited from
code
readonly code: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:64
The executable code (function body)
Inherited from
complexity
readonly complexity: SkillComplexity;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:62
Complexity level
Inherited from
createdAt
readonly createdAt: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:76
When the skill was created
Inherited from
dependencies
readonly dependencies: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:70
Skills this depends on (for composition)
Inherited from
description
readonly description: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:58
Detailed description of what the skill does
Inherited from
examples
readonly examples: readonly SkillExample[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:74
Usage example(s)
Inherited from
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:54
Unique identifier
Inherited from
metrics
readonly metrics: SkillMetrics;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:160
Execution metrics
name
readonly name: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:56
Human-readable name
Inherited from
outputType
readonly outputType: string;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:68
Expected output type description
Inherited from
parameters
readonly parameters: readonly SkillParameter[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:66
Input parameter definitions
Inherited from
provenance?
readonly optional provenance?: SkillProvenance;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:86
Provenance tracking (optional, for audit trail)
Inherited from
rbac?
readonly optional rbac?: SkillRBAC;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:84
Role-based access control (optional, for permission enforcement)
Inherited from
tags
readonly tags: readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:72
Keywords for search/retrieval
Inherited from
updatedAt
readonly updatedAt: Date;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:78
When the skill was last modified
Inherited from
version
readonly version: number;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:80
Version number for tracking changes
Inherited from
Type Aliases
AuthorizationMethod
type AuthorizationMethod = "role" | "explicit" | "inherited";
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:146
Method used to authorize skill execution.
DependencyErrorCode
type DependencyErrorCode =
| "CIRCULAR_DEPENDENCY"
| "MISSING_DEPENDENCY"
| "VERSION_MISMATCH"
| "SELF_DEPENDENCY"
| "SKILL_NOT_FOUND";
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:42
Error codes for dependency-related failures.
FallbackBehavior
type FallbackBehavior = "error" | "partial" | "empty";
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:41
Configuration for fallback behavior when skills cannot be loaded.
- error: Fail the load operation with an error
- partial: Load whatever skills are available
- empty: Return an empty skill set
SecurityErrorCode
type SecurityErrorCode =
| "PERMISSION_DENIED"
| "ROLE_NOT_ALLOWED"
| "ATTESTATION_REQUIRED"
| "INVALID_PROVENANCE"
| "SIGNATURE_MISMATCH"
| "EXECUTION_TIMEOUT"
| "SANDBOX_VIOLATION";
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:173
Error codes for security-related failures.
SkillCategory
type SkillCategory =
| "file-operations"
| "code-generation"
| "code-analysis"
| "testing"
| "documentation"
| "refactoring"
| "debugging"
| "deployment"
| "general"
| "coding-standards"
| "security"
| "database"
| "cloud-native"
| "devops"
| "api"
| "frontend"
| "observability"
| "compliance";
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:29
Skill categories for organization.
Extended in Epic #643 to support standards absorption categories.
SkillComplexity
type SkillComplexity = "primitive" | "simple" | "moderate" | "complex" | "composite";
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:17
Skill complexity levels.
SkillDependencyType
type SkillDependencyType = "required" | "optional" | "recommended";
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:23
Type of dependency relationship between skills.
- required: Skill cannot execute without dependency
- optional: Skill can execute without, but benefits from dependency
- recommended: Soft dependency, suggestion only
SkillExecutionStatus
type SkillExecutionStatus = "success" | "failure" | "timeout" | "error";
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:22
Skill execution status.
SkillLoaderErrorCode
type SkillLoaderErrorCode =
| "ROLE_NOT_MAPPED"
| "REQUIRED_CATEGORY_MISSING"
| "RBAC_DENIED"
| "DEPENDENCY_ERROR"
| "VALIDATION_ERROR"
| "EMPTY_RESULT";
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:93
Error codes for skill loader failures.
SkillPermission
type SkillPermission = "read" | "write" | "execute" | "network" | "filesystem" | "spawn";
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:22
Available skill permissions. Each permission grants specific capabilities to a skill.
Variables
AuthorizationMethodSchema
const AuthorizationMethodSchema: ZodEnum<{
explicit: "explicit";
inherited: "inherited";
role: "role";
}>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-schemas.ts:114
Zod schema for AuthorizationMethod.
COMPLEXITY_ORDER
const COMPLEXITY_ORDER: Record<SkillComplexity, number>;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:349
Complexity ordering for comparisons.
DEFAULT_COMPOSER_CONFIG
const DEFAULT_COMPOSER_CONFIG: SkillComposerConfig;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:43
Default composer configuration.
DEFAULT_EXECUTION_TIME_MS
const DEFAULT_EXECUTION_TIME_MS: 30000 = 30_000;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:55
Default execution time limit in milliseconds.
DEFAULT_PERMISSIONS
const DEFAULT_PERMISSIONS: readonly SkillPermission[];
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:45
Default permissions for new skills (minimal, read-only).
DEFAULT_RBAC
const DEFAULT_RBAC: SkillRBAC;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:101
Default RBAC allowing all roles without attestation requirement.
DEFAULT_ROLE_MAPPINGS
const DEFAULT_ROLE_MAPPINGS: readonly RoleSkillMapping[];
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:278
Default role-to-skill category mappings. Maps expert roles to their appropriate skill categories.
DEFAULT_SKILL_LIBRARY_CONFIG
const DEFAULT_SKILL_LIBRARY_CONFIG: SkillLibraryConfig;
Defined in: packages/nexus-agents/src/agents/skills/skill-types.ts:336
Default skill library configuration.
DEFAULT_SKILL_LOADER_CONFIG
const DEFAULT_SKILL_LOADER_CONFIG: SkillLoaderConfig;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:361
Default skill loader configuration.
DependencyErrorCodeSchema
const DependencyErrorCodeSchema: ZodEnum<{
CIRCULAR_DEPENDENCY: "CIRCULAR_DEPENDENCY";
MISSING_DEPENDENCY: "MISSING_DEPENDENCY";
SELF_DEPENDENCY: "SELF_DEPENDENCY";
SKILL_NOT_FOUND: "SKILL_NOT_FOUND";
VERSION_MISMATCH: "VERSION_MISMATCH";
}>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:110
Zod schema for DependencyErrorCode.
DependencyErrorSchema
const DependencyErrorSchema: ZodObject<{
code: ZodEnum<{
CIRCULAR_DEPENDENCY: "CIRCULAR_DEPENDENCY";
MISSING_DEPENDENCY: "MISSING_DEPENDENCY";
SELF_DEPENDENCY: "SELF_DEPENDENCY";
SKILL_NOT_FOUND: "SKILL_NOT_FOUND";
VERSION_MISMATCH: "VERSION_MISMATCH";
}>;
context: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
message: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:121
Zod schema for DependencyError.
LoadedSkillSetSchema
const LoadedSkillSetSchema: ZodObject<{
agentId: ZodString;
agentRole: ZodEnum<{
architecture_expert: "architecture_expert";
code_expert: "code_expert";
custom: "custom";
devops_expert: "devops_expert";
documentation_expert: "documentation_expert";
orchestrator: "orchestrator";
security_expert: "security_expert";
testing_expert: "testing_expert";
thinker: "thinker";
verifier: "verifier";
worker: "worker";
}>;
executionOrder: ZodReadonly<ZodArray<ZodString>>;
loadedAt: ZodDate;
missingRequired: ZodReadonly<ZodArray<ZodString>>;
skills: ZodReadonly<ZodArray<ZodAny>>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:240
Zod schema for LoadedSkillSet.
MAX_EXECUTION_TIME_MS
const MAX_EXECUTION_TIME_MS: 300000 = 300_000;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:50
Maximum execution time in milliseconds.
SecurityErrorCodeSchema
const SecurityErrorCodeSchema: ZodEnum<{
ATTESTATION_REQUIRED: "ATTESTATION_REQUIRED";
EXECUTION_TIMEOUT: "EXECUTION_TIMEOUT";
INVALID_PROVENANCE: "INVALID_PROVENANCE";
PERMISSION_DENIED: "PERMISSION_DENIED";
ROLE_NOT_ALLOWED: "ROLE_NOT_ALLOWED";
SANDBOX_VIOLATION: "SANDBOX_VIOLATION";
SIGNATURE_MISMATCH: "SIGNATURE_MISMATCH";
}>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-schemas.ts:139
Zod schema for SecurityErrorCode.
SKILL_DEFAULT_CAPABILITIES
const SKILL_DEFAULT_CAPABILITIES: SkillCapabilities;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:76
Default capabilities for new skills.
SKILL_PERMISSIONS
const SKILL_PERMISSIONS: readonly SkillPermission[];
Defined in: packages/nexus-agents/src/agents/skills/skill-security-types.ts:33
All valid skill permissions as a readonly array.
SkillAgentRoleSchema
const SkillAgentRoleSchema: ZodEnum<{
architecture_expert: "architecture_expert";
code_expert: "code_expert";
custom: "custom";
documentation_expert: "documentation_expert";
infrastructure_expert: "infrastructure_expert";
orchestrator: "orchestrator";
security_expert: "security_expert";
testing_expert: "testing_expert";
thinker: "thinker";
verifier: "verifier";
worker: "worker";
}>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-schemas.ts:33
Zod schema for AgentRole (mirrors core/types/agent.ts).
SkillAttestationSchema
const SkillAttestationSchema: ZodObject<{
authorizationMethod: ZodEnum<{
explicit: "explicit";
inherited: "inherited";
role: "role";
}>;
authorized: ZodBoolean;
executorId: ZodString;
inputHash: ZodString;
skillId: ZodString;
timestamp: ZodDate;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-schemas.ts:119
Zod schema for SkillAttestation.
SkillCapabilitiesSchema
const SkillCapabilitiesSchema: ZodObject<{
maxExecutionTime: ZodNumber;
permissions: ZodReadonly<ZodArray<ZodEnum<{
execute: "execute";
filesystem: "filesystem";
network: "network";
read: "read";
spawn: "spawn";
write: "write";
}>>>;
sandboxed: ZodBoolean;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-schemas.ts:54
Zod schema for SkillCapabilities.
SkillDependencySchema
const SkillDependencySchema: ZodObject<{
dependsOn: ZodString;
minVersion: ZodOptional<ZodNumber>;
skillId: ZodString;
type: ZodEnum<{
optional: "optional";
recommended: "recommended";
required: "required";
}>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:100
Zod schema for SkillDependency.
SkillDependencyTypeSchema
const SkillDependencyTypeSchema: ZodEnum<{
optional: "optional";
recommended: "recommended";
required: "required";
}>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-types.ts:95
Zod schema for SkillDependencyType.
SkillLoaderConfigSchema
const SkillLoaderConfigSchema: ZodObject<{
defaultMaxSkills: ZodDefault<ZodNumber>;
enforceDependencies: ZodDefault<ZodBoolean>;
enforceRBAC: ZodDefault<ZodBoolean>;
fallbackBehavior: ZodDefault<ZodEnum<{
empty: "empty";
error: "error";
partial: "partial";
}>>;
mappings: ZodReadonly<ZodArray<ZodObject<{
maxSkills: ZodOptional<ZodNumber>;
optionalCategories: ZodOptional<ZodReadonly<ZodArray<ZodEnum<{
api: ...;
cloud-native: ...;
code-analysis: ...;
code-generation: ...;
coding-standards: ...;
compliance: ...;
database: ...;
debugging: ...;
deployment: ...;
devops: ...;
documentation: ...;
file-operations: ...;
frontend: ...;
general: ...;
observability: ...;
refactoring: ...;
security: ...;
testing: ...;
}>>>>;
requiredCategories: ZodReadonly<ZodArray<ZodEnum<{
api: "api";
cloud-native: "cloud-native";
code-analysis: "code-analysis";
code-generation: "code-generation";
coding-standards: "coding-standards";
compliance: "compliance";
database: "database";
debugging: "debugging";
deployment: "deployment";
devops: "devops";
documentation: "documentation";
file-operations: "file-operations";
frontend: "frontend";
general: "general";
observability: "observability";
refactoring: "refactoring";
security: "security";
testing: "testing";
}>>>;
role: ZodEnum<{
architecture_expert: "architecture_expert";
code_expert: "code_expert";
custom: "custom";
devops_expert: "devops_expert";
documentation_expert: "documentation_expert";
orchestrator: "orchestrator";
security_expert: "security_expert";
testing_expert: "testing_expert";
thinker: "thinker";
verifier: "verifier";
worker: "worker";
}>;
}, $strip>>>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:229
Zod schema for SkillLoaderConfig.
SkillLoaderErrorSchema
const SkillLoaderErrorSchema: ZodObject<{
code: ZodEnum<{
DEPENDENCY_ERROR: "DEPENDENCY_ERROR";
EMPTY_RESULT: "EMPTY_RESULT";
RBAC_DENIED: "RBAC_DENIED";
REQUIRED_CATEGORY_MISSING: "REQUIRED_CATEGORY_MISSING";
ROLE_NOT_MAPPED: "ROLE_NOT_MAPPED";
VALIDATION_ERROR: "VALIDATION_ERROR";
}>;
context: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
message: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-types.ts:264
Zod schema for SkillLoaderError.
SkillPermissionSchema
const SkillPermissionSchema: ZodEnum<{
execute: "execute";
filesystem: "filesystem";
network: "network";
read: "read";
spawn: "spawn";
write: "write";
}>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-schemas.ts:21
Zod schema for SkillPermission.
SkillProvenanceSchema
const SkillProvenanceSchema: ZodObject<{
createdAt: ZodDate;
createdBy: ZodString;
modifiedAt: ZodOptional<ZodDate>;
modifiedBy: ZodOptional<ZodString>;
signature: ZodOptional<ZodString>;
version: ZodNumber;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-schemas.ts:98
Zod schema for SkillProvenance.
SkillRBACSchema
const SkillRBACSchema: ZodObject<{
allowedRoles: ZodReadonly<ZodArray<ZodEnum<{
architecture_expert: "architecture_expert";
code_expert: "code_expert";
custom: "custom";
documentation_expert: "documentation_expert";
infrastructure_expert: "infrastructure_expert";
orchestrator: "orchestrator";
security_expert: "security_expert";
testing_expert: "testing_expert";
thinker: "thinker";
verifier: "verifier";
worker: "worker";
}>>>;
deniedRoles: ZodOptional<ZodReadonly<ZodArray<ZodEnum<{
architecture_expert: "architecture_expert";
code_expert: "code_expert";
custom: "custom";
documentation_expert: "documentation_expert";
infrastructure_expert: "infrastructure_expert";
orchestrator: "orchestrator";
security_expert: "security_expert";
testing_expert: "testing_expert";
thinker: "thinker";
verifier: "verifier";
worker: "worker";
}>>>>;
requiresAttestation: ZodBoolean;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-schemas.ts:77
Zod schema for SkillRBAC.
SkillSecurityErrorSchema
const SkillSecurityErrorSchema: ZodObject<{
code: ZodEnum<{
ATTESTATION_REQUIRED: "ATTESTATION_REQUIRED";
EXECUTION_TIMEOUT: "EXECUTION_TIMEOUT";
INVALID_PROVENANCE: "INVALID_PROVENANCE";
PERMISSION_DENIED: "PERMISSION_DENIED";
ROLE_NOT_ALLOWED: "ROLE_NOT_ALLOWED";
SANDBOX_VIOLATION: "SANDBOX_VIOLATION";
SIGNATURE_MISMATCH: "SIGNATURE_MISMATCH";
}>;
context: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
message: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security-schemas.ts:152
Zod schema for SkillSecurityError.
Functions
buildSkillDependencyGraph()
function buildSkillDependencyGraph(skills): ISkillDependencyGraph;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:309
Builds a dependency graph from an array of skills.
Parameters
skills
readonly Skill[]
Returns
canExecuteSkill()
function canExecuteSkill(agentRole, rbac): boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-security.ts:86
Checks if an agent role can execute a skill based on RBAC rules.
Parameters
agentRole
The role of the agent attempting execution
rbac
The skill’s RBAC configuration
Returns
boolean
True if the role is allowed to execute the skill
checkPermissionBoundary()
function checkPermissionBoundary(capabilities, requestedPermissions): boolean;
Defined in: packages/nexus-agents/src/agents/skills/skill-security.ts:202
Checks if requested permissions are within the skill’s permission boundary.
Parameters
capabilities
The skill’s capability configuration
requestedPermissions
readonly SkillPermission[]
Permissions being requested for an operation
Returns
boolean
True if all requested permissions are allowed
createAttestation()
function createAttestation(
skillId,
executorId,
input,
authorized,
method
): SkillAttestation;
Defined in: packages/nexus-agents/src/agents/skills/skill-security.ts:123
Creates an attestation record for a skill execution.
Parameters
skillId
string
ID of the skill being executed
executorId
string
ID of the agent executing the skill
input
unknown
Input parameters for the skill
authorized
boolean
Whether execution is authorized
method
How authorization was determined
Returns
A new SkillAttestation record
createDependencyError()
function createDependencyError(
code,
message,
context?
): DependencyError;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-helpers.ts:38
Creates a dependency error with the given code and message.
Parameters
code
The error code
message
string
Human-readable error message
context?
Record<string, unknown>
Additional context for debugging
Returns
A DependencyError
createSecurityError()
function createSecurityError(
code,
message,
context?
): SkillSecurityError;
Defined in: packages/nexus-agents/src/agents/skills/skill-security.ts:222
Creates a security error with the given code and message.
Parameters
code
The error code
message
string
Human-readable error message
context?
Record<string, unknown>
Additional context for debugging
Returns
A SkillSecurityError
createSkillComposer()
function createSkillComposer(
library,
config?,
logger?
): SkillComposer;
Defined in: packages/nexus-agents/src/agents/skills/skill-composer.ts:386
Creates a skill composer.
Parameters
library
config?
Partial<SkillComposerConfig>
logger?
Returns
createSkillDependencyGraph()
function createSkillDependencyGraph(): ISkillDependencyGraph;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph.ts:330
Creates an empty skill dependency graph.
Returns
createSkillLibrary()
function createSkillLibrary(config?, logger?): SkillLibrary;
Defined in: packages/nexus-agents/src/agents/skills/skill-library.ts:433
Creates a skill library with optional configuration.
Parameters
config?
Partial<SkillLibraryConfig>
logger?
Returns
createSkillLoader()
function createSkillLoader(
library,
config?,
logger?
): ISkillLoader;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader.ts:396
Creates a skill loader with the given library and configuration.
Parameters
library
config?
Partial<SkillLoaderConfig>
logger?
Returns
findMissingDependencies()
function findMissingDependencies(
graph,
skillIds,
available
): readonly string[];
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-helpers.ts:239
Finds missing dependencies for a set of skills.
Parameters
graph
The dependency graph
skillIds
readonly string[]
Skills to check
available
ReadonlySet<string>
Set of available skill IDs
Returns
readonly string[]
Array of missing required dependency IDs
getSkillSetForTask()
function getSkillSetForTask(
agent,
task,
loader
): Result<LoadedSkillSet, SkillLoaderError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-integration.ts:98
Gets the full loaded skill set for a task execution.
Unlike getSkillsForTask, this returns the complete LoadedSkillSet
including execution order and missing required information.
Parameters
agent
The agent that will execute the task
task
The task to get skills for
loader
The skill loader to use
Returns
Result<LoadedSkillSet, SkillLoaderError>
Result with LoadedSkillSet or SkillLoaderError on failure
getSkillsForTask()
function getSkillsForTask(
agent,
task,
loader
): Result<readonly Skill[], SkillLoaderError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-integration.ts:77
Gets skills appropriate for a task execution.
Loads skills based on the agent’s role and the task description, potentially including additional task-relevant skills beyond the agent’s default role-based skills.
Parameters
agent
The agent that will execute the task
task
The task to get skills for
loader
The skill loader to use
Returns
Result<readonly Skill[], SkillLoaderError>
Result with readonly array of skills or SkillLoaderError on failure
Example
const agent = createAgent({ id: 'agent-1', role: 'code_expert' });
const task = { id: 'task-1', description: 'Refactor the user service' };
const loader = createSkillLoader(library);
const result = getSkillsForTask(agent, task, loader);
if (result.ok) {
console.log(`Loaded ${result.value.length} skills for task`);
}
initializeAgentSkills()
function initializeAgentSkills(agent, loader): Result<void, SkillLoaderError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-loader-integration.ts:40
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
The agent to initialize skills for
loader
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);
}
resolveWithFallbacks()
function resolveWithFallbacks(
graph,
skillIds,
available
): Result<readonly string[], DependencyError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-dependency-graph-helpers.ts:193
Resolves skill dependencies with fallbacks for missing optional dependencies.
Parameters
graph
The dependency graph
skillIds
readonly string[]
Skills to resolve
available
ReadonlySet<string>
Set of available skill IDs
Returns
Result<readonly string[], DependencyError>
Result with resolved skill IDs or error
validateSkillCapabilities()
function validateSkillCapabilities(capabilities): Result<void, SkillSecurityError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security.ts:241
Validates capabilities against security constraints.
Parameters
capabilities
The capabilities to validate
Returns
Result<void, SkillSecurityError>
Result indicating success or validation error
validateSkillExecution()
function validateSkillExecution(
agentRole,
capabilities,
rbac,
requestedPermissions
): Result<void, SkillSecurityError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security.ts:318
Performs comprehensive security validation for skill execution.
Parameters
agentRole
The role of the agent attempting execution
capabilities
The skill’s capabilities
rbac
The skill’s RBAC configuration
requestedPermissions
readonly SkillPermission[]
Permissions needed for the operation
Returns
Result<void, SkillSecurityError>
Result indicating success or the first validation error
validateSkillProvenance()
function validateSkillProvenance(provenance): Result<void, SkillSecurityError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security.ts:150
Validates skill provenance for integrity.
Parameters
provenance
The provenance to validate
Returns
Result<void, SkillSecurityError>
Result indicating success or validation error
validateSkillRBAC()
function validateSkillRBAC(rbac): Result<void, SkillSecurityError>;
Defined in: packages/nexus-agents/src/agents/skills/skill-security.ts:279
Validates RBAC configuration.
Parameters
rbac
The RBAC configuration to validate
Returns
Result<void, SkillSecurityError>
Result indicating success or validation error