Method LoadFromUrlAsync
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
urlstringThe URL to the skill. Can be a direct SKILL.md URL or a ZIP archive.
overwriteboolWhether to overwrite existing skills with the same name.
cancellationTokenCancellationTokenA 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
urlisnullor empty.- HttpRequestException
Thrown when the HTTP request fails.