detect-static-dependencies

Scan C# code for unmockable static APIs and generate ranked reports.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/1k-off/umbraco-observability-playground --skill detect-static-dependencies
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detect-static-dependencies
Source: https://github.com/1k-off/umbraco-observability-playground/tree/main/.agents/skills/detect-static-dependencies
Command: npx skills add https://github.com/1k-off/umbraco-observability-playground --skill detect-static-dependencies

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you locate and prioritize hard-to-test static dependencies in C# code so you can plan targeted improvements to testability instead of guessing where the biggest coupling lives.

Core Features & Use Cases

  • Static dependency scanning: Finds specific static APIs (time, filesystem, environment, network, console, process) across scoped C# inputs to reveal testability blockers.
  • Ranked reporting: Produces a category summary plus top patterns and the most affected files so you know what to tackle first.
  • Testability planning guidance: Recommends likely replacement abstractions (for example, TimeProvider, System.IO.Abstractions, IHttpClientFactory) to support a migration strategy.

Quick Start

Ask the agent to scan your C# folder for static dependencies and return the top 10 patterns with the files most affected, excluding bin and obj.

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 hard-to-test static dependencies in C# code?

To find hard-to-test static dependencies in C# code, scan your files or solution for unmockable APIs like DateTime, File, Directory, and HttpClient. This produces a ranked report of call-site frequencies and affected files to prioritize testability improvements.

What are the common static coupling issues that block C# unit testing?

Common static coupling issues blocking C# unit testing include direct calls to DateTime, File/Directory, Environment, HttpClient, Console, and Process. These unmockable static APIs prevent isolated testing and require specific abstraction replacements to resolve.

How do I scan a .csproj or .sln for unmockable static API calls?

You can scan a .csproj or .sln for unmockable static API calls by applying category filtering and exclusion handling for obj and bin directories. This aggregates each dependency category to map recommended .NET abstraction replacements.

What .NET abstractions should replace static dependencies like DateTime and HttpClient?

Recommended .NET abstractions to replace static dependencies include TimeProvider for time, System.IO.Abstractions for filesystem access, and IHttpClientFactory for network calls. These replacements enable effective mocking and improve code testability.

Can I exclude generated code directories when scanning C# files for testability blockers?

Yes, you can and should exclude generated code directories when scanning C# files for testability blockers. The scanning process explicitly handles exclusion for obj and bin folders to ensure the ranked report reflects only your source code.

What's the best way to plan a migration strategy for untestable static C# code?

The best way to plan a migration strategy for untestable static C# code is to use a ranked static dependency report showing top patterns and most affected files. This targeted approach maps each category to its recommended .NET abstraction replacements for prioritized refactoring.