AgentStack
SKILL verified MIT Self-run

Microsoft Extensions

skill-managedcode-dotnet-skills-microsoft-extensions · by managedcode

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; gener…

No reviews yet
0 installs
5 views
0.0% view→install

Install

$ agentstack add skill-managedcode-dotnet-skills-microsoft-extensions

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Microsoft Extensions? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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.

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](references/patterns.md) - DI patterns, Configuration patterns, Options pattern, Logging patterns, HttpClientFactory patterns, Hosted Service patterns
  • [anti-patterns.md](references/anti-patterns.md) - Common mistakes with DI, configuration, options, logging, HttpClient, and hosted services

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.