agentsclimarketplace

Dead code elimination

Skill dgabreuu/react-skill-pack/skills/dead-code-elimination

Skills for refactoring and optimizing React and Vite applications.

Install
npx -y skills add dgabreuu/react-skill-pack --skill dead-code-elimination

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 20 days oldThe repository was created 20 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when a React + Vite project needs an advisory scan for unreachable modules, unused imports or unreferenced dependencies before a manually reviewed cleanup.

SKILL.md

3.2 KB, as published. Nobody here has run it

Dead Code Elimination

Purpose

Find cleanup candidates without automatically removing code. The analysis uses the static module graph, HTML and Vite entries, package.json, dynamic imports, workers, and known glob patterns. Reflection, runtime-generated imports, and external contracts still require human review.

Memory and patterns

Read the local MEMORY.md and follow ../.shared/SKILL-MEMORY-PROTOCOL.md; use node "<skills-root>/.shared/src/memory-cli.js" append ... for actionable results. The utility validates, renumbers, and retains up to 12 entries.

Before making decisions influenced by existing code, follow ../.shared/PATTERN-LEARNING-PROTOCOL.md and query the repository catalog with node "<skills-root>/.shared/src/pattern-learning/pattern-cli.js" query ...; after confirming a new or refined pattern in the code, consolidate it with node "<skills-root>/.shared/src/pattern-learning/pattern-cli.js" upsert ....

Usage

Compatible with React 18/19, Vite 7/8, and Node 22.13+.

node "<skill-dir>/scripts/scan-dead-code.js" \
  --project-dir <project> --format json --dry-run

Output flags and behavior follow the shared CLI contract in ../.shared/README.md.

When not to use

  • The goal is shrinking a measured bundle; use the bundle-optimization skill (tree shaking may already eliminate the code).
  • Findings would be removed without manual confirmation; this skill is advisory and authorizes no automatic removal.

Interpretation

  • high identifies strong local evidence, such as an import whose binding is never read.
  • medium identifies a graph candidate, such as a file that is unreachable from discovered entries.
  • confidence and action: review are required: no finding authorizes automatic removal.
  • peerDependencies, public exports, scripts, configuration files, HTML entries, tests, stories, workers, and polyfills are preserved or treated as roots.
  • A clean result does not prove a bundle improvement; Vite or Rolldown may already remove the code through tree shaking.

Safe process

  1. Run the scanner in JSON mode and preserve the report.
  2. Review each finding against package.json exports, HTML, scripts, aliases, glob patterns, and dynamic loading.
  3. Remove only items confirmed manually.
  4. Run functional tests and a production build.
  5. Compare raw, gzip, and Brotli bytes for the initial entry. Record 0 B when cleanup does not change the artifact.

Limitations

The scanner does not execute vite.config, interpret reflection or complex shadowing, or cover every glob variant. tsconfig.json aliases and common queries are resolved; aliases defined only in Vite, conditional exports, and advanced patterns require manual review. Use Knip, ESLint, or bundler analysis as complementary checks when the project requires coverage beyond the static graph.

Files

  • scripts/scan-dead-code.js: advisory scanner and CLI.
  • checklists/dead-code-checklist.md: manual review.
  • examples/: illustrative examples; they do not authorize removal.

Gives 0 of the 12 instructions most refactoring skills give

Counted across 521 of the 525 authors here whose files we hold, read 2026-08-06

  • run tests after each changein 59 of 521, across 56 files
  • write tests before refactoringin 27 of 521, across 24 files
  • preserve external behaviorin 26 of 521, across 22 files
  • remove dead codein 25 of 521, across 24 files
  • make small incremental changesin 20 of 521, across 17 files
  • break the implementation into tiny commitsin 18 of 521, across 5 files
  • ask the user about alternative optionsin 17 of 521, across 4 files
  • create a GitHub issue with the planin 17 of 521, across 4 files
  • explore the repository to verify assertionsin 17 of 521, across 4 files
  • interview the user about the refactorin 16 of 521, across 3 files
  • check the codebase for test coveragein 16 of 521, across 3 files
  • refactor one thing at a timein 16 of 521, across 12 files

Said here and by no other author read

  • Run the scanner in JSON mode and preserve the report
  • Review each finding against package configuration and entry points
  • Remove only items confirmed manually
  • Run functional tests and a production build
  • Compare raw gzip and brotli bytes for the initial entry
  • Read and follow the shared memory protocol

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.