Table of Contents

Method TryGet

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

TryGet(string, out AgentSkill)

Tries to get a skill by name.

public bool TryGet(string name, out AgentSkill skill)

Parameters

name string

The skill name (case-insensitive).

skill AgentSkill

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

Returns

bool

true if the skill was found; otherwise, false.

Examples

Safe skill retrieval without exceptions:

var registry = new SkillRegistry();
registry.LoadFromDirectory("./skills");

if (registry.TryGet("code-review", out var skill))
{
    Console.WriteLine(skill.Description);
}
else
{
    Console.WriteLine("Skill not found");
}