Postpartum-genushyacinthus29/dotnet-skills/skills/dotnet-microsoft-extensions-ai/SKILL.md
dotnet-microsoft-extensions-ai
Build provider-agnostic .NET AI integrations with `Microsoft.Extensions.AI`, `IChatClient`, embeddings, middleware, structured output, vector search, and evaluation.
- Source repository stars
- 9
- Declared platforms
- 0
- Static risk flags
- 0
- Last source update
- 2026-08-23
- Source checked
- 2026-08-25
Decision brief
What it does: where it fits
Build provider-agnostic . NET AI integrations with `Microsoft.
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/Postpartum-genushyacinthus29/dotnet-skills --skill "skills/dotnet-microsoft-extensions-ai"Inspect the Agent Skill "dotnet-microsoft-extensions-ai" from https://github.com/Postpartum-genushyacinthus29/dotnet-skills/blob/f9c1a213bc25d95641adc3a59f8048cb5656741c/skills/dotnet-microsoft-extensions-ai/SKILL.md at commit f9c1a213bc25d95641adc3a59f8048cb5656741c. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Workflow
1. Classify the request first: plain model access, tool calling, embeddings/vector search, evaluation, image generation, local-model prototyping, MCP bootstrap, or true agent orchestration. 2. Default to Microsoft.Extensions.AI for application and service code that needs provide…
Classify the request first: plain model access, tool calling, embeddings/vector search, evaluation, image generation, local-model prototyping, MCP bootstrap, or true agent orchestration.Default to Microsoft.Extensions.AI for application and service code that needs provider-agnostic chat, embeddings, middleware, structured output, and testability.Reference Microsoft.Extensions.AI.Abstractions directly only when authoring provider libraries or lower-level reusable integration packages. - 02
Trigger On
building or reviewing .NET code that uses Microsoft.Extensions.AI, Microsoft.Extensions.AI.Abstractions, IChatClient, IEmbeddingGenerator, ChatOptions, or AIFunction
building or reviewing .NET code that uses Microsoft.Extensions.AI, Microsoft.Extensions.AI.Abstractions, IChatClient, IEmbeddingGenerator, ChatOptions, or AIFunctionadding IImageGenerator, local-model chat via Ollama, AI app templates, or the .NET AI quickstarts for assistants and MCPchoosing between low-level AI abstractions, provider SDKs, vector-search composition, evaluation libraries, and a fuller agent framework - 03
Architecture
Review the “Architecture” section in the pinned source before continuing.
Review and apply the “Architecture” source section. - 04
Core Knowledge
Microsoft.Extensions.AI.Abstractions contains the core exchange contracts such as IChatClient, IEmbeddingGenerator, message/content types, and tool abstractions.
Microsoft.Extensions.AI.Abstractions contains the core exchange contracts such as IChatClient, IEmbeddingGenerator, message/content types, and tool abstractions.Microsoft.Extensions.AI adds the higher-level application surface: middleware builders, automatic function invocation, caching, logging, and OpenTelemetry integration.Most apps and services should reference Microsoft.Extensions.AI; provider and connector libraries usually reference only the abstractions package. - 05
Decision Cheatsheet
Review the “Decision Cheatsheet” section in the pinned source before continuing.
Review and apply the “Decision Cheatsheet” source section.
Permission review
Static risk signals and limitations
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 9 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- Postpartum-genushyacinthus29/dotnet-skills
- Skill path
- skills/dotnet-microsoft-extensions-ai/SKILL.md
- Commit
- f9c1a213bc25d95641adc3a59f8048cb5656741c
- License
- MIT
- Collected
- 2026-08-25
- Default branch
- main
View the original SKILL.md
Microsoft.Extensions.AI
Trigger On
- building or reviewing
.NETcode that usesMicrosoft.Extensions.AI,Microsoft.Extensions.AI.Abstractions,IChatClient,IEmbeddingGenerator,ChatOptions, orAIFunction - adding
IImageGenerator, local-model chat via Ollama, AI app templates, or the.NET AIquickstarts for assistants and MCP - choosing between low-level AI abstractions, provider SDKs, vector-search composition, evaluation libraries, and a fuller agent framework
- adding streaming chat, structured output, embeddings, tool calling, telemetry, caching, or DI-based AI middleware
- wiring
Microsoft.Extensions.VectorData,Microsoft.Extensions.DataIngestion, MCP tooling, or evaluation packages around a provider-agnostic AI app
Workflow
- Classify the request first: plain model access, tool calling, embeddings/vector search, evaluation, image generation, local-model prototyping, MCP bootstrap, or true agent orchestration.
- Default to
Microsoft.Extensions.AIfor application and service code that needs provider-agnostic chat, embeddings, middleware, structured output, and testability. - Reference
Microsoft.Extensions.AI.Abstractionsdirectly only when authoring provider libraries or lower-level reusable integration packages. - Model
IChatClientandIEmbeddingGeneratorcomposition explicitly in DI. Keep options, caching, telemetry, logging, and tool invocation inspectable in the pipeline. - Treat chat state deliberately. For stateless providers, resend history. For stateful providers, propagate
ConversationIdrather than assuming all providers behave the same way. - Use
Microsoft.Extensions.VectorDataandMicrosoft.Extensions.DataIngestionas adjacent building blocks for RAG instead of hand-rolling store abstractions prematurely. Model ingestion as an explicit reader -> processor -> chunker -> writer pipeline when the document-preparation path matters. - Treat the
.NET AIquickstarts as bootstrap paths, not finished architecture. They now cover minimal assistants, MCP client/server flows, local models, app templates, and image generation. Start there for a vertical slice, then harden the DI, telemetry, and evaluation story here. - Escalate to
dotnet-microsoft-agent-frameworkwhen the requirement becomes agent threads, multi-agent orchestration, higher-order workflows, durable execution, or remote agent hosting. - Validate with real providers, realistic prompts, and evaluation gates so the abstraction layer actually buys portability and reliability.
Architecture
flowchart LR
A["Task"] --> B{"Need agent threads, multi-agent orchestration, or remote agent hosting?"}
B -->|Yes| C["Use Microsoft Agent Framework on top of `Microsoft.Extensions.AI.Abstractions`"]
B -->|No| D{"Need provider-agnostic chat, embeddings, tools, typed output, or evaluation?"}
D -->|Yes| E["Use `Microsoft.Extensions.AI`"]
E --> F["Compose `IChatClient` / `IEmbeddingGenerator` in DI"]
F --> G["Add caching, telemetry, tools, vector data, and evaluation deliberately"]
D -->|No| H["Use plain provider SDKs or deterministic .NET code"]
Core Knowledge
Microsoft.Extensions.AI.Abstractionscontains the core exchange contracts such asIChatClient,IEmbeddingGenerator<TInput, TEmbedding>, message/content types, and tool abstractions.Microsoft.Extensions.AIadds the higher-level application surface: middleware builders, automatic function invocation, caching, logging, and OpenTelemetry integration.- Most apps and services should reference
Microsoft.Extensions.AI; provider and connector libraries usually reference only the abstractions package. IChatClientcenters onGetResponseAsyncandGetStreamingResponseAsync. The returnedChatResponseorChatResponseUpdateobjects carry messages, tool-related content, metadata, and optional conversation identifiers.- Local-model quickstarts still route through the same
IChatClientabstraction. Ollama-backed clients are useful for low-cost prototyping, offline dev loops, and portability testing, but you still own chat history replay, latency, and model-quality tradeoffs. ChatOptionsis the normal control plane for model ID, temperature, tools,AdditionalProperties, and provider-specific raw options.- Tool calling is modeled with
AIFunction,AIFunctionFactory, andFunctionInvokingChatClient. Ambient data can flow through closures,AdditionalProperties,AIFunctionArguments.Context, or DI. - Tool calling can target local .NET methods, external APIs, or MCP-backed tools. The model requests calls; your app still owns execution, validation, and side-effect boundaries.
- Tool definitions consume request tokens. Keep tool descriptions short and register only the tools relevant for the current conversation or workflow.
FunctionInvokingChatClientcan handle the tool-invocation loop and parallel tool-call responses automatically when the provider/model supports that shape.IEmbeddingGeneratoris the standard abstraction for semantic search, vector indexing, similarity, and cache-key generation. Pair it withMicrosoft.Extensions.VectorData.Abstractionsfor vector store operations.IImageGeneratoris the experimental MEAI image surface. TreatMEAI001as an intentional opt-in, keep image generation separate from chat concerns, and compose logging/caching/hosting middleware around it the same way you would forIChatClient.Microsoft.Extensions.DataIngestiongives you the document-side RAG pipeline:IngestionDocument, document readers like MarkItDown/Markdig, document processors such asImageAlternativeTextEnricher, chunkers, chunk processors,VectorStoreWriter<T>, andIngestionPipeline<T>for end-to-end composition.IngestionPipeline<T>.ProcessAsyncis partial-success oriented. HandleIAsyncEnumerable<IngestionResult>deliberately instead of assuming one failed document should automatically crash the whole ingestion run.Microsoft.Extensions.AI.Evaluation.*gives you quality, NLP, safety, caching, and reporting layers for regression checks and CI gates.- The official
.NET AIdocs now make MCP, assistants, local models, templates, and text-to-image part of the same app-level story. Usedotnet-mcpwhen the protocol itself becomes the design problem; stay here when you still mostly need app composition aroundIChatClientand friends. Microsoft Agent Frameworkbuilds on these abstractions. Use it when you need autonomous orchestration, threads, workflows, hosting, or multi-agent collaboration instead of just model composition.
Decision Cheatsheet
| If you need | Default choice | Why |
|---|---|---|
| App-level provider abstraction with middleware | Microsoft.Extensions.AI | Highest leverage for apps and services |
| A reusable provider or connector library | Microsoft.Extensions.AI.Abstractions | Keeps your package at the contract layer |
| Typed chat or UI streaming | IChatClient with GetResponseAsync / GetStreamingResponseAsync | Common request/response shape across providers |
| Tool calling from .NET methods | AIFunction + FunctionInvokingChatClient | Native function metadata and invocation pipeline |
| Typed structured output | IChatClient.GetResponseAsync<T> extensions | Keeps schema intent in code instead of prompt parsing |
| Vector search or RAG | IEmbeddingGenerator + Microsoft.Extensions.VectorData.Abstractions | Standardizes embeddings and store access |
| Local model prototyping | IChatClient with an Ollama-backed implementation | Keeps the app on the MEAI abstractions while you validate prompts or UX locally |
| Text-to-image or image-generation middleware | IImageGenerator | Use the dedicated image abstraction instead of overloading chat APIs |
| Evaluation and regression gates | Microsoft.Extensions.AI.Evaluation.* | Relevance, safety, task adherence, caching, reports |
| Agent threads or multi-step autonomous orchestration | dotnet-microsoft-agent-framework | This is beyond plain provider abstraction |
Common Failure Modes
- Referencing only
Microsoft.Extensions.AI.Abstractionsin an app and then rebuilding middleware, telemetry, or function invocation by hand. - Treating
IChatClientas if it already gives you durable agent threads, orchestration, or hosted-agent semantics. - Mixing provider-specific assistants APIs with
IChatClientas if they were the same runtime contract. - Forgetting to distinguish stateless history replay from stateful
ConversationIdflows. - Hiding important chat behavior in singleton service fields instead of explicit message history, options, or persistent storage.
- Adding tool calling without validating parameter binding, invalid input behavior, side effects, or DI-scoped dependencies.
- Building RAG without stable chunking, embedding-model/version tracking, or vector dimension discipline.
- Shipping AI features without evaluation baselines, safety checks, or telemetry for prompt/model drift.
Deliver
- a justified package and abstraction choice:
Abstractionsonly vs fullMicrosoft.Extensions.AI - a concrete
IChatClient/IEmbeddingGeneratorcomposition strategy - explicit tool-calling, options, state, caching, logging, and telemetry decisions
- vector-search, evaluation, or MCP integration guidance when the scenario needs it
- a clear escalation path to Agent Framework when the problem exceeds provider abstraction
Validate
- the abstraction layer solves a real portability, testability, or composition problem
- provider registration and middleware order stay explicit in DI
- chat state management matches whether the provider is stateless or stateful
- structured output, tool invocation, and embedding flows are typed and observable
- vector store, embedding model, and chunking strategy are consistent
- evaluation or safety gates exist for important prompts and agent-like behaviors
- agentic requirements are not being under-modeled as a simple
IChatClientintegration
When exact wording, edge-case API behavior, or less-common examples matter, check the local official docs snapshot before relying on summaries.
References
- official-docs-index.md - Slim local snapshot map with direct links to every mirrored
.NET AIdocs page plus API-reference pointers - patterns.md - Package choice,
IChatClient, embeddings, DI pipelines, tool-calling, and Agent Framework escalation guidance - examples.md - Quickstart-to-task map covering chat, structured output, function calling, vector search, local models, MCP, and assistants
- evaluation.md - Quality, NLP, safety, caching, reporting, and CI-oriented evaluation guidance
Frequently asked questions
What to verify before installation and use
What does the dotnet-microsoft-extensions-ai source document cover?
Build provider-agnostic . NET AI integrations with `Microsoft.
How do I install dotnet-microsoft-extensions-ai?
The source record exposes this install command: npx skills add https://github.com/Postpartum-genushyacinthus29/dotnet-skills --skill "skills/dotnet-microsoft-extensions-ai". Inspect the command and pinned source before running it.
Alternatives
Compare before choosing
garrytan/gbrain
bulk-ingestion
End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.
alirezarezvani/claude-skills
app-store-optimization
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
wanshuiyin/Auto-claude-code-research-in-sleep
citation-audit
Use it for operations and research tasks; the detail page covers purpose, installation, and practical steps.
prowler-cloud/prowler
postgresql-indexing
PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing index usage statistics, reindexing, dropping indexes, or working with partitioned table indexes. Also trigger when discussing index strategies, partial indexes, or index maintenance