Skip to content
Agentmart
Submit a tool

add-to-xcode

REQUIRED: After creating ANY .swift, .m, .mm, .c, .cpp, or .h file in a directory containing a .xcodeproj, you MUST run add_to_xcode.rb to register it with…

Skill by michaelboeding

IndexedMIT★ 30
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/michaelboeding-add-to-xcode

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

REQUIRED: After creating ANY .swift, .m, .mm, .c, .cpp, or .h file in a directory containing a .xcodeproj, you MUST run add_to_xcode.rb to register it with the project. Without this step, the file will NOT appear in Xcode and will NOT compile.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/add-to-xcode

What's inside

Skill name
add-to-xcode
Description
REQUIRED: After creating ANY .swift, .m, .mm, .c, .cpp, or .h file in a directory containing a .xcodeproj, you MUST run add_to_xcode.rb to register it with the project. Without this step, the file will NOT appear in Xcode and will NOT compile.
License
MIT
Instructions
168 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (2)

  • SKILL.md
  • add_to_xcode.rb · scripts/

SKILL.md (first lines)

# 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:**

```bash
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

```bash
# 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

| Extension | Added to Compile Sources |
|-----------|-------------------------|
| `.swift` | ✅ Yes |
| `.m` | ✅ Yes |
| `.mm` | ✅ Yes |
| `.c` | ✅ Yes |
| `.cpp` | ✅ Yes |
| `.h` | ❌ No (reference only) |

## Workflow

### Step 1: Create the file normally

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

class MyFeature {
    // Implementation
}
EOF
```

### Step 2: Add to Xcode project

```bash
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:

```bash
gem install xcodeproj
```

## Examples

### Adding a new Swift file

```bash
# 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

```bash
# 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

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

@implementation LegacyManager

From michaelboeding/skills, MIT.

More from michaelboeding/skills

Signals

Stars
30
Forks
2
Open issues
0
Last commit (this folder)
Jan 5, 2026 (9 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from michaelboeding

Cite this page

add-to-xcode skill. Agent Mart. https://agentmart.dev/skills/michaelboeding-add-to-xcode (last updated 2026-10-24)