Table of Contents

Method LoadFromGitHubAsync

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

LoadFromGitHubAsync(string, string, string, string, bool, CancellationToken)

Asynchronously loads and registers a skill from a GitHub repository.

public Task<AgentSkill> LoadFromGitHubAsync(string owner, string repo, string path, string branch = "main", bool overwrite = false, CancellationToken cancellationToken = default)

Parameters

owner string

The repository owner (username or organization).

repo string

The repository name.

path string

The path to the skill directory within the repository.

branch string

The branch name. Defaults to "main".

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 skill.

Examples

Loading a skill from a GitHub repository:

var registry = new SkillRegistry();
var skill = await registry.LoadFromGitHubAsync(
    owner: "myorg",
    repo: "skills-library",
    path: "skills/code-review");
Console.WriteLine($"Loaded from GitHub: {skill.Name}");

Exceptions

ArgumentNullException

Thrown when required parameters are null or empty.

HttpRequestException

Thrown when the HTTP request fails.