Postpartum-genushyacinthus29/dotnet-skills/skills/dotnet-semantic-kernel/SKILL.md
dotnet-semantic-kernel
Build AI-enabled .NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable.
- Source repository stars
- 9
- Declared platforms
- 0
- Static risk flags
- 0
- Last source update
- 2026-08-26
- Source checked
- 2026-08-28
Decision brief
What it does: where it fits
Build AI-enabled . NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable.
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/Postpartum-genushyacinthus29/dotnet-skills --skill "skills/dotnet-semantic-kernel"Inspect the Agent Skill "dotnet-semantic-kernel" from https://github.com/Postpartum-genushyacinthus29/dotnet-skills/blob/e520b1e9a27485d8b5f3ec0b71dfcd85ab371a40/skills/dotnet-semantic-kernel/SKILL.md at commit e520b1e9a27485d8b5f3ec0b71dfcd85ab371a40. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
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
Build the Kernel with required servicesCreate Plugins with well-described functionsConfigure Function Calling for automatic tool use - 02
Kernel Setup
Review the “Kernel Setup” section in the pinned source before continuing.
Review and apply the “Kernel Setup” source section. - 03
Trigger On
adding AI-driven prompts, plugins, or orchestration to a .NET app
adding AI-driven prompts, plugins, or orchestration to a .NET appreviewing kernel construction, service registration, or plugin usagebuilding function-calling patterns with LLMs - 04
Documentation
Semantic Kernel Overview
Semantic Kernel OverviewPlugins and FunctionsAgent Functions - 05
Core Concepts
Review the “Core Concepts” section in the pinned source before continuing.
Review and apply the “Core Concepts” source section.
Permission review
Static risk signals and limitations
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 92/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 9 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- Postpartum-genushyacinthus29/dotnet-skills
- Skill path
- skills/dotnet-semantic-kernel/SKILL.md
- Commit
- e520b1e9a27485d8b5f3ec0b71dfcd85ab371a40
- License
- MIT
- Collected
- 2026-08-28
- Default branch
- main
View the original SKILL.md
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
- Semantic Kernel Overview
- Plugins and Functions
- Agent Functions
- GitHub Repository
- Microsoft Agent Framework
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
| Concept | Description |
|---|---|
| Kernel | Central orchestrator for AI services and plugins |
| Plugin | Collection of functions exposed to the LLM |
| Function | Native C# method or prompt template |
| Chat Completion | LLM service for generating responses |
| Memory | Vector storage for semantic search |
Workflow
- Build the Kernel with required services
- Create Plugins with well-described functions
- Configure Function Calling for automatic tool use
- Handle Responses and manage conversation state
- Test and Observe AI behavior with logging
Kernel Setup
Basic Configuration
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
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
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
| Practice | Why It Matters |
|---|---|
Clear [Description] | LLM uses this to decide when to call |
| Specific parameter names | Helps LLM map user intent |
| Idempotent functions | Safe to retry on failures |
| Return meaningful strings | LLM needs to understand results |
| Validate inputs | LLM may hallucinate parameters |
Function Calling
Automatic Function Calling
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
var settings = new OpenAIPromptExecutionSettings
{
FunctionChoiceBehavior = FunctionChoiceBehavior.Required(
[kernel.Plugins["Weather"]["GetWeather"]])
};
Chat Completion Patterns
Multi-Turn Conversation
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
await foreach (var chunk in chatService.GetStreamingChatMessageContentsAsync(
history, executionSettings, kernel))
{
Console.Write(chunk.Content);
}
Multi-Agent Plugin Isolation
// 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-Pattern | Why It's Bad | Better Approach |
|---|---|---|
Vague [Description] | LLM won't call at right time | Be specific and actionable |
| Sharing kernel across agents | Plugin leakage | Clone or create new kernels |
| No input validation | Hallucinated parameters | Validate and return errors |
| Using deprecated Planners | Removed in favor of function calling | Use FunctionChoiceBehavior |
| Ignoring logging | Can't debug AI decisions | Enable Semantic Kernel logging |
Error Handling
[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
[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 dotnet-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
Frequently asked questions
What to verify before installation and use
What does the dotnet-semantic-kernel source document cover?
Build AI-enabled . NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable.
How do I install dotnet-semantic-kernel?
The source record exposes this install command: npx skills add https://github.com/Postpartum-genushyacinthus29/dotnet-skills --skill "skills/dotnet-semantic-kernel". Inspect the command and pinned source before running it.
Alternatives
Compare before choosing
Postpartum-genushyacinthus29/dotnet-skills
dotnet-mvvm
Implement the Model-View-ViewModel pattern in .NET applications with proper separation of concerns, data binding, commands, and testable ViewModels using MVVM Toolkit.
mgiovani/cc-arsenal
team-review
Multi-agent review team: architecture, security, performance, testing, style, docs/UX, plus an adversary that cross-examines the other 6, for security-sensitive, architectural, or large PRs (15+ files) where a single-agent pass risks missing cross-cutting issues. Use for auth/payments/PII changes, schema/pattern changes, compliance sign-off, or when asked to 'get the review team on this' / 'multi-agent review' / 'thorough review before merge'. For a standard PR or a quick pre-merge check, use /r
dotnet/skills
dotnet-webapi
Guides creation and modification of ASP.NET Core Web API endpoints with correct HTTP semantics, OpenAPI metadata, and error handling. USE FOR: adding new API endpoints (controllers or minimal APIs), wiring up OpenAPI/Swagger, creating .http test files, setting up global error handling middleware. DO NOT USE FOR: general C# coding style, EF Core data access or query optimization (use optimizing-ef-core-queries), frontend/Blazor work, gRPC services, or SignalR hubs.
almanak-co/sdk
almanak-strategy-builder
Build, test, and deploy DeFi trading strategies using the Almanak SDK. ALWAYS use this skill when the user mentions almanak, DeFi strategy, trading strategy, yield farming, liquidity provision, token swap, borrowing, lending, perpetuals, staking, vault deposit, bridging tokens, backtesting, paper trading, or on-chain execution. Use for writing strategy.py files, composing intents (Swap, LP, Borrow, Supply, Perp, Bridge, Stake, Vault, Prediction), working with config.json strategy parameters, run