skills/swift_deep_insight/SKILL.md
Identify unused code in Swift projects using the Swift compiler's index store. Detects unused classes, structs, functions, properties, protocols, and more. Use when cleaning up dead code, auditing codebase health, preparing for refactoring, or reviewing PR scope — even if they don't mention "index store" or "dead code" but describe removing unused or unreachable code.
npx skillsauth add swiftzilla/skills swift_deep_insightInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Detect unused (dead) code in Swift projects using the Swift compiler's index store.
Build the project in Xcode first — the index store is created automatically at ~/Library/Developer/Xcode/DerivedData/<Project>/Index/DataStore.
Build with xcodebuild -scheme <scheme> build or swift build.
Run from the project root or specify a path:
# Scan current directory
swift run swift-deep-insight --project-path .
# Verbose output
swift run swift-deep-insight --project-path . --verbose
# Xcode-clickable output (file:line:column:)
swift run swift-deep-insight --project-path . --xcode-format
# Include public declarations (normally excluded)
swift run swift-deep-insight --project-path . --include-public
| Option | Description |
|--------|-------------|
| --project-path | Path to Swift project (default: current directory) |
| --verbose | Enable detailed logging |
| --xcode-format | Output in Xcode-compatible format (file:line:column:) |
| --include-public | Include public declarations in unused analysis |
| --exclude-tests | Exclude test targets from analysis |
| --build | Build the project before scanning (default: false) |
responds(to:), perform(), or other runtime mechanisms will appear unused even though it's called.--include-public to override.main, @main, @NSApplicationMain, and AppDelegate are treated as roots — everything reachable from them is "used".tools
Use this skill when you need expert Swift/iOS architectural guidance, semantic codebase analysis, or PR impact reviews. It provides a senior mentor layer for Swift (SwiftUI, UIKit, Combine, Concurrency) and a semantic engine to query local code context. Trigger this skill to: 1. Validate architectural patterns before implementation using 'ask'. 2. Find and map local code dependencies using 'context'. 3. Analyze the risk and blast radius of a PR using 'review'. 4. Generate system overviews for onboarding using 'onboard'. 5. Troubleshoot runtime crashes with semantic LLDB tools using 'debug'. Activate even if specific keywords are missing but the intent is improving Swift code quality or understanding project structure.
development
Swift Testing framework for unit tests, integration tests, and async testing with modern syntax.
development
SwiftUI framework concepts including property wrappers, state management, and reactive UI patterns.
development
Swift style guidelines covering naming conventions, code organization, and best practices for writing idiomatic Swift code.