Scan repo for unused files/functions and propose safe deletions with report and git patch
Scans repository for unused code and generates safe deletion report with git patch
/plugin marketplace add Benny9193/devflow/plugin install benny9193-devflow@Benny9193/devflowScan this repository for dead code - unused files, functions, classes, variables, and exports. Generate a comprehensive report and safe deletion patch.
Identify Entry Points
Scan for Unused Code
Verify Safety
Create a markdown report with:
# Dead Code Analysis Report
## Summary
- Total files scanned: X
- Potentially unused files: X
- Potentially unused functions: X
- Estimated removable lines: X
## High Confidence (Safe to Remove)
Items with no references found anywhere:
- [ ] `path/to/file.ts` - entire file unused
- [ ] `src/utils.ts:functionName` (lines 45-67)
## Medium Confidence (Review Recommended)
Items that might have dynamic usage:
- [ ] `path/to/file.ts:export` - only used in tests
## Low Confidence (Investigate)
Items with potential indirect usage:
- [ ] `src/api.ts:handler` - might be route handler
After the report, generate a git patch file that can be applied with git apply:
diff --git a/path/to/unused-file.ts b/path/to/unused-file.ts
deleted file mode 100644
--- a/path/to/unused-file.ts
+++ /dev/null
@@ -1,XX +0,0 @@
-[file contents]
Save the patch to dead-code-removal.patch in the project root.