
microsoft-agent-framework
Comprehensive knowledge of Microsoft Agent Framework for building production AI agents and workflows. Auto-activates for agent building, workflow design, AutoGen migration, and enterprise AI tasks.
- Installs
- 258
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/rysweet/amplihack --skill microsoft-agent-framework- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads microsoft-agent-framework automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Microsoft Agent Framework Skill
Version: 0.1.0-preview | Last Updated: 2025-11-15 | Framework Version: 0.1.0-preview Languages: Python 3.10+, C# (.NET 8.0+) | License: MIT
Quick Reference
Microsoft Agent Framework is an open-source platform for building production AI agents and workflows, unifying AutoGen's simplicity with Semantic Kernel's enterprise features.
Core Capabilities: AI Agents (stateful conversations, tool integration) | Workflows (graph-based orchestration, parallel processing) | Enterprise features (telemetry, middleware, MCP support)
Installation:
- Python:
pip install agent-framework-core --pre - C#:
dotnet add package Microsoft.Agents.AI --prerelease
Repository: https://github.com/microsoft/agent-framework (5.1k stars)
When to Use This Skill
Use Microsoft Agent Framework when you need:
- Production AI Agents with enterprise features (telemetry, middleware, structured outputs)
- Multi-Agent Orchestration via graph-based workflows with conditional routing
- Tool/Function Integration with approval workflows and error handling
- Cross-Platform Development requiring both Python and C# implementations
- Research-to-Production Pipeline leveraging AutoGen + Semantic Kernel convergence
Integration with amplihack: Use Agent Framework for stateful conversational agents and complex orchestration. Use amplihack's native agent system for stateless task delegation and simple orchestration. See @integration/decision-framework.md for detailed guidance.
Core Concepts
1. AI Agents
Stateful conversational entities that process messages, call tools, and maintain context.
Python Example:
from agents_framework import Agent, ModelClient
# Create agent with model
agent = Agent(
name="assistant",
model=ModelClient(model="gpt-4"),
instructions="You are a helpful assistant"
)
# Single-turn conversation
response = await agent.run(message="Hello!")
print(response.content)
# Multi-turn with thread
from agents_framework import Thread
thread = Thread()
response = await agent.run(thread=thread, message="What's 2+2?")
response = await agent.run(thread=thread, message="Double that")
C# Example:
using Microsoft.Agents.AI;
var agent = new Agent(
name: "assistant",
model: new ModelClient(model: "gpt-4"),
instructions: "You are a helpful assistant"
);
var response = await agent.RunAsync("Hello!");
Console.WriteLine(response.Content);
2. Tools & Functions
Extend agent capabilities by providing callable functions.
Python Example:
from agents_framework import function_tool
@function_tool
def get_weather(location: str) -> str:
"""Get weather for a location."""
return f"Weather in {location}: Sunny, 72°F"
agent = Agent(
name="assistant",
model=ModelClient(model="gpt-4"),
tools=[get_weather]
)
response = await agent.run(message="What's the weather in Seattle?")
# Agent automatically calls get_weather() and responds with result
C# Example:
[FunctionTool]
public static string GetWeather(string location)
{
return $"Weather in {location}: Sunny, 72°F";
}
var agent = new Agent(
name: "assistant",
model: new ModelClient(model: "gpt-4"),
tools: new[] { typeof(Tools).GetMethod("GetWeather") }
);
3. Workflows
Graph-based orchestration for multi-agent systems with conditional routing and parallel execution.
Python Example:
from agents_framework import Workflow, GraphWorkflow
# Define workflow graph
workflow = GraphWorkflow()
# Add agents as nodes
workflow.add_node("researcher", research_agent)
workflow.add_node("writer", writer_agent)
workflow.add_node("reviewer", review_agent)
# Define edges (control flow)
workflow.add_edge("researcher", "writer") # Sequential
workflow.add_edge("writer", "reviewer")
# Conditional routing
def should_revise(state):
return state.get("needs_revision", False)
workflow.add_conditional_edge(
"reviewer",
should_revise,
{"revise": "writer", "done": "END"}
)
# Execute workflow
result = await workflow.run(initial_message="Research AI trends")
C# Example:
var workflow = new GraphWorkflow();
workflow.AddNode("researcher", researchAgent);
workflow.AddNode("writer", writerAgent);
workflow.AddNode("reviewer", reviewAgent);
workflow.AddEdge("researcher", "writer");
workflow.AddEdge("writer", "reviewer");
var result = await workflow.RunAsync("Research AI trends");
4. Context & State Management
Maintain conversation history and shared state across agents.
Python:
from agents_framework import Thread, ContextProvider
# Thread maintains conversation history
thread = Thread()
await agent.run(thread=thread, message="Remember: My name is Alice")
await agent.run(thread=thread, message="What's my name?") # "Alice"
# Custom context provider
class DatabaseContext(ContextProvider):
async def get_context(self, thread_id: str):
return await db.fetch_history(thread_id)
async def save_context(self, thread_id: str, messages):
await db.save_history(thread_id, messages)
agent = Agent(model=model, context_provider=DatabaseContext())
5. Middleware & Telemetry
Add cross-cutting concerns like logging, auth, and monitoring.
Python:
from agents_framework import Middleware
from opentelemetry import trace
# Custom middleware
class LoggingMiddleware(Middleware):
async def process(self, message, next_handler):
print(f"Processing: {message.content}")
response = await next_handler(message)
print(f"Response: {response.content}")
return response
# OpenTelemetry integration
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span("agent-run"):
response = await agent.run(message="Hello")
C#:
public class LoggingMiddleware : IMiddleware
{
public async Task<Message> ProcessAsync(Message message, Func<Message, Task<Message>> next)
{
Console.WriteLine($"Processing: {message.Content}");
var response = await next(message);
Console.WriteLine($"Response: {response.Content}");
return response;
}
}
Common Patterns
Human-in-the-Loop Approval
from agents_framework import HumanInTheLoop
@function_tool
def delete_file(path: str) -> str:
"""Delete a file (requires approval)."""
return f"Deleted {path}"
# Add approval wrapper
delete_file_with_approval = HumanInTheLoop(
tool=delete_file,
approval_prompt="Approve deletion of {path}?"
)
agent = Agent(tools=[delete_file_with_approval])
Parallel Agent Execution
workflow = GraphWorkflow()
# Add multiple agents
workflow.add_node("analyst1", analyst_agent)
workflow.add_node("analyst2", analyst_agent)
workflow.add_node("synthesizer", synthesis_agent)
# Parallel execution
workflow.add_edge("START", ["analyst1", "analyst2"]) # Both run in parallel
workflow.add_edge(["analyst1", "analyst2"], "synthesizer") # Wait for both
result = await workflow.run(message="Analyze market trends")
Structured Output Generation
from pydantic import BaseModel
class WeatherReport(BaseModel):
location: str
temperature: float
conditions: str
agent = Agent(
model=model,
instructions="Generate weather reports",
response_format=WeatherReport
)
response = await agent.run(message="Weather in Seattle")
report: WeatherReport = response.parsed
print(f"{report.location}: {report.temperature}°F, {report.conditions}")
Error Handling & Retries
from agents_framework import RetryPolicy
agent = Agent(
model=model,
retry_policy=RetryPolicy(
max_retries=3,
backoff_factor=2.0,
exceptions=[TimeoutError, ConnectionError]
)
)
try:
response = await agent.run(message="Hello")
except Exception as e:
print(f"Failed after retries: {e}")
Integration with amplihack
Decision Framework
Use Microsoft Agent Framework when:
- Building stateful conversational agents (multi-turn dialogue)
- Need enterprise features (telemetry, middleware, auth)
- Complex multi-agent orchestration with conditional routing
- Cross-platform requirements (Python + C#)
- Integration with Microsoft ecosystem (Azure, M365)
Use amplihack native agents when:
- Stateless task delegation (code review, analysis)
- Simple sequential/parallel orchestration
- File-based operations and local tooling
- Rapid prototyping without infrastructure
- Token-efficient skill-based architecture
Hybrid Approach:
# Use amplihack for orchestration
from claude import Agent as ClaudeAgent
orchestrator = ClaudeAgent("orchestrator.md")
# Delegate to Agent Framework for stateful agents
from agents_framework import Agent, Thread
conversational_agent = Agent(
model=ModelClient(model="gpt-4"),
instructions="Maintain conversation context"
)
thread = Thread()
response1 = await conversational_agent.run(thread=thread, message="Start task")
response2 = await conversational_agent.run(thread=thread, message="Continue")
# Use amplihack for final synthesis
result = orchestrator.process({"responses": [response1, response2]})
See @integration/amplihack-integration.md for complete patterns.
Quick Start Workflow
-
Install:
pip install agent-framework-core --pre(Python) ordotnet add package Microsoft.Agents.AI --prerelease(C#) -
Create Basic Agent:
from agents_framework import Agent, ModelClient agent = Agent( name="assistant", model=ModelClient(model="gpt-4"), instructions="You are a helpful assistant" ) response = await agent.run(message="Hello!") -
Add Tools:
@function_tool def calculate(expr: str) -> float: return eval(expr) agent = Agent(model=model, tools=[calculate]) -
Build Workflow:
workflow = GraphWorkflow() workflow.add_node("agent1", agent1) workflow.add_node("agent2", agent2) workflow.add_edge("agent1", "agent2") result = await workflow.run(message="Task") -
Add Telemetry:
from opentelemetry import trace tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("agent-run"): response = await agent.run(message="Hello")
Reference Documentation
For detailed information, see:
@reference/01-overview.md- Architecture, components, use cases@reference/02-agents.md- Agent creation, lifecycle, advanced features@reference/03-workflows.md- Workflow patterns, executors, checkpointing@reference/04-tools-functions.md- Tool definition, approval workflows, error handling@reference/05-context-middleware.md- Context providers, middleware patterns, auth@reference/06-telemetry-monitoring.md- OpenTelemetry, logging, debugging@reference/07-advanced-patterns.md- Multi-agent patterns, streaming, DevUI
Working Examples
@examples/01-basic-agent.py- Simple conversational agent@examples/02-tool-integration.py- Agent with function calling@examples/03-simple-workflow.py- Multi-agent workflow@examples/04-basic-agent.cs- C# agent implementation@examples/05-tool-integration.cs- C# tool integration@examples/06-simple-workflow.cs- C# workflow example
Maintenance
Check framework freshness: python @scripts/check-freshness.py
Current version tracking: @metadata/version-tracking.json
Token Count: ~4,200 tokens (under 4,800 limit)
FAQ
What does the microsoft-agent-framework skill do?
Comprehensive knowledge of Microsoft Agent Framework for building production AI agents and workflows. Auto-activates for agent building, workflow design, AutoGen migration, and enterprise AI tasks.
How do I install microsoft-agent-framework?
Run npx skills add https://github.com/rysweet/amplihack --skill microsoft-agent-framework in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/microsoft-agent-framework/ (personal) or .claude/skills/microsoft-agent-framework/ (project).
Which AI agents can use microsoft-agent-framework?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is microsoft-agent-framework safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains microsoft-agent-framework?
It is published by rysweet in rysweet/amplihack. It has 258 recorded installs.
More from rysweet/amplihack
cybersecurity-analyst
rysweet/amplihack
Analyzes events through cybersecurity lens using threat modeling, attack surface analysis, defense-in-depth, zero-trust architecture, and risk-based frameworks (CIA triad, STRIDE, MITRE ATT&CK). Provides insights on vulnerabilities, attack vectors, defense strategies, incident response, and security posture. Use when: Security incidents, vulnerability assessments, threat analysis, security architecture, compliance. Evaluates: Confidentiality, integrity, availability, threat actors, attack patterns, controls, residual risk.
lawyer-analyst
rysweet/amplihack
Analyzes events through legal lens using statutory interpretation, case law analysis, legal reasoning, constitutional principles, and multiple legal frameworks (common law, civil law, international law). Provides insights on legal rights, obligations, liabilities, remedies, and compliance requirements. Use when: Legal disputes, contracts, regulations, compliance, rights analysis, liability assessment. Evaluates: Legal obligations, rights, liabilities, remedies, precedent, statutory authority, constitutionality.
psychologist-analyst
rysweet/amplihack
Analyzes events through psychological lens using cognitive psychology, social psychology, developmental psychology, clinical psychology, and neuroscience. Provides insights on behavior, cognition, emotion, motivation, group dynamics, decision-making biases, mental health, and individual differences. Use when: Behavioral patterns, decision-making, group behavior, mental health, leadership, persuasion, trauma, development. Evaluates: Cognitive processes, emotional responses, motivations, biases, group dynamics, personality, mental states.
mermaid-diagram-generator
rysweet/amplihack
Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams, and Gantt charts. Generates valid Mermaid syntax for embedding in markdown docs.
economist-analyst
rysweet/amplihack
Analyzes events through economic lens using supply/demand, incentive structures, market dynamics, and multiple schools of economic thought (Classical, Keynesian, Austrian, Behavioral). Provides insights on market impacts, resource allocation, policy implications, and distributional effects. Use when: Economic events, policy changes, market shifts, financial crises, regulatory decisions. Evaluates: Incentives, efficiency, opportunity costs, market failures, systemic risks.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available