mcpbeat Sign in

Dead Dependencies Skill for Claude

>- Find and safely remove unused ("dead") npm dependencies in RedisInsight using a grep + leaf-check + build-gate recipe. Use when cleaning up dependencies, investigating whether a package is still used, removing a suspected leftover, or when the user mentions dead deps, unused dependencies, dependency cleanup, leftover packages, or "is this safe to remove". Complements the weekly vulnerability audit (`scripts/dependency-audit-report.mjs`), which only reports vulnerabilities.

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
8685
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/redis/RedisInsight --skill dead-dependencies

The instruction itself

10 sections, as written by the author

Dead Dependencies

Identify and safely remove unused npm dependencies. This is a **local,

interactive** workflow — a scheduled report can only ever guess; confirming a

dependency is dead requires grepping real usage and running the build.

Why manual (not knip/depcheck)

Static tools over-report badly in this repo and must not be trusted blindly:

  • The root package.json is a mega-manifest (UI + desktop + build + test

+ storybook + electron), so a tool scanning one area flags everything used

elsewhere as "unused".

  • Lots of dependencies are referenced without an import: webpack loaders

and eslint/jest/babel plugins by string in config, tools invoked from

package.json scripts, runtime -r preloads, dynamic require, and

ambient @types/*.

  • The webpack→Vite migration left genuinely dead build tooling behind,

mixed in with false positives.

The reliable signal is: **grep for usage → confirm it's a leaf → remove it and

run the build gate.** That is exactly how jsonpath was confirmed dead and

removed (worked example at the bottom).

The recipe (per candidate)

1. Grep the whole repo for real usage

PKG=jsonpath   # the dependency to check
grep -rn "$PKG" \
  redisinsight configs scripts tests .storybook \
  --include=*.ts --include=*.tsx --include=*.js --include=*.jsx \
  --include=*.mjs --include=*.cjs --include=*.json \
  2>/dev/null | grep -v node_modules

Look for import ... from '$PKG', require('$PKG'), import('$PKG'), and

bare references. Ignore unrelated substring hits (e.g. nestjs-form-data when

checking form-data, or a package name appearing only in tutorial/manifest

text). Zero real references → candidate for the next steps.

2. Rule out no-import usage

A clean grep is necessary but not sufficient. Check the ways a package is

used without an import:

  • Config string references — search the build/test config for the bare

name: .eslintrc.js, configs/webpack.config.*.ts,

redisinsight/ui/vite.config.mjs, jest.config.cjs, babel.config.cjs,

electron-builder.json, .mocharc*. eslint plugins, webpack loaders, and

jest/mocha reporters live here.

  • package.json scripts — a tool like concurrently, lint-staged, or a

reporter is "used" if a scripts entry (any workspace) invokes it.

  • Runtime preloads / dynamicnode -r <pkg>, require(variable), or a

wasm/worker loader with a computed path.

3. Leaf check

npm ls "$PKG"        # in the workspace that declares it

Confirm nothing else in the tree depends on it, and note any transitive deps it

uniquely pulls (removing jsonpath also dropped underscore).

4. Classify before acting

| Situation | Action |

| --- | --- |

| Plain runtime/dev dep, zero references anywhere | Delete (after the gate below) |

| @types/x where base x bundles its own types (node_modules/x/package.json has types/typings) | Delete — the DefinitelyTyped package is obsolete |

| @types/x that's ambient/global-only (e.g. @types/webpack-env) | Keep — never imported by design |

| Declared in more than one workspace (package.json), used in only one | Relocate/dedupe — remove the *unused* declaration, never the used copy |

| Shadows a Node builtin (buffer, assert, …) | Keep — usually a false positive |

| Referenced only in a config/scripts (step 2 hit) | Keep |

5. The gate — the only real proof

Remove it, reinstall (per the repo's dependency rules — never hand-edit

package.json/lockfile, never --ignore-scripts), and verify the affected

area builds:

npm uninstall "$PKG"          # in the declaring workspace; updates the lockfile
npm run type-check            # or the affected workspace's type-check
npm run test                  # / test:api, as relevant
npm run build                 # if it's a build-time dep

Green across the relevant checks = safe. Commit the package.json +

package-lock.json change (see the git-safety / dependency rules in

CLAUDE.md). If anything goes red, it wasn't dead — restore it.

Optional: enumerate candidates to sweep

To triage the whole surface rather than one package, list declared deps and

grep each for an import, then apply steps 2–5 to the ones with zero hits:

node -e "const p=require('./package.json');console.log([...Object.keys(p.dependencies||{}),...Object.keys(p.devDependencies||{})].join('\n'))" \
| while read PKG; do
    hits=$(grep -rl --include=*.ts --include=*.tsx --include=*.js --include=*.jsx --include=*.mjs \
      -e "from ['\"]$PKG" -e "require(['\"]$PKG" redisinsight configs scripts tests 2>/dev/null | grep -vc node_modules)
    [ "$hits" = "0" ] && echo "candidate: $PKG"
  done

This is a first filter only — every candidate still goes through steps 2–5.

Expect false positives (config/string/dynamic/ambient use). Never delete straight

from this list.

Worked example — jsonpath

  • Grep across the repo → the only hits were unrelated tutorial text in a

manifest.json; no import/require.

  • Not referenced in any config or script.
  • npm ls jsonpath → a leaf; it was also the sole reason underscore was

installed.

  • Plain runtime dep, zero references → likely deletable.
  • Removed jsonpath + @types/jsonpath, npm install, npm run type-check

→ green. Confirmed dead; committed. (underscore dropped with it.)

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take redis/dead-dependencies from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npm. Without those the skill loads but fails at the first command.