Skill

From diegopacheco/ai-playground · View interactive version

Skill is an AI agent skill from the GitHub repository diegopacheco/ai-playground. Find dead Java code by static reachability from entry points. Parses the sources, builds the method call graph, walks it from real entry points (main, Spring web/lifecycle/scheduler handlers, JUnit tests, framework callbacks), and renders a light-theme website with summary cards, a reachable-vs-dead

How to use this skill

Skill file

dead-code

Generate a static dead-code report website for the Java project the user is working on.

Steps

  1. Find the Java source root. Prefer src/main/java; if absent, use the directory the user points at or the closest directory containing .java files. If the user names a specific module or subproject, scope to it. To include tests, point the script at a root that also covers src/test/java.
  2. Run the analyzer that ships with this skill:

```

python3 ~/.claude/skills/dead-code/find_dead_code.py <java-src-dir> <out-dir> [title]

```

Use dead-code-site inside the target project as <out-dir> unless the user asks for another location, and pass the project name as the title.

  1. The script writes a single self-contained index.html and prints the totals (methods, entry points, reachable, dead, dead classes). Serve it with python3 -m http.server from <out-dir> (pick a free port) or tell the user to open the file directly, then report the URL or path and the headline numbers.
  2. Tell the user how to read the site: the cards summarize totals, the donut shows the reachable-vs-dead split, the dead code tab lists every unreachable method grouped by file (with file:line, a reason tag, and who calls it), and the entry points tab shows the seeds the analysis started from. The search box filters by class, method, or file.

How reachability is decided

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.