dead-code-finder
Skill96 starsChanged 16 days agoMITView on GitHub
Find dead code and unused files/components in CC Director. Use when you need to identify unused projects, classes, or services that can be safely removed to simplify the codebase.
- Deletes or force-pushes
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 11 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Not referenced by any other project in the solution
- Distinctive: line 27
Not an entry point (WPF app, console app)
- Distinctive: line 28
Only referenced by other unused projects (chain detection)
- Distinctive: line 33
All public classes/interfaces have zero external references
- Distinctive: line 41
Not referenced in any other XAML file
- Distinctive: line 42
Not the main window (MainWindow.xaml)
- Distinctive: line 83
Use IDE tools or:
- Distinctive: line 145
Never auto-delete: - Always review before removing code
- Very specific: line 149
Build after removal: - Always run dotnet build cc-director.sln after removing code
- Distinctive: line 153
When you've confirmed code is dead:
- Distinctive: line 157
Update solution file: if removing projects
- Distinctive: line 159
Run tests: if applicable
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dead Code Finder Skill
Find and identify dead code in the CC Director application to simplify maintenance and reduce codebase complexity.
Scope
INCLUDED directories:
src/CcDirector.Core/- Core business logicsrc/CcDirector.Wpf/- WPF applicationsrc/CcClick/- CLI tool for UI automation
EXCLUDED directories:
src/CcDirector.Core.Tests/- Test projects (don't flag as dead code)src/CcDirector.TestHarness/- Test utilities
Analysis Types
1. Unused Project Detection
Find projects (.csproj) that are:
- Not referenced by any other project in the solution
- Not an entry point (WPF app, console app)
- Only referenced by other unused projects (chain detection)
2. Unused File Detection
Find C# files (.cs) where:
- All public classes/interfaces have zero external references
- File is not an entry point (Program.cs, App.xaml.cs)
- File is not a test file
3. Unused XAML Detection
Find XAML files (.xaml) where:
- UserControl or Window is never instantiated
- Not referenced in any other XAML file
- Not the main window (MainWindow.xaml)
4. Unused Service Detection
Find services where:
- Registered in DI (if applicable)
- But never injected or used
Manual Analysis Steps
Step 1: Find Unused Projects
# List all project references in solution
grep -r "ProjectReference" --include="*.csproj" src/Compare against project list to find unreferenced projects.
Step 2: Find Unused Classes
# Find public classes
grep -r "public class " --include="*.cs" src/ | grep -v Tests
# For each class, search for references
grep -r "ClassName" --include="*.cs" --include="*.xaml" src/Step 3: Find Unused XAML Components
# Find all XAML files
find src -name "*.xaml" -not -name "App.xaml" -not -name "*.Designer.xaml"
# For each UserControl, search for usage
grep -r "<local:ControlName" --include="*.xaml" src/Step 4: Find Unused Methods
Use IDE tools or:
# Find public methods
grep -r "public.*\w\+\s*(" --include="*.cs" src/ | grep -v Tests
# Search for method name usage
grep -r "MethodName" --include="*.cs" src/Output Format
The analysis produces a structured report:
================================================================================
DEAD CODE ANALYSIS REPORT
Generated: {timestamp}
================================================================================
SUMMARY
-------
Potentially unused projects: X
Potentially unused files: Y
Potentially unused controls: Z
================================================================================
SECTION 1: UNUSED PROJECTS (High Confidence)
================================================================================
Project: src/CcDirector.OldFeature/CcDirector.OldFeature.csproj
Status: NOT REFERENCED
Reason: No ProjectReference found in any other .csproj
Action: Review and delete if confirmed unused
---
================================================================================
SECTION 2: UNUSED FILES (High Confidence)
================================================================================
File: src/CcDirector.Core/Legacy/OldHelper.cs
Classes: OldHelper
References found: 0
Action: Review and delete if confirmed unused
---
================================================================================
SECTION 3: UNUSED XAML CONTROLS (High Confidence)
================================================================================
Control: OldDialog.xaml
Location: src/CcDirector.Wpf/Dialogs/
Usage search: <local:OldDialog found 0 times
Action: Review and delete if confirmed unused
---Safety Guidelines
- Never auto-delete - Always review before removing code
- Check git history - Some code may be recently added and not yet integrated
- Search for string references - Some code is loaded dynamically by name
- Check configuration files - Services may be registered in config
- Build after removal - Always run
dotnet build cc-director.slnafter removing code
Removal Workflow
When you've confirmed code is dead:
- Document the removal in the commit message
- Remove in order: Files first, then projects
- Update solution file if removing projects
- Build the solution to verify nothing breaks
- Run tests if applicable
# Remove project from solution
dotnet sln cc-director.sln remove "src/path/to/project.csproj"
# Delete the project directory
rm -rf "src/path/to/project"
# Build to verify
dotnet build cc-director.sln
# Run tests
dotnet test src/CcDirector.Core.TestsCommon False Positives
Entry Points - These are NEVER dead code:
CcDirector.Wpf- Main WPF appCcClick- CLI toolCcDirector.TestHarness- Test utility
Infrastructure Code:
App.xaml/App.xaml.csAssemblyInfo.cs- Extension methods classes
- Attribute classes
XAML Resources:
- Styles defined in ResourceDictionaries
- Converters used via StaticResource
Skill Version: 1.0 Last Updated: 2026-02-14 Adapted from: sampleWeb dead-code-finder skill
Other versions2 projects use a version of this.
Word for word · 1
- thefrederiksen/devthrottle★ 96100% same
Edited · 0
None found.
Wrote their own version · 1
- navjyotnishant/nj-agents★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-expertSkill
- cc-settings-apiSkill
- cencon-generateSkill
- code-maintenanceSkill
- commitSkill
- deploy-hosted-gatewaySkill
- developer-agentSkill
- dev-throttleSkill
- document-featuresSkill
- enter-issueSkill
- fleet-commsSkill
- implementation-loopSkill
- move-sessionSkill
- playwright-cliSkill
- product-agentSkill
- qa-agentSkill
- read-issuesSkill
- release-managerSkill
- review-codeSkill
- shipSkill
- skill-managerSkill
- support-agentSkill
- terminologySkill
- test-managerSkill
- ui-testSkill
- update-docsSkill
- voice-reviewSkill
- warning-fixerSkill
- wingman-brief-reviewerSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

