Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计异常

add-to-xcodeADD TO Xcode 搜索

Agent Skill

add-to-xcode 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

420

周安装

17

GitHub Stars

10

下载量

132
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:add-to-xcode(ADD TO Xcode 搜索)
来源仓库:https://github.com/michaelboeding/skills
仓库路径:skills/add-to-xcode
安装命令:
npx skills add https://github.com/michaelboeding/skills --skill add-to-xcode
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/michaelboeding/skills --skill add-to-xcode

简介

add-to-xcode 用于在 Xcode 项目中自动将新创建的原生源文件注册到导航器和编译列表。

  • 适用于 Swift、Objective-C、C、C++ 等原生开发场景,确保文件被正确识别和编译。
  • 安装后需在每次新建源文件后运行指定 Ruby 脚本,以更新项目配置。
  • 使用前需确认脚本路径权限,避免跳过步骤导致文件丢失或编译失败。
  • 该技能依赖本地 Ruby 环境和 Xcode 项目结构,不支持跨平台使用。

SKILL.md

Add to Xcode

⚠️ MANDATORY: Run After Creating Source Files

Every time you create a .swift, .m, .mm, .c, .cpp, or .h file in an Xcode project, you MUST run:

ruby ${CLAUDE_PLUGIN_ROOT}/skills/add-to-xcode/scripts/add_to_xcode.rb <filepath>

If you skip this step:

  • ❌ File will NOT appear in Xcode's navigator
  • ❌ File will NOT compile with the app
  • ❌ User will have to manually add it

Quick Reference

# ALWAYS do this after creating any source file:
# Use subshell to get latest version (handles multiple cached versions)
ruby "$(ls -1d ~/.claude/plugins/cache/michaelboeding-skills/skills/*/skills/add-to-xcode/scripts/add_to_xcode.rb 2>/dev/null | sort -V | tail -1)" NewFile.swift

Supported File Types

ExtensionAdded to Compile Sources
.swift✅ Yes
.m✅ Yes
.mm✅ Yes
.c✅ Yes
.cpp✅ Yes
.h❌ No (reference only)

Workflow

Step 1: Create the file normally

# Example: Create a new Swift file
cat > Sources/Features/MyFeature.swift << 'EOF'
import Foundation

class MyFeature {
    // Implementation
}
EOF

Step 2: Add to Xcode project

ruby ${CLAUDE_PLUGIN_ROOT}/skills/add-to-xcode/scripts/add_to_xcode.rb Sources/Features/MyFeature.swift

Output:

✓ Added Sources/Features/MyFeature.swift to MyApp.xcodeproj (target: MyApp)

What the Script Does

  1. Finds the .xcodeproj - Searches current directory and parents
  2. Creates group hierarchy - Matches the file's directory structure
  3. Adds file reference - Registers with the project
  4. Adds to build target - Source files (.swift, .m, .mm, .c, .cpp) are added to the first target's compile sources

Requirements

Ruby with the xcodeproj gem:

gem install xcodeproj

Examples

Adding a new Swift file

# Create the file
cat > MyApp/ViewModels/ProfileViewModel.swift << 'EOF'
import SwiftUI

@Observable
class ProfileViewModel {
    var name: String = ""
    var email: String = ""
}
EOF

# Add to Xcode
ruby ${CLAUDE_PLUGIN_ROOT}/skills/add-to-xcode/scripts/add_to_xcode.rb MyApp/ViewModels/ProfileViewModel.swift

Adding a header file

# Create header
cat > MyApp/Bridge/MyApp-Bridging-Header.h << 'EOF'
#import <SomeLibrary/SomeLibrary.h>
EOF

# Add to Xcode (headers are added but not to compile sources)
ruby ${CLAUDE_PLUGIN_ROOT}/skills/add-to-xcode/scripts/add_to_xcode.rb MyApp/Bridge/MyApp-Bridging-Header.h

Adding Objective-C files

# Create implementation
cat > MyApp/Legacy/LegacyManager.m << 'EOF'
#import "LegacyManager.h"

@implementation LegacyManager
// Implementation
@end
EOF

# Add to Xcode
ruby ${CLAUDE_PLUGIN_ROOT}/skills/add-to-xcode/scripts/add_to_xcode.rb MyApp/Legacy/LegacyManager.m

Agent Integration

When working in an Xcode project, agents should:

  1. Check for .xcodeproj before creating source files
  2. Create the file using standard file creation
  3. Run add_to_xcode.rb immediately after file creation
# Pattern for agents:
# 1. Create file
cat > NewFile.swift << 'EOF'
// content
EOF

# 2. Register with Xcode
ruby ${CLAUDE_PLUGIN_ROOT}/skills/add-to-xcode/scripts/add_to_xcode.rb NewFile.swift

Troubleshooting

"No.xcodeproj found"

  • Make sure you're running from within the Xcode project directory or a subdirectory

"gem not found: xcodeproj"

  • Install with: gem install xcodeproj
  • On macOS with system Ruby, you may need: sudo gem install xcodeproj

File added but not compiling

  • Check that the file extension is recognized (.swift, .m, .mm, .c, .cpp)
  • Verify the target exists and has a source build phase
  • Header files (.h) are not added to compile sources (this is correct)

Related Skills

SkillUse Case
ios-to-androidConvert iOS code to Android
android-to-iosConvert Android code to iOS

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.12%
按下载量换算50

Claude

29.99%
按下载量换算40

Cursor

17.7%
按下载量换算23

Gemini CLI

9.84%
按下载量换算13

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills