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 skills add Arasz/ai-raccoon --skill dotnet-hosted-service-testinggit clone --depth 1 https://github.com/Arasz/ai-raccoonWrote 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/arasz/ai-raccoon/dotnet-hosted-service-testing)<a href="https://agentmods.dev/skills/arasz/ai-raccoon/dotnet-hosted-service-testing"><img src="https://agentmods.dev/badge/skills/arasz/ai-raccoon/dotnet-hosted-service-testing/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/arasz/ai-raccoon/dotnet-hosted-service-testing"><img src="https://agentmods.dev/badge/skills/arasz/ai-raccoon/dotnet-hosted-service-testing.svg" alt="Reviewed on agentmods" width="80" 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.00084 | $0.02029 |
| Opus 5.5 | $0.00034 | $0.00812 |
| Sonnet 5.5 | $0.00017 | $0.00406 |
| Haiku 4.5 | $0.00008 | $0.00203 |
Grade A, and why
dotnet-hosted-service-testing 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 yesterday.
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.
dotnet-hosted-service-testing
Trigger
- Writing tests for a
BackgroundService(ExecuteAsync loop, interval polling, periodic jobs). - Reviewing tests that use
FakeTimeProvider/TimeProvider(e.g.Microsoft.Extensions.Time.Testing). - Judging whether hosted-service tests honestly cover the loop, interval, dedup, error-tolerance, and DI-registration paths.
FakeTimeProvider + BackgroundService semantics (empirically verified on .NET 10)
StartAsyncdoes NOT runExecuteAsyncon the caller thread. The loop body starts on a threadpool thread;StartAsyncreturns before the first pass runs. Consequence:time.Advance(...)immediately afterStartAsyncis reliably LOST — theTask.Delay/PeriodicTimertimer isn't registered yet. The first advance silently does nothing.- Timer callbacks fire inline on the
Advancecaller thread, but theTask.Delaycontinuation is queued to the threadpool (RunContinuationsAsynchronously). After eachAdvance, give the continuation real time to land (await Task.Delay(100, TestContext.Current.CancellationToken)), then assert. Task.Delay(interval, timeProvider, token)registers its timer synchronously inside the call — but only when the loop reaches it. With fully-synchronous fakes (Task.FromResulteverywhere), the first pass completes synchronously insideExecuteAsync; the first real yield is the delay.- A poll-loop test that passes via a lost first advance is fragile in both directions: it passes when the advance is lost, and FAILS (despite correct behavior) if the timer ever registers in time. Assert on an invocation counter in the fake (e.g. RunOnceAsync calls), not on side-effect counts.
- Side-effect counts encode fake artifacts. If the fake's shared index is never updated by
ShareAsync, a second loop pass re-shares — expectingcount == 2documents fake behavior that can never happen in production (a real store would dedup the second pass). Test loop-iteration count; test dedup separately with a pre-populated index. - A
RunOnceAsyncinternal seam (called byExecuteAsync, directly testable) is the right shape — test the pass logic through the seam, and the interval through the loop test. - PeriodicTimer observables (verified .NET 10): the fake fires a periodic timer TWICE per
Advancewhen two schedule points fall inside the window, and the loop's check runs asynchronously at the POST-advance clock — never at the tick's due time. A single large Advance past the deadline fires immediately regardless of tick size, so the tick period is unobservable via one big advance. Pin a tick period by split advances: keep the clock below the deadline until the cadence is established, then cross (recipe + numbers:references/watchdog-e2e-tick-cadence-and-di-signaling.md). StopApplicationon a WebApplication host does NOT auto-stop the host (verified): it cancelsApplicationStoppingand makesWaitForShutdownAsyncreturn (the runner contract);ApplicationStoppedfires only after the runner callshost.StopAsync()/dispose. For "watchdog shut the host down" assertions, assert the runner-shaped chain —ApplicationStoppingtoken, thenWaitForShutdownAsynccompletes, thenStopAsync— notApplicationStoppeddirectly.- Timing-sensitive fake-clock tests: re-run under the full-suite filter (parallel load can starve the 100ms settle) and REBUILD after test edits before judging flakiness —
--no-buildagainst a stale assembly reports phantom failures. - Watchdog-style deadline services: derive the poll tick from the timeout (
tick = min(60s, timeout/4)), not a fixed 60s — a fixed tick makes short-timeout gates unsatisfiable (a 2s-timeout host shuts down up to 62s late, so a "within ~5s" assertion can never pass) AND makes early-shutdown assertions vacuously true. The deadline-check granularity must be a fraction of the timeout at every scale; pin the derivation with a short-timeout test. - Sync on the service's own log emissions, not wall-clock delays. When the loop's first action emits a
[LoggerMessage]event (e.g. a startup-pass checkpoint), poll theFakeLoggercollector snapshot instead ofTask.Delay(50)before probing andTask.Delay(100)before asserting:WaitForLogAsync(eventId, count)— poll every ~10 ms up to a 5 s timeout, throwTimeoutExceptionnaming the expected event/count. Fixed delays race BOTH directions: a slow box misses the startup pass (the probe write lands before it, then the startup truncation breaks the assertion), and a fast box asserts before the tick's continuation lands. The service's own log emission is the deterministic sync point — the startup event doubles as the "timer registered" guarantee. (Applied 2026-08-07 to bank-maintenance lifecycle tests after review flagged the fixed-delay flake risk; the polling rewrite ran 4x stable.)
What ships with it
5 files 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.
- yesterday First seen · 58 lines · 84 tokens per session scan A 5417a5ecb70f
dotnet-hosted-service-testing is a skill published in the GitHub repository Arasz/ai-raccoon (7 stars, last pushed today), licensed MIT. It adds 84 tokens to every session and 2,029 once invoked, about $0.0003 per session on Opus 5.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-12-05.
dotnet-hosted-service-testing compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| dotnet-hosted-service-testingArasz/ai-raccoon | Skill | 7 | today | MIT | A | 84 | Claude Code, Codex |
| http-client-migrationGen-Verse/PAST-Bench | Skill | 40 | 4mo ago | Apache-2.0 | A | 14 | Claude Code, Codex |
| code-qualitywaybarrios/opencode-power-pack | Skill | 562 | 5d ago | MIT | A | 49 | Claude Code |
| compiler-b09bd196FuRongJun-1999/dsh-memory | Skill | 778 | today | MIT | A | 104 | Claude Code |
| cartographer-kb-createBeppeTemp/cartographer | Skill | 74 | yesterday | Apache-2.0 | A | 53 | Claude Code, Codex |
| cartographer-kb-importBeppeTemp/cartographer | Skill | 74 | yesterday | Apache-2.0 | A | 51 | Claude Code, Codex |
| cartographer-kb-source-authorBeppeTemp/cartographer | Skill | 74 | yesterday | Apache-2.0 | A | 106 | Claude Code, Codex |