Install any skill in seconds. Free to start, no credit card required.
Get Started Free →dotnet/migrate-static-to-wrapper
Replace existing static dependency call sites with a wrapper or built-in abstraction that already exists or is registered in DI, across a bounded scope (file, project, namespace). USE FOR: replace DateTime.UtcNow/DateTime.Now with TimeProvider and add the constructor parameter, migrate static call sites to a wrapper already in DI, bulk replace File.* with IFileSystem, scoped migration of statics in only certain files, update unit tests to a fake time source, make an existing static or utility cl
Passed 15 of 19 test cases with the skill, and 10 of 19 without it.
and 5 more in the full report
5 fixed12 passed either way5 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 5 test cases the skill fixed. Same model, same prompt, with and without the skill.
We need to migrate our test suite in `tests/Billing.Tests/` from NUnit (`[Test]`, `Assert.AreEqual`) to xUnit (`[Fact]`, `Assert.Equal`). Please perform this test framework conversion.
| Checked | Without skill | With skill |
|---|---|---|
| Declines the task as test framework migration is out of scope | Missed | Passed |
The instructions your model reads when the skill loads.
Perform mechanical, codemod-style replacement of static dependency call sites with calls to injected wrapper interfaces or built-in abstractions. Operates on a bounded scope (single file, project, or namespace) so migrations can be done incrementally.
generate-testability-wrappers) or built-in abstractions identifiedDateTime.UtcNow → TimeProvider.GetUtcNow() across a projectFile.* → IFileSystem.File.* across a namespacestatic utility class testable by adding an ambient seam (Step 3) while its existing call sites keep
compiling unchangedgenerate-testability-wrappers first).
A built-in abstraction such as TimeProvider or IFileSystem always counts as existing.detect-static-dependencies)testability-obstacle)A class that is
static, or a project with no DI container, is not a reason to skip this skill — that is exactly what the ambient seam in Step 3 is for. Use it whenever the call sites must keep compiling unchanged.
| Input | Required | Description |
|---|---|---|
| Static pattern | Yes | What to replace (e.g., DateTime.UtcNow, File.ReadAllText) |
| Replacement abstraction | Yes | What to use instead (e.g., TimeProvider, IFileSystem) |
| Scope | Yes | File path, project (.csproj), namespace, or directory to migrate |
| Injection strategy | No | constructor (default), primary-constructor, or ambient |
test cases passed, vs 10 / 19 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.