1.6 KiB
1.6 KiB
id, title, workspaceRoot, schedule, tools, mode, enabled, modelSelection, timeoutSeconds, maxIterations, tags, metadata
| id | title | workspaceRoot | schedule | tools | mode | enabled | modelSelection | timeoutSeconds | maxIterations | tags | metadata | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| dead-code-finder | Find and Report Dead Code | /absolute/path/to/repo | 0 4 * * SUN | run_commands,read_files,search_codebase | plan | false |
|
2400 | 30 |
|
|
Scan the codebase for dead code and unused exports:
-
Identify unused exports:
- Functions not called within the module or by external modules
- Classes with no instantiations
- Constants/variables not referenced
- Type definitions not used
-
Detect unreachable code patterns:
- Statements after return/throw
- Unreachable branches in conditionals
- Dead try-catch blocks
- Unused catch parameters
-
Analyze file-level patterns:
- Modules that are never imported
- Test files without corresponding implementation
- Example/demo code in main codebase
- Deprecated or marked-for-removal code
Generate a comprehensive report with:
- Dead code segments (with file locations and line numbers)
- Confidence level for each finding (high/medium/low)
- Safe-to-remove vs requires-review items
- Estimated code reduction if cleanup is done
Safe removals candidates:
- Variables only assigned, never read
- Functions declared but never called
- Exported items with no external references
Requires review:
- Code that might be called dynamically
- Public APIs (check if external consumers exist)
- Backwards-compatibility concerns
Use plan mode to suggest removals without applying them.