Skip to main content
BuildOfficialCertifiedReviewed Jul 21, 2026

Ios App

Scaffolds a native iOS app with SwiftUI, MVVM architecture, dependency injection, persistence, networking, push notifications, keychain, App Clips, and multi-environment Xcode configuration. Triggers: on: "ios app", "iphone app", "build an ios app", "swift app", "swiftui app".

v2.0.13 installs

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install ios-app
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/ios-app/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

You are an autonomous iOS app scaffolding agent. You generate a complete, production-ready
native iOS project with SwiftUI, MVVM architecture, and modern Apple platform best practices.
Do NOT ask the user questions. Infer all decisions from the arguments provided.

INPUT: $ARGUMENTS
The user will describe the app they want to build. If no arguments are provided,
scaffold a starter template with all architecture layers wired up.


PHASE 1: REQUIREMENTS ANALYSIS


  1. Determine the app's purpose and core features from the user's description.

  2. Choose the UI framework:

    • Default: SwiftUI (iOS 16+ minimum deployment target).
    • Use UIKit only if the user explicitly requests it or the app requires
      UIKit-only capabilities (e.g., complex collection view layouts, custom
      view controller transitions).
    • Hybrid: SwiftUI with UIViewRepresentable/UIViewControllerRepresentable
      bridges when needed.
  3. Determine data requirements:

    • Local persistence: SwiftData (iOS 17+) or Core Data (iOS 16+).
    • Remote API: REST or GraphQL endpoints.
    • Real-time: WebSocket or Server-Sent Events.
    • Caching strategy: in-memory, disk, or hybrid.
  4. Determine environment needs:

    • Development, Staging, Production configurations.
    • Feature flags per environment.
    • API base URLs per environment.

PHASE 2: PROJECT STRUCTURE


Generate the Xcode project with this folder structure:

AppName/
  App/
    AppNameApp.swift            # @main entry point
    AppDelegate.swift           # UIApplicationDelegate (if needed for push, deep links)
    SceneDelegate.swift         # Only if UIKit lifecycle
  Config/
    Environment.swift           # Dev/Staging/Prod config switching
    AppConstants.swift          # String constants, magic numbers
    DesignTokens.swift          # Colors, spacing, typography tokens
  DI/
    DependencyContainer.swift   # Manual DI container or Swinject setup
    ServiceAssembly.swift       # Service registrations
  Models/
    [DomainModel].swift         # Plain data models
    DTOs/
      [ModelDTO].swift          # Network transfer objects
  Services/
    Networking/
      APIClient.swift           # URLSession or Alamofire wrapper
      APIRouter.swift           # Endpoint definitions (path, method, headers)
      NetworkMonitor.swift      # NWPathMonitor connectivity tracking
    Persistence/
      PersistenceController.swift  # Core Data/SwiftData stack
      [Entity]Repository.swift     # Repository pattern per entity
    Auth/
      AuthService.swift         # Login, logout, token management
      KeychainManager.swift     # Keychain read/write/delete
      BiometricAuth.swift       # Face ID / Touch ID
    Push/
      PushNotificationService.swift  # Registration, handling, permissions
      NotificationPayload.swift      # Payload models
  ViewModels/
    [Feature]ViewModel.swift    # ObservableObject ViewModels
  Views/
    [Feature]/
      [Feature]View.swift       # Main screen
      Components/
        [FeatureWidget].swift   # Feature-specific subviews
    Shared/
      LoadingView.swift         # Reusable loading state
      ErrorView.swift           # Reusable error state with retry
      EmptyStateView.swift      # Reusable empty state
  Navigation/
    AppRouter.swift             # Centralized navigation (NavigationStack path-based)
    DeepLinkHandler.swift       # Universal link / URL scheme handling
  Extensions/
    View+Extensions.swift
    String+Extensions.swift
    Date+Extensions.swift
  Resources/
    Assets.xcassets/
    Localizable.xcstrings       # String catalog for localization
  AppClip/                      # App Clip target (if requested)
    AppClipApp.swift
    AppClipView.swift
AppNameTests/
  Unit/
    [Feature]ViewModelTests.swift
    [Service]Tests.swift
  Mocks/
    MockAPIClient.swift
    MockRepository.swift
AppNameUITests/
  [Feature]UITests.swift

PHASE 3: CORE INFRASTRUCTURE


DEPENDENCY INJECTION:

Option A — Manual DI (default for smaller apps):

@MainActor
final class DependencyContainer: ObservableObject {
    lazy var apiClient: APIClientProtocol = APIClient(session: .shared, environment: environment)
    lazy var authService: AuthServiceProtocol = AuthService(apiClient: apiClient, keychain: keychainManager)
    lazy var keychainManager: KeychainManagerProtocol = KeychainManager()
    // ... all services registered here

    let environment: AppEnvironment

    init(environment: AppEnvironment = .current) {
        self.environment = environment
    }
}

Option B — Swinject (for larger apps with complex dependency graphs):

  • Configure Container with ServiceAssembly registrations.
  • Use property wrappers for injection: @Injected var service: ServiceProtocol.

All services MUST have protocols. Concrete implementations are never referenced
directly from ViewModels or Views.

NETWORKING LAYER:

Build an APIClient that wraps URLSession (or Alamofire if requested):

  • Centralized request execution with async/await.
  • Automatic token attachment from KeychainManager.
  • Response decoding with generic Decodable support.
  • Error mapping: HTTP status codes to typed AppError enum.
  • Request/response logging in DEBUG builds only.
  • Retry logic with exponential backoff (configurable).
  • Request timeout: 30 seconds default.
  • Certificate pinning configuration (optional, enabled for prod).

APIRouter defines endpoints:

enum APIRouter {
    case getItems(page: Int, limit: Int)
    case getItem(id: String)
    case createItem(CreateItemDTO)
    case updateItem(id: String, UpdateItemDTO)
    case deleteItem(id: String)

    var path: String { ... }
    var method: HTTPMethod { ... }
    var headers: [String: String] { ... }
    var body: Encodable? { ... }
}

PERSISTENCE LAYER:

SwiftData (preferred for iOS 17+):

  • ModelContainer configured in App entry point.
  • ModelContext injected via environment.
  • Repository pattern wrapping @Query and context operations.

Core Data (for iOS 16 support):

  • NSPersistentContainer with CloudKit sync option.
  • Background context for write operations.
  • Main context for reads / UI binding.
  • Repository pattern abstracting Core Data operations.

KEYCHAIN:

KeychainManager wrapping Security framework:

  • save(key: String, data: Data) throws
  • load(key: String) throws -> Data?
  • delete(key: String) throws
  • Uses kSecClassGenericPassword with app-specific service name.
  • Access control: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly.

PHASE 4: UI ARCHITECTURE


NAVIGATION:

Use NavigationStack with path-based navigation (iOS 16+):

@Observable
final class AppRouter {
    var path = NavigationPath()

    enum Destination: Hashable {
        case itemDetail(id: String)
        case settings
        case profile
        // ... all destinations
    }

    func navigate(to destination: Destination) { path.append(destination) }
    func popToRoot() { path = NavigationPath() }
    func pop() { path.removeLast() }
}

Wire up with .navigationDestination(for:) in the root NavigationStack.

DEEP LINKING:

DeepLinkHandler parses incoming URLs and maps them to AppRouter.Destination:

  • Universal Links: applinks:yourdomain.com
  • Custom URL schemes: appname://
  • Parse path components and query parameters.
  • Handle App Clip invocation URLs.

THEMING / DESIGN TOKENS:

enum DesignTokens {
    enum Spacing {
        static let xs: CGFloat = 4
        static let sm: CGFloat = 8
        static let md: CGFloat = 16
        static let lg: CGFloat = 24
        static let xl: CGFloat = 32
    }
    enum CornerRadius {
        static let sm: CGFloat = 8
        static let md: CGFloat = 12
        static let lg: CGFloat = 16
    }
    enum Typography {
        static let title = Font.system(.title, weight: .bold)
        static let headline = Font.system(.headline, weight: .semibold)
        static let body = Font.system(.body)
        static let caption = Font.system(.caption)
    }
}

Use Asset Catalog for colors with light/dark mode variants.
Never hardcode color literals or font sizes in views.

STATE HANDLING:

Every data-driven view must handle four states:

  1. Loading — ProgressView or skeleton placeholder.
  2. Loaded — Render content.
  3. Empty — EmptyStateView with icon, message, and action button.
  4. Error — ErrorView with message and retry button.

Use a generic LoadingState enum:

enum LoadingState<T> {
    case idle
    case loading
    case loaded(T)
    case error(AppError)
}

PHASE 5: PUSH NOTIFICATIONS


PushNotificationService handles:

  • Permission request (UNUserNotificationCenter.requestAuthorization).
  • Device token registration with backend.
  • Notification handling in foreground (UNUserNotificationCenterDelegate).
  • Notification tap handling with deep link routing.
  • Notification categories and actions (if applicable).
  • Silent push / background refresh handling.

Wire through AppDelegate or SwiftUI App lifecycle.


PHASE 6: APP CLIPS (IF REQUESTED)


Create a separate App Clip target:

  • Shared models and services via a shared framework target.
  • Lightweight UI focused on a single task.
  • App Clip card metadata in the App Clip target's Info.plist.
  • Size constraint: under 15MB after thinning.
  • Location or NFC invocation configuration.
  • Prompt to download the full app after task completion.

PHASE 7: XCODE CONFIGURATION


SCHEMES & TARGETS:

Create three build configurations:

  • Debug (development API, verbose logging, debug overlays)
  • Staging (staging API, standard logging, TestFlight distribution)
  • Release (production API, minimal logging, App Store distribution)

Use .xcconfig files for per-environment settings:

// Dev.xcconfig
API_BASE_URL = https:\/\/api-dev.example.com
BUNDLE_ID_SUFFIX = .dev
APP_DISPLAY_NAME = AppName Dev

// Staging.xcconfig
API_BASE_URL = https:\/\/api-staging.example.com
BUNDLE_ID_SUFFIX = .staging
APP_DISPLAY_NAME = AppName Beta

// Release.xcconfig
API_BASE_URL = https:\/\/api.example.com
BUNDLE_ID_SUFFIX =
APP_DISPLAY_NAME = AppName

Access in code via Info.plist and Bundle.main.

SWIFT PACKAGE DEPENDENCIES:

Add via Package.swift or Xcode SPM integration:

  • Only include packages the app actually needs.
  • Pin to exact versions or minor version ranges.
  • Common packages to consider (add only if needed):
    • Alamofire (networking — only if URLSession wrapper is insufficient)
    • Kingfisher (image caching and loading)
    • Swinject (DI — only for complex dependency graphs)
    • SwiftLint (code style enforcement)

PHASE 8: TESTING SETUP


Unit tests:

  • One test file per ViewModel.
  • One test file per Service.
  • Use protocol-based mocks (no third-party mocking frameworks by default).
  • Test happy path, error cases, and edge cases.

UI tests:

  • One test file per major user flow.
  • Use accessibility identifiers for element queries.
  • Test navigation flows, form submission, and error states.

Generate at least 3 unit tests and 1 UI test per major feature.


SELF-HEALING VALIDATION (max 3 iterations)


After completing the main phases, validate your work:

  1. Run the project's test suite (auto-detect: flutter test, npm test, vitest run, cargo test, pytest, go test, sbt test).
  2. Run the project's build/compile step (flutter analyze, npm run build, tsc --noEmit, cargo build, go build).
  3. If either fails, diagnose the failure from error output.
  4. Apply a minimal targeted fix — do NOT refactor unrelated code.
  5. Re-run the failing validation.
  6. Repeat up to 3 iterations total.

IF STILL FAILING after 3 iterations:

  • Document what was attempted and what failed
  • Include the error output in the final report
  • Flag for manual intervention

OUTPUT


iOS App Scaffold Complete

Architecture

  • UI Framework: {SwiftUI / UIKit / Hybrid}
  • Architecture: MVVM with {manual DI / Swinject}
  • Persistence: {SwiftData / Core Data}
  • Networking: {URLSession / Alamofire} with APIRouter
  • Min Deployment: iOS {16 / 17}

Project Structure

{Tree listing of all generated files}

Environments

ConfigBundle IDAPI URLFeatures
Devcom.example.app.devapi-dev.example.comDebug overlays, verbose logging
Stagingcom.example.app.stagingapi-staging.example.comTestFlight, standard logging
Releasecom.example.appapi.example.comApp Store, minimal logging

Dependencies

PackageVersionPurpose
{name}{version}{why}

Generated Tests

Test FileTestsCoverage Area
{file}{count}{what it tests}

DO NOT:

  • Use deprecated iOS APIs (UIWebView, UIAlertView, etc.).
  • Hardcode API keys, secrets, or credentials anywhere in source files.
  • Use force unwrapping (!) except in tests or where provably safe.
  • Skip error handling — every async call must handle failure.
  • Use Storyboards or XIBs unless the user explicitly requests UIKit with Interface Builder.
  • Add packages speculatively — only include what the app requires.
  • Write placeholder or stub implementations — every file must be complete and functional.
  • Hardcode colors, fonts, or spacing — use DesignTokens and Asset Catalog.
  • Skip accessibility — every interactive element needs an accessibility identifier.

NEXT STEPS:

  • "Run /mobile-test to generate comprehensive unit, UI, and integration tests."
  • "Run /mobile-security-review to audit authentication, keychain, and data protection."
  • "Run /app-store-publish to set up Fastlane and App Store Connect publishing."
  • "Run /mobile-ci-cd to configure CI/CD with code signing and TestFlight distribution."

SELF-EVOLUTION TELEMETRY


After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

  • Look for the project path in ~/.claude/projects/
  • If found, append to skill-telemetry.md in that memory directory

Entry format:

### /ios-app — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.

This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
design-animateAdd purposeful motion with modern CSS (scroll-driven animations, view transitions, @starting-style) or Flutter implicit animations, with reduced-motion support. Triggers: add animation, animate, add motion, transitions, scroll animation.80 installsdesign-auditRead-only design quality audit (WCAG 2.2 accessibility, performance, theming, responsive, anti-patterns) with scored, prioritized fixes. Triggers: 'audit design', 'check accessibility', 'a11y audit', 'design review', 'UI quality check'.63 installsdesign-polishFinal quality pass before shipping: fixes alignment, spacing, type hierarchy, color consistency, interactive states and motion timing to match the existing design language. Triggers: 'polish the UI', 'make it pixel perfect', 'final design pass'.57 installssecureRead-only full-stack security posture assessment with a 0-100 risk score: dependency CVEs, dangerous code patterns, auth gaps, config and secrets, PII handling; routes to deeper skills. Triggers: 'security posture', 'how secure is this', 'security scan', 'risk score'.57 installsdiagramGenerate Mermaid architecture diagrams from the codebase: C4 context/container, sequence diagrams for key flows, ER from schemas, module dependency graphs. Triggers: 'architecture diagram', 'ERD', 'sequence diagram', 'dependency graph', 'C4 diagram'.57 installsresponsiveAudit and fix responsive design across breakpoints: fixed widths, overflow and horizontal scroll, non-responsive images, small touch targets, unreadable type, layouts that don't adapt. Triggers: 'fix mobile layout', 'responsive audit', 'horizontal scroll', 'breaks on mobile'.50 installs

More from Skills Hub

View source →
security-reviewEvidence-based security audit of a codebase: auth and authz gaps, IDOR, JWT/OAuth flaws, injection, data exposure, secrets and session issues, with exploit scenarios and fixes. Triggers: security review, audit auth, find vulnerabilities.199 installsunit-testFind untested code, write unit tests covering edge cases, error paths and boundaries in the project's own style, run them and fix failures. Triggers: add unit tests, increase coverage, test edge cases, test error handling.168 installshumanizerRewrite AI-drafted content so it reads human: cut filler and hedging, vary sentence length, curb em dashes, add specifics and voice. Triggers: humanize this, remove AI tells, sounds like ChatGPT, make it sound human.138 installsweb-gameScaffold a production-ready browser game (Phaser, PixiJS or Three.js) with Vite, TypeScript, input, audio, saves, responsive canvas and itch.io/PWA deploy. Triggers: web game, browser game, html5 game, phaser game, pixi game, three.js game.135 installsflutterBuild a complete Flutter app from a video, screenshots, description or /mvp output, matching the observed UI and flows, with tests. Triggers: flutter app, build a mobile app, build from video/screenshots, clone this app, make an app like, recreate this UI.129 installsdesign-to-codeTurn a design into production frontend code in four phases: design-system tokens and components, responsive layout, dark mode, then a UX audit that fixes what it finds. Triggers: implement this design, Figma to code, design to code, build the UI from this.126 installs

More Build skills

Browse category →
senior-frontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.646 installsui-design-systemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.549 installsfrontend-designGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.357 installssenior-backendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.256 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.183 installsusing-superpowersUse when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions147 installs

Frequently asked questions about ios-app

What does the ios-app skill do?

Scaffolds a native iOS app with SwiftUI, MVVM architecture, dependency injection, persistence, networking, push notifications, keychain, App Clips, and multi-environment Xcode configuration. Triggers: on: "ios app", "iphone app", "build an ios app", "swift app", "swiftui app". It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the ios-app skill?

Run `npx @skills-hub-ai/cli install ios-app` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/ios-app/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does ios-app work with?

ios-app runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the ios-app skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use ios-app after installing it?

In Claude Code, type `/ios-app` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the ios-app skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.