Table of Contents

Method LoadAndRegisterAsync

Namespace
LMKit.Agents.Skills
Assembly
LM-Kit.NET.dll

LoadAndRegisterAsync(string, bool, CancellationToken)

Asynchronously loads and registers a skill from a directory.

public Task<AgentSkill> LoadAndRegisterAsync(string skillPath, bool overwrite = false, CancellationToken cancellationToken = default)

Parameters

skillPath string

The path to the skill directory.

overwrite bool

Whether to overwrite existing skills with the same name.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<AgentSkill>

A task that represents the asynchronous operation, containing the loaded and registered skill.

Examples

Asynchronously loading and registering a skill:

var registry = new SkillRegistry();
var skill = await registry.LoadAndRegisterAsync("./skills/code-review");
Console.WriteLine($"Loaded: {skill.Name}");

Exceptions

SkillParseException

Thrown when the skill cannot be parsed.

OperationCanceledException

Thrown when the operation is cancelled.