ios-di-and-build

Configures iOS dependency injection, SwiftPM packages, build settings, and CI pipelines.

Updated Jun 13, 2026
One-click install
npx skills add https://github.com/22Teikk/22Teikk-Agent-Skills-Hub --skill ios-di-and-build-22teikk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ios-di-and-build
Source: https://github.com/22Teikk/22Teikk-Agent-Skills-Hub/tree/main/packs/ios/skills/ios-di-and-build
Command: npx skills add https://github.com/22Teikk/22Teikk-Agent-Skills-Hub --skill ios-di-and-build-22teikk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? iOS projects often accumulate hidden coupling through singletons, untracked dependencies, hardcoded environment values, and fragile code signing setups. This Skill provides a structured approach to wiring dependencies via initializer injection, pinning SwiftPM packages, managing build configurations with .xcconfig files, and automating CI with Xcode Cloud or GitHub Actions. ## Core Features & Use Cases - Dependency Injection Patterns: Replace service-locator singletons with protocol-based initializer injection and a single composition root for testability. - Build & Dependency Management: Configure Package.swift with pinned versions, SwiftLint rules, and environment-specific .xcconfig files instead of #if DEBUG branching. - CI/CD & Code Signing: Set up GitHub Actions on macOS runners or Xcode Cloud with manual signing, keeping certificates and provisioning profiles in CI secrets. - Use Case: When migrating a project from CocoaPods to SPM or adding a new third-party library, use this Skill to declare the dependency correctly, configure linting, and wire CI so the build passes on every machine. ## Quick Start Ask the agent to set up dependency injection and a GitHub Actions CI pipeline for your iOS project using SwiftPM and SwiftLint.

Frequently Asked Questions about ios-di-and-build

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

FAQPage Schema
How do I set up dependency injection in an iOS app without Hilt?▼

Use protocol-based initializer injection where every long-lived type receives dependencies through its init method. Build a single composition root, such as an AppDependencies struct, that wires concrete implementations once at launch and passes them down to features.

How do I add SPM dependencies to an iOS project?▼

Declare packages in Package.swift using exact: for libraries whose API changes would break you and from: for trusted semver libraries. Verify resolutions with swift package show-dependencies and always commit Package.resolved to prevent drift across developers.

Should I use Xcode Cloud or GitHub Actions for iOS CI?▼

Xcode Cloud works best for projects without custom build steps and includes 25 free hours monthly. GitHub Actions on macos-14 runners offers more control, including SPM caching, SwiftLint with --strict, and manual code signing via xcodebuild flags.

Why is using #if DEBUG for API URLs a bad practice?▼

The #if DEBUG directive compiles different code in Debug versus Release, creating bug surfaces that only appear in one configuration. Use .xcconfig files with user-defined build settings read via Bundle.main.infoDictionary for environment differences instead.

Can I commit code signing certificates to a private repository?▼

No, never commit .p12, .cer, .mobileprovision, or .p8 files even in private repos. Leaked signing identities can sign malicious apps impersonating yours, so store all signing material in your CI provider's secret store and gitignore the files.