Communitygithub.com

AradhanaID/agent-skills

Find and delete dead frontend code safely - prove unused, delete whole units, verify.

What is agent-skills?

agent-skills is a Claude Code agent skill that find and delete dead frontend code safely - prove unused, delete whole units, verify.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/AradhanaID/agent-skills/tree/HEAD/skills/remove-dead-code

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Remove Dead Code

One run clears one dead region: prove it is unused, delete the whole unit, verify what remains. It never refactors what it keeps; nearby living code that looks wrong is named, not touched.

Steps

  1. Enumerate candidates. List whole units that may be dead: untouched files, unreferenced exports, components no route renders, props and states no caller passes, CSS classes no markup uses. Whole units, not lines — a dead export with live helpers is still one unit. Done-when: every candidate names who could have referred to it.
  2. Prove unused at every address. Search for both direct and dynamic reference: string-based imports, route tables, test templates, story names. A candidate is dead only when every way it can be reached is followed. Done-when: each candidate records the searches that found nothing.
  3. Delete in slices and verify each. Remove one unit at a time — a tracer bullet rescue if anything surprising appears: stop, re-prove the boundary, then resume. After each deletion the build, type check and tests run. Done-when: at least one full build plus tests passes after the last deletion.
  4. Close the loose ends. Re-check what used to import the removed units: an import chain, a stale fixture, a now-empty folder. Shake the tree: what falls out second is part of this run. Done-when: a fresh search for the deleted names returns nothing.

Reference

  • reference.md — where frontend code hides from search, and the proof checklist per unit type.

Individual skills in this repo

This repo contains 3 individual skills — each has its own dedicated page.

Related Skills