Borrowing it
Nothing to install: this file belongs to lewing/helix.mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/lewing/helix.mcp/main/.copilot/skills/ihttpclientfactory-di/SKILL.mdgit clone --depth 1 https://github.com/lewing/helix.mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/lewing/helix.mcp/ihttpclientfactory-di)<a href="https://agentmods.dev/skills/lewing/helix.mcp/ihttpclientfactory-di"><img src="https://agentmods.dev/badge/skills/lewing/helix.mcp/ihttpclientfactory-di.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00368 |
| Opus 5 | $0.00000 | $0.00184 |
| Sonnet 5 | $0.00000 | $0.00074 |
| Haiku 4.5 | $0.00000 | $0.00037 |
Grade A, and why
ihttpclientfactory-di scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Skill: IHttpClientFactory with Optional Constructor Injection
Confidence: low Source: earned
Problem
You need to replace static or new HttpClient() patterns with IHttpClientFactory for proper handler lifecycle management, but the service is constructed by tests that don't use DI.
Wrong Pattern
// Static field — socket exhaustion, no DNS refresh
private static readonly HttpClient s_httpClient = new();
// Or: required parameter breaks all test constructors
public MyService(IHelixApiClient api, HttpClient httpClient) { ... }
Right Pattern
// Optional parameter — production injects from factory, tests get default
public MyService(IHelixApiClient api, HttpClient? httpClient = null)
{
_api = api ?? throw new ArgumentNullException(nameof(api));
_httpClient = httpClient ?? new HttpClient();
}
DI registration:
services.AddHttpClient("MyDownload", c => c.Timeout = TimeSpan.FromMinutes(5));
services.AddSingleton<MyService>(sp =>
new MyService(
sp.GetRequiredService<IMyApiClient>(),
sp.GetRequiredService<IHttpClientFactory>().CreateClient("MyDownload")));
Why
- IHttpClientFactory manages
HttpMessageHandlerlifetime (recycles every 2 min by default) - Avoids socket exhaustion from long-lived static HttpClient
- Named clients allow per-use-case timeout configuration
- Optional parameter preserves backward compatibility with tests
- Tests that don't exercise HTTP can pass one arg; tests that do can inject a mock handler
Applies When
- Replacing static
HttpClientfields in services - Service is heavily tested with direct construction (not DI)
- Multiple HTTP use cases need different timeouts
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 53 lines · 0 tokens per session scan A ecda72958264
ihttpclientfactory-di is a skill published in the GitHub repository lewing/helix.mcp (4 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 368 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
codegen
Use for .NET code generation work with Roslyn, Microsoft.OpenApi, Razor templates, DTO/manager/controller generation, REST API generation, C# HttpClient generation, Angular/Axios TypeScript request clients, generated formatting, and deterministic output.
worker-services
Build long-running .NET background services with BackgroundService, Generic Host, graceful shutdown, configuration, logging, and deployment patterns suited to workers and daemons. USE FOR: background services; scheduled workers; hosted services; worker extraction; graceful shutdown, health checks, and service hosting…
aspnet-core
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET. USE FOR: working on ASP.NET Core apps, services, or middleware; changing auth, routing, configuration, hosting, or deployment behavior; deciding…
minimal-apis
Design and implement Minimal APIs in ASP.NET Core using handler-first endpoints, route groups, filters, and lightweight composition suited to modern .NET services. USE FOR: building new HTTP APIs in ASP.NET Core; creating lightweight microservices; choosing between Minimal APIs and controllers. DO NOT USE FOR…
web-api
Build or maintain controller-based ASP.NET Core APIs when the project needs controller conventions, advanced model binding, validation extensions, OData, JsonPatch, or existing API patterns. USE FOR: working on controller-based APIs in ASP.NET Core; needing controller-specific extensibility or conventions; migrating…
managedcode-communication
Use ManagedCode.Communication when a .NET application needs explicit result objects, structured errors, and predictable service or API boundaries instead of exception-driven control flow. USE FOR: integrating ManagedCode.Communication into services or APIs; replacing exception-driven result handling with explicit…