SwiftFindRefs for Openclaw

A specialized CLI tool that queries Xcode IndexStoreDB to find every Swift file referencing a specific symbol.

michaelversus
v1.0.5
Feb 1, 2026
1
2.7k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install swiftfindrefs

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install swiftfindrefs using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is SwiftFindRefs?

SwiftFindRefs is a high-precision tool designed for iOS and macOS developers who need to identify exactly where code symbols are used across a project. By leveraging the IndexStoreDB (IndexStore) found in Xcode's DerivedData, it provides a level of accuracy that text-based search tools like grep or ripgrep cannot match.

This tool is a vital part of the Openclaw Skills ecosystem, allowing AI agents and developers to perform reliable cross-module refactors and dependency audits without the risk of missing references due to complex Swift syntax or macro expansions. It ensures that any changes to a public API are fully accounted for by scanning the actual compiled index of the project.

SwiftFindRefs Use Cases

  • Locating all references to a symbol before performing a cross-module rename or refactor.
  • Identifying files that require new import statements after moving a class or struct to a different module.
  • Auditing the usage of specific protocols or functions to determine if they are safe to delete.
  • Creating automated scripts to batch-process files that depend on a specific data model or service.

How SwiftFindRefs Works

  1. The tool locates the project's IndexStore within the DerivedData directory based on the provided project name.
  2. It queries the IndexStoreDB using the symbol name and optional type (class, struct, etc.) to find all occurrences.
  3. The system resolves these occurrences to absolute file paths on the local machine.
  4. It returns a deduplicated, script-friendly list of file paths that can be piped into other commands or reviewed by the developer.

SwiftFindRefs Setup

To use this tool within your Openclaw Skills workflow, you must have Xcode installed and have built your project at least once to generate the index. Install the CLI tool via Homebrew:

brew tap michaelversus/SwiftFindRefs https://github.com/michaelversus/SwiftFindRefs.git
brew install swiftfindrefs

SwiftFindRefs Data Schema & Taxonomy

SwiftFindRefs utilizes the native Xcode indexing format and provides a clean output for integration into developer workflows.

Feature Specification
Input Project Name, Symbol Name, Symbol Type
Output Format Absolute file paths (one per line)
Requirements macOS, Xcode, IndexStoreDB
Supported Types class, struct, enum, protocol, function, variable

SwiftFindRefs Advanced Features

  • Support for explicit DataStore paths using --dataStorePath for non-standard build configurations.
  • Integration ready for shell scripting to automate complex tasks like 'fix missing imports'.
  • Strict output contract that produces deduplicated, newline-separated paths for easy piping.
  • Verbose mode for diagnosing IndexStore resolution errors or path discovery issues.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*