Table of Contents

Method Activate

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

Activate(string, string)

Activates a skill by name and prepares its context for injection.

public SkillContext Activate(string skillName, string userContext = null)

Parameters

skillName string

The name of the skill to activate.

userContext string

Optional additional context from the user.

Returns

SkillContext

The prepared skill context.

Examples

Activating a skill by name:

var activator = new SkillActivator(registry);
var context = activator.Activate("code-review", "Focus on security issues");
Console.WriteLine(context.FormattedInstructions);

Exceptions

InvalidOperationException

Thrown when the registry is not set or the skill is not found.

Activate(AgentSkill, string)

Activates a skill and prepares its context for injection.

public SkillContext Activate(AgentSkill skill, string userContext = null)

Parameters

skill AgentSkill

The skill to activate.

userContext string

Optional additional context from the user.

Returns

SkillContext

The prepared skill context.

Examples

Activating a skill directly:

var skill = AgentSkill.Load("./skills/code-review");
var activator = new SkillActivator();
var context = activator.Activate(skill, "Review for memory leaks");

Exceptions

ArgumentNullException

Thrown when skill is null.