add-to-xcode

Register new source files with an Xcode project via a Ruby script.

24|2|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/michaelboeding/skills --skill add-to-xcode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-to-xcode
Source: https://github.com/michaelboeding/skills/tree/main/skills/add-to-xcode
Command: npx skills add https://github.com/michaelboeding/skills --skill add-to-xcode

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ruby, xcodeproj, and includes scripts (resource) components.

What problem does it solve?

This Skill ensures that after you create any Swift, Objective-C, C, C++, or header file inside a directory containing an .xcodeproj, you must run a special script to register it with the project. Without this step, the file will not appear in Xcode or compile.

Core Features & Use Cases

  • Mandatory post-create registration: Run the add_to_xcode.rb script after creating source files to update the Xcode project.
  • Wide file type support: Covers .swift, .m, .mm, .c, .cpp files (headers .h are read-only in the build, but still supported for reference).
  • Use Case: After adding a new file to your Xcode project, execute the script to ensure it appears in the navigator and is compiled.

Quick Start

Run the post-file creation command to register your new file with the Xcode project, replacing <filepath> with your actual file path: ruby ${CLAUDE_PLUGIN_ROOT}/skills/add-to-xcode/scripts/add_to_xcode.rb <filepath>

Frequently Asked Questions about add-to-xcode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I register new source files in an Xcode project automatically?

Register new source files by running the add_to_xcode.rb Ruby script with your file path. The script updates the .xcodeproj to include Swift, Objective-C, C, C++, or header files in the navigator and build system, ensuring they compile without manual project configuration.

Do I need to manually add Swift and C++ files to Xcode every time I create them?

Yes, newly created source files won't appear in Xcode's navigator or compile unless registered. This Skill automates that registration step using a Ruby script that updates your project, eliminating manual addition for .swift, .m, .mm, .c, .cpp, and .h files.

What file types does Xcode project registration support?

The registration process supports .swift, .m (Objective-C), .mm (Objective-C++), .c (C), .cpp (C++), and .h (header) files. All source file types common in iOS and macOS development are covered by the xcodeproj update mechanism.

Can I automate file registration in both iOS and macOS Xcode projects?

Yes, the Ruby-based registration script works for both iOS and macOS projects containing .xcodeproj bundles. It applies the same xcodeproj gem-driven update across both platform workflows.

What dependencies do I need to register files with Xcode projects?

You need Ruby runtime and the xcodeproj Ruby gem installed on your system. The add_to_xcode.rb script invokes xcodeproj to modify your project file, so both must be available in your development environment.

Why don't newly created files automatically appear in Xcode's navigator?

Xcode projects store file references in the .xcodeproj bundle's build configuration. Creating a file on disk doesn't update this configuration automatically, so the file remains invisible to Xcode until the project structure is explicitly updated via tooling like xcodeproj.