Open
Conversation
4 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for class-based Agent Skills in the .NET implementation so skills can be packaged and reused as first-class C# types (e.g., from shared libraries/NuGet), while preserving existing file-based and inline skill flows.
Changes:
- Introduces
AgentClassSkilland a shared XML content builder to synthesize skill content (name/description/instructions/resources/scripts). - Broadens skill registration to accept
AgentSkillinstances (enabling inline + class-based skills through existing provider/source pipelines). - Adds unit tests and expands the .NET AgentSkills samples to include class-based skills, DI-enabled variants, and mixed-source usage.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/AgentSkillsProviderTests.cs | Adds provider tests covering class-based skills registration + deduplication. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/AgentClassSkillTests.cs | New unit tests validating AgentClassSkill behavior and synthesized content. |
| dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkillScript.cs | Exposes parameters schema via override to support generic script schema handling. |
| dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkillContentBuilder.cs | New internal helper to build XML content for programmatic/class-based skills. |
| dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkill.cs | Refactors inline skill content generation to use shared builder. |
| dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentClassSkill.cs | New abstract base type for class-packaged skills (instructions/resources/scripts). |
| dotnet/src/Microsoft.Agents.AI/Skills/AgentSkillsProviderBuilder.cs | Documentation updates clarifying advanced mixed-source builder usage. |
| dotnet/src/Microsoft.Agents.AI/Skills/AgentSkillsProvider.cs | Updates constructors to accept AgentSkill (not only inline skills). |
| dotnet/src/Microsoft.Agents.AI/Skills/AgentSkillScript.cs | Adds virtual ParametersSchema to unify schema exposure across script types. |
| dotnet/samples/02-agents/AgentSkills/README.md | Updates overview to include class-based skills and mixed/DI samples. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step06_ClassBasedSkillsWithDI/README.md | New sample documentation for DI with class-based skills. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step06_ClassBasedSkillsWithDI/Program.cs | New DI-enabled class-based skills sample implementation. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step06_ClassBasedSkillsWithDI/Agent_Step06_ClassBasedSkillsWithDI.csproj | New sample project file for Step06. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step05_CodeDefinedSkillsWithDI/README.md | New sample documentation for DI with inline (code-defined) skills. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step05_CodeDefinedSkillsWithDI/Program.cs | New DI-enabled inline skills sample implementation. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step05_CodeDefinedSkillsWithDI/Agent_Step05_CodeDefinedSkillsWithDI.csproj | New sample project file for Step05. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step04_MixedSkills/skills/unit-converter/SKILL.md | New file-based skill content for mixed-skills sample. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step04_MixedSkills/skills/unit-converter/scripts/convert-units.py | New script used by file-based skill in mixed sample. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step04_MixedSkills/skills/unit-converter/references/unit-conversion-table.md | New reference document for file-based unit conversion skill. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step04_MixedSkills/README.md | New documentation for advanced mixed skills sample. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step04_MixedSkills/Program.cs | New mixed skills sample combining file + inline + class-based skills. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step04_MixedSkills/Agent_Step04_MixedSkills.csproj | New sample project file for Step04 (copies skills to output). |
| dotnet/samples/02-agents/AgentSkills/Agent_Step03_ClassBasedSkills/README.md | New documentation for basic class-based skills sample. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step03_ClassBasedSkills/Program.cs | New class-based skills sample implementation. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step03_ClassBasedSkills/Agent_Step03_ClassBasedSkills.csproj | New sample project file for Step03. |
| dotnet/samples/02-agents/AgentSkills/Agent_Step01_FileBasedSkills/README.md | Minor terminology correction (“script runner” wording). |
| dotnet/filtered-unit.slnx | Adds a filtered solution file (currently appears to be a generated artifact). |
| dotnet/AGENTS.md | Updates .NET guidance to require Async suffix on async test methods. |
| dotnet/agent-framework-dotnet.slnx | Adds new AgentSkills sample projects to the main solution. |
The filtered solution file is generated dynamically by eng/scripts/New-FilteredSolution.ps1 during CI. Checking it in risks it becoming stale and out-of-sync with the real solution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The filtered solution file is generated dynamically by eng/scripts/New-FilteredSolution.ps1 during CI. Checking it in risks it becoming stale and out-of-sync with the real solution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
peibekwe
reviewed
Apr 1, 2026
| @@ -0,0 +1,116 @@ | |||
| // Copyright (c) Microsoft. All rights reserved. | |||
|
|
|||
| // This sample demonstrates how to use Dependency Injection (DI) with Agent Skills. | |||
Contributor
There was a problem hiding this comment.
nit: Could some of these samples be merged with others (e.g. DI and non-DI related samples merged into one project) to reduce the number of sample projects we have?
peibekwe
approved these changes
Apr 1, 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
Add class-based skills so skills can be distributed and reused as first-class C# types (for example from shared libraries/NuGet packages).
Changes
Closes: #4350