Table of Contents

Method TryLoad

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

TryLoad(string, out AgentSkill)

Tries to load an Agent Skill from a directory.

public static bool TryLoad(string skillPath, out AgentSkill skill)

Parameters

skillPath string

The path to the skill directory.

skill AgentSkill

When this method returns, contains the loaded skill if successful; otherwise, null.

Returns

bool

true if 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");
}