home / skills / willsigmon / sigstack / dead-code-eliminator
This skill identifies and removes dead code in a TypeScript project by detecting unused guards, enhanced variants, and deprecated files.
npx playbooks add skill willsigmon/sigstack --skill dead-code-eliminatorReview the files below or copy the command above to add this skill to your agents.
---
name: Dead Code Eliminator
description: Find and delete unused files, disabled code blocks, Enhanced variants, deprecated features, test files in production for Leavn app
allowed-tools: Read, Edit, Grep, Glob, Bash
---
# Dead Code Eliminator
Find and delete dead code:
1. **Find candidates**:
- Files with `#if false`
- *Enhanced.swift variants
- NavigationCoordinator (unused)
- *Stub.swift files
2. **Verify unused**:
```bash
grep -r "ClassName" LeavnApp/Sources/
```
3. **Delete safely**:
- Remove from Xcode project
- Delete file
- Run build to verify
- Commit deletion
Use when: Code cleanup, unused files, deprecated features, reducing codebase size
This skill scans a TypeScript-based Leavn app to find and remove dead code such as unused files, disabled code blocks, enhanced variants, deprecated features, and test artifacts present in production. It focuses on safe identification, verification, and deletion so you can shrink the codebase and reduce maintenance overhead. The workflow emphasizes non-destructive checks, build verification, and clean commits.
The tool locates candidate dead code by pattern and naming conventions (e.g., files containing conditional disables, *Enhanced variants, NavigationCoordinator, *Stub.swift). It verifies usage with targeted grep-style searches across the Sources tree to confirm absence of references. Once verified, it removes the file from project configuration, deletes the file, runs a full build, and produces a ready-to-commit change set.
How do you confirm a file is truly unused?
Search the entire source tree for class, function, and symbol references; run static analysis and a full build to ensure no link or runtime errors.
What if I delete something accidentally?
Keep deletions in small commits or feature branches so you can revert easily; consider creating a backup branch before sweeping deletions.