Octopus
Using SK Skills
SK skills are collections of semantic functions (prompt templates) that can be loaded into the SK kernel and called by name. The SemanticKernelPlugin allows loading these skill libraries as part of the Octopus plugin startup.
What Is an SK Skill?
An SK skill is a directory containing one or more semantic functions. Each function has:
- A
skprompt.txt— the prompt template with Handlebars-style variable substitution - A
config.json— model settings (max tokens, temperature, etc.)
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
| Feature | SK Skill (semantic function) | Octopus AI Function (JavaScript) |
|---|---|---|
| Language | Prompt template (skprompt.txt) | JavaScript (Jint/V8) |
| Storage | File system (deployed with app) | SQL Server (no deployment) |
| LLM call | Yes — calls LLM to execute | No — pure computation |
| Editable at runtime | No — requires redeployment | Yes — edit in admin UI |
| Best for | Prompt-based transformations, summarisation | Data manipulation, rule evaluation, formatting |