mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
7ba636d642
* support agent skills * make the new agent skill provider experimental * Fix file encoding: add UTF-8 BOM to .cs files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix final newline and simplify new expressions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix broken links in Agent Skills sample README Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add null check for skillPaths parameter Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Normalize references * normilize skill path * address comments regarding symlink check * address comments * fix failing test + regex improvements * small optimizations and improvments * address pr review comments * Update dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com> * address pr review comments * address pr review comments --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
7ba636d642
·
2026-02-20 21:05:56 +00:00
History
Agent Skills Sample
This sample demonstrates how to use Agent Skills with a ChatClientAgent in the Microsoft Agent Framework.
What are Agent Skills?
Agent Skills are modular packages of instructions and resources that enable AI agents to perform specialized tasks. They follow the Agent Skills specification and implement the progressive disclosure pattern:
- Advertise: Skills are advertised with name + description (~100 tokens per skill)
- Load: Full instructions are loaded on-demand via
load_skilltool - Resources: References and other files loaded via
read_skill_resourcetool
Skills Included
expense-report
Policy-based expense filing with spending limits, receipt requirements, and approval workflows.
references/POLICY_FAQ.md— Detailed expense policy Q&Aassets/expense-report-template.md— Submission template
Project Structure
Agent_Step01_BasicSkills/
├── Program.cs
├── Agent_Step01_BasicSkills.csproj
└── skills/
└── expense-report/
├── SKILL.md
├── references/
│ └── POLICY_FAQ.md
└── assets/
└── expense-report-template.md
Running the Sample
Prerequisites
- .NET 10.0 SDK
- Azure OpenAI endpoint with a deployed model
Setup
-
Set environment variables:
export AZURE_OPENAI_ENDPOINT="https://your-endpoint.openai.azure.com/" export AZURE_OPENAI_DEPLOYMENT_NAME="gpt-4o-mini" -
Run the sample:
dotnet run
Examples
The sample runs two examples:
- Expense policy FAQ — Asks about tip reimbursement; the agent loads the expense-report skill and reads the FAQ resource
- Filing an expense report — Multi-turn conversation to draft an expense report using the template asset