Skip to main content

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.

跳到安装

来源信息

仓库
stanfish06/skillquarium
最近来源活动
2026年8月10日 01:51
检测到的 SKILL.md 语言
英语
星标
7
分支
4

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。