Skip to content

.NET: Add inline skills API#4951

Open
SergeyMenshykh wants to merge 4 commits intomicrosoft:mainfrom
SergeyMenshykh:inline-skills
Open

.NET: Add inline skills API#4951
SergeyMenshykh wants to merge 4 commits intomicrosoft:mainfrom
SergeyMenshykh:inline-skills

Conversation

@SergeyMenshykh
Copy link
Copy Markdown
Member

@SergeyMenshykh SergeyMenshykh commented Mar 27, 2026

Summary

Adds the inline skills API — code-defined skills with resources (static values or delegates) and scripts (delegates).

New types

  • AgentInlineSkill — Skill defined entirely in code with XML content generation, resources, and scripts
  • AgentInlineSkillResource — Skill resource backed by a static value or delegate
  • AgentInlineSkillScript — Skill script backed by a delegate with automatic parameter marshaling

Integration

  • AgentSkillsProvider constructors accepting inline skills
  • AgentSkillsProviderBuilder.UseInlineSkill(s) methods

@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation .NET labels Mar 27, 2026
@SergeyMenshykh SergeyMenshykh changed the title .NET: Add inline skills API with test coverage .NET: Add inline skills API Mar 27, 2026
- Add 'Async' suffix to async test methods in FilteringAgentSkillsSourceTests,
  DeduplicatingAgentSkillsSourceTests, and AgentInMemorySkillsSourceTests
- Use pragma to suppress false-positive IDE0004 on casts needed for overload
  disambiguation in AgentInlineSkillTests and AgentInlineSkillResourceTests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SergeyMenshykh SergeyMenshykh marked this pull request as ready for review March 27, 2026 15:15
Copilot AI review requested due to automatic review settings March 27, 2026 15:15
@SergeyMenshykh SergeyMenshykh self-assigned this Mar 27, 2026
@SergeyMenshykh SergeyMenshykh moved this to In Review in Agent Framework Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “inline skills” surface area to the .NET Agent Skills system, enabling code-defined skills with delegate-backed resources and scripts, plus builder/provider integration and accompanying tests/samples.

Changes:

  • Introduces programmatic skill types: AgentInlineSkill, AgentInlineSkillResource, AgentInlineSkillScript.
  • Adds inline-skill integration points in AgentSkillsProvider and AgentSkillsProviderBuilder (plus an internal AgentInMemorySkillsSource).
  • Updates unit tests and adds a new sample demonstrating code-defined skills.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkill.cs New code-defined skill type that synthesizes skill content and registers resources/scripts.
dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkillResource.cs New resource implementation backed by a static value or delegate.
dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkillScript.cs New script implementation backed by a delegate via AIFunctionFactory.
dotnet/src/Microsoft.Agents.AI/Skills/AgentInMemorySkillsSource.cs New internal skills source to serve in-memory AgentSkill instances.
dotnet/src/Microsoft.Agents.AI/Skills/AgentSkillsProvider.cs Adds provider constructors accepting inline skills; adjusts file-based constructor behavior.
dotnet/src/Microsoft.Agents.AI/Skills/AgentSkillsProviderBuilder.cs Adds UseInlineSkill(s) APIs for composing inline skills into a provider.
dotnet/src/Microsoft.Agents.AI/Skills/AgentSkill.cs Updates documentation to mention inline skills and synthesized content.
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/AgentInlineSkillTests.cs New unit tests for inline skill frontmatter/content/resource/script behavior.
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/AgentInlineSkillResourceTests.cs New unit tests for inline resource behavior.
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/AgentInlineSkillScriptTests.cs New unit tests for inline script delegate invocation and schema.
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/AgentInMemorySkillsSourceTests.cs New unit tests for in-memory skills source.
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/AgentSkillsProviderTests.cs Adds tests exercising mixed sources / inline constructor usage.
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FilteringAgentSkillsSourceTests.cs Updates tests to use AgentInMemorySkillsSource + inline skills.
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/DeduplicatingAgentSkillsSourceTests.cs Updates tests to use inline skills / in-memory source.
dotnet/samples/02-agents/AgentSkills/README.md Documents file-based vs code-defined skills and links new sample.
dotnet/samples/02-agents/AgentSkills/Agent_Step02_CodeDefinedSkills/* New sample demonstrating inline skills with resources and scripts.
dotnet/agent-framework-dotnet.slnx Adds the new sample project; also removes some unrelated projects/solution items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants