Table of Contents

Method SaveToFile

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

SaveToFile(string, bool)

Saves the skill to disk as a SKILL.md file.

public string SaveToFile(string directoryPath, bool createDirectory = true)

Parameters

directoryPath string

The directory where the skill will be saved.

createDirectory bool

Whether to create the directory if it doesn't exist.

Returns

string

The path to the created SKILL.md file.

Examples

Saving a skill to disk:

var builder = new SkillBuilder()
    .WithName("code-review")
    .WithDescription("Reviews code")
    .WithInstructions("# Guidelines\n...");

string skillPath = builder.SaveToFile("./skills/code-review");
Console.WriteLine($"Skill saved to: {skillPath}");

Exceptions

InvalidOperationException

Thrown when required fields are missing.