Agent skill · Testing & QA

generate-testability-wrappers

Generate wrapper interfaces and DI registration for hard-to-test static dependencies in C#, when the abstraction does NOT exist yet. Produces IFileSystem, IEnvironmentProvider, IConsole, IProcessRunner wrappers, or guides first-time adoption of TimeProvider and IHttpClientFactory. With no DI container, produces the ambient context seam instead. USE FOR: generate wrapper for static, create IFileSystem wrapper, wrap DateTime.Now, make a static or a class testable, create abstraction for File.*, generate DI registration, adopt TimeProvider when it is not registered yet, IHttpClientFactory setup,

dotnetgithub.com/dotnetGitHub ↗
claude-codeMIT
Install
npx skills add dotnet/skills --skill generate-testability-wrappers --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 11 KB
Bundled scripts: none
Path: plugins/dotnet-test/skills/generate-testability-wrappers/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 4,927
Language: C#
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Generate Testability Wrappers Generate wrapper interfaces, default implementations, and DI service registration code for untestable static dependencies. For statics that already have .NET built-in abstractions (`TimeProvider`, `IHttpClientFactory`), guide adoption of the built-in. For statics without built-in alternatives, generate custom minimal wrappers. ## When to Use - After running `detect-static-dependencies` and identifying which statics to wrap - When the user asks to make a class testable by replacing statics with injected abstractions - When adopting `TimeProvider` (.NET 8+) or `System.IO.Abstractions` - When creating a custom wrapper for `Environment.*`, `Console.*`, or `Process.*` - When there is no DI container and the seam has to be ambient rather than injected ## When Not to Use - The user wants to find statics first (use `detect-static-dependencies`) - The user wants to bulk-replace call sites (use `migrate-static-to-wrapper`) - The static is already behind an interface > A project with **no DI container**, or a user who does not want to add one, is **not** a reason to skip this skill — > that is exactly what the ambient context seam in Step 5 is for. Choose the s

What's inside
Steps it walks through
  1. When to Use
  2. When Not to Use
  3. Inputs
  4. Workflow
  5. Step 1: Determine the abstraction strategy
  6. Step 2: Generate built-in abstraction adoption (Time, HTTP)
  7. Step 3: Generate custom wrappers (Environment, Console, Process)
  8. Step 4: Generate file system wrapper adoption
  9. Step 5: Generate ambient context alternative (when DI is not available)
  10. Step 6: Place generated files
  11. Validation
  12. Common Pitfalls
More from skills
All skills →
About this skill
What does the generate-testability-wrappers skill do?

Generate wrapper interfaces and DI registration for hard-to-test static dependencies in C#, when the abstraction does NOT exist yet. Produces IFileSystem, IEnvironmentProvider, IConsole, IProcessRunner wrappers, or guides first-time adoption of TimeProvider and IHttpClientFactory. With no DI container, produces the ambient context seam instead. USE FOR: generate wrapper for static, create IFileSystem wrapper, wrap DateTime.Now, make a static or a class testable, create abstraction for File.*, generate DI registration, adopt TimeProvider when it is not registered yet, IHttpClientFactory setup,

How do I install it?

Run `npx skills add dotnet/skills --skill generate-testability-wrappers --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going