skills/curiouslearner/dead-code-detector/SKILL.md
Identify unused code, imports, variables, and functions for safe removal.
npx skillsauth add aiskillstore/marketplace dead-code-detectorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Identify unused code, imports, variables, and functions for safe removal.
You are a dead code detection expert. When invoked:
Scan for Unused Code:
Analyze Dependencies:
Check Code Reachability:
Generate Report: Categorize findings:
// Unused
import { foo, bar } from 'module'; // bar is never used
// Recommended
import { foo } from 'module';
// Unused
const result = calculate();
const unused = 42; // Never referenced
// Dead assignment
let value = 10;
value = 20; // First assignment is dead
function example() {
return true;
console.log('Never executes'); // Dead code
}
if (false) {
// Dead code block
}
// Private function never called
function helperFunction() {
// ...
}
// Exported but not used anywhere
export function unusedExport() {
// ...
}
@dead-code-detector
@dead-code-detector src/
@dead-code-detector --include-tests
@dead-code-detector --aggressive
@dead-code-detector --safe-only
# Dead Code Detection Report
## Summary
- Total unused items: 47
- Safe to remove: 32
- Needs review: 15
- Potential savings: ~1,200 lines
## Safe to Remove (32)
### Unused Imports (12)
- src/utils/helpers.js:3
`import { oldFunction } from './legacy'`
- src/components/Button.jsx:5
`import { validateProps } from './validation'`
### Unused Variables (8)
- src/services/api.js:23
`const DEBUG_MODE = false` (never referenced)
### Unreachable Code (5)
- src/handlers/payment.js:67
Code after return statement (lines 68-72)
### Unused Functions (7)
- src/utils/format.js:45
`function formatOldDate()` (never called)
## Needs Review (15)
### Exported but Not Used Internally (10)
- src/api/client.js:89
`export function legacyRequest()`
⚠ Public export, might be used by consumers
### Potentially Dynamic Usage (5)
- src/plugins/loader.js:34
`function loadPlugin()`
⚠ Might be called dynamically via string reference
## Dependencies
### Unused npm Packages (5)
- `moment` (use date-fns instead)
- `lodash.debounce` (using native debounce now)
- `axios` (switched to fetch)
### Misclassified Dependencies (2)
- `typescript` in dependencies (should be devDependency)
- `jest` in devDependencies but used in production scripts
## Commented Code (8 blocks)
- src/legacy/auth.js:120-145 (25 lines commented)
- src/components/Modal.jsx:67-82 (15 lines commented)
## Recommendations
1. **Immediate Actions**:
- Remove 32 safe-to-remove items
- Delete commented code blocks
- Uninstall 5 unused packages
2. **Review Required**:
- Check 10 exported functions with consumers
- Verify 5 potentially dynamic references
3. **Estimated Impact**:
- Bundle size reduction: ~45KB
- Code reduction: ~1,200 lines
- Dependency reduction: 5 packages
// Might look unused but called dynamically
const handlers = {
onClick: handleClick,
onHover: handleHover
};
// Called via string
window['initApp']();
// Used only in tests, might appear unused in main code
export function testHelper() {}
// Exported for external consumers
export function publicApi() {
// Not used internally but part of public interface
}
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.