testability-obstacle

testability-obstacle is a skill for Claude Code, Codex from managedcode/dotnet-skills. It costs 128 tokens per session (2,925 once invoked), scanned A, a copy of testability-obstacle, MIT.

A C#/.NET testing assistant that adds a small controllable seam around hard-to-test dependencies such as time, delays, files, environment values, randomness, or static APIs.

In plain words
What is it for?
It is for introducing the smallest required production change and adding deterministic tests for code that depends on ambient system state.
Why use it?
It makes behaviour depending on these outside influences testable without using real I/O or changing the intended production behaviour.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for introducing the smallest required production change and adding deterministic tests for code that depends on ambient system state.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/managedcode/dotnet-skills/testability-obstacle
Install

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.

Any agent
npx skills add managedcode/dotnet-skills --skill testability-obstacle
Clone the repo
git clone --depth 1 https://github.com/managedcode/dotnet-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for testability-obstacle

README.md
[![agentmods](https://agentmods.dev/badge/skills/managedcode/dotnet-skills/testability-obstacle/github.svg)](https://agentmods.dev/skills/managedcode/dotnet-skills/testability-obstacle)
Your own site
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/testability-obstacle"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/testability-obstacle/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.

agentmods 80×15 button for testability-obstacle

Your own site · 80×15
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/testability-obstacle"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/testability-obstacle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 128 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,925 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 94% copy Near-identical to another mod in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00128 $0.02925
Opus 5.5 $0.00051 $0.01170
Sonnet 5.5 $0.00026 $0.00585
Haiku 4.5 $0.00013 $0.00293

Measured 1mo ago against content hash e5edc5a1cf9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testability-obstacle 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 1mo 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.

Origin

This is a copy

94% identical to testability-obstacle — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

catalog/Testing/Official-DotNet-Test/skills/testability-obstacle/SKILL.md · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Resolve a Testability Obstacle

Introduce the smallest behavior-preserving seam needed to test a specific C# behavior, then add deterministic tests that prove both the behavior and the seam. The production edit is a means to the requested test, not an invitation to redesign adjacent code.

When to Use

  • A requested test would otherwise read/write the real filesystem.
  • Behavior depends on the current time, delay, random value, environment, console, process, or another ambient dependency.
  • The user explicitly permits or requests a safe production seam.
  • Existing tests cannot control a dependency without process-global mutation.

When Not to Use

  • The dependency is already injected or passed as an argument. Write tests with a fake through the existing seam using code-testing.
  • The user wants a repository-wide testability audit. Use detect-static-dependencies.
  • The user wants wrappers generated but not call sites/tests changed. Use generate-testability-wrappers.
  • The user requests a broad mechanical migration. Use migrate-static-to-wrapper, then generate tests separately.
  • The user already selected an existing replacement such as TimeProvider or IFileSystem and asks to migrate call sites to it. Use migrate-static-to-wrapper, which also updates affected tests.
  • The code is not C#/.NET.

Inputs

Input Required Description
Behavior to test Yes The method/workflow and expected observable behavior
Target scope No Discover the narrowest relevant file/project when omitted
Allowed production changes No Default to the minimum internal/constructor seam

Workflow

Step 1: Prove the obstacle

Read the target production path and its existing tests. Identify the exact ambient operation preventing a deterministic test and the behavior that must remain unchanged. Do not run a repository-wide static scan for a single-class request.

If an adequate seam already exists, stop refactoring and use it. This skill adds no value when a fake can already be supplied.

Read the full file on GitHub · 272 lines

Files

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.

Changes

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.

  1. 1mo ago Changed e5edc5a1cf9e
  2. 2mo ago Changed · -46 lines 743c5c2a08e7
  3. 2mo ago Changed · +8 lines 9049628d3391
  4. 2mo ago Changed · +18 lines · +4 tokens per session 094d442bf9ad
  5. 2mo ago First seen · 292 lines · 124 tokens per session scan A a585aeef9774

Subscribe to this mod's changes

testability-obstacle is a skill published in the GitHub repository managedcode/dotnet-skills (527 stars, last pushed 16d ago), licensed MIT. It adds 128 tokens to every session and 2,925 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 94% identical to testability-obstacle, differing in 0 lines, and is treated as a copy.

Related

testability-obstacle compared with skills from other repositories

testability-obstacle next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
testability-obstaclemanagedcode/dotnet-skillsSkill52716d agoMITA128Claude Code, Codex
clean-architecture-dotnetSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A50Claude Code, Codex
creating-dotnet-mcp-serversSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A43Claude Code, Codex
jackson-3-migrationnavikt/copilotSkill65yesterdayMITA53Claude Code, Codex
java-to-kotlinnavikt/copilotSkill65yesterdayMITA35Claude Code, Codex
rust-developmentnavikt/copilotSkill65yesterdayMITA27Claude Code, Codex
spring-boot-scaffoldnavikt/copilotSkill65yesterdayMITA32Claude Code, Codex