dead-code-scanner

Identify and report unreferenced Swift code symbols in markdown reports.

49|9|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/Terryc21/xcode-workflow-skills --skill dead-code-scanner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dead-code-scanner
Source: https://github.com/Terryc21/xcode-workflow-skills/tree/main/skills/dead-code-scanner
Command: npx skills add https://github.com/Terryc21/xcode-workflow-skills --skill dead-code-scanner

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Find orphaned code after refactors or for ongoing hygiene to reduce maintenance burden and hidden bugs.

Core Features & Use Cases

  • Detects unused declarations (functions, types, properties) in Swift projects.
  • Supports Quick (recent changes) and Full (entire codebase) scan modes.
  • Generates a markdown report under .agents/research with per-symbol findings for review and remediation.

Quick Start

Run a quick scan to surface dead code and begin a guided cleanup pass.

Frequently Asked Questions about dead-code-scanner

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

FAQPage Schema
How do I find unused Swift code in my project after a large refactor?

To find unused Swift code after refactoring, you need static analysis that tracks symbol declarations and usages across your entire codebase. This dead code scanner identifies orphaned functions, types, and properties with no references, generating a markdown report with per-symbol confidence and remediation suggestions.

What's the best way to detect unused functions and types in a Swift codebase?

Detecting unused functions and types in a Swift codebase requires reference tracking that maps every declaration to its usages. A full codebase scan analyzes these symbols, respects allowlists and inline annotations to prevent false positives, and outputs structured findings for review.

Can I prevent certain Swift symbols from being flagged as dead code?

You can prevent certain Swift symbols from being flagged as dead code by using allowlists and inline annotations. The scanner respects these exclusions during reference tracking, ensuring symbols exposed via reflection or external interfaces are not mistakenly reported as unused.

How does dead code detection work with Swift static analysis?

Dead code detection with Swift static analysis works by parsing symbol declarations and cross-referencing them against usages throughout the codebase. It calculates per-symbol confidence scores for unused declarations and generates a markdown report under .agents/research with remediation suggestions.

Why does dead code scanning report false positives for public APIs?

Dead code scanning may report false positives for public APIs because static analysis cannot detect external references outside the codebase. You can suppress these false positives by adding affected symbols to an allowlist or annotating them inline to exclude them from unused code detection.