detect-static-dependencies

Scan C# source files for hard-to-test static dependencies and produce a ranked report.

Updated Aug 9, 2026
One-click install
npx skills add https://github.com/adinj00/player-performance --skill detect-static-dependencies-adinj00
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detect-static-dependencies
Source: https://github.com/adinj00/player-performance/tree/main/.agents/skills/detect-static-dependencies
Command: npx skills add https://github.com/adinj00/player-performance --skill detect-static-dependencies-adinj00

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? C# codebases often contain direct calls to static APIs like DateTime.Now, File.*, and HttpClient that make unit testing difficult. This Skill audits a codebase to find these untestable static call sites, ranks them by frequency, and recommends the appropriate .NET abstraction for each category. ## Core Features & Use Cases - Static Dependency Detection: Scans .cs files for time, filesystem, environment, network, console, and process static calls. - Ranked Testability Report: Produces category summaries, top 10 patterns by frequency, and the most affected files. - Migration Guidance: Recommends built-in replacements like TimeProvider, IHttpClientFactory, and System.IO.Abstractions, ordered by migration priority. - Use Case: Before adding unit tests to a legacy solution, scan the entire .sln to discover that DateTime.UtcNow appears 28 times across 14 files, then prioritize wrapping time dependencies first. ## Quick Start Scan my C# project for untestable static dependencies and show me which files have the most static call sites.

Frequently Asked Questions about detect-static-dependencies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find untestable static dependencies in C# code?

Scan your .cs files for patterns like DateTime.Now, File.ReadAllText, Environment.GetEnvironmentVariable, and new HttpClient(). The scan produces a ranked report showing call site counts per category and the most affected files.

What replaces DateTime.Now for testable C# code?

Use TimeProvider, which is built into .NET 8 and later, to abstract time access. For projects targeting earlier frameworks, use NodaTime.IClock or a custom ISystemClock interface instead.

Can I scan a single file or directory instead of a whole solution?

Yes, the scan scope accepts a single .cs file, a directory, a .csproj, or a .sln file. Directories are scanned recursively with obj/ and bin/ folders automatically excluded.

Does this tool generate wrapper classes or migrate the code?

No, it only detects and reports static dependencies. Use generate-testability-wrappers to create wrapper classes or migrate-static-to-wrapper for mechanical bulk migration of the detected call sites.

Why are static calls counted in code already behind interfaces?

They should not be. Before counting a call site, check whether it sits behind an injected interface or abstraction like TimeProvider, since wrapped calls are already testable and excluded from the report.