Agent skill

Semantic Kernel

by managedcode in managedcode/dotnet-skills

Build AI-enabled .NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable.

MITAuto-check passedAI & LLM Engineering

Install Semantic Kernel

skills CLI
$ npx skills add managedcode/dotnet-skills --skill semantic-kernel -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install managedcode/dotnet-skills semantic-kernel --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/managedcode/dotnet-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/catalog/Frameworks/Semantic-Kernel/skills/semantic-kernel .claude/skills/semantic-kernel && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
semantic-kernel
GitHub stars
486
Token cost
~2.8k tokens
SKILL.md length
600 words
Files
4 (incl. references)
Skills in repo
81
Repo updated
First seen
Licence
MIT

At a glance

Build AI-enabled .NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable.

  • Works in 9 steps: Build the Kernel with required services → Create Plugins with well-described… → Configure Function Calling for automatic… → …
  • : adding AI-driven prompts
  • SKILL.md covers Trigger On, Documentation, Core Concepts and Workflow, plus 11 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Semantic Kernel is an agent skill from managedcode/dotnet-skills. Build AI-enabled .NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable. USE FOR: adding AI-driven prompts, plugins, or orchestration to a .NET app; reviewing kernel construction, service registration, or plugin usage; building function-calling. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint…

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `manifest.json`, `references/anti-patterns.md` and `references/patterns.md`). Compatibility notes: Requires Semantic Kernel 1.x packages (.NET 8+).

It sits in AI & LLM Engineering, covering Structured output and tool calling, Codebase knowledge for agents and LLM API integration. It works with .NET and OpenAPI. The repository describes itself as: Installable .NET skill catalog and CLI for Codex, Claude Code, GitHub Copilot, and Gemini. The licence is MIT.

When your agent uses it

  • : adding AI-driven prompts
  • Orchestration to a .NET app
  • Reviewing kernel construction
  • Service registration

Example prompts

  • “/semantic-kernel”

Requirements

  • Compatibility (from SKILL.md): Requires Semantic Kernel 1.x packages (.NET 8+).

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Build the Kernel with required services
  2. Create Plugins with well-described functions
  3. Configure Function Calling for automatic tool use
  4. Handle Responses and manage conversation state
  5. Test and Observe AI behavior with logging
  6. For Semantic Kernel dotnet-1.79.0 and later, keep OpenAPI plugin server URL validation enabled, do not re-enable automatic redirects on…
  7. Re-test Cosmos DB vector-store queries, file and document plugins, OpenAPI server-variable URLs, and Ollama reasoning settings after…
  8. Treat the Prompty.Core 2.0.0-beta.3 update in 1.79.0 as a breaking dependency change. Re-run prompt-template tests and remove security…
  9. In 1.80.0, re-test OpenAPI plugin HTTP-client defaults and Gemini calls that restrict FunctionChoiceBehavior to a supplied function list…

What it can do on your machine

Read from SKILL.md and the folder at commit 535dd55. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires Semantic Kernel 1.x packages (.NET 8+).

    From compatibility in the SKILL.md frontmatter.

Context cost

Semantic Kernel loads about 2.8k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 145 tokens; SKILL.md has 600 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~145
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from managedcode/dotnet-skills at commit 535dd55, republished under its MIT licence (© managedcode). 600 words, ~2,758 tokens.

Download SKILL.mdSave it as .claude/skills/semantic-kernel/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
semantic-kernel
description
Build AI-enabled .NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable. USE FOR: adding AI-driven prompts, plugins, or orchestration to a .NET app; reviewing kernel construction, service registration, or plugin usage; building function-calling. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.
compatibility
Requires Semantic Kernel 1.x packages (.NET 8+).

Semantic Kernel for .NET

Trigger On

  • adding AI-driven prompts, plugins, or orchestration to a .NET app
  • reviewing kernel construction, service registration, or plugin usage
  • building function-calling patterns with LLMs
  • migrating older Semantic Kernel code to current APIs

Documentation

References
  • patterns.md - Plugin patterns, function calling patterns, multi-agent patterns, prompt templates, and RAG patterns
  • anti-patterns.md - Common Semantic Kernel mistakes and how to avoid them

Core Concepts

ConceptDescription
KernelCentral orchestrator for AI services and plugins
PluginCollection of functions exposed to the LLM
FunctionNative C# method or prompt template
Chat CompletionLLM service for generating responses
MemoryVector storage for semantic search

Workflow

  1. Build the Kernel with required services
  2. Create Plugins with well-described functions
  3. Configure Function Calling for automatic tool use
  4. Handle Responses and manage conversation state
  5. Test and Observe AI behavior with logging
  6. For Semantic Kernel dotnet-1.79.0 and later, keep OpenAPI plugin server URL validation enabled, do not re-enable automatic redirects on the default HttpPlugin or WebFileDownloadPlugin clients without an explicit trusted-host policy, and use the current Microsoft Agent Framework-compatible migration samples when moving SK agent code to Agent Framework.
  7. Re-test Cosmos DB vector-store queries, file and document plugins, OpenAPI server-variable URLs, and Ollama reasoning settings after upgrading to 1.79.0. The release fixes the Cosmos vector-store path, rejects mixed-separator UNC paths, URL-encodes OpenAPI server variables, adds Ollama Think, and allows deterministic TimePlugin tests through TimeProvider injection.
  8. Treat the Prompty.Core 2.0.0-beta.3 update in 1.79.0 as a breaking dependency change. Re-run prompt-template tests and remove security workarounds that are no longer needed after the vulnerable transitive version is gone.
  9. In 1.80.0, re-test OpenAPI plugin HTTP-client defaults and Gemini calls that restrict FunctionChoiceBehavior to a supplied function list. The migrated .NET MEVD providers are no longer owned by Semantic Kernel; follow their redirect guidance and keep vector-provider package references explicit during upgrades.

For 1.80.1, update migrated vector-provider references to the current CommunityToolkit.VectorData package names and re-run connector and OpenAPI plugin tests after the dependency refresh. The release removes retired OpenAI Assistants integration tests; do not interpret that removal as a working Assistants migration path. Use Responses or the current Agent Framework migration guidance for affected integrations.

Show full SKILL.md (219 more words)Show less

Kernel Setup

Basic Configuration
csharp
var builder = Kernel.CreateBuilder();

builder.AddAzureOpenAIChatCompletion(
    deploymentName: "gpt-4",
    endpoint: config["AzureOpenAI:Endpoint"]!,
    apiKey: config["AzureOpenAI:ApiKey"]!);

// Or OpenAI
builder.AddOpenAIChatCompletion(
    modelId: "gpt-4",
    apiKey: config["OpenAI:ApiKey"]!);

var kernel = builder.Build();
With Dependency Injection
csharp
builder.Services.AddKernel()
    .AddAzureOpenAIChatCompletion(
        deploymentName: "gpt-4",
        endpoint: config["AzureOpenAI:Endpoint"]!,
        apiKey: config["AzureOpenAI:ApiKey"]!);

// Register plugins
builder.Services.AddSingleton<WeatherPlugin>();
builder.Services.AddSingleton<OrderPlugin>();

// In your service
public class AiService(Kernel kernel)
{
    public async Task<string> ChatAsync(string message)
    {
        var response = await kernel.InvokePromptAsync(message);
        return response.ToString();
    }
}

Plugin Patterns

Creating a Plugin
csharp
public class WeatherPlugin
{
    [KernelFunction]
    [Description("Gets the current weather for a specified city")]
    public async Task<string> GetWeather(
        [Description("The city name, e.g., 'Seattle'")] string city,
        [Description("Temperature unit: 'celsius' or 'fahrenheit'")] string unit = "celsius")
    {
        // Call actual weather API
        var weather = await _weatherService.GetCurrentAsync(city);
        return $"Weather in {city}: {weather.Temperature}° {unit}, {weather.Condition}";
    }

    [KernelFunction]
    [Description("Gets the weather forecast for the next N days")]
    public async Task<string> GetForecast(
        [Description("The city name")] string city,
        [Description("Number of days (1-7)")] int days = 3)
    {
        var forecast = await _weatherService.GetForecastAsync(city, days);
        return FormatForecast(forecast);
    }
}
Plugin Best Practices
PracticeWhy It Matters
Clear [Description]LLM uses this to decide when to call
Specific parameter namesHelps LLM map user intent
Idempotent functionsSafe to retry on failures
Return meaningful stringsLLM needs to understand results
Validate inputsLLM may hallucinate parameters

Function Calling

Automatic Function Calling
csharp
var settings = new OpenAIPromptExecutionSettings
{
    FunctionChoiceBehavior = FunctionChoiceBehavior.Auto()
};

kernel.Plugins.AddFromObject(new WeatherPlugin(), "Weather");
kernel.Plugins.AddFromObject(new OrderPlugin(), "Orders");

var result = await kernel.InvokePromptAsync(
    "What's the weather in Seattle and do I have any pending orders?",
    new KernelArguments(settings));
Manual Function Selection
csharp
var settings = new OpenAIPromptExecutionSettings
{
    FunctionChoiceBehavior = FunctionChoiceBehavior.Required(
        [kernel.Plugins["Weather"]["GetWeather"]])
};

Chat Completion Patterns

Multi-Turn Conversation
csharp
var chatService = kernel.GetRequiredService<IChatCompletionService>();
var history = new ChatHistory();

history.AddSystemMessage("You are a helpful assistant.");
history.AddUserMessage(userMessage);

var response = await chatService.GetChatMessageContentAsync(
    history,
    executionSettings: new OpenAIPromptExecutionSettings
    {
        FunctionChoiceBehavior = FunctionChoiceBehavior.Auto()
    },
    kernel: kernel);

history.AddAssistantMessage(response.Content!);
Streaming Response
csharp
await foreach (var chunk in chatService.GetStreamingChatMessageContentsAsync(
    history, executionSettings, kernel))
{
    Console.Write(chunk.Content);
}

Multi-Agent Plugin Isolation

csharp
// WRONG - agents share plugins
var sharedKernel = Kernel.CreateBuilder().Build();
sharedKernel.Plugins.AddFromObject(new AllPlugins());

var agent1 = new ChatCompletionAgent { Kernel = sharedKernel };
var agent2 = new ChatCompletionAgent { Kernel = sharedKernel };
// Both agents have same plugins!

// CORRECT - isolated kernels
var kernel1 = CreateKernelForAgent1();
kernel1.Plugins.AddFromObject(new WeatherPlugin());

var kernel2 = CreateKernelForAgent2();
kernel2.Plugins.AddFromObject(new OrderPlugin());

var agent1 = new ChatCompletionAgent { Kernel = kernel1 };
var agent2 = new ChatCompletionAgent { Kernel = kernel2 };

Anti-Patterns to Avoid

Anti-PatternWhy It's BadBetter Approach
Vague [Description]LLM won't call at right timeBe specific and actionable
Sharing kernel across agentsPlugin leakageClone or create new kernels
No input validationHallucinated parametersValidate and return errors
Using deprecated PlannersRemoved in favor of function callingUse FunctionChoiceBehavior
Ignoring loggingCan't debug AI decisionsEnable Semantic Kernel logging

Error Handling

csharp
[KernelFunction]
[Description("Places an order for a product")]
public async Task<string> PlaceOrder(
    [Description("Product ID")] string productId,
    [Description("Quantity (1-100)")] int quantity)
{
    // Validate inputs
    if (string.IsNullOrEmpty(productId))
        return "Error: Product ID is required";

    if (quantity < 1 || quantity > 100)
        return "Error: Quantity must be between 1 and 100";

    try
    {
        var order = await _orderService.CreateAsync(productId, quantity);
        return $"Order {order.Id} placed successfully for {quantity} units";
    }
    catch (ProductNotFoundException)
    {
        return $"Error: Product '{productId}' not found";
    }
}

Testing Plugins

csharp
[Fact]
public async Task GetWeather_ReturnsFormattedWeather()
{
    var mockWeatherService = new Mock<IWeatherService>();
    mockWeatherService.Setup(w => w.GetCurrentAsync("Seattle"))
        .ReturnsAsync(new Weather { Temperature = 20, Condition = "Sunny" });

    var plugin = new WeatherPlugin(mockWeatherService.Object);

    var result = await plugin.GetWeather("Seattle", "celsius");

    Assert.Contains("20°", result);
    Assert.Contains("Sunny", result);
}

Microsoft Agent Framework

For complex multi-agent scenarios, consider microsoft-agent-framework:

  • Multi-agent orchestration
  • Agent-to-agent communication
  • Enterprise patterns

Deliver

  • kernel setup with clear service and plugin composition
  • AI features that fit naturally into the existing .NET app
  • observable and testable function-calling behavior
  • proper plugin isolation for multi-agent scenarios

Validate

  • plugins have clear, specific descriptions
  • function calling works as expected
  • AI flows are logged and debuggable
  • input validation prevents hallucination issues
  • kernel instances are properly scoped
  • deprecated APIs are not used

© managedcode, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in catalog/Frameworks/Semantic-Kernel/skills/semantic-kernel of managedcode/dotnet-skills.

  • SKILL.md
  • manifest.json
  • references/anti-patterns.md
  • references/patterns.md

Open the folder on GitHubat commit 535dd55

Compare with similar skills

Semantic Kernel next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Semantic Kernel compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Semantic Kernel this skillmanagedcode/dotnet-skills486—~2.8kAutomated safety check: PassMIT
Azure AI Agents Persistent Dotnetmicrosoft/skills3.1k6 repos~3kAutomated safety check: PassMIT
Claude Cookbooks Reference2025Emma/vibe-coding-cn23k1 repos~2.2kAutomated safety check: PassMIT
Gemini API Devgoogle-gemini/gemini-skills4.3k—~5.1kAutomated safety check: PassApache-2.0
Azure Openai To Responsesmicrosoft/ai-agents-for-beginners77k—~6kAutomated safety check: NotesMIT
Anthropic Product Knowledgesyahiidkamil/Software-Engineer-AI-Agent-Atlas3974 repos~651Automated safety check: PassNone

Similar skills

  • Official

    Azure AI Agents Persistent SDK for .NET. An agent skill from microsoft/skills.

    3.1k GitHub starsUsed in 6 repos~3k tokens
    AI & LLM EngineeringAuto-check passed
  • Claude Cookbooks Reference

    2025Emma/vibe-coding-cn

    Reference of Claude API examples and guides covering tool use, vision, RAG, classification, summarization, text-to-SQL, prompt caching and agent patterns.

    23k GitHub starsUsed in 1 repo~2.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Gemini API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, speech generation (TTS), voice…

    4.3k GitHub stars~5.1k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Azure Openai To Responses

    microsoft/ai-agents-for-beginners

    Official

    Migrate Python apps from Azure OpenAI Chat Completions to the Responses API.

    77k GitHub stars~6k tokensUpdated 18 days ago
    AI & LLM EngineeringAuto-check: notes
  • Anthropic Product Knowledge

    syahiidkamil/Software-Engineer-AI-Agent-Atlas

    Stop and consult this skill whenever your response would include specific facts about Anthropic's products.

    397 GitHub starsUsed in 4 repos~651 tokens
    AI & LLM EngineeringAuto-check passed
  • Afm

    scouzi1966/maclocal-api

    Maintain and extend AFM (maclocal-api), a Swift OpenAI-compatible local LLM server and CLI for Apple Foundation Models, MLX models, API gateway proxying, and Vision OCR.

    345 GitHub stars~1.2k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed

More from managedcode/dotnet-skills

All 81 skills in this repo
  • Analyzer Config

    managedcode/dotnet-skills

    Use a repo-root .editorconfig to configure free .NET analyzer and style rules.

    486 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Archunitnet

    managedcode/dotnet-skills

    Use the open-source free ArchUnitNET library for architecture rules in .NET tests.

    486 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Aspire

    managedcode/dotnet-skills

    Build, upgrade, and operate Aspire 13.5.x C or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing, MCP, and deployment patterns for…

    486 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Aspnet Core

    managedcode/dotnet-skills

    Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET.

    486 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Asynkron Profiler

    managedcode/dotnet-skills

    Use the open-source free Asynkron.Profiler dotnet tool for CLI-first CPU, allocation, exception, contention, and heap profiling of .NET commands or existing trace artifacts.

    486 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Azure Functions

    managedcode/dotnet-skills

    Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns.

    486 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Works with

Questions about Semantic Kernel

What does Semantic Kernel do?

Build AI-enabled .NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable. Semantic Kernel is an agent skill from managedcode/dotnet-skills.NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable.

When should I use Semantic Kernel?

Semantic Kernel fits situations like: : adding AI-driven prompts; orchestration to a .NET app; reviewing kernel construction; service registration.

How do I install Semantic Kernel in Claude Code?

Run `npx skills add managedcode/dotnet-skills --skill semantic-kernel -a claude-code`. Or copy the skill folder (catalog/Frameworks/Semantic-Kernel/skills/semantic-kernel in managedcode/dotnet-skills) into .claude/skills/semantic-kernel in your project. Claude Code loads it when a task matches its description.

How do I install Semantic Kernel in Codex?

Run `npx skills add managedcode/dotnet-skills --skill semantic-kernel -a codex`. Or copy the skill folder (catalog/Frameworks/Semantic-Kernel/skills/semantic-kernel in managedcode/dotnet-skills) into .agents/skills/semantic-kernel in your project. Codex loads it when a task matches its description.

Can I use Semantic Kernel in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add managedcode/dotnet-skills --skill semantic-kernel -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/semantic-kernel, .gemini/skills/semantic-kernel, .github/skills/semantic-kernel and .opencode/skills/semantic-kernel in your project.

What does Semantic Kernel need to run?

SKILL.md names no scripts, command-line tools or credentials: Semantic Kernel is instructions for the agent only. Compatibility (from SKILL.md): Requires Semantic Kernel 1.x packages (.NET 8+)..

Does Semantic Kernel access the network?

SKILL.md names 2 domains. As links in the text: learn.microsoft.com and github.com. This is read from the text; nothing was executed.

Is Semantic Kernel safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Semantic Kernel use?

Semantic Kernel is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Semantic Kernel use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.8k tokens, read only when the agent opens those files.

What are the alternatives to Semantic Kernel?

Skills that share tags, products or a category with Semantic Kernel: Azure AI Agents Persistent Dotnet (microsoft/skills, 3.1k stars), Claude Cookbooks Reference (2025Emma/vibe-coding-cn, 23k stars), Gemini API Dev (google-gemini/gemini-skills, 4.3k stars) and Azure Openai To Responses (microsoft/ai-agents-for-beginners, 77k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Semantic Kernel?

managedcode (a GitHub organization) maintains it in managedcode/dotnet-skills, which has 486 GitHub stars. The repository holds 81 skills in this directory. The repository was last updated on October 7, 2026.

Source: managedcode/dotnet-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.