使用 swiftfindrefs (IndexStoreDB) 列出引用符号的每个 Swift 源文件。 “查找引用”、“修复缺失的导入”和跨模块重构是必需的。不要用 grep/rg 或 IDE 搜索替换。
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install swiftfindrefs或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install swiftfindrefs⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/swiftfindrefs/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: swiftfindrefs description: Use swiftfindrefs (IndexStoreDB) to list every Swift source file referencing a symbol. Mandatory for “find references”, “fix missing imports”, and cross-module refactors. Do not replace with grep/rg or IDE search. ---
Use swiftfindrefs to locate every Swift source file that references a given symbol by querying Xcode’s IndexStore (DerivedData). This skill exists to prevent incomplete refactors caused by text search or heuristics.
swiftfindrefs before editing any files.swiftfindrefs.grep, rg, IDE search, or filesystem heuristics for reference discovery.swiftfindrefs available in PATHbrew tap michaelversus/SwiftFindRefs https://github.com/michaelversus/SwiftFindRefs.git
brew install swiftfindrefs
Prefer providing --projectName and --symbolType when possible.
swiftfindrefs \
--projectName <XcodeProjectName> \
--symbolName <SymbolName> \
--symbolType <class|struct|enum|protocol|function|variable>
Optional flags:
--dataStorePath : explicit DataStore (or IndexStoreDB) path; skips discovery-v, --verbose: enables verbose output for diagnostic purposes (flag, no value required)swiftfindrefs for the symbol.Use swiftfindrefs to restrict scope, then add imports only where needed.
swiftfindrefs -p <Project> -n <Symbol> -t <Type> | while read file; do
if ! grep -q "^import <ModuleName>$" "$file"; then
echo "$file"
fi
done
Then for each printed file:
import in the imports block at the top.swiftfindrefs for the symbol.安装 快速查找引用 后,可以对 AI 说这些话来触发它
Help me get started with swiftfindrefs
Explains what swiftfindrefs does, walks through the setup, and runs a quick demo based on your current project
Use swiftfindrefs to use swiftfindrefs (IndexStoreDB) to list every Swift source file re...
Invokes swiftfindrefs with the right parameters and returns the result directly in the conversation
What can I do with swiftfindrefs in my developer & devops workflow?
Lists the top use cases for swiftfindrefs, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/swiftfindrefs/ 目录(个人级,所有项目可用),或 .claude/skills/swiftfindrefs/(项目级)。重启 AI 客户端后,用 /swiftfindrefs 主动调用,或让 AI 根据上下文自动发现并使用。
快速查找引用 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
快速查找引用 可免费安装使用。请查阅仓库了解许可证信息。
使用 swiftfindrefs (IndexStoreDB) 列出引用符号的每个 Swift 源文件。 “查找引用”、“修复缺失的导入”和跨模块重构是必需的。不要用 grep/rg 或 IDE 搜索替换。
快速查找引用 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using swiftfindrefs
Identifies repetitive steps in your workflow and sets up swiftfindrefs to handle them automatically