A repo-wide audit of every component file, hook, lib module, constant, and CSS rule with zero importers. Every deletion verified by grep + tsc + biome + tests + canvas dogfood. The Anything Engine codebase shrank from 93 component files to 33 (65% reduction). Build still clean, no functional regressions.
For every .tsx / .ts file in src/, two grep checks ran against all other files in the repo:
# For each file, check if any OTHER file imports its path for f in $(find src/ -name "*.tsx"); do base=$(basename "$f" .tsx) # Match both quote styles: from "...component-name" and '...component-name' if ! grep -rlFq "/$base\"" src/ --exclude="$base.tsx"; then if ! grep -rlFq "/$base'" src/ --exclude="$base.tsx"; then # Zero importers anywhere → DEAD DEAD+=("$f") fi fi done
grep -F (fixed strings) instead of grep -E?
Component basenames can contain regex meta-characters like dots (e.g. file.test). Fixed-string mode means we don’t have to escape, and we get exact-substring matching. The /$base" and /$base' patterns enforce that the match is a complete file-path component (no false positives from substring matches like card matching card-actions).
After each deletion (4 CSS commits, 1 mass-delete of 53 components, 1 lib/hook/constants commit, 1 cross-feature commit): pnpm exec tsc --noEmit, pnpm exec biome lint --error-on-warnings src/, pnpm test, agent-browser screenshot against the live canvas. No commit landed without all four green.
The single CSS file was 3,859 lines and carried 97 lint warnings, all noImportantStyles. The pattern: scoped overrides under parent classes that no longer exist in any DOM. Splitting the audit into chunks made each deletion verifiable.
21% file size reduction. 97 lint warnings → 0. Canvas dogfood-verified after each trim — welcome state intact, all 3 columns rendering perfectly.
These were prototype/scaffolding files from earlier Wave iterations that never made it into the live UI. Each had ZERO importers. Mass-deleted in one commit (3f2b6f0) after grep verification.
All prefixed anything-engine-*.tsx. Component count went from 93 → 40 in one commit, then to 33 after the cross-feature sweep removed 7 more.
After the 53-component delete, 4 more files became unreachable through cascade analysis:
Beyond AE, the same audit ran against every .tsx in src/. Found 28 more zero-importer components scattered across the codebase.
After the sweep, these are the only AE components that ship to users. The list is small enough to fit in your head — that’s the point.