This skill helps automate iOS XcodeGen workflows to generate projects, fix destinations, wire assets, manage SwiftPM in CI, and resolve packaging issues.
npx playbooks add skill vladimirbrejcha/ios-ai-skills --skill ios-xcodegen
Use this skill only when a repository already uses XcodeGen or is explicitly
evaluating it. XcodeGen spec semantics belong here; local builds, simulators,
launches, and test execution belong to xcode-build, and Xcode Cloud lifecycle
policy belongs to xcode-cloud.
The mutable claims below were reviewed against XcodeGen 2.45.4 and current
Apple documentation retrieved on 2026-07-16. Read
[references/primary-sources.md](references/primary-sources.md) before changing
toolchain, asset, destination, Swift package, or packaging guidance.
project.yml or project.yaml as the source of truth. Do not edit agenerated .xcodeproj as the durable fix.
xcodegen --version.Preserve stricter project requirements. Do not silently install or update to
an unreviewed latest release.
minimumXcodeGenVersion for the schema featuresit uses. The fixtures use the reviewed 2.45.4 baseline. A minimum-version
guard does not replace the repository's tool-installation pin.
resource before replacing an existing generated project. Generate with an
explicit spec path, for example xcodegen generate --spec project.yml.
does not prove that resources, hosts, packages, or binary embedding are
correct.
phase. In an XcodeGen sources entry, use buildPhase: resources where the
path is not otherwise classified correctly.
settings:
ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS: "YES"
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS: "YES"
ColorResource andImageResource. Inspect the generated interface for the active Xcode before
changing call sites; do not assume legacy wrapper type names.
reports zero tests, inspect the generated scheme and selected test plan first.
the XcodeGen spec, then verify the generated TEST_HOST and BUNDLE_LOADER
settings. For UI tests, verify the generated target-under-test relationship
instead of copying unit-test host settings.
@testable import fails, confirm the product module name, targetmembership, and that the test target and host build for the same discovered
destination.
Generate the project before asking the active Xcode installation for supported
destinations:
xcodebuild -project path/to/App.xcodeproj -scheme App -showdestinations
Use -workspace instead when the generated build container is a workspace.
Choose a destination returned for that exact scheme and toolchain, preferably
by its returned id when repeatability matters. My Mac (Designed for iPad) is
available only for eligible apps and hosts; do not hard-code a command-line
variant or assume it appears. Choose an iOS Simulator or device destination
that is also compatible with every selected vendor binary slice.
reviewed pinning policy. The fixture uses an exact version only to make the
contract deterministic.
and then locate the shared Package.resolved relative to the actual generated
container. Project and workspace layouts differ; there is no universal path.
From a repository root, a scoped diagnostic is:
find . -path '*/xcshareddata/swiftpm/Package.resolved' -print
is committed or restored at the same generated-container-relative path before
the build. Confirm regeneration does not remove it. Package resolution may
require network access or credentials; obtain authorization before adding
either.
Classify the selected product, not just its filename or outer XCFramework
wrapper, and then inspect the generated Link Binary and Embed/Copy phases.
.a): link it, but never copy or embed the archive intoan app bundle. XcodeGen 2.45.4 does not document a library: dependency, and
its documented framework: dependency covers frameworks and XCFrameworks,
not a raw-archive recipe. Do not invent either form. Preserve an existing
project-owned recipe only after the generated project proves a link phase and
no copy phase; otherwise stop for a reviewed project-specific solution.
verify the generated phases and archive.
so the bundle resources are copied while the already-linked static archive is
omitted. Do not force embed: false solely because the framework is static.
and its resources. The wrapper does not establish one universal embed value.
unless the platform supplies it. Verify the selected slice supports the
chosen destination.
After archiving, inspect the explicit app underpath/to/App.xcarchive/Products/Applications/ and its Frameworks directory.
A copied raw .a is always a packaging error. A dynamic framework or a
resource-bearing static framework bundle can be expected, so validate each
entry against its classified product and the current Apple rules instead of
requiring the directory to contain only dynamic code.
is complete, and check whether the repository intentionally commits generated
output. Never delete the only authoritative project representation.
explicit -derivedDataPath, confirm and clean only that project-specific
path. Otherwise identify the exact project child first and keep cleanup
separate from the source-of-truth fix.
Regenerate only the named project and re-run the focused checks after cleanup.
Run the public-safe structural contract check after editing this skill:
sh ios-xcodegen/scripts/test_contract.sh
The check parses the resource/test/package fixture, validates the binary and
destination decision fixture, rejects the stale claims corrected by this
review, and confirms the dated primary-source map remains linked.
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.