Table of Contents

Method ParseAsync

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

ParseAsync(string, CancellationToken)

Asynchronously parses a skill from the specified directory.

public static Task<AgentSkill> ParseAsync(string skillPath, CancellationToken cancellationToken = default)

Parameters

skillPath string

The path to the skill directory containing a SKILL.md file.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<AgentSkill>

A task that represents the asynchronous operation, containing the parsed Agent Skill.

Examples

Asynchronously parsing a skill:

var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
var skill = await SkillParser.ParseAsync("./skills/code-review", cts.Token);
Console.WriteLine($"Parsed: {skill.Name}");

Exceptions

ArgumentNullException

Thrown when skillPath is null.

DirectoryNotFoundException

Thrown when the specified directory does not exist.

FileNotFoundException

Thrown when SKILL.md is not found in the specified directory.

SkillParseException

Thrown when the SKILL.md file cannot be parsed.

OperationCanceledException

Thrown when the operation is cancelled.