Portal Community

What Is an SK Skill?

An SK skill is a directory containing one or more semantic functions. Each function has:

Skills/
├── HRSkill/
│   ├── SummarizeLeavePolicy/
│   │   ├── skprompt.txt
│   │   └── config.json
│   └── DraftLeaveEmail/
│       ├── skprompt.txt
│       └── config.json
└── SupportSkill/
    └── CategorizeTicket/
        ├── skprompt.txt
        └── config.json

Skill Prompt Example

// Skills/HRSkill/SummarizeLeavePolicy/skprompt.txt
You are an HR assistant. Summarize the leave policy below in plain English,
using bullet points. Keep the summary under 200 words.

Leave Policy:
{{$policy_text}}

Summary:
// Skills/HRSkill/SummarizeLeavePolicy/config.json
{
  "schema": 1,
  "description": "Summarize a leave policy document in plain English.",
  "execution_settings": {
    "default": {
      "max_tokens": 300,
      "temperature": 0.3
    }
  },
  "input_variables": [
    {
      "name": "policy_text",
      "description": "The full leave policy text to summarize",
      "is_required": true
    }
  ]
}

Loading Skills in OnStartAsync

public async Task OnStartAsync(IServiceProvider sp, CancellationToken ct)
{
    var kernel = sp.GetRequiredService<ISKKernelRegistry>().Get("default");

    // Load all skills from a directory on disk
    var skillsPath = Path.Combine(AppContext.BaseDirectory, "Skills");
    kernel.ImportPluginFromPromptDirectory(skillsPath, "HRSkill");
    kernel.ImportPluginFromPromptDirectory(skillsPath, "SupportSkill");

    await Task.CompletedTask;
}

Calling a Skill from an MCP Tool Handler

// MCP tool handler that delegates to an SK semantic function
var result = await kernel.InvokeAsync(
    pluginName:    "HRSkill",
    functionName:  "SummarizeLeavePolicy",
    arguments:     new KernelArguments
    {
        ["policy_text"] = rawPolicyText
    });

return JsonSerializer.Serialize(new
{
    summary   = result.GetValue<string>(),
    word_count = result.GetValue<string>()?.Split(' ').Length ?? 0
});

Skill vs AI Function Comparison

FeatureSK Skill (semantic function)Octopus AI Function (JavaScript)
LanguagePrompt template (skprompt.txt)JavaScript (Jint/V8)
StorageFile system (deployed with app)SQL Server (no deployment)
LLM callYes — calls LLM to executeNo — pure computation
Editable at runtimeNo — requires redeploymentYes — edit in admin UI
Best forPrompt-based transformations, summarisationData manipulation, rule evaluation, formatting