Microsoft agent framework is an AI agent skill from the GitHub repository managedcode/dotnet-skills. Build .NET AI agents, harnesses, and multi-agent workflows with Microsoft Agent Framework using the right agent type, sessions, tools, workflows, hosting protocols, and enterprise guardrails. USE FOR: building or reviewing .NET code that uses Microsoft.Agents.*, Microsoft.Extensions.AI, AIAgent, Har
Claude Code: save it as .claude/skills/microsoft-agent-framework/SKILL.md
Cursor: save it as .cursor/rules/microsoft-agent-framework.md
Codex: save it as .agents/skills/microsoft-agent-framework/SKILL.md
ChatGPT, Gemini and other assistants: paste it into custom or project instructions
Skill file
Microsoft Agent Framework
Trigger On
building or reviewing .NET code that uses Microsoft.Agents.*, Microsoft.Extensions.AI, AIAgent, HarnessAgent, AgentSession, or Agent Framework hosting packages
choosing between ChatClientAgent, Responses agents, hosted agents, custom agents, Anthropic agents, workflows, or durable agents
adding the batteries-included Microsoft.Agents.AI.Harness surface for planning, todos, compaction, file memory/access, tool approvals, skills, shell execution, or background agents
authoring preview-era Microsoft.Agents.AI.Workflows.Declarative* packages or wrapping a workflow with workflow.AsAIAgent()
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
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.
Choose the execution shape first: single AIAgent, batteries-included HarnessAgent, 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.
Choose the agent type and provider intentionally. Prefer the simplest agent that satisfies the threading, tooling, and hosting requirements.
Keep agents stateless and keep conversation or long-lived state in AgentSession. Treat the session as opaque provider-owned state, serialize it through the owning agent, and never accept a raw service conversation ID as an end-user authorization boundary.
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.
For workflows, model executors, edges, typed RequestPort boundaries, checkpoints, shared state, and human-in-the-loop explicitly rather than hiding control flow in prompts.
Prefer Responses-based protocols for new remote/OpenAI-compatible integrations unless you specifically need Chat Completions compatibility.
Use durable agents only when you truly need Azure Functions serverless hosting, durable thread storage, or deterministic long-running orchestrations.
Verify preview status, package maturity, docs recency, and provider-specific limitations before locking a production architecture.