dead-code-cleanup

Remove dead Swift code in isolated git worktrees with build and test verification.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/bzellman/earp-kit --skill dead-code-cleanup-bzellman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dead-code-cleanup
Source: https://github.com/bzellman/earp-kit/tree/main/skills/project/your-monorepo/dead-code-cleanup
Command: npx skills add https://github.com/bzellman/earp-kit --skill dead-code-cleanup-bzellman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safely clean up dead code in Swift projects by isolating changes in a dedicated git worktree and reporting findings for review.

Core Features & Use Cases

  • Creates an isolated git worktree outside the main repository to prevent IDE indexer conflicts.
  • Spawns a Dead Code Agent to scan and remove dead code with verifications after each change.
  • Generates a DEAD_CODE_REPORT.md with a summary of removals and outcomes for easy review and merge decisions.
  • Typical use cases include cleaning unused private functions, unreachable code, and test-only dead code across large Swift bases.

Quick Start

Invoke the command /dead-code-cleanup with an optional scope to target a subset of the codebase.

Frequently Asked Questions about dead-code-cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely remove dead Swift code from my repository?

Dead Swift code is safely removed by isolating changes in a dedicated git worktree, scanning for unreachable functions, and verifying the build after each modification to prevent indexer conflicts.

What is a git worktree and why use it for dead code cleanup?

A git worktree creates an isolated working directory outside the main repository to prevent IDE indexer conflicts while a dedicated agent scans and removes dead code with verifications after each change.

Can I limit dead code cleanup to a specific scope like Core or Services?

Yes, you can invoke the cleanup with an optional scope parameter to target a subset of the Swift codebase, such as Core/Services directories or the entire repository.

How do I review what dead code was removed before merging?

Reviewing removed dead code is handled by a generated DEAD_CODE_REPORT.md file containing a summary of removals and outcomes, supported by managed worktree branches ready for merge or discard.

What types of dead code can be cleaned up in a Swift project?

Typical dead code cleanup targets unused private functions, unreachable code, and test-only dead code across large Swift bases, managed safely through isolated worktrees and build verification.