agentsclimarketplace

Dotnet microsoft agent framework

Skill Postpartum-genushyacinthus29/dotnet-skills/skills/dotnet-microsoft-agent-framework

Build .NET AI agents and multi-agent workflows with Microsoft Agent Framework using the right agent type, threads, tools, workflows, hosting protocols, and enterprise guardrails.From its SKILL.md

Install
npx -y skills add Postpartum-genushyacinthus29/dotnet-skills --skill dotnet-microsoft-agent-framework

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

11.8 KB, ~2.5k tokens by cl100k_base, as published. Nobody here has run it

Microsoft Agent Framework

Trigger On

  • building or reviewing .NET code that uses Microsoft.Agents.*, Microsoft.Extensions.AI, AIAgent, AgentThread, AgentSession, or Agent Framework hosting packages
  • choosing between ChatClientAgent, Responses agents, hosted agents, custom agents, Anthropic agents, workflows, or durable agents
  • authoring preview-era Microsoft.Agents.AI.Workflows.Declarative* packages or wrapping a workflow with workflow.AsAIAgent()
  • adding tools, MCP, A2A, OpenAI-compatible hosting, AG-UI, DevUI, background responses, or OpenTelemetry
  • migrating from Semantic Kernel agent APIs or aligning AutoGen-style multi-agent patterns to Agent Framework
  • using Anthropic Claude models (haiku, sonnet, opus) via AnthropicClient or through Azure Foundry with AnthropicFoundryClient

Workflow

  1. Decide whether the problem should stay deterministic. If plain code or a typed workflow without LLM autonomy is enough, do that instead of adding an agent.
  2. Choose the execution shape first: single AIAgent, explicit programmatic Workflow, workflow-as-agent wrapper, declarative workflow when YAML portability is explicitly required, Azure Functions durable agent, ASP.NET Core hosted agent, AG-UI remote UI, or DevUI local debugging.
  3. Choose the agent type and provider intentionally. Prefer the simplest agent that satisfies the threading, tooling, and hosting requirements.
  4. Keep agents stateless and keep conversation or long-lived state in provider-owned session objects. Most persistence guidance still centers on AgentThread, while newer middleware and background-response examples may surface AgentSession. Treat both as opaque provider-specific state.
  5. Add only the tools and middleware that the scenario needs. Narrow the tool surface, require approval for side effects, and treat MCP, A2A, and third-party services as trust boundaries.
  6. For workflows, model executors, edges, request-response ports, checkpoints, shared state, and human-in-the-loop explicitly rather than hiding control flow in prompts.
  7. Prefer Responses-based protocols for new remote/OpenAI-compatible integrations unless you specifically need Chat Completions compatibility.
  8. Use durable agents only when you truly need Azure Functions serverless hosting, durable thread storage, or deterministic long-running orchestrations.
  9. Verify preview status, package maturity, docs recency, and provider-specific limitations before locking a production architecture.

Architecture

flowchart LR
  A["Task"] --> B{"Deterministic code is enough?"}
  B -->|Yes| C["Write normal .NET code or a plain workflow"]
  B -->|No| D{"One dynamic decision-maker is enough?"}
  D -->|Yes| E["Use an `AIAgent` / `ChatClientAgent`"]
  D -->|No| F["Use a typed `Workflow`"]
  F --> G{"Needs durable Azure hosting or week-long execution?"}
  G -->|Yes| H["Use durable agents on Azure Functions"]
  G -->|No| I["Use in-process workflows"]
  E --> J{"Need a remote protocol or UI?"}
  F --> J
  J -->|OpenAI-compatible HTTP| K["ASP.NET Core Hosting.OpenAI"]
  J -->|Agent-to-agent protocol| L["A2A hosting"]
  J -->|Web UI protocol| M["AG-UI"]
  J -->|Local debug shell| N["DevUI (dev only)"]

Core Knowledge

  • AIAgent is the common runtime abstraction. It should stay mostly stateless.
  • AgentThread still anchors most persisted conversation guidance, but some newer runtime surfaces now pass AgentSession instead. Treat either state object as opaque provider-owned data and verify exact callback signatures against the current official page.
  • AgentResponse and AgentResponseUpdate are not just text containers. They can include tool calls, tool results, structured output, reasoning-like updates, and response metadata.
  • ChatClientAgent is the safest default when you already have an IChatClient and do not need a hosted-agent service.
  • Current Learn docs now treat Microsoft Foundry Agents as the canonical Azure-hosted persistent-agent page. The old Azure AI Foundry Agent and Foundry Models Chat/Responses URLs now collapse into that broader provider surface, so do not model them as separate top-level product families in design discussions.
  • Current Learn docs also position Azure OpenAI Responses as the richest Azure OpenAI client: it is the path that exposes tool approval, code interpreter, file search, web search, hosted MCP, and local MCP tools.
  • Workflow is an explicit graph of executors and edges. Use it when the control flow must stay inspectable, typed, resumable, or human-steerable.
  • workflow.AsAIAgent() is the escape hatch when a complex workflow needs to present a normal agent surface. It keeps sessions, streaming, and agent response APIs, but the workflow start executor still needs chat-message-compatible input.
  • AgentWorkflowBuilder provides high-level factory methods such as BuildConcurrent for common agent orchestration patterns. Use it when you need concurrent or sequential agent pipelines without writing custom executor classes.
  • Declarative workflows are now a documented surface, but the .NET package/runtime story is still preview-heavy and narrower than programmatic workflows. Use YAML when portability and operator-editable orchestration matter; keep deeply custom .NET control flow programmatic.
  • Hosting layers such as OpenAI-compatible HTTP, A2A, and AG-UI are adapters over your in-process agent or workflow. They do not replace the core architecture choice.
  • Durable agents are a hosting and persistence decision for Azure Functions. They are not the default answer for ordinary app-level orchestration.
  • Current Learn docs now consolidate middleware under agents/middleware and tools under agents/tools/*; older tutorial URLs can redirect to the same canonical page, so prefer the canonical path when exact signatures or headings matter.

Decision Cheatsheet

If you needDefault choiceWhy
One model-backed assistant with normal .NET compositionChatClientAgent or chatClient.AsAIAgent(...)Lowest friction, middleware-friendly, works with IChatClient
OpenAI-style future-facing APIs, background responses, or richer response stateResponses-based agentBetter fit for new OpenAI-compatible integrations
Simple client-managed chat historyChat Completions agentKeeps request/response simple
Service-hosted agents and service-owned threads/toolsMicrosoft Foundry Agent or other hosted agentManaged runtime is the requirement
Azure-hosted OpenAI-compatible models with the richest hosted-tool surface but app-owned compositionAzure OpenAI Responses agentBest Azure OpenAI default when you need code interpreter, file search, web search, hosted MCP, or tool approval without moving to a persistent service-managed agent
Anthropic Claude models (haiku, sonnet, opus) directly or via Azure FoundryAnthropicClient.AsAIAgent(...) or AnthropicFoundryClient.AsAIAgent(...)Use Microsoft.Agents.AI.Anthropic; add Anthropic.Foundry for Azure-hosted Claude
Typed multi-step orchestrationWorkflow or AgentWorkflowBuilder helpersControl flow stays explicit and testable; use BuildConcurrent for agent fan-out/fan-in
YAML-defined orchestration that non-developers or operators need to editDeclarative workflow packagesGood for portable trigger/action graphs; do not pretend the .NET preview is as flexible as programmatic workflows
Week-long or failure-resilient Azure executionDurable agent on Azure FunctionsDurable Task gives replay and persisted state
Agent-to-agent interoperabilityA2A hosting or A2A proxy agentThis is protocol-level delegation, not local inference
Browser or web UI protocol integrationAG-UIDesigned for remote UI sync and approval flows

Common Failure Modes

  • Adding an agent where deterministic code or a plain typed workflow would be clearer and cheaper.
  • Assuming agent instance fields are the durable source of truth instead of storing real state in AgentThread, stores, or workflow state.
  • Picking Chat Completions when the scenario really needs Responses features such as background execution or service-backed response chains.
  • Treating hosted-agent services and local IChatClient agents as if they share the same thread and tool guarantees.
  • Hiding orchestration inside prompts instead of modeling executors, edges, requests, checkpoints, and HITL explicitly.
  • Exposing too many tools at once, especially side-effecting tools without approvals, middleware checks, or clear trust boundaries.
  • Treating DevUI as a production UI surface instead of a development and debugging tool.

Deliver

  • a justified architecture choice: agent vs workflow vs durable orchestration
  • the concrete .NET agent type, provider, and package set
  • an explicit thread, tool, middleware, and observability strategy
  • hosting and protocol decisions for OpenAI-compatible APIs, A2A, AG-UI, or Azure Functions
  • migration notes when replacing Semantic Kernel agent APIs or AutoGen-style orchestration

Validate

  • the scenario really needs agentic behavior and is not better served by deterministic code
  • the selected agent type matches the provider, thread model, and tool model
  • AgentThread or AgentSession lifecycle, serialization, and compatibility boundaries are explicit for the chosen provider surface
  • tool approval, MCP headers, and third-party trust boundaries are handled safely
  • workflows define checkpoints, request-response, shared state, and HITL paths deliberately
  • DevUI is treated as a development sample, not a production surface
  • docs or packages marked preview are called out, and Python-only docs are not mistaken for guaranteed .NET APIs

When a decision depends on exact wording, long-tail feature coverage, or a less-common integration, check the local official docs snapshot before relying on summaries.

References

  • official-docs-index.md - Slim local Microsoft Learn snapshot map with direct links to every mirrored page, live-only support pages, and API-reference pointers
  • patterns.md - Architecture routing, agent types, provider and thread model selection, and durable-agent guidance
  • providers.md - Provider, SDK, endpoint, package, and Responses-vs-ChatCompletions selection
  • tools.md - Function tools, hosted tools, tool approval, agent-as-tool, and service limitations
  • sessions.md - AgentThread, chat history storage, reducers, context providers, and thread serialization
  • middleware.md - Agent, function-calling, and IChatClient middleware with guardrail patterns
  • workflows.md - Executors, edges, requests and responses, checkpoints, orchestrations, and declarative workflow notes
  • mcp.md - MCP integration, agent-as-MCP, security rules, and MCP-vs-A2A guidance
  • hosting.md - ASP.NET Core hosting, OpenAI-compatible APIs, A2A, AG-UI, Azure Functions, and Purview integration
  • devui.md - DevUI capabilities, modes, auth, tracing, and safe usage boundaries
  • migration.md - Semantic Kernel and AutoGen migration notes, concept mapping, and breaking-model shifts
  • support.md - Preview status, official support channels, and recurring troubleshooting checks
  • examples.md - Quick-start and tutorial recipe index covering the official docs set

What ships with it: 114 files

1255.7 KB alongside SKILL.md

references/

74 more files not listed here. See all 114 in the repository.

Gives 0 of the 12 instructions most context ai engineering skills give in ~2.5k tokens

Counted across 1,193 of the 1,976 authors here whose files we hold, read 2026-08-07

  • Dispatch a fresh implementer subagent per taskin 48 of 1193, across 19 files
  • Dispatch a final code reviewer after all tasksin 33 of 1193, across 8 files
  • Provide full task text to the subagentin 30 of 1193, across 9 files
  • Review spec compliance before code qualityin 27 of 1193, across 10 files
  • Make the hook script executablein 26 of 1193, across 8 files
  • Re-snapshot after navigation or DOM changesin 25 of 1193, across 19 files
  • Read files before editing themin 22 of 1193, across 11 files
  • Answer subagent questions before proceedingin 22 of 1193, across 7 files
  • Mark task complete in TodoWrite after approvalin 22 of 1193, across 6 files
  • Merge hook into existing settingsin 21 of 1193, across 3 files
  • Ask if installation is global or projectin 20 of 1193, across 2 files
  • Copy the hook script to target locationin 20 of 1193, across 2 files

Said here and by no other author read

  • use deterministic code over agents when sufficient
  • choose the execution shape first
  • keep agents stateless
  • keep conversation state in provider sessions
  • model workflow control flow explicitly
  • narrow the tool surface

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 326,401. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.