.NET: Support Agent Skills#4122
Merged
SergeyMenshykh merged 19 commits intomicrosoft:mainfrom Feb 20, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new .NET AIContextProvider that discovers Agent Skills from the filesystem and exposes them to agents via progressive disclosure (advertise → load → read resources), along with tests and a getting-started sample.
Changes:
- Introduces
FileAgentSkillsProvider+ supporting loader/types to discoverSKILL.mdskills, advertise them via injected instructions, and exposeload_skill/read_skill_resourcetools. - Adds unit tests for discovery/parsing/resource-reading and updates projects to suppress the experimental diagnostic (
MAAI001). - Adds a new Getting Started “Agent Skills” sample and wires it into the samples index/solution.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/tests/Microsoft.Agents.AI.UnitTests/Microsoft.Agents.AI.UnitTests.csproj | Suppresses experimental diagnostic in unit tests. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillsProviderTests.cs | Tests provider prompt/tool injection behavior and customization. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillLoaderTests.cs | Tests skill discovery/parsing/resource validation and read behavior. |
| dotnet/src/Microsoft.Agents.AI/Skills/SkillFrontmatter.cs | Adds parsed frontmatter type for skill metadata. |
| dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProviderOptions.cs | Adds options for customizing the advertisement prompt template. |
| dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs | Implements the context provider and exposes the two skill tools. |
| dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillLoader.cs | Implements discovery, frontmatter parsing, and resource validation/reading. |
| dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkill.cs | Adds internal representation of a loaded skill (body + resources). |
| dotnet/src/Microsoft.Agents.AI/Microsoft.Agents.AI.csproj | Enables diagnostic IDs/experimental attribute injection and suppresses MAAI001. |
| dotnet/samples/GettingStarted/README.md | Links new Agent Skills section from Getting Started index. |
| dotnet/samples/GettingStarted/AgentSkills/README.md | Adds index README for Agent Skills samples. |
| dotnet/samples/GettingStarted/AgentSkills/Agent_Step01_BasicSkills/skills/expense-report/references/POLICY_FAQ.md | Adds sample skill reference document. |
| dotnet/samples/GettingStarted/AgentSkills/Agent_Step01_BasicSkills/skills/expense-report/assets/expense-report-template.md | Adds sample skill asset template. |
| dotnet/samples/GettingStarted/AgentSkills/Agent_Step01_BasicSkills/skills/expense-report/SKILL.md | Adds sample skill with frontmatter + resource links. |
| dotnet/samples/GettingStarted/AgentSkills/Agent_Step01_BasicSkills/README.md | Documents the sample and how progressive disclosure works. |
| dotnet/samples/GettingStarted/AgentSkills/Agent_Step01_BasicSkills/Program.cs | Demonstrates usage of FileAgentSkillsProvider with an agent. |
| dotnet/samples/GettingStarted/AgentSkills/Agent_Step01_BasicSkills/Agent_Step01_BasicSkills.csproj | Adds sample project and copies skill content to output. |
| dotnet/agent-framework-dotnet.slnx | Adds the new sample to the solution structure. |
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillLoaderTests.cs
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
westey-m
approved these changes
Feb 20, 2026
lokitoth
reviewed
Feb 20, 2026
lokitoth
approved these changes
Feb 20, 2026
westey-m
approved these changes
Feb 20, 2026
dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs
Outdated
Show resolved
Hide resolved
rogerbarreto
approved these changes
Feb 20, 2026
Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
rogerbarreto
approved these changes
Feb 20, 2026
westey-m
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
FileAgentSkillsProvider, anAIContextProviderthat discovers and exposes Agent Skills from filesystem directories following the Agent Skills specification progressive disclosure pattern: advertise → load → read resources.Changes
FileAgentSkillsProvider— discoversSKILL.mdfiles from configured directories, advertises skills via system prompt injection, and providesload_skill/read_skill_resourcetools for on-demand access.FileAgentSkillsProviderOptions— configuration for custom prompt templates.FileAgentSkillLoader/FileAgentSkill/SkillFrontmatter— internal helpers and model classes for skill discovery, frontmatter parsing, and secure resource reading (path traversal / symlink guards).Agent_Step01_BasicSkills) demonstrating usage with an expense-report skill.FileAgentSkillsProvideris marked as experimental (MAAI001) usingDiagnosticIds.Key Design Decisions
Out of Scope
Closes: #3499