agentleFS
duckduckgoduckduckgo/apple-browsers/.claude/skills/ddg-xcode-add-file/SKILL.md

ddg-xcode-add-file

Skill274 starsChanged 9 days agoApache-2.0View on GitHub

Use when creating, moving, renaming or deleting a file or folder that belongs to the iOS or macOS Xcode project rather than a Swift package.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Buildable folder: create, move or delete the file on disk and stop.

    line 19
  2. Distinctive:

    New directory under a group: ask the user to create it in Xcode as a folder (File ▸ New ▸ Folder) so it becomes a buildable folder, on iOS …

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add, move or delete a file in the Xcode projects

Files inside a Swift package (SharedPackages/, iOS/LocalPackages/, macOS/LocalPackages/) need no project change: SwiftPM reads them from disk. For everything else, what to do depends on how the destination folder is represented in iOS/DuckDuckGo-iOS.xcodeproj/project.pbxproj or macOS/DuckDuckGo-macOS.xcodeproj/project.pbxproj.

  1. Classify the destination. For each ancestor folder, nearest first, run grep "path = <FolderName>;" <project.pbxproj> | grep PBXFileSystemSynchronizedRootGroup. A match is a buildable folder; no match all the way up is a group. If a folder name is ambiguous, confirm the match's ID is listed in the parent group's children. On iOS, iOS/DuckDuckGo/ itself and iOS/DuckDuckGoTests/ are still groups. The macOS project is mid-migration: most of its folders are still groups.
  2. Buildable folder: create, move or delete the file on disk and stop. A pbxproj entry on top of that compiles the file twice. If the file needs a different target than its folder gives it, mirror an existing PBXFileSystemSynchronizedBuildFileExceptionSet, or ask the user to set it in Xcode's File Inspector.
  3. Group: pick a sibling file with the same target membership and copy its entries with fresh IDs (python3 -c "import secrets; print(secrets.token_hex(12).upper())", then grep that each ID is unused):

    • one PBXFileReference
    • one PBXBuildFile per target
    • one child line in the parent PBXGroup
    • one line in each target's PBXSourcesBuildPhase

    On macOS that is normally two targets: DuckDuckGo Privacy Browser and DuckDuckGo Privacy Browser App Store, or Unit Tests and Unit Tests App Store. A file in only one of them builds locally and fails in CI. Moving or deleting a file removes the same entries.

  4. Edit surgically. Insert or delete lines anchored on the sibling's exact lines. Never re-serialize the file, for example with the xcodeproj gem: it rewrites package references and produces an unreviewable diff.
  5. New directory under a group: ask the user to create it in Xcode as a folder (File ▸ New ▸ Folder) so it becomes a buildable folder, on iOS and macOS alike. Converting existing groups belongs in dedicated migration PRs that use Xcode's Convert to Folder.

Done when plutil -lint passes on the project file, its git diff holds only the lines for your files, and each file is in every target its siblings are in.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.