Table of Contents

Method TryParseSlashCommand

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

TryParseSlashCommand(string, out AgentSkill, out string)

Parses a slash command and returns the matching skill.

public bool TryParseSlashCommand(string input, out AgentSkill skill, out string arguments)

Parameters

input string

The user input starting with a slash (e.g., /pdf-processing).

skill AgentSkill

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

arguments string

When this method returns, contains the remaining text after the skill name; otherwise, null.

Returns

bool

true if a slash command was parsed and a skill was found; otherwise, false.

Examples

Parsing a slash command from user input:

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

string userInput = "/code-review check for security issues";
if (registry.TryParseSlashCommand(userInput, out var skill, out var args))
{
    Console.WriteLine($"Skill: {skill.Name}");
    Console.WriteLine($"Arguments: {args}"); // "check for security issues"
}