agentleFS
foxminchanfoxminchan/BookWorm/.agents/skills/agent-framework-builder-dotnet/SKILL.md

agent-framework-builder-dotnet

Skill508 starsChanged 8 days agoMITView on GitHub

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.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 1

    1. microsoft/agent-framework★ 15k94% same

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository6 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill as the entry point for .NET Agent Framework application work.

    line 13
  2. Distinctive:

    Read only the linked reference for the selected path.

    line 23
  3. Very specific:

    Add only the narrow packages the application needs (for example Microsoft.Agents.AI plus one provider package) instead of every …

    line 66
  4. Distinctive:

    Use local guidance for stable decisions and common patterns.

    line 80
  5. Distinctive:

    When the coding agent supports MCP, configure the Microsoft Learn MCP Server as a Streamable HTTP server:

    line 86
  6. Very specific:

    Search Microsoft Learn with microsoft_docs_search.

    line 95
  7. Very specific:

    Use microsoft_code_sample_search when a current implementation example is needed.

    line 97
  8. Very specific:

    If Learn MCP is unavailable and a trusted mslearn CLI is already installed, use the equivalent command:

    line 98
  9. Distinctive:

    Do not fetch and execute an unpinned CLI package during a coding session.

    line 106

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

PathChoose it whenDetails
Plain agentOne model-driven actor owns the task and tools, sessions, context, and middleware are sufficient.Plain agents
Harness agentThe 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 orchestrationExplicit stages, routing, parallelism, multiple participants, checkpointing, human input, or intermediate outputs are central to correctness.Workflows
Declarative definitionYAML should be the source of truth for a supported agent or workflow.Declarative definitions
EvaluationExpected outputs, tool calls, failed runs, or quality regressions are the main concern.Evaluation
ObservabilityThe task is diagnosing or monitoring runtime behavior with traces, logs, and metrics.Observability
ExtensibilityThe application needs a custom chat client, agent, context provider, chat history provider, or middleware.Extensibility
IntegrationThe task is choosing or wiring a provider, protocol, memory store, tool service, UI, or platform extension.Integrations
Hosting and deploymentWorking 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 the project pins one.
  • Add only the narrow packages the application needs (for example Microsoft.Agents.AI plus one provider package) instead of every Microsoft.Agents.AI.* package.
  • Package maturity differs per package: some are released, others are -preview or -alpha. Check the package's current status before depending on it and allow prerelease versions only when required.
  • Some APIs are marked [Experimental] and surface diagnostic IDs (for example MAAI001). Suppress a diagnostic only deliberately, scoped to the code that uses the API, after confirming the feature may change.
  • Agent Framework does not read configuration on your behalf. Read endpoints, models, and keys through IConfiguration, user secrets, or environment variables and pass them to the client explicitly. Prefer a token credential such as DefaultAzureCredential over API keys, and never hard-code secrets.
  • DefaultAzureCredential probes several credential sources, which adds latency and risk in production. When the hosting identity is known (for example managed identity), use that specific credential instead.

Current documentation lookup

Use local guidance for stable decisions and common patterns. For provider matrices, package maturity, hosted tools, deployment details, or unfamiliar APIs, consult current sources before generating code.

The reference pages intentionally describe selection rules, invariants, and non-obvious gotchas. Use XML docs or API reference pages for signatures and option details, and use Learn or maintained samples for end-to-end procedures.

When the coding agent supports MCP, configure the Microsoft Learn MCP Server as a Streamable HTTP server:

https://learn.microsoft.com/api/mcp

See Microsoft Learn MCP Server setup for client configuration. The endpoint is for MCP clients and returns an error when opened directly in a browser.

  1. Search Microsoft Learn with microsoft_docs_search.
  2. Fetch the relevant page with microsoft_docs_fetch.
  3. Use microsoft_code_sample_search when a current implementation example is needed.
  4. If Learn MCP is unavailable and a trusted mslearn CLI is already installed, use the equivalent command:
MCP toolPreinstalled CLI
microsoft_docs_search(query="...")mslearn search "..."
microsoft_docs_fetch(url="...")mslearn fetch "..."
microsoft_code_sample_search(query="...", language="csharp")mslearn code-search "..." --language csharp

Do not fetch and execute an unpinned CLI package during a coding session. Use the official Microsoft Learn MCP/CLI setup to install or update it intentionally.

Canonical starting points:

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.