Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/stefanthecode/dotnet-ai-toolkit/correlation-id-middlewarenpx skills add StefanTheCode/dotnet-ai-toolkit --skill correlation-id-middlewaregit clone --depth 1 https://github.com/StefanTheCode/dotnet-ai-toolkitWhat 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 | $0.00100 | $0.00698 |
| Opus 5 | $0.00050 | $0.00349 |
| Sonnet 5 | $0.00020 | $0.00140 |
| Haiku 4.5 | $0.00010 | $0.00070 |
Grade A, and why
correlation-id-middleware 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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Correlation-ID Middleware
Give every request a correlation id that shows up in every log line, propagates to downstream HTTP/messaging, and ties a user's request together across services — even where full tracing isn't set up.
Input — point it at your project
Works on a target: a project or GitHub URL. Check for existing setup and the HTTP/logging stack: grep -rn "CorrelationId\|X-Correlation\|HttpContext.TraceIdentifier\|UseSerilog\|HttpClient" --include=*.cs <target>.
Middleware
public class CorrelationIdMiddleware(RequestDelegate next)
{
public const string Header = "X-Correlation-ID";
public async Task Invoke(HttpContext ctx)
{
var id = ctx.Request.Headers.TryGetValue(Header, out var v) && !string.IsNullOrEmpty(v)
? v.ToString() : Activity.Current?.TraceId.ToString() ?? Guid.NewGuid().ToString();
ctx.Items[Header] = id;
ctx.Response.Headers[Header] = id; // echo back to caller
using (Serilog.Context.LogContext.PushProperty("CorrelationId", id)) // enrich all logs
await next(ctx);
}
}
app.UseMiddleware<CorrelationIdMiddleware>(); // early in the pipeline
Propagate to downstream calls
A DelegatingHandler that copies the id onto outbound HttpClient requests:
public class CorrelationHandler(IHttpContextAccessor http) : DelegatingHandler
{
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage req, CancellationToken ct)
{
if (http.HttpContext?.Items[CorrelationIdMiddleware.Header] is string id)
req.Headers.TryAddWithoutValidation(CorrelationIdMiddleware.Header, id);
return base.SendAsync(req, ct);
}
}
// builder.Services.AddHttpClient<T>().AddHttpMessageHandler<CorrelationHandler>();
For messaging, put the id in message headers (publish) and restore it (consume).
Principles
- Reuse the W3C trace id when present — don't invent a parallel id that competes with real tracing; correlation id complements it for log-grep-ability.
- Accept an inbound id (from a gateway/caller) before generating a new one.
- Enrich logs once via
LogContextso every line carries it automatically. - Echo it in the response so clients can report it in bug tickets.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 3d ago First seen · 58 lines · 100 tokens per session scan A 77a5b07e0bf3
correlation-id-middleware is a skill published in the GitHub repository StefanTheCode/dotnet-ai-toolkit (19 stars, last pushed 24d ago), licensed MIT. It adds 100 tokens to every session and 698 once invoked, about $0.0005 per session on Opus 5. 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-30.
Other skills, from other repositories
github-ci-fix-onboarding
Onboards and troubleshoots GitHub PR CI fixing by configuring GitHub CLI authentication, a non-exposed GitHub token, a matching local checkout, and a ready coding agent before running fixgithubprci. Use for first-time setup, failed prerequisites, demos, or action-shaped requests to onboard the user onto the local…
greptimedb-development-docker-image
Builds a development-only GreptimeDB Docker image from a local debug binary for local-cluster testing, and optionally pushes it to a development registry. Use when the user asks to package, build, tag, publish, or cross-build a non-release GreptimeDB or GreptimeDB Enterprise image for debugging.
greptimedb-release
Runbook for publishing a new GreptimeDB version (tag + GitHub release + docs release-note PR) on the upstream GreptimeTeam/greptimedb repo. Use when asked to "release" / "publish" a GreptimeDB version (e.g. v1.1.0, v1.0.3).
yandex-cloud
Read Yandex Cloud through its REST API. Applies to any question about VMs, metrics, logs, audit events, Kubernetes, managed databases, serverless, networking or any other Yandex Cloud resource. Never shell out to the yc CLI — it is not how this agent reaches Yandex Cloud and is usually not installed.
morning-report
Weather + news morning briefing: fetch live weather and headlines, compose a plain-text briefing, deliver it. Multi-step; load before acting.
github-security-fix
Remediate GitHub security / Dependabot / CodeQL / code-quality alerts via fixgithubsecurityalert.