dead-code

Identify unreferenced private or internal symbols in a Roslyn workspace.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/darylmcd/Roslyn-Backed-MCP --skill dead-code-darylmcd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dead-code
Source: https://github.com/darylmcd/Roslyn-Backed-MCP/tree/main/skills/dead-code
Command: npx skills add https://github.com/darylmcd/Roslyn-Backed-MCP --skill dead-code-darylmcd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Dead code detection and cleanup helps maintainable codebases by locating unreferenced symbols, verifying their usage, and safely removing or scaffolding replacements to preserve behavior.

Core Features & Use Cases

  • Identify unreferenced private/internal symbols across a loaded Roslyn-based workspace.
  • Verify potential dead code with references checks before removal and ensure conservative changes.
  • Preview removals and apply changes only after explicit user confirmation, with compile checks.

Quick Start

Audit the loaded workspace for dead code, review the automated removal previews, and apply changes only after verification.

Frequently Asked Questions about dead-code

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

FAQPage Schema
How do I find and remove dead code in a C# Roslyn workspace?

Dead code detection locates unreferenced private or internal symbols across a loaded Roslyn-based workspace, verifies their usage with reference checks, and safely removes them after a preview. It preserves behavior by ensuring conservative changes with compile checks.

What is the safest way to clean up unreferenced private symbols in C#?

Safe dead code cleanup uses a deterministic preview and apply workflow with compile checks. The audit verifies references before any removal to prevent regressions, applying changes only after explicit user confirmation.

Can I scope dead code analysis to a specific project within my solution?

Yes, the dead code audit can optionally scope to a specific project when provided. This allows you to target static analysis and cleanup efforts at a subset of the loaded Roslyn workspace.

Does static analysis for unreferenced code preserve public APIs?

Dead code detection safeguards public APIs by preserving them unless explicitly overridden. It focuses on locating unreferenced private or internal symbols to ensure maintainability without breaking external consumers.

How do I preview C# code cleanup changes before applying them?

The dead code removal process uses a deterministic preview workflow, generating automated removal previews for review. You apply changes only after verifying the preview and confirming the compile checks pass.

What are the limitations of automated dead code removal in C#?

Automated dead code removal is limited to unreferenced private and internal symbols, conservatively preserving public APIs unless explicitly overridden. It requires reference verification and compile checks before applying any changes to prevent regressions.