Agent skill

Microsoft Extensions

by managedcode in managedcode/dotnet-skills

Use the Microsoft.Extensions stack correctly across Generic Host, dependency injection, configuration, logging, options, HttpClientFactory, and other shared infrastructure patterns.

MITAuto-check passedDevelopment

Install Microsoft Extensions

skills CLI
$ npx skills add managedcode/dotnet-skills --skill microsoft-extensions -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install managedcode/dotnet-skills microsoft-extensions --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/managedcode/dotnet-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/catalog/Libraries/Microsoft-Extensions/skills/microsoft-extensions .claude/skills/microsoft-extensions && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
microsoft-extensions
GitHub stars
486
Token cost
~945 tokens
SKILL.md length
361 words
Files
4 (incl. references)
Skills in repo
81
Repo updated
First seen
Licence
MIT

At a glance

Use the Microsoft.Extensions stack correctly across Generic Host, dependency injection, configuration, logging, options, HttpClientFactory, and other shared infrastructure patterns.

  • Works in 7 steps: Prefer the Generic Host for apps that… → Keep service registration predictable:… → Use options binding for structured… → …
  • : wiring dependency injection
  • SKILL.md covers Trigger On, Workflow, Current Upstream Notes and Deliver, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Microsoft Extensions is an agent skill from managedcode/dotnet-skills. Use the Microsoft.Extensions stack correctly across Generic Host, dependency injection, configuration, logging, options, HttpClientFactory, and other shared infrastructure patterns. USE FOR: wiring dependency injection, configuration, logging, or options; introducing Generic Host patterns into non-web .NET apps; cleaning up service registration, typed HTTP. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run…

Its SKILL.md is about 950 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `manifest.json`, `references/anti-patterns.md` and `references/patterns.md`). Compatibility notes: Relevant to console apps, workers, ASP.NET Core apps, functions, and reusable libraries.

It sits in Development, covering Design patterns and Codebase knowledge for agents. It works with .NET. The repository describes itself as: Installable .NET skill catalog and CLI for Codex, Claude Code, GitHub Copilot, and Gemini. The licence is MIT.

When your agent uses it

  • : wiring dependency injection
  • Introducing Generic Host patterns into non-web .NET apps
  • Cleaning up service registration
  • : unrelated stacks

Example prompts

  • “/microsoft-extensions”

Requirements

  • Compatibility (from SKILL.md): Relevant to console apps, workers, ASP.NET Core apps, functions, and reusable libraries.

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Prefer the Generic Host for apps that need configuration, DI, logging, hosted services, or coordinated startup.
  2. Keep service registration predictable: composition at the edge, concrete implementations hidden behind interfaces only where that…
  3. Use options binding for structured configuration and validate configuration at startup when bad settings would fail later at runtime.
  4. Prefer IHttpClientFactory and typed or named clients for outbound HTTP instead of ad-hoc singleton or per-call HttpClient usage.
  5. Use logging categories and config-driven log levels rather than scattered ad-hoc logging behavior.
  6. For Kubernetes-hosted services, prefer the stable Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes package from the 10.7+…
  7. Avoid building mini-frameworks over Microsoft.Extensions unless the repo genuinely needs reusable composition primitives.

What it can do on your machine

Read from SKILL.md and the folder at commit 535dd55. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Relevant to console apps, workers, ASP.NET Core apps, functions, and reusable libraries.

    From compatibility in the SKILL.md frontmatter.

Context cost

Microsoft Extensions loads about 945 tokens when it runs, and up to ~8.4k if it reads all its reference files. Until then it costs about 153 tokens; SKILL.md has 361 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~153
When it runs · the whole SKILL.md, loaded when a task matches
~945
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from managedcode/dotnet-skills at commit 535dd55, republished under its MIT licence (© managedcode). 361 words, ~945 tokens.

Download SKILL.mdSave it as .claude/skills/microsoft-extensions/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
microsoft-extensions
description
Use the Microsoft.Extensions stack correctly across Generic Host, dependency injection, configuration, logging, options, HttpClientFactory, and other shared infrastructure patterns. USE FOR: wiring dependency injection, configuration, logging, or options; introducing Generic Host patterns into non-web .NET apps; cleaning up service registration, typed HTTP. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.
compatibility
Relevant to console apps, workers, ASP.NET Core apps, functions, and reusable libraries.

Microsoft.Extensions for .NET

Trigger On

  • wiring dependency injection, configuration, logging, or options
  • introducing Generic Host patterns into non-web .NET apps
  • cleaning up service registration, typed HTTP clients, or shared infrastructure code

Workflow

  1. Prefer the Generic Host for apps that need configuration, DI, logging, hosted services, or coordinated startup.
  2. Keep service registration predictable: composition at the edge, concrete implementations hidden behind interfaces only where that abstraction buys flexibility.
  3. Use options binding for structured configuration and validate configuration at startup when bad settings would fail later at runtime.
  4. Prefer IHttpClientFactory and typed or named clients for outbound HTTP instead of ad-hoc singleton or per-call HttpClient usage.
  5. Use logging categories and config-driven log levels rather than scattered ad-hoc logging behavior.
  6. For Kubernetes-hosted services, prefer the stable Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes package from the 10.7+ line when CPU/memory request and limit metrics should come from pod resource quotas.
  7. Avoid building mini-frameworks over Microsoft.Extensions unless the repo genuinely needs reusable composition primitives.

Current Upstream Notes

  • dotnet/extensions v10.9.0 adds experimental AI routing and failover clients and includes HTTP diagnostics/source-logging fixes. Generic Host, dependency injection, configuration, logging, options, and IHttpClientFactory patterns remain unchanged; route AI-specific architecture to microsoft-extensions-ai.
  • The MCP server project template moved out of dotnet/extensions and into the ASP.NET Core/.NET SDK distribution. Update scaffolding automation to use the SDK-provided template instead of pinning the removed extensions template package.
  • If repository automation creates AI templates from the prior v10.8.4 change, pass --provider azureopenai, --provider ollama, or --provider openai explicitly and validate the selected provider's secrets and local-development path.
  • Keep Microsoft.Extensions package versions aligned within the repo's selected servicing line, then rerun host startup and options-validation tests after upgrading.
Show full SKILL.md (85 more words)Show less

Deliver

  • clean host wiring and service registration
  • configuration and logging that are observable and testable
  • infrastructure code that fits naturally with the .NET stack

Validate

  • service lifetimes are correct
  • configuration is strongly typed where it matters
  • host setup remains easy to debug and reason about
  • Kubernetes resource monitoring uses the stable quota-provider APIs when pod request/limit dimensions matter

References

  • patterns.md - DI patterns, Configuration patterns, Options pattern, Logging patterns, HttpClientFactory patterns, Hosted Service patterns
  • anti-patterns.md - Common mistakes with DI, configuration, options, logging, HttpClient, and hosted services

© managedcode, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in catalog/Libraries/Microsoft-Extensions/skills/microsoft-extensions of managedcode/dotnet-skills.

  • SKILL.md
  • manifest.json
  • references/anti-patterns.md
  • references/patterns.md

Open the folder on GitHubat commit 535dd55

Compare with similar skills

Microsoft Extensions next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Microsoft Extensions compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Microsoft Extensions this skillmanagedcode/dotnet-skills486—~945Automated safety check: PassMIT
GitVersion .NET DevelopmentGitTools/GitVersion3.1k—~1.7kAutomated safety check: PassMIT
Scaffoldcodewithmukesh/dotnet-claude-kit751—~1.7kAutomated safety check: PassMIT
Architecture Advisorcodewithmukesh/dotnet-claude-kit7511 repos~2.9kAutomated safety check: PassMIT
Akka.Hosting Actor PatternsAaronontheweb/dotnet-skills1.2k1 repos~5kAutomated safety check: PassMIT
Clean Architecture DotnetSebastienDegodez/copilot-instructions197—~5.1kAutomated safety check: PassApache-2.0

Similar skills

  • GitVersion .NET Development

    GitTools/GitVersion

    Gives repository-specific .NET guidance for GitVersion: build and test commands, central package management, project layout and coding conventions.

    3.1k GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Scaffold

    codewithmukesh/dotnet-claude-kit

    Architecture-aware feature scaffolding for .NET 10 projects.

    751 GitHub stars~1.7k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Architecture Advisor

    codewithmukesh/dotnet-claude-kit

    Architecture selection advisor for .NET applications. An agent skill from codewithmukesh/dotnet-claude-kit.

    751 GitHub starsUsed in 1 repo~2.9k tokens
    DevelopmentAuto-check passed
  • Akka.Hosting Actor Patterns

    Aaronontheweb/dotnet-skills

    Shows how to build entity actors with Akka.Hosting so the same code runs in local unit tests and in a sharded cluster in production.

    1.2k GitHub starsUsed in 1 repo~5k tokens
    DevelopmentAuto-check passed
  • Clean Architecture Dotnet

    SebastienDegodez/copilot-instructions

    A skill your agent uses when domain logic leaks into API/Infrastructure, project references violate layer boundaries, or you need to decide between CQS (always), CQRS bus (complex domains), and DDD…

    197 GitHub stars~5.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Dependency Injection

    codewithmukesh/dotnet-claude-kit

    Dependency injection patterns for .NET 10. An agent skill from codewithmukesh/dotnet-claude-kit.

    751 GitHub starsUsed in 1 repo~1.5k tokens
    DevelopmentAuto-check passed

More from managedcode/dotnet-skills

All 81 skills in this repo
  • Analyzer Config

    managedcode/dotnet-skills

    Use a repo-root .editorconfig to configure free .NET analyzer and style rules.

    486 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Archunitnet

    managedcode/dotnet-skills

    Use the open-source free ArchUnitNET library for architecture rules in .NET tests.

    486 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Aspire

    managedcode/dotnet-skills

    Build, upgrade, and operate Aspire 13.5.x C or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing, MCP, and deployment patterns for…

    486 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Aspnet Core

    managedcode/dotnet-skills

    Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET.

    486 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Asynkron Profiler

    managedcode/dotnet-skills

    Use the open-source free Asynkron.Profiler dotnet tool for CLI-first CPU, allocation, exception, contention, and heap profiling of .NET commands or existing trace artifacts.

    486 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Azure Functions

    managedcode/dotnet-skills

    Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns.

    486 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Microsoft Extensions

What does Microsoft Extensions do?

Use the Microsoft.Extensions stack correctly across Generic Host, dependency injection, configuration, logging, options, HttpClientFactory, and other shared infrastructure patterns. Microsoft Extensions is an agent skill from managedcode/dotnet-skills.Extensions stack correctly across Generic Host, dependency injection, configuration, logging, options, HttpClientFactory, and other shared infrastructure patterns.

When should I use Microsoft Extensions?

Microsoft Extensions fits situations like: : wiring dependency injection; introducing Generic Host patterns into non-web .NET apps; cleaning up service registration; : unrelated stacks.

How do I install Microsoft Extensions in Claude Code?

Run `npx skills add managedcode/dotnet-skills --skill microsoft-extensions -a claude-code`. Or copy the skill folder (catalog/Libraries/Microsoft-Extensions/skills/microsoft-extensions in managedcode/dotnet-skills) into .claude/skills/microsoft-extensions in your project. Claude Code loads it when a task matches its description.

How do I install Microsoft Extensions in Codex?

Run `npx skills add managedcode/dotnet-skills --skill microsoft-extensions -a codex`. Or copy the skill folder (catalog/Libraries/Microsoft-Extensions/skills/microsoft-extensions in managedcode/dotnet-skills) into .agents/skills/microsoft-extensions in your project. Codex loads it when a task matches its description.

Can I use Microsoft Extensions in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add managedcode/dotnet-skills --skill microsoft-extensions -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/microsoft-extensions, .gemini/skills/microsoft-extensions, .github/skills/microsoft-extensions and .opencode/skills/microsoft-extensions in your project.

What does Microsoft Extensions need to run?

SKILL.md names no scripts, command-line tools or credentials: Microsoft Extensions is instructions for the agent only. Compatibility (from SKILL.md): Relevant to console apps, workers, ASP.NET Core apps, functions, and reusable libraries..

Does Microsoft Extensions access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Microsoft Extensions safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Microsoft Extensions use?

Microsoft Extensions is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Microsoft Extensions use?

About 945 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.5k tokens, read only when the agent opens those files.

What are the alternatives to Microsoft Extensions?

Skills that share tags, products or a category with Microsoft Extensions: GitVersion .NET Development (GitTools/GitVersion, 3.1k stars), Scaffold (codewithmukesh/dotnet-claude-kit, 751 stars), Architecture Advisor (codewithmukesh/dotnet-claude-kit, 751 stars) and Akka.Hosting Actor Patterns (Aaronontheweb/dotnet-skills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Microsoft Extensions?

managedcode (a GitHub organization) maintains it in managedcode/dotnet-skills, which has 486 GitHub stars. The repository holds 81 skills in this directory. The repository was last updated on October 7, 2026.

Source: managedcode/dotnet-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.