rysweet avatar

microsoft-agent-framework

Expert knowledge of Microsoft Agent Framework for building production AI agents and workflows. Use w

作者 rysweet|オープンソース

Microsoft Agent Framework Skill

Version: 1.0.0 | Status: Production Ready | Last Updated: 2025-11-15

Overview

This Claude Code skill provides comprehensive Microsoft Agent Framework knowledge through progressive disclosure, enabling efficient agent development in .NET and Python while maintaining token efficiency and integration with amplihack workflows.

What is Microsoft Agent Framework?

Microsoft Agent Framework is an open-source SDK that combines the best of AutoGen (agent collaboration) and Semantic Kernel (enterprise readiness) into a unified platform for building production-grade multi-agent systems.

Key Features:

  • Graph-based workflow orchestration with parallel execution
  • Type-safe tool integration with Pydantic models
  • Built-in observability via OpenTelemetry
  • Cross-platform support (.NET and Python)
  • Native MCP (Model Context Protocol) integration
  • Production-ready with DevUI for development and debugging

Progressive Disclosure Architecture

This skill uses a tiered approach to balance comprehensive knowledge with token efficiency:

Tier 1: Metadata (<100 tokens)

Always loaded - Skill identity, capabilities summary, common use cases

  • Auto-discovery for Claude Code
  • Quick routing to appropriate content

Tier 2: Core Instructions (~4,800 tokens)

Default load - Framework overview and quick reference

  • Architecture components (agents, workflows, tools, middleware)
  • Quick start patterns for Python and C#
  • Decision framework (Agent Framework vs amplihack)
  • Integration patterns with amplihack workflows

Tier 3: Detailed Documentation (~18,000 tokens)

On-demand - Deep technical content

  • Component deep dives
  • Tutorial walkthroughs
  • Sample code patterns
  • Workflow orchestration patterns

Tier 4: Advanced Topics (~12,000 tokens)

Explicit request - Specialized scenarios

  • RAG integration patterns
  • Async multi-agent coordination
  • Function interception and middleware
  • Production deployment patterns

Total Skill: ~35,000 tokens (full content) Typical Load: ~5,000 tokens (most queries)

Directory Structure

.claude/skills/microsoft-agent-framework/
├── skill.md                     # Tier 1+2: Core skill content (4,800 tokens)
├── README.md                    # This file - skill documentation
├── reference/                   # Tier 3: Detailed technical documentation
│   ├── 01-overview.md          # Architecture and components
│   ├── 02-agents.md            # Agent lifecycle and patterns
│   ├── 03-workflows.md         # Graph-based orchestration
│   ├── 04-tools-functions.md  # Tool integration
│   ├── 05-context-middleware.md # Context providers and middleware
│   ├── 06-telemetry-monitoring.md # Observability
│   └── 07-advanced-patterns.md # Multi-agent patterns
├── examples/                    # Working code examples
│   ├── 01-basic-agent.py       # Python: Simple agent
│   ├── 02-tool-integration.py  # Python: Tool usage
│   ├── 03-simple-workflow.py   # Python: Workflow
│   ├── 04-basic-agent.cs       # C#: Simple agent
│   ├── 05-tool-integration.cs  # C#: Tool usage
│   └── 06-simple-workflow.cs   # C#: Workflow
├── integration/                 # Integration with amplihack
│   ├── decision-framework.md   # When to use Agent Framework
│   ├── amplihack-integration.md # Integration patterns
│   └── migration-guide.md      # Migration strategies
├── metadata/                    # Version tracking and sources
│   ├── version-tracking.json   # Framework and doc versions
│   ├── sources.json           # URL mappings and priorities
│   └── last-updated.txt       # Human-readable update info
└── scripts/
    └── check-freshness.py      # Documentation freshness checker

Usage Examples

Quick Start Query

User: "How do I create a basic agent with tools?"
Claude loads: skill.md (Tier 1+2) = ~4,800 tokens
Response: Quick start example with code

Detailed Tutorial

User: "Show me how to build a workflow with conditional branching"
Claude loads: skill.md + reference/03-workflows.md + examples
Response: Full workflow tutorial with examples

Advanced Scenario

User: "Build a RAG agent with async multi-agent coordination"
Claude loads: skill.md + reference/ (RAG + async) + examples
Response: Complete implementation with patterns

Decision Support

User: "Should I use Agent Framework or amplihack for this feature?"
Claude loads: skill.md + integration/decision-framework.md
Response: Decision framework with recommendation

Integration with Amplihack

Decision Framework

Use Microsoft Agent Framework when:

  • Building production .NET or Python agent applications
  • Need graph-based workflow orchestration
  • Require type-safe tool integration
  • Want built-in observability (OpenTelemetry)
  • Building multi-agent systems with explicit control flow
  • Need conversation persistence across disconnected sessions

Use amplihack when:

  • Orchestrating Claude Code operations
  • Need Claude-specific optimizations
  • Building development workflow automation
  • Want agent-based code generation and review
  • Require git workflow integration

Hybrid Approach:

  • Use amplihack for orchestration and planning
  • Use Agent Framework for implementation and execution
  • Amplihack agents generate Agent Framework code
  • Agent Framework handles production deployment

Integration Patterns

See @integration/amplihack-integration.md for detailed patterns including:

  • Calling Agent Framework from amplihack agents
  • Workflow integration strategies
  • State management between systems
  • Decision point identification

Maintenance and Freshness

Version Tracking

The skill tracks framework versions and documentation freshness:

# Check if documentation needs updating
python scripts/check-freshness.py

Current Versions:

  • Skill Version: 1.0.0
  • Framework Version: 0.1.0-preview
  • Last Updated: 2025-11-15
  • Next Verification Due: 2025-12-15

Source URLs (10 Total)

  1. Microsoft Learn - Overview: Architecture fundamentals
  2. Microsoft Learn - Tutorials: Step-by-step guides
  3. Microsoft Learn - Workflows: Graph-based orchestration
  4. GitHub Repository: API reference and code
  5. GitHub Workflow Samples: Real-world examples
  6. DevBlog Announcement: Strategic vision and roadmap
  7. LinkedIn - Workflows: Workflow patterns (Victor Dibia)
  8. LinkedIn - Function Calls: Middleware patterns (Victor Dibia)
  9. LinkedIn - Async: Multi-agent coordination (Victor Dibia)
  10. LinkedIn - RAG: RAG implementation patterns (Victor Dibia)

See @metadata/sources.json for complete URL mappings and priorities.

Update Workflow

  1. Check GitHub releases for new framework versions
  2. Review official documentation for changes
  3. Scan blogs/articles for new content
  4. Fetch updated content from all sources
  5. Distill content maintaining token budgets
  6. Update skill files and metadata
  7. Test with sample queries
  8. Validate examples compile and run

Frequency: Monthly (or when framework releases occur)

Token Budget Allocation

TierContentToken LimitLoad Strategy
1Metadata100Always
2Core Instructions4,700Default
3Detailed Docs18,000On-demand
4Advanced Topics12,000Explicit

Design Goal: 80% of queries answered with <10,000 tokens

Quick Reference: Key Concepts

Agents

Stateful conversational entities that process messages, call tools, and maintain context.

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!")

Workflows

Graph-based orchestration for multi-agent systems with conditional routing.

from agents_framework import GraphWorkflow

workflow = GraphWorkflow()
workflow.add_node("researcher", research_agent)
workflow.add_node("writer", writer_agent)
workflow.add_edge("researcher", "writer")

result = await workflow.run(initial_message="Research AI trends")

Tools

Extend agent capabilities by providing callable functions.

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(model=model, tools=[get_weather])

Middleware

Intercept and process messages before/after agent execution.

from agents_framework import Middleware

class LoggingMiddleware(Middleware):
    async def process_request(self, message: dict, context: dict):
        print(f"Request: {message['content']}")
        return message, context

agent = Agent(model=model, middleware=[LoggingMiddleware()])

Philosophy Alignment

This skill follows amplihack philosophy:

Ruthless Simplicity

  • Progressive disclosure: Load only what's needed
  • Clear contracts: Tier structure explicit and predictable
  • Minimal abstraction: Direct documentation access

Modular Brick Design

  • Single responsibility: One skill = Agent Framework knowledge
  • Clear studs: Tier-based API for content access
  • Regeneratable: All content from source URLs + distillation rules
  • Self-contained: No external runtime dependencies

Zero-BS Implementation

  • No placeholders or stubs
  • All code examples are valid and runnable
  • Working defaults for all patterns
  • Every function works or doesn't exist

Token Efficiency

  • Default load: 4,800 tokens (Tier 1+2)
  • Lazy loading: Tier 3+4 on-demand only
  • Content distillation: 10 URLs → 35K tokens (not 100K+ raw)

Resources

Official Documentation

Community

Amplihack Integration

  • Skills Catalog: .claude/skills/README.md
  • Decision Framework: @integration/decision-framework.md
  • Integration Patterns: @integration/amplihack-integration.md

Contributing

To update this skill:

  1. Check Freshness: Run python scripts/check-freshness.py
  2. Review Sources: Check all 10 source URLs for updates
  3. Update Content: Maintain token budgets for each tier
  4. Update Metadata: Increment version, update dates
  5. Test Examples: Verify all code examples compile and run
  6. Update README: Reflect any structural changes

License

This skill documentation is maintained by the amplihack team. Microsoft Agent Framework is MIT licensed.


Skill Status: Production Ready ✓ Framework Version: 0.1.0-preview Documentation Current: Yes (0 days old) Next Verification: 2025-12-15