Method TryLoad
TryLoad(string, out AgentSkill)
Tries to load an Agent Skill from a directory.
public static bool TryLoad(string skillPath, out AgentSkill skill)
Parameters
skillPathstringThe path to the skill directory.
skillAgentSkillWhen this method returns, contains the loaded skill if successful; otherwise,
null.
Returns
- bool
trueif the skill was loaded successfully; otherwise,false.
Examples
Safe loading without exceptions:
if (AgentSkill.TryLoad("./skills/code-review", out var skill))
{
Console.WriteLine($"Loaded: {skill.Name}");
}
else
{
Console.WriteLine("Failed to load skill");
}