microsoft-agent-framework
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMicrosoft Agent Framework
Microsoft Agent Framework
Use this skill when working with applications, agents, workflows, or migrations built on Microsoft Agent Framework.
Microsoft Agent Framework is the unified successor to Semantic Kernel and AutoGen, combining their strengths with new capabilities. Because it is still in public preview and changes quickly, always ground implementation advice in the latest official documentation and samples rather than relying on stale knowledge.
当你处理基于Microsoft Agent Framework构建的应用程序、Agent、工作流或迁移任务时,可使用本技能。
Microsoft Agent Framework是Semantic Kernel和AutoGen的统一继任者,它结合了两者的优势并新增了多项功能。由于目前它仍处于公开预览阶段且迭代速度较快,因此实现建议务必以最新官方文档和示例为准,切勿依赖过时知识。
Determine the target language first
首先确定目标语言
Choose the language workflow before making recommendations or code changes:
- Use the .NET workflow when the repository contains ,
.cs,.csproj,.sln, or other .NET project files, or when the user explicitly asks for C# or .NET guidance. Follow references/dotnet.md..slnx - Use the Python workflow when the repository contains ,
.py,pyproject.toml, or the user explicitly asks for Python guidance. Follow references/python.md.requirements.txt - If the repository contains both ecosystems, match the language used by the files being edited or the user's stated target.
- If the language is ambiguous, inspect the current workspace first and then choose the closest language-specific reference.
在给出建议或修改代码前,请先选择对应的语言工作流:
- 当仓库中包含、
.cs、.csproj、.sln等.NET项目文件,或用户明确请求C#/.NET相关指导时,使用**.NET**工作流。请遵循references/dotnet.md中的内容。.slnx - 当仓库中包含、
.py、pyproject.toml等文件,或用户明确请求Python相关指导时,使用Python工作流。请遵循references/python.md中的内容。requirements.txt - 若仓库同时包含两种生态的文件,则以待编辑文件使用的语言或用户指定的目标语言为准。
- 若语言不明确,请先检查当前工作区,再选择最匹配的语言专属参考资料。
Always consult live documentation
务必参考实时文档
- Read the Microsoft Agent Framework overview first: https://learn.microsoft.com/agent-framework/overview/agent-framework-overview
- Prefer official docs and samples for the current API surface.
- Use the Microsoft Docs MCP tooling when available to fetch up-to-date framework guidance and examples.
- Treat older Semantic Kernel or AutoGen patterns as migration inputs, not as the default implementation model.
- 首先阅读Microsoft Agent Framework概述:https://learn.microsoft.com/agent-framework/overview/agent-framework-overview
- 优先采用针对当前API接口的官方文档和示例。
- 若有可用的Microsoft Docs MCP工具,请使用它获取最新的框架指导和示例。
- 仅将旧版Semantic Kernel或AutoGen模式作为迁移输入,而非默认实现模型。
Shared guidance
共享指南
When working with Microsoft Agent Framework in any language:
- Use async patterns for agent and workflow operations.
- Implement explicit error handling and logging.
- Prefer strong typing, clear interfaces, and maintainable composition patterns.
- Use when Azure authentication is appropriate.
DefaultAzureCredential - Use agents for autonomous decision-making, ad hoc planning, conversation flows, tool usage, and MCP server interactions.
- Use workflows for multi-step orchestration, predefined execution graphs, long-running tasks, and human-in-the-loop scenarios.
- Support model providers such as Azure AI Foundry, Azure OpenAI, OpenAI, and others, but prefer Azure AI Foundry services for new projects when that matches user needs.
- Use thread-based or equivalent state handling, context providers, middleware, checkpointing, routing, and orchestration patterns when they fit the problem.
在任何语言中使用Microsoft Agent Framework时,请遵循以下规则:
- 对Agent和工作流操作使用异步模式。
- 实现明确的错误处理和日志记录。
- 优先使用强类型、清晰的接口和可维护的组合模式。
- 当需要Azure身份验证时,使用。
DefaultAzureCredential - 在自主决策、临时规划、对话流程、工具调用以及MCP服务器交互场景中使用Agent。
- 在多步骤编排、预定义执行图、长期运行任务和人机协同场景中使用工作流。
- 支持Azure AI Foundry、Azure OpenAI、OpenAI等模型提供商,但当符合用户需求时,新项目优先选用Azure AI Foundry服务。
- 当问题适用时,使用基于线程的(或等效的)状态处理、上下文提供程序、中间件、检查点、路由和编排模式。
Migration guidance
迁移指南
- If migrating from Semantic Kernel, use the official migration guide: https://learn.microsoft.com/agent-framework/migration-guide/from-semantic-kernel/
- If migrating from AutoGen, use the official migration guide: https://learn.microsoft.com/agent-framework/migration-guide/from-autogen/
- Preserve behavior first, then adopt native Agent Framework patterns incrementally.
- 若从Semantic Kernel迁移,请使用官方迁移指南:https://learn.microsoft.com/agent-framework/migration-guide/from-semantic-kernel/
- 若从AutoGen迁移,请使用官方迁移指南:https://learn.microsoft.com/agent-framework/migration-guide/from-autogen/
- 首先保留原有行为,然后逐步采用原生Agent Framework模式。
Workflow
工作流
- Determine the target language and read the matching reference file.
- Fetch the latest official docs and samples before making implementation choices.
- Apply the shared agent and workflow guidance from this skill.
- Use the language-specific package, repository, sample paths, and coding practices from the chosen reference.
- When examples in the repo differ from current docs, explain the difference and follow the current supported pattern.
- 确定目标语言并阅读对应的参考文件。
- 在做出实现选择前,获取最新的官方文档和示例。
- 应用本技能中提供的共享Agent和工作流指南。
- 使用所选参考资料中的语言专属包、仓库路径、示例路径和编码规范。
- 当仓库中的示例与当前文档存在差异时,需解释差异并遵循当前受支持的模式。
References
参考资料
- .NET reference
- Python reference
- .NET参考
- Python参考
Completion criteria
完成标准
- Recommendations match the target language.
- Package names, repository paths, and sample locations match the selected ecosystem.
- Guidance reflects current Microsoft Agent Framework documentation rather than legacy assumptions.
- Migration advice calls out Semantic Kernel and AutoGen only when relevant.
- 建议与目标语言匹配。
- 包名称、仓库路径和示例位置与所选生态系统一致。
- 指导内容反映Microsoft Agent Framework的当前文档,而非旧有假设。
- 仅在相关场景下提及Semantic Kernel和AutoGen的迁移建议。