跳到正文
Skillpedia
API 与服务器(后端)14k · #11139

agent-framework-builder-dotnet

它能做什么

这项技能指导使用 Microsoft Agent Framework 构建 .NET(C#)应用,涵盖智能体、工作流、工具和托管。适合想在 C# 应用中加入 AI 助手的开发者。

适用场景

  • ✓当你想在 .NET 应用中构建 AI 智能体的时候。
  • ✓当你需要一个由多个智能体或工具协调的多步骤工作流的时候。
  • ✓当你想根据当前框架版本检查现有 .NET 智能体应用的时候。

技能链接

https://github.com/microsoft/agent-framework/blob/main/skills/agent-framework-builder-dotnet/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/microsoft/agent-framework/blob/main/skills/agent-framework-builder-dotnet/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我用 Microsoft Agent Framework 在我的 C# 应用中加入一个带搜索工具的 AI 智能体?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会检查你的项目,从智能体、工作流或其他选项中挑选最简单的匹配模式,并且只阅读所需的指南。然后它会做出最小的改动,并进行有针对性的检查。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Agent Framework builder for .NET

Use this skill as the entry point for .NET Agent Framework application work. Choose the smallest framework pattern that preserves the required behavior, load only the relevant references, and validate against current APIs instead of relying on remembered preview-era syntax.

Workflow

  1. Inspect the existing solution: target frameworks, SDK version, package management (central package management or per-project), and installed Microsoft.Agents.AI.* packages and versions.
  2. Choose the simplest matching path from the table below.
  3. Resolve design questions only when they materially change the implementation.
  4. Read only the linked reference for the selected path.
  5. Implement the smallest coherent change and run the narrowest validation that exercises it.

Core abstractions

  • A chat client is a Microsoft.Extensions.AI.IChatClient. It sends messages and options to a model provider and returns chat responses or streaming updates. Agent Framework builds on Microsoft.Extensions.AI types such as ChatMessage, AIFunction, and ChatOptions instead of redefining them.
  • An agent derives from AIAgent and exposes RunAsync(...) and RunStreamingAsync(...). ChatClientAgent is the standard implementation: it wraps an IChatClient with instructions, tools, context providers, a chat history provider, and session handling. Provider packages usually create one through an AsAIAgent(...) extension method.
  • A harness agent is a HarnessAgent from Microsoft.Agents.AI.Harness. It wraps a ChatClientAgent with an opinionated set of context providers and agent decorators; it is still an AIAgent.
  • A workflow (Microsoft.Agents.AI.Workflows) coordinates explicit execution paths between executors and agents. AgentWorkflowBuilder provides standard sequential, concurrent, handoff, group-chat, and Magentic patterns over AIAgent participants. A workflow can be exposed as an AIAgent when callers need the agent contract.

User interface options

  • DevUI (Microsoft.Agents.AI.DevUI) is a local development, testing, and debugging tool for interacting with agents and workflows. Never run or deploy DevUI as a production application host.
  • AG-UI is the application-facing protocol integration for connecting an agent or workflow to an AG-UI-compatible frontend. Use Microsoft.Agents.AI.Hosting.AGUI.AspNetCore (server) when the product needs streaming UI events, tool interactions, shared state, interrupts, or resume behavior.

Choose the build path

Path Choose it when Details
Plain agent One model-driven actor owns the task and tools, sessions, context, and middleware are sufficient. Plain agents
Harness agent The product needs an operating loop with todos, modes, memory, approvals, skills, optional file access, background agents, shell, compaction, or repeated execution. Harness agents
Workflow or orchestration Explicit stages, routing, parallelism, multiple participants, checkpointing, human input, or intermediate outputs are central to correctness. Workflows
Declarative definition YAML should be the source of truth for a supported agent or workflow. Declarative definitions
Evaluation Expected outputs, tool calls, failed runs, or quality regressions are the main concern. Evaluation
Observability The task is diagnosing or monitoring runtime behavior with traces, logs, and metrics. Observability
Extensibility The application needs a custom chat client, agent, context provider, chat history provider, or middleware. Extensibility
Integration The task is choosing or wiring a provider, protocol, memory store, tool service, UI, or platform extension. Integrations
Hosting and deployment Working Agent Framework code needs a process host, protocol endpoint, identity contract, or deployment shape. Hosting and deployment

Defaults

  • Target a currently supported .NET release. The packages multi-target current and recent LTS .NET versions, and some also support .NET Standard 2.0 and .NET Framework 4.7.2. Prefer the latest supported SDK unless th
常见问题

我需要知道该用哪种模式吗?

不需要。这项技能会帮你选出能保持所需行为的最简单模式。

它会使用当前的 API 吗?

会。这项技能告诉智能体检查当前的 API,而不是依赖旧的预览版示例。

它涵盖托管吗?

涵盖。它包括托管、工具、会话、中间件和评估。

详情

作者的原始描述

Use this skill when building, modifying, reviewing, evaluating, integrating, or hosting .NET (C#) applications with Microsoft Agent Framework. Use it for Agent Framework agents, harness agents, workflows, orchestrations, declarative definitions, tools, sessions, middleware, evaluation, observability, integrations, or hosting, even when the user has not yet chosen the correct framework pattern.

repo: microsoft/agent-framework

热度

GitHub 星标
14k
排名
#11139
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能