danny-sg/internals-viewer / .claude/skills/unused-code
unused-code
VerifiedFinds unused types and members in Internals Viewer projects by Roslyn reachability from production code, where code reached only from tests or from other unused code counts as unused, then removes them without losing test coverage. Use whenever the user asks whether a type or member is used, asks to find, review or remove unused, dead, leftover or test-only code in a project, or says unused types keep being missed, even when they name only one type.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.7 KB |
| scripts/MemberRemover/LeadingBlankLineRemover.cs | other | 1.6 KB |
| scripts/MemberRemover/MemberRemover.csproj | other | 379 B |
| scripts/MemberRemover/Program.cs | other | 981 B |
| scripts/MemberRemover/Removal.cs | other | 94 B |
| scripts/MemberRemover/RemovalResult.cs | other | 162 B |
| scripts/MemberRemover/SourceFile.cs | other | 4.7 KB |
| scripts/UnusedCodeAnalyser/Analysis.cs | other | 4.8 KB |
| scripts/UnusedCodeAnalyser/Declaration.cs | other | 972 B |
| scripts/UnusedCodeAnalyser/IsolatedOutput.cs | other | 3.6 KB |
| scripts/UnusedCodeAnalyser/Program.cs | other | 1.5 KB |
| scripts/UnusedCodeAnalyser/ReferenceGraph.Report.cs | other | 10.2 KB |
| scripts/UnusedCodeAnalyser/ReferenceGraph.cs | other | 10.3 KB |
| scripts/UnusedCodeAnalyser/SymbolReferences.cs | other | 7.2 KB |
| scripts/UnusedCodeAnalyser/UnusedCodeAnalyser.csproj | other | 487 B |
scripts/UnusedCodeAnalyser/Program.cs
View on GitHubusing System.Diagnostics;
using System.Reflection;
using UnusedCodeAnalyser;
const string AnalyseOption = "--analyse";
var isChild = args.Length > 0 && args[0] == AnalyseOption;
var arguments = isChild ? args[1..] : args;
if (arguments.Length < 3)
{
Console.Error.WriteLine("Usage: UnusedCodeAnalyser <solution> <output directory> <assembly> [<assembly> ...]");
return 1;
}
var solutionPath = Path.GetFullPath(arguments[0]);
var outputDirectory = Path.GetFullPath(arguments[1]);
var solutionDirectory = Path.GetDirectoryName(solutionPath)!;
if (isChild)
{
return await Analysis.RunAsync(solutionPath, solutionDirectory, outputDirectory, arguments.Skip(2).ToHashSet(StringComparer.Ordinal));
}
var existing = IsolatedOutput.Find(solutionDirectory);
try
{
if (!IsolatedOutput.BuildAnalyzers(solutionDirectory))
{
return 1;
}
var processPath = Environment.ProcessPath!;
var start = new ProcessStartInfo(processPath);
if (Path.GetFileNameWithoutExtension(processPath).Equals("dotnet", StringComparison.OrdinalIgnoreCase))
{
start.ArgumentList.Add(Assembly.GetEntryAssembly()!.Location);
}
start.ArgumentList.Add(AnalyseOption);
foreach (var argument in arguments)
{
start.ArgumentList.Add(argument);
}
using var analysis = Process.Start(start)!;
await analysis.WaitForExitAsync();
return analysis.ExitCode;
}
finally
{
IsolatedOutput.Remove(solutionDirectory, existing);
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |