swiftfindrefs_skill

This skill helps you locate every Swift reference across a project using swiftfindrefs to query IndexStoreDB.
  • Python

2.5k

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill swiftfindrefs

  • _meta.json285 B
  • SKILL.md2.8 KB

Overview

This skill integrates swiftfindrefs (IndexStoreDB) to list every Swift source file that references a specified symbol. It ensures refactors and import fixes are complete by relying on Xcode’s IndexStore rather than text searches. Use it as the canonical source of truth for “find references”, fixing missing imports, and cross-module renames.

How this skill works

The tool queries Xcode’s IndexStore (DerivedData) for a given project, symbol name, and symbol type and emits one absolute file path per referencing source file. Output is deduplicated, script-friendly, and intentionally unordered. If the IndexStore or DerivedData cannot be resolved, the skill stops and reports the error rather than guessing.

When to use it

  • Before editing any files that might reference a symbol
  • When performing cross-module refactors or renames
  • To locate files that require new import statements after moving a symbol
  • When auditing whether a symbol is unused before deletion
  • Any time grep/rg/IDE search might miss references due to indexing or compiler-level relationships

Best practices

  • Always run swiftfindrefs and restrict edits to files it returns
  • Prefer passing --projectName and --symbolType to improve accuracy
  • Do not replace swiftfindrefs with grep, rg, or IDE search heuristics
  • If IndexStore/DerivedData resolution fails, stop and surface the error — do not guess additional files
  • Preserve existing import ordering and grouping when inserting imports; never add duplicates

Example use cases

  • Find all files that reference a class before renaming it across modules
  • List files that need an import after moving a type into a different framework
  • Confirm a symbol is unused by checking that swiftfindrefs returns no files before deleting it
  • Limit code review scope to only files that actually reference a changed API
  • Create automation that adds missing imports only in files reported by swiftfindrefs

FAQ

macOS with Xcode installed, the project must have been built at least once (DerivedData exists), and swiftfindrefs must be in PATH.

Can I fallback to grep or IDE search?

No. This skill mandates using swiftfindrefs (IndexStoreDB). Text search and IDE heuristics can miss references and are not acceptable fallbacks.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational