aspnet-core
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on…
Guides technology selection and implementation of AI and ML features in .NET 8+ applications using ML.NET, Microsoft.Extensions.AI (MEAI), Microsoft Agent Framework (MAF), GitHub Copilot SDK, ONNX Runtime, and OllamaSharp. Covers the full spectrum from classic ML through modern
$ npx -y skills add managedcode/dotnet-skills --skill technology-selection --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/technology-selectionContext preview
The summary Claude sees to decide when to auto-load this skill.
Guides technology selection and implementation of AI and ML features in .NET 8+ applications using ML.NET, Microsoft.Extensions.AI (MEAI), Microsoft Agent Framework (MAF), GitHub Copilot SDK, ONNX Runtime, and OllamaSharp. Covers the full spectrum from classic ML through modern
name: technology-selection description: "Guides technology selection and implementation of AI and ML features in .NET 8+ applications using ML.NET, Microsoft.Extensions.AI (MEAI), Microsoft Agent Framework (MAF), GitHub Copilot SDK, ONNX Runtime, and OllamaSharp. Covers the full spectrum from classic ML through modern LLM orchestration to local inference. Use when adding classification, regression, clustering, anomaly detection, recommendation, LLM integration (text generation, summarization, reasoning), RAG pipelines with vector search, agentic workflows with tool calling, Copilot extensions, or custom model inference via ONNX Runtime to a .NET project. DO NOT USE FOR projects targeting .NET Framework (requires .NET 8+), the task is pure data engineering or ETL with no ML/AI component, or the project needs a custom deep learning training loop (use Python with PyTorch/TensorFlow, then export to ONNX for .NET inference)." license: MIT
Pick the right technology first, then deliver **only what the task asks for**. If the task asks for a plan, comparison, or architecture (or says "do not write code"), produce that — do not scaffold, build, or run code unprompted.
State which branch applies and why, then choose that technology.
| Task type | Technology | Why | |-----------|-----------|-----| | Structured/tabular: classification, regression, clustering, anomaly detection, recommendation | **ML.NET** (`Microsoft.ML`) | Deterministic (fixed seed), no cloud dependency, purpose-built | | NL understanding, generation, summarization, reasoning (single prompt → response, no tools) | **LLM via Microsoft.Extensions.AI** (`IChatClient`) | Language capability, no orchestration needed | | Agentic: multi-step tool/function calling, agent loops, multi-agent | **Microsoft Agent Framework** (`Microsoft.Agents.AI`) on **Microsoft.Extensions.AI** | Needs orchestration, tool dispatch, iteration control `IChatClient` lacks | | GitHub Copilot extensions / custom dev-workflow agents | **GitHub Copilot SDK** (`GitHub.Copilot.SDK`) | Integrates with the Copilot agent runtime | | Run a pre-trained/custom model in production | **ONNX Runtime** (`Microsoft.ML.OnnxRuntime`) | Hardware-accelerated, format-agnostic inference | | Local/offline LLM inference | **OllamaSharp** ([Ollama models](https://ollama.com/search)) | Privacy-sensitive, air-gapped, cost-constrained | | Semantic search, RAG, embedding storage | **Microsoft.Extensions.VectorData.Abstractions** (MEVD) + a provider (Azure AI Search, Milvus, MongoDB, pgvector, Pinecone, Qdrant, Redis, SQL) | Provider-agnostic vector search | | Ingest, chunk, load documents into a vector store | **Microsoft.Extensions.AI.DataIngestion** (preview) + MEVD | Parses, chunks, embeds, upserts | | Both structured predictions AND NL reasoning | **Hybrid**: ML.NET scoring + LLM reasoning layer | ML.NET is reproducible; LLM adds explanation |
**Critical rule:** Do NOT use an LLM for tasks ML.NET handles well (tabular classification, regression, clustering) — LLMs are slower, costlier, and non-deterministic for these.
| Layer | Library | Use when | |-------|---------|----------| | **Abstraction** | `Microsoft.Extensions.AI` (MEAI) | Always the foundation. Use `IChatClient` directly for prompt-response and simple, bounded function invocation. | | **Provider SDK** | `Azure.AI.OpenAI` / `OpenAI` / `Azure.AI.Inference` / `OllamaSharp` | Concrete provider behind MEAI via `AddChatClient`. | | **Orchestration** | `Microsoft.Agents.AI` (prerelease) | Multi-step tool use, durable agent loops, and multi-agent workflows. | | **Copilot** | `GitHub.Copilot.SDK` | Building Copilot-platform extensions only. |
Rules: start with MEAI; put the provider behind it via `AddChatClient` (don't call the provider in business logic); use `Microsoft.Agents.AI` for multi-step or durable agent workflows rather than hand-rolling an agent loop; never mix a raw `HttpClient`-to-OpenAI call with MEAI in the same workflow. Do **not** use Accord.NET (archived). For new projects, prefer MEAI and Agent Framework unless existing Semantic Kernel features or investments are a requirement. Register AI/ML services via DI; load secrets from user-secrets / env / Key Vault — never hardcode keys.
Every answer — plan or implementation — must address the guardrails for the selected branch:
set; report real metrics (MicroAccuracy/MacroAccuracy/LogLoss, AUC/F1, or RMSE/R²); serve with `PredictionEnginePool<TIn,TOut>` (never a singleton `PredictionEngine`).
set `Temperature` and `MaxOutputTokens` in `ChatOptions`; add retry/timeout (`RetryingChatClient`/Polly); pin a dated model; load keys from user-secrets / env / Key Vault — **never hardcode an `sk-…` key**; validate non-deterministic output against a schema with a fallback.
hand-rolled loop); set `MaximumIterations` and a token/cost ceiling; define each tool with a clear schema (`AIFunctionFactory.Create`); log each step (never raw sensitive content).
the embeddings** (don't re-embed per query); store/query with `Microsoft.Extensions.VectorData.Abstractions` (MEVD) + the provider the user asked for (e.g. pgvector); filter by a **minimum similarity score**; keep **source attribution** for each answer. Honor the UI/storage the user specified; use only real, existing NuGet packages.
**Then choose depth:**
Stop explaining .NET to your AI. Start building. We've all been there: asking Claude to use Entity Framework, only to get EF6 patterns in a .NET 8 project. Explaining to Copilot that Blazor Server and Blazor WebAssembly aren't the same thing.
Repo: managedcode/dotnet-skills
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on…
Build, upgrade, and operate Aspire 13.5.x C# or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing,…
Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns. USE FOR:…
Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and…
Maintain or migrate EF6-based applications with realistic guidance on what to keep, what to modernize, and when EF Core is or is not the right next step. USE…
Design, tune, or review EF Core data access with proper modeling, migrations, query translation, performance, and lifetime management for modern .NET…