CtrlK
BlogDocsLog inGet started
Tessl Logo

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. Codemod-style bulk replacement of DateTime.Now/UtcNow to TimeProvider, File.ReadAllText to IFileSystem, and similar, across a bounded scope (file, project, namespace), adding constructor injection to affected classes and updating their unit tests to use a test double. 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, migrate a service to TimeProvider and update its unit tests to a controllable/fake time source, update test doubles when migrating off static DateTime/File calls. DO NOT USE FOR: detecting statics (use detect-static-dependencies), creating or registering the wrapper when it does not exist yet (use generate-testability-wrappers), migrating between test frameworks.

75

Quality

92%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Quality

Content

85%

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

A thorough, highly actionable codemod workflow with clear sequencing, build verification, and concrete replacement tables. Its only real weakness is mild verbosity, chiefly the duplicated DateTimeKind guidance across a callout and the pitfalls table.

Suggestions

Consolidate the DateTimeKind-preservation guidance: keep it once — either the Step 2 callout or the Common Pitfalls row — and cross-reference rather than restating near-verbatim, to reclaim tokens.

Tighten the ambient-context section by merging the parallelism caveat into the bullet list rather than a standalone paragraph, preserving the key constraint with fewer words.

The replacement-mapping table is valuable but large; consider whether some categories (Process, Console, Env) belong in a reference file once the skill grows, to keep the overview lean.

DimensionReasoningScore

Conciseness

The body is mostly efficient and instructional with no concept-padding, but the DateTimeKind preservation guidance appears both as a lengthy blockquote callout (Step 2) and again, near-verbatim, in the Common Pitfalls table, and the ambient-context section runs long. It could be tightened; not the lean 3 anchor but well above verbose 1.

2 / 3

Actionability

Provides a concrete replacement-mapping table, executable C# snippets for ambient seams and test restore-in-finally, exact `using` directives, the `dotnet build` command, and precise NuGet package names — copy-paste ready. Matches the fully-executable 3 anchor.

3 / 3

Workflow Clarity

Seven clearly sequenced steps with prerequisite verification (Step 1), an explicit build verification checkpoint (Step 6), an error-recovery branch ('If the build fails:'), and a Validation checklist. Feedback loops are present for this batch/codemod operation, satisfying the 3 anchor.

3 / 3

Progressive Disclosure

Single-file skill (no references/scripts/assets bundles) organized into well-signaled sections — When to Use, Inputs, Workflow, Validation, Common Pitfalls — with one-level navigation. Under the simple-skill scoring note, a well-organized single file scores 3 without external references.

3 / 3

Total

11

/

12

Passed

Description

100%

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A highly specific, well-scoped description that pairs concrete replacement actions with explicit USE FOR / DO NOT USE FOR triggers and clean separation from neighboring skills. It avoids fluff and over-claims entirely.

DimensionReasoningScore

Specificity

Lists multiple concrete actions: 'Codemod-style bulk replacement of DateTime.Now/UtcNow to TimeProvider, File.ReadAllText to IFileSystem', 'adding constructor injection to affected classes and updating their unit tests to use a test double'. Matches the 'Lists multiple specific concrete actions' anchor rather than 2, which only names a domain and some actions.

3 / 3

Completeness

Explicitly answers both what (replace static call sites with a DI-registered wrapper, add constructor injection, update tests) and when via dedicated 'USE FOR' and 'DO NOT USE FOR' clauses. Matches the 'Clearly answers both what AND when with explicit triggers' anchor.

3 / 3

Trigger Term Quality

Uses natural phrasing users would actually say — 'DateTime.UtcNow/DateTime.Now with TimeProvider', 'File.* with IFileSystem', 'constructor parameter', 'test doubles', 'unit tests'. Good coverage of common variations; not just jargon, so above the 2 anchor.

3 / 3

Distinctiveness Conflict Risk

Clear niche (mechanical migration of existing statics to existing wrappers) with a DO NOT USE FOR clause naming sibling skills (detect-static-dependencies, generate-testability-wrappers), making it unlikely to trigger for the wrong skill.

3 / 3

Total

12

/

12

Passed

Validation

100%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation16 / 16 Passed

Validation for skill structure

No warnings or errors.

Repository
dotnet/skills
Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.