Method LoadFromGitHubAsync
LoadFromGitHubAsync(string, string, string, string, CancellationToken)
Loads a skill from a GitHub repository.
public Task<AgentSkill> LoadFromGitHubAsync(string owner, string repo, string path, string branch = "main", 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".
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<AgentSkill>
The loaded skill.
Examples
Loading a skill from GitHub:
using var loader = new SkillRemoteLoader();
var skill = await loader.LoadFromGitHubAsync(
owner: "myorg",
repo: "skills-library",
path: "skills/code-review",
branch: "main");
Console.WriteLine($"Loaded from GitHub: {skill.Name}");
Exceptions
- ArgumentNullException
Thrown when required parameters are
nullor empty.- HttpRequestException
Thrown when the HTTP request fails.
- SkillParseException
Thrown when the skill cannot be parsed.