Table of Contents

Method LoadFromUrlAsync

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

LoadFromUrlAsync(string, bool, CancellationToken)

Asynchronously loads and registers a skill from a remote URL.

public Task<int> LoadFromUrlAsync(string url, bool overwrite = false, CancellationToken cancellationToken = default)

Parameters

url string

The URL to the skill. Can be a direct SKILL.md URL or a ZIP archive.

overwrite bool

Whether to overwrite existing skills with the same name.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<int>

A task that represents the asynchronous operation, containing the number of skills loaded.

Examples

Loading a skill from a remote URL:

var registry = new SkillRegistry();
int loaded = await registry.LoadFromUrlAsync("https://example.com/skills/code-review/SKILL.md");
Console.WriteLine($"Loaded {loaded} skills from URL");

Remarks

This method uses SkillRemoteLoader internally. Skills are cached locally.

Exceptions

ArgumentNullException

Thrown when url is null or empty.

HttpRequestException

Thrown when the HTTP request fails.