Method LoadFromGitHubAsync
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
ownerstringThe repository owner (username or organization).
repostringThe repository name.
pathstringThe path to the skill directory within the repository.
branchstringThe branch name. Defaults to "main".
overwriteboolWhether to overwrite existing skills with the same name.
cancellationTokenCancellationTokenA 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
nullor empty.- HttpRequestException
Thrown when the HTTP request fails.