← Back to Skills Marketplace
charlie-morrison

dead-code-finder

by charlie-morrison · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
105
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install dead-code-finder
Description
Find and remove dead code in JavaScript/TypeScript projects. Detects unused exports, unreferenced files, orphaned components, unused dependencies, and dead f...
README (SKILL.md)

Dead Code Finder

Detect and report dead code in JavaScript/TypeScript projects.

Quick Start

# Full scan — unused exports, files, and dependencies
python3 scripts/find_dead_code.py /path/to/project

# Exports only
python3 scripts/find_dead_code.py /path/to/project --mode exports

# Unused files only
python3 scripts/find_dead_code.py /path/to/project --mode files

# Unused dependencies only
python3 scripts/find_dead_code.py /path/to/project --mode deps

# JSON output for programmatic use
python3 scripts/find_dead_code.py /path/to/project --json

What It Detects

1. Unused Exports

Exported functions, classes, constants, types, and interfaces never imported anywhere.

  • Named exports (export function foo, export const bar)
  • Re-exports (export { x } from './y')
  • Type exports (export type, export interface)
  • Barrel file analysis (index.ts re-exports)

2. Unreferenced Files

Files never imported by any other file in the project.

  • Skips entry points (configurable)
  • Skips test files, config files, and scripts by default
  • Handles path aliases (tsconfig paths)

3. Unused Dependencies

npm packages in package.json never imported in code.

  • Checks dependencies and devDependencies
  • Recognizes CLI tools as potentially used
  • Handles scoped packages and subpath imports

Configuration

Default entry points: src/index.{ts,tsx,js,jsx}, src/main.*, src/app.*, pages/**/*, app/**/*.

Default ignores: node_modules, dist, build, .next, coverage, __tests__, *.test.*, *.spec.*, *.config.*, *.d.ts.

Override via flags:

--entry "src/main.ts,src/worker.ts"
--ignore "generated,vendor"

Interpreting Results

=== Dead Code Report ===

UNUSED EXPORTS (12 found):
  src/utils/helpers.ts: formatDate, parseQuery, slugify
  src/components/Button.tsx: ButtonProps (type)
  src/api/client.ts: createClient

UNREFERENCED FILES (3 found):
  src/legacy/oldAuth.ts
  src/utils/deprecated.ts
  src/components/unused/Card.tsx

UNUSED DEPENDENCIES (2 found):
  moment
  lodash.merge

Workflow

  1. Run scan on the project
  2. Review report — some findings may be false positives (dynamic imports, reflection)
  3. Verify each finding before removing
  4. Remove confirmed dead code
  5. Run tests to confirm nothing broke

Limitations

  • Dynamic imports with variable paths may cause false positives
  • Code consumed by external packages (libraries) shows as unused
  • CSS/SCSS imports not tracked
  • export * partially supported
Usage Guidance
This skill appears coherent: it includes a Python script that scans a local project for unused exports/files/deps and gives CLI instructions. Before installing or running it: (1) ensure python3 is available on the agent/environment (the metadata doesn't declare this), (2) review the full scripts (the provided file listing was truncated in this package review — confirm there are no network calls, env reads, or write operations you don't expect), (3) run the tool on a copy or sample repo first to validate results (regex-based scanners can give false positives), and (4) avoid granting it access to sensitive repositories or leaving it to run autonomously on all projects unless you trust it. If you want higher confidence, provide the complete, untruncated script for review or run it in a sandboxed environment and inspect any network activity.
Capability Analysis
Type: OpenClaw Skill Name: dead-code-finder Version: 1.0.0 The skill bundle is a legitimate utility for identifying unused code, exports, and dependencies in JavaScript/TypeScript projects. The primary script, scripts/find_dead_code.py, performs local static analysis using regex and standard file I/O without any network activity, external dependencies, or suspicious execution patterns. No evidence of prompt injection, data exfiltration, or malicious intent was found in SKILL.md or the source code.
Capability Assessment
Purpose & Capability
SKILL.md and the included Python script both implement a JS/TS dead-code scanner, so purpose and capabilities align. Minor inconsistency: the runtime examples assume python3 is available, but the skill metadata does not declare any required binary; the skill may fail if python3 is absent.
Instruction Scope
Runtime instructions only tell the agent to run the included script against a project path and to review results. The scanner reads project files (tsconfig.json, package.json) which is expected for this task. There are no instructions to read unrelated system files or to send data to external endpoints.
Install Mechanism
No install spec (instruction-only) and the included script is pure Python with no declared external dependencies, so nothing arbitrary will be downloaded or executed during install. This is a low-risk install model.
Credentials
The skill requests no environment variables, credentials, or config paths beyond reading project files (tsconfig.json, package.json) which are relevant to dead-code analysis. No evidence of unrelated secret access.
Persistence & Privilege
always is false and the skill does not request system-wide changes or modify other skills. Autonomous invocation is allowed (platform default) but that is not excessive for a local code-analysis tool.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install dead-code-finder
  3. After installation, invoke the skill by name or use /dead-code-finder
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release
Metadata
Slug dead-code-finder
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is dead-code-finder?

Find and remove dead code in JavaScript/TypeScript projects. Detects unused exports, unreferenced files, orphaned components, unused dependencies, and dead f... It is an AI Agent Skill for Claude Code / OpenClaw, with 105 downloads so far.

How do I install dead-code-finder?

Run "/install dead-code-finder" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is dead-code-finder free?

Yes, dead-code-finder is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does dead-code-finder support?

dead-code-finder is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created dead-code-finder?

It is built and maintained by charlie-morrison (@charlie-morrison); the current version is v1.0.0.

💬 Comments