Method TryParseSlashCommand
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
inputstringThe user input starting with a slash (e.g.,
/pdf-processing).skillAgentSkillWhen this method returns, contains the matching skill if found; otherwise,
null.argumentsstringWhen this method returns, contains the remaining text after the skill name; otherwise,
null.
Returns
- bool
trueif 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"
}