Skip to content

Commit 696c27e

Browse files
authored
feat: Skills support (#131)
* Introduce agent skills system and file loader Add a first-class "skills" system: domain models (AgentSkill, SkillModels), providers, exceptions, SkillBuilder, SkillRegistry, ISkillLoader/ISkillComposer interfaces, SkillComposer implementation, and a FileSystemSkillLoader that parses YAML frontmatter in .md files. Wire skills into startup and runtime: register built-in skill providers, expose ISkillRegistry/ISkillComposer via IAIHubServices/AIHub, persist skills across re-initialization, and extend AgentContext with WithSkill(s) and inline skill support that are applied via the composer on Create. Add example code and .md skills (caveman, file-journalist), AddSkillsFromDirectory helper, and include YamlDotNet package for parsing. Also minor domain tweaks (Agent.Skills list, Mcp.Model default, unit test updates) and a SkillBuilder utility under MaIN.Core.Hub.Utils. NOTE: an OpenAI key was inserted into OpenAiExampleSetup.cs (likely accidental). * Load folder-based SKILL.md Add support for folder-based skill packages and include files. FileSystemSkillLoader now treats SKILL.md as a package entrypoint, only loads SKILL.md from package directories, and aggregates any files listed in an includes frontmatter key into the skill InstructionFragment. New helpers ResolveIncludePattern and LoadIncludes handle relative paths and simple wildcards. Also add a code-review skill (SKILL.md plus prompts/examples) and an AgentWithFolderSkillExample, and register the example in Program.cs so the new skill demo is available. * Organize skill examples, add calculator skill Reorganize agent skill examples into a new Examples/Agents/Skills folder and introduce a custom code-based skill. - Removed the old Examples/Agents/AgentWithSkillsExample.cs and reintroduced skill examples under Examples/Agents/Skills: AgentWithSkillsExample.cs, AgentWithFileSkillExample.cs, AgentWithFolderSkillExample.cs. - Added AgentWithCustomCodeSkillExample.cs which registers a CalculatorSkill that implements IAgentSkillProvider. The CalculatorSkill exposes a "calculate" tool (executes expressions via DataTable.Compute) and an instruction fragment to ensure the agent uses the tool for arithmetic. - Updated Examples/Examples/Program.cs: added using Examples.Agents.Skills, registered the new examples (including the custom C# skill) in DI, and added a menu entry for the custom skill example. These changes tidy example layout and demonstrate both file/folder-based skills and executable code skills (tools) in examples. * small fixes * Add MCP examples and MCP HTTP support Add examples and skill for MCP filesystem usage and extend MCP service to support multiple backends. - Add examples: McpAnthropicExample and AgentWithMcpFileWriterSkillExample, plus skills/funfact-writer/SKILL.md to demonstrate MCP filesystem writes. - Register new examples in Examples/Program.cs. - Overhaul McpService: add HTTP-based MCP loop for OpenAI-compatible backends, Anthropic-specific handling (tool_use/tool_result), SK-based path for Gemini/Vertex, helper methods (GetEndpointAndKey, BuildResult), and JSON tool execution/iteration logic. - Update SkillComposer to populate Mcp backend when composing agent MCP configs. These changes enable MCP integration with Anthropic and add a robust HTTP fallback for OpenAI-compatible MCP flows, plus example usage and a file-writer skill. * Add unit and e2e tests for skills and MCP Introduce comprehensive tests: FileSystemSkillLoaderTests, SkillComposerTests, SkillRegistryTests and McpTests (E2E). Unit tests cover parsing, folder-based skills, MCP definitions, step merging, tool/source conflicts, behaviours and instruction merging, and registry/provider/loader integration. McpTests exercise MCP file-write flows against OpenAI, Gemini and Anthropic backends using a temporary filesystem helper and environment-key skipping. * Add web fetch/clean, robust memory & decision Remove caveman example and its project reference; switch WebSearchSkillProvider default to BBC RSS feed. Add explicit backend tracking in McpContext so WithConfig respects an explicitly set backend. Improve MemoryService to fallback when JsonCleaner returns null before importing text. Harden AnswerCommandHandler: skip knowledge when index empty, safely parse LLM JSON decision with try/catch and treat non-JSON (cloud) responses as false. Implement web fetching/cleaning in FetchCommandHandler (HTTP fetch, RSS extraction, HTML tag stripping, length cap) and pass cleaned text to AskMemory instead of just URL. Update FetchDataStepHandler to prefer the last user message as the fetch query (falling back to behaviour template). These changes improve resilience to malformed input, cloud backend differences, and provide usable web content for memory. * Filter out built-in agent skills Introduce a marker interface IBuiltInAgentSkillProvider and update all bundled skill providers to implement it. SkillRegistry now records built-in skill names, exposes GetAllExcludingBuiltIn(), and excludes bundled skills from that list. Add AgentContext.WithAllSkills() and IAgentConfigurationBuilder.WithAllSkills() to apply only non-built-in (user/folder) skills when configuring agents. Add unit tests to verify filtering and direct registration behavior. * Exclude Replace skills from WithAllSkills Skip skills with SkillStepPlacement.Replace when collecting all skills and enforce replace-skill rules in the composer. Changes include: - Add Examples.Agents.Skills.AgentWithAllSkillsExample and register it in Examples/Program.cs to demonstrate .WithAllSkills(). - Update AgentContext.WithAllSkills() to ignore Replace-placement skills when adding inline skills. - Improve IAgentConfigurationBuilder XML docs to document that Replace-placement skills are excluded and must be opted in explicitly. - Refactor SkillComposer.MergeSteps to be an instance method, throw a SkillConflictException when multiple Replace skills are present, and log a warning when a single Replace skill is applied alongside other skills (discarding their steps). - Add unit tests: AgentContextTests.WithAllSkills_SkipsReplacePlacementSkills and SkillComposerTests cases to validate Replace-skill conflicts and warning behavior. These changes ensure Replace-placement skills remain exclusive and are not implicitly added by WithAllSkills(), with composer-level validation and diagnostics for conflicting configurations. * Avoid duplicate skills and retain non-built-ins Make WithAllSkills idempotent and ensure non-built-in skills persist across re-initialization. Added two unit tests: one to verify WithAllSkills called twice does not duplicate skills, and one to verify folder/user skills populate the agent's Skills list. AIHub.GetCurrentSkills now returns SkillRegistry.GetAllExcludingBuiltIn so bundled built-ins are excluded. AgentContext: added _allSkillsApplied flag to prevent repeated application, and ensure inline skill names are added to the agent.Skills when composing. * Final fiexs: Enhance skill composing, loading, and logging Add richer logging, redaction, and notifications across services; make skill registry thread-safe; and improve skill loading. - SkillComposer: raise pipeline logging to Information, redact sensitive step arguments (URLs/tokens), and improve conflict messages/formatting. - SkillRegistry: switch to concurrent collections, use AddOrUpdate/TryAdd and snapshot built-in names for safe enumeration. - FileSystemSkillLoader: accept ILogger, use NullLogger default, log parse warnings instead of Console.WriteLine, and make parser instance method. - Bootstrapper changes: register console logging (MaIN.Core) and pass ILogger<FileSystemSkillLoader> into skill loader registrations (MaIN.Services). - AgentContext: deduplicate and ignore empty pending skill names when adding to agent.Skills (case-insensitive). - StepProcessor: change per-step log level from Information to Debug. - FetchCommandHandler: inject INotificationService and emit progress notifications (URL length, previews, AskMemory results); add Truncate helper. - Tests: add unit tests for SkillComposer logging/redaction and a guard test ensuring bundled skill providers implement the built-in marker. - Examples/appsettings: small example prompt tweak and add logging categories to appsettings for System.Net.Http and SkillComposer. These changes improve observability, privacy of logged data, concurrency safety, and provide progress notifications during fetch operations. * versioning * Add provider-side skills support Introduce provider-side skill support: add uploaders, cache, and coordinator to upload SKILL.md bundles to cloud provider Skills APIs (OpenAI, Anthropic). New abstractions IProviderSkillUploader and IProviderSkillCache, plus ProviderSkillUploadCoordinator and implementations (OpenAiSkillUploader, AnthropicSkillUploader, ProviderSkillCache). Domain updates include ProviderSkillReference, BundlePath on AgentSkill, and storing ProviderSkillReferences on Agent/Chat. Skill composition and agent creation now support routing uploadable skills as provider references (SkillComposer/AgentContext changes) and perform lazy uploads via the coordinator; bootstrapper warms the cache and registers services. LLM integrations updated: OpenAiService uses the Responses API with provider skill refs, AnthropicService includes skills/container support and beta headers; new API endpoints/constants added. Add unit tests and example: tests for uploader, cache, coordinator, filesystem loader and composer; example demonstrates agent using provider skills. * Model-aware provider skills and uploader/service fixes Make provider-skill handling model-aware and harden upload/LLM service logic. Add BackendCapabilities.SupportsSkillsApi and unit tests to detect which specific models (OpenAI gpt-5.5+, Anthropic opus-4.x+) accept native Skills API; update SkillComposer and AgentContext to only route skills as provider references when both backend and model support the Skills API. Add new model constants and CloudModel records for gpt-5.5 and Claude Opus revisions and update example agents to use those models; remove the deprecated AgentWithProviderSkillsExample. Use ActivatorUtilities in LLMServiceFactory so DI-resolved services (including loggers) are provided. Fix Anthropic/ OpenAI uploader and service behaviors: correct multipart field names for Anthropic, prefer skill_id when parsing OpenAI upload responses, extract version strings robustly, send version as string in skill references, and add retry/backoff for OpenAI Responses eventual-consistency and 5xx errors. Improve OpenAiService/CompatibleService behaviors: drop provider refs when model rejects shell tool, mirror notification token protocol for Responses path, fallback to raw retrieved chunks when memory returns an "INFO NOT FOUND" sentinel, and handle Anthropic Messages API system-message placement. Add related logging and safety checks throughout. * Add RequireNativeSkillsApi strict mode and exception Introduce a strict mode for provider-native Skills API routing via MaINSettings.SkillUpload.RequireNativeSkillsApi (default false) and document ReconcileWithProvider behavior. Add SkillNotSupportedException to signal when an uploadable skill cannot be routed through a backend/model/cache under strict mode. Update SkillComposer to respect the new setting: code-defined skills (Execute delegate) are always composed locally, while uploadable skills will either be routed via provider cache or cause SkillNotSupportedException when the backend lacks a Skills API, the model rejects Skills, or the provider cache misses in strict mode; non-strict mode falls back to inline composition and logs the reason. Add unit tests covering strict/non-strict behavior, cache miss, unsupported backend/model, and exemption for code-defined skills.
1 parent 841dd68 commit 696c27e

81 files changed

Lines changed: 5678 additions & 205 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using Examples.Utils;
2+
using MaIN.Core.Hub;
3+
using MaIN.Domain.Models;
4+
5+
namespace Examples.Agents.Skills;
6+
7+
/// <summary>
8+
/// Demonstrates <c>.WithAllSkills()</c>: attaches every skill currently in the registry except:
9+
/// - MaIN's bundled ones (web-search, journalist, rag-expert, summarizer, mcp-tool-caller)
10+
/// - skills with Replace placement (e.g. funfact-writer) — they wipe the step pipeline and are exclusive
11+
///
12+
/// In Program.cs the host registers:
13+
/// - services.AddSkillsFromDirectory("./skills") — folder skills (e.g. code-review, funfact-writer)
14+
/// - services.AddSingleton&lt;IAgentSkillProvider, CalculatorSkill&gt;() — custom C# skill
15+
///
16+
/// The prompt below intentionally hits BOTH composable skills in one shot:
17+
/// - code-review (folder, .md) inspects the snippet for bugs / style
18+
/// - calculator (custom C# tool) verifies the arithmetic claim made in a comment
19+
///
20+
/// A bundled or Replace-placement skill can be opted in by chaining .WithSkill("name") after .WithAllSkills().
21+
/// </summary>
22+
public class AgentWithAllSkillsExample : IExample
23+
{
24+
public async Task Start()
25+
{
26+
Console.WriteLine("Agent with .WithAllSkills() (code-review folder skill + CalculatorSkill, OpenAi)");
27+
Console.WriteLine("Skipped: MaIN bundled skills (web-search, journalist, rag-expert, summarizer, mcp-tool-caller).");
28+
29+
OpenAiExample.Setup();
30+
31+
var context = await AIHub.Agent()
32+
.WithModel(Models.OpenAi.Gpt5_5)
33+
.WithAllSkills()
34+
.CreateAsync(interactiveResponse: true);
35+
36+
await context.ProcessAsync("""
37+
Review this code and verify the math in the comment using the calculator tool:
38+
39+
// Net price after 15% discount on $1250 is $1062.5
40+
public decimal ApplyDiscount(decimal price)
41+
{
42+
var discount = price * 0.15;
43+
return price - discount;
44+
}
45+
""");
46+
}
47+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
using System.Data;
2+
using System.Text.Json;
3+
using Examples.Utils;
4+
using MaIN.Core.Hub;
5+
using MaIN.Domain.Entities.Skills;
6+
using MaIN.Domain.Models;
7+
8+
namespace Examples.Agents.Skills;
9+
10+
/// <summary>
11+
/// Demonstrates a custom code-based skill defined in the Examples project.
12+
/// CalculatorSkill implements IAgentSkillProvider and is registered in Program.cs via
13+
/// services.AddSingleton&lt;IAgentSkillProvider, CalculatorSkill&gt;(). The SkillRegistry
14+
/// picks it up automatically at startup — no manual Register() call needed here.
15+
/// This is the key difference from file-based skills: code skills can execute C# functions as tools.
16+
/// </summary>
17+
public class AgentWithCustomCodeSkillExample : IExample
18+
{
19+
public async Task Start()
20+
{
21+
Console.WriteLine("Agent with custom code-based skill (CalculatorSkill, OpenAi)");
22+
23+
OpenAiExample.Setup();
24+
25+
// CalculatorSkill is registered in Program.cs via DI (services.AddSingleton<IAgentSkillProvider, CalculatorSkill>();) and is already in the registry.
26+
var context = await AIHub.Agent()
27+
.WithModel(Models.OpenAi.Gpt5_5)
28+
.WithSkill("calculator")
29+
.CreateAsync(interactiveResponse: true);
30+
31+
await context.ProcessAsync(
32+
"A shop sells 3 items: apple $1.25, banana $0.80, cherry $3.40. " +
33+
"I buy 4 apples, 7 bananas and 2 cherries. What is the total cost? " +
34+
"Also, if I pay with $30, what is my change?");
35+
}
36+
}
37+
38+
/// <summary>
39+
/// Custom code-based skill defined in the Examples project.
40+
/// Gives the agent a "calculate" tool backed by a real C# function — something
41+
/// .md file-based skills cannot do (they have no executable code).
42+
/// </summary>
43+
public class CalculatorSkill : IAgentSkillProvider
44+
{
45+
public AgentSkill GetSkill() => new()
46+
{
47+
Name = "calculator",
48+
Description = "Gives the agent a precise calculation tool. Use when the prompt involves arithmetic.",
49+
Version = "1.0.0",
50+
Steps = ["ANSWER"],
51+
StepPlacement = SkillStepPlacement.Before,
52+
Priority = 20,
53+
Tags = ["math", "tools", "calculator"],
54+
Tools =
55+
[
56+
new SkillToolDefinition
57+
{
58+
Name = "calculate",
59+
Description = "Evaluates a mathematical expression and returns the result. " +
60+
"Supports +, -, *, /, %, ^ and parentheses.",
61+
Parameters = new
62+
{
63+
type = "object",
64+
properties = new
65+
{
66+
expression = new
67+
{
68+
type = "string",
69+
description = "The math expression to evaluate, e.g. \"(12 + 8) * 3 / 4\""
70+
}
71+
},
72+
required = new[] { "expression" }
73+
},
74+
Execute = async args =>
75+
{
76+
await Task.CompletedTask;
77+
try
78+
{
79+
var doc = JsonDocument.Parse(args);
80+
var expression = doc.RootElement.GetProperty("expression").GetString() ?? "";
81+
var result = new DataTable().Compute(expression, null);
82+
return $"{result}";
83+
}
84+
catch (Exception ex)
85+
{
86+
return $"Error: {ex.Message}";
87+
}
88+
}
89+
}
90+
],
91+
InstructionFragment =
92+
"You have access to a precise calculator tool. " +
93+
"For any arithmetic — no matter how simple — always call the calculate tool instead of computing mentally. " +
94+
"Show the expression you used and the result."
95+
};
96+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using MaIN.Core;
2+
using MaIN.Core.Hub;
3+
using MaIN.Domain.Configuration;
4+
using MaIN.Domain.Models;
5+
6+
namespace Examples.Agents.Skills;
7+
8+
/// <summary>
9+
/// Demonstrates a skill loaded from a .md file in ./skills/ folder.
10+
/// Drop any .md skill file there and it's auto-picked up on startup.
11+
///
12+
/// This example also opts into RequireNativeSkillsApi=true — SkillComposer throws
13+
/// SkillNotSupportedException if any uploadable skill can't be routed through the
14+
/// provider's native Skills API. Use a model that supports Skills (e.g. gpt-5.5) to succeed.
15+
/// </summary>
16+
public class AgentWithFileSkillExample : IExample
17+
{
18+
public async Task Start()
19+
{
20+
Console.WriteLine("Agent with file-based skill (OpenAi, RequireNativeSkillsApi=true)");
21+
Console.WriteLine("Looks for skills in ./skills/ directory...");
22+
23+
MaINBootstrapper.Initialize(configureSettings: options =>
24+
{
25+
options.BackendType = BackendType.OpenAi;
26+
options.OpenAiKey = "<YOUR_OPENAI_KEY>";
27+
options.SkillUpload.RequireNativeSkillsApi = true;
28+
});
29+
30+
// gpt-5.5 supports the native Skills API. Swap to gpt-4o-mini to see SkillNotSupportedException in action.
31+
var context = await AIHub.Agent()
32+
.WithModel(Models.OpenAi.Gpt5_5)
33+
.WithSkill("web-search")
34+
.WithSkill("file-journalist")
35+
.CreateAsync(interactiveResponse: true);
36+
37+
await context.ProcessAsync("Provide today's newsletter.");
38+
}
39+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Examples.Utils;
2+
using MaIN.Core.Hub;
3+
using MaIN.Domain.Models;
4+
5+
namespace Examples.Agents.Skills;
6+
7+
/// <summary>
8+
/// Demonstrates a folder-based skill: skills/code-review/SKILL.md is the entrypoint,
9+
/// prompts/ and examples/ subdirectories are loaded via the "includes" frontmatter key.
10+
/// </summary>
11+
public class AgentWithFolderSkillExample : IExample
12+
{
13+
public async Task Start()
14+
{
15+
Console.WriteLine("Agent with folder-based skill (code-review, Anthropic)");
16+
Console.WriteLine("Skill loaded from: ./skills/code-review/SKILL.md");
17+
18+
AnthropicExample.Setup();
19+
20+
var context = await AIHub.Agent()
21+
.WithModel(Models.Anthropic.ClaudeOpus4_7)
22+
.WithSkill("code-review") // name provided in name section in SKILL.md file
23+
.CreateAsync(interactiveResponse: true);
24+
25+
await context.ProcessAsync("""
26+
Review this code:
27+
public List<string> GetNames(List<User> users)
28+
{
29+
List<string> names = new List<string>();
30+
for (int i = 0; i < users.Count; i++)
31+
{
32+
names.Add(users[i].Name);
33+
}
34+
return names;
35+
}
36+
""");
37+
}
38+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Examples.Utils;
2+
using MaIN.Core.Hub;
3+
using MaIN.Domain.Models;
4+
5+
namespace Examples.Agents.Skills;
6+
7+
/// <summary>
8+
/// Demonstrates a folder-based .md skill that wires up an MCP server.
9+
/// The skill (skills/funfact-writer/SKILL.md) configures @modelcontextprotocol/server-filesystem
10+
/// via its mcp: frontmatter — no C# required. The agent uses the MCP write_file tool
11+
/// to create C:/Users/Public/funfacts/funfact.txt with a generated fun fact.
12+
/// </summary>
13+
public class AgentWithMcpFileWriterSkillExample : IExample
14+
{
15+
public async Task Start()
16+
{
17+
Console.WriteLine("Agent with MCP file-writer skill (.md, OpenAi)");
18+
Console.WriteLine("Skill wires up @modelcontextprotocol/server-filesystem via SKILL.md frontmatter.");
19+
Console.WriteLine("Output: C:/Users/Public/funfacts/funfact.txt");
20+
21+
OpenAiExample.Setup();
22+
23+
var context = await AIHub.Agent()
24+
.WithModel(Models.OpenAi.Gpt5_5)
25+
.WithSkill("funfact-writer") // loaded from ./skills/funfact-writer/SKILL.md
26+
.CreateAsync();
27+
28+
var result = await context.ProcessAsync("Generate a fun fact and save it to the file.");
29+
Console.WriteLine(result.Message.Content);
30+
}
31+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Examples.Utils;
2+
using MaIN.Core.Hub;
3+
using MaIN.Domain.Models;
4+
5+
namespace Examples.Agents.Skills;
6+
7+
/// <summary>
8+
/// Demonstrates skills applied via code — built-in "web-search" + "journalist".
9+
/// Equivalent to AgentWithWebDataSourceOpenAiExample but with 2 lines instead of 15.
10+
/// </summary>
11+
public class AgentWithSkillsExample : IExample
12+
{
13+
public async Task Start()
14+
{
15+
Console.WriteLine("Agent with registered skills (code-based, OpenAi)");
16+
17+
OpenAiExample.Setup();
18+
19+
var context = await AIHub.Agent()
20+
.WithModel(Models.OpenAi.Gpt5_5)
21+
.WithSkill("web-search") // FETCH_DATA step + BBC source
22+
.WithSkill("journalist") // BECOME+Journalist + ANSWER steps + behaviour
23+
.CreateAsync(interactiveResponse: true);
24+
25+
await context.ProcessAsync("Provide today's newsletter");
26+
}
27+
}

Examples/Examples/Examples.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,8 @@
4949
<None Update="Files\Knowledge\people.md">
5050
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5151
</None>
52+
<None Update="skills\**\*.md">
53+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
54+
</None>
5255
</ItemGroup>
5356
</Project>

Examples/Examples/Program.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using Examples;
22
using Examples.Agents;
33
using Examples.Agents.Flows;
4+
using Examples.Agents.Skills;
45
using Examples.Chat;
56
using Examples.Mcp;
67
using MaIN.Core;
8+
using MaIN.Domain.Entities.Skills;
9+
using MaIN.Services;
710
using Microsoft.Extensions.Configuration;
811
using Microsoft.Extensions.DependencyInjection;
912

@@ -30,6 +33,9 @@
3033
services.AddSingleton<IConfiguration>(configuration);
3134
services.AddMaIN(configuration);
3235

36+
services.AddSkillsFromDirectory("./skills");
37+
services.AddSingleton<IAgentSkillProvider, CalculatorSkill>();
38+
3339
RegisterExamples(services);
3440

3541
var serviceProvider = services.BuildServiceProvider();
@@ -68,6 +74,12 @@ static void RegisterExamples(IServiceCollection services)
6874
services.AddTransient<AgentsFlowLoadedExample>();
6975
services.AddTransient<ChatExampleOpenAi>();
7076
services.AddTransient<AgentWithWebDataSourceOpenAiExample>();
77+
services.AddTransient<AgentWithSkillsExample>();
78+
services.AddTransient<AgentWithFileSkillExample>();
79+
services.AddTransient<AgentWithFolderSkillExample>();
80+
services.AddTransient<AgentWithCustomCodeSkillExample>();
81+
services.AddTransient<AgentWithAllSkillsExample>();
82+
services.AddTransient<AgentWithMcpFileWriterSkillExample>();
7183
services.AddTransient<ChatWithImageGenOpenAiExample>();
7284
services.AddTransient<ChatExampleGemini>();
7385
services.AddTransient<ChatGrammarExampleGemini>();
@@ -183,6 +195,11 @@ public class ExampleRegistry(IServiceProvider serviceProvider)
183195
("\u25a0 OpenAi Chat", serviceProvider.GetRequiredService<ChatExampleOpenAi>()),
184196
("\u25a0 OpenAi Chat with image", serviceProvider.GetRequiredService<ChatWithImageGenOpenAiExample>()),
185197
("\u25a0 OpenAi Agent with Web Data Source", serviceProvider.GetRequiredService<AgentWithWebDataSourceOpenAiExample>()),
198+
("\u25a0 Agent with Skills (file-based .md)", serviceProvider.GetRequiredService<AgentWithFileSkillExample>()),
199+
("\u25a0 Agent with Skills (folder-based SKILL.md)", serviceProvider.GetRequiredService<AgentWithFolderSkillExample>()),
200+
("\u25a0 Agent with Skills (custom C# skill)", serviceProvider.GetRequiredService<AgentWithCustomCodeSkillExample>()),
201+
("\u25a0 Agent with Skills (.WithAllSkills)", serviceProvider.GetRequiredService<AgentWithAllSkillsExample>()),
202+
("\u25a0 Agent with Skills (MCP file writer)", serviceProvider.GetRequiredService<AgentWithMcpFileWriterSkillExample>()),
186203
("\u25a0 Gemini Chat", serviceProvider.GetRequiredService<ChatExampleGemini>()),
187204
("\u25a0 Gemini Chat with grammar", serviceProvider.GetRequiredService<ChatGrammarExampleGemini>()),
188205
("\u25a0 Gemini Chat with image", serviceProvider.GetRequiredService<ChatWithImageGenGeminiExample>()),

Examples/Examples/appsettings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
"Logging": {
33
"LogLevel": {
4-
"Default": "Information",
5-
"Microsoft.AspNetCore": "Warning"
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning",
6+
"System.Net.Http": "Warning",
7+
"MaIN.Services.Services.SkillComposer": "Information"
68
}
79
},
810
"MaIN": {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: code-review
3+
description: Reviews code for bugs, security issues, and improvements
4+
version: 1.0.0
5+
steps:
6+
- ANSWER
7+
placement: before
8+
priority: 30
9+
tags:
10+
- code
11+
- review
12+
- quality
13+
includes:
14+
- prompts/review.md
15+
- examples/bad.md
16+
- examples/good.md
17+
---
18+
19+
You are an expert code reviewer with deep knowledge of software engineering best practices.
20+
Keep reviews concise and actionable.

0 commit comments

Comments
 (0)