dead-code-elimination
Installation
SKILL.md
Automated Dead Code Elimination (Static Tree-Shaking Protocol)
Overview
Legacy codebases and rapidly evolving features accumulate Dead Code: uncalled helper functions, unused variable declarations, commented-out legacy blocks, and orphan imports.
When an AI agent ingests files with dead code, it suffers from two major problems:
- Context Bloat: Up to 35% of ingested tokens are consumed by functions that are never executed in production.
- Phantom Refactoring: The model spends time refactoring and writing unit tests for obsolete functions that the engineering team intended to delete.
The Dead Code Elimination Protocol runs local static analysis tree-shakers (knip, vulture, autoflake) via CLI to prune dead code before passing files to LLM context.