agentleFS
tddworkstddworks/claude-skills/skills/ios-app-scaffold/SKILL.md

ios-app-scaffold

Skill39 starsChanged 11 months agoApache-2.0View on GitHub

Scaffold iOS apps with Tuist and layered architecture (Domain, Infrastructure, App). Use when: (1) Creating a new iOS app project, (2) Setting up Tuist project structure, (3) User asks to "create an iOS app", "scaffold an app", or "set up a new Swift project", (4) User wants layered/clean architecture for iOS, (5) User mentions Tuist setup.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 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.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the scaffold script:

    line 16
  2. Very specific:

    Add domain models: Create models in Sources/Domain/Models/

    line 78
  3. Very specific:

    Define protocols: Add repository protocols in Sources/Domain/Protocols/

    line 79
  4. Very specific:

    Implement persistence: Add SwiftData entities in Sources/Infrastructure/Local/

    line 80
  5. Very specific:

    Build UI: Create views in Sources/App/Views/

    line 81
  6. Distinctive:

    Views consume Domain directly: - No ViewModel layer needed:

    line 118

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

iOS App Scaffold

Scaffold iOS apps with Tuist, Swift 6, and layered architecture.

Quick Start

Run the scaffold script:

python3 scripts/scaffold.py <AppName> <output-directory> [--bundle-id <id>] [--team-id <id>]

Example:

python3 scripts/scaffold.py MyApp /Users/me/projects --bundle-id com.mycompany.myapp --team-id ABC123

Then generate and open:

cd /Users/me/projects/MyApp
tuist generate
open MyApp.xcworkspace

Generated Structure

AppName/
├── Sources/
│   ├── App/                    # SwiftUI views, app entry
│   │   ├── Views/
│   │   ├── Resources/
│   │   │   ├── Assets.xcassets
│   │   │   ├── XCConfig/       # Build configuration
│   │   │   │   ├── shared.xcconfig
│   │   │   │   ├── debug.xcconfig
│   │   │   │   └── release.xcconfig
│   │   │   └── en.lproj/
│   │   ├── Application/
│   │   ├── Info.plist
│   │   └── AppNameApp.swift
│   ├── Domain/                 # Business logic (no dependencies)
│   │   ├── Models/
│   │   ├── Protocols/          # @Mockable repository interfaces
│   │   └── Utils/
│   └── Infrastructure/         # Persistence implementations
│       └── Local/              # SwiftData repositories
├── Tests/
│   ├── DomainTests/
│   └── InfrastructureTests/
├── Project.swift               # Tuist configuration
├── Tuist.swift
├── .gitignore
└── README.md

Architecture

LayerPurposeDependencies
DomainModels, protocols, business logicNone
InfrastructureSwiftData persistenceDomain
AppSwiftUI views, app entryDomain, Infrastructure

For detailed patterns, see references/architecture.md.

After Scaffolding

  1. Replace example files: Edit Example.swift, ExampleRepository.swift, LocalExampleRepository.swift
  2. Add domain models: Create models in Sources/Domain/Models/
  3. Define protocols: Add repository protocols in Sources/Domain/Protocols/
  4. Implement persistence: Add SwiftData entities in Sources/Infrastructure/Local/
  5. Build UI: Create views in Sources/App/Views/

Adding Dependencies

Edit Project.swift packages array:

packages: [
    .remote(url: "https://github.com/Kolos65/Mockable.git", requirement: .upToNextMajor(from: "0.5.0")),
    // Add more packages here
],

Then add to target dependencies:

dependencies: [
    .package(product: "PackageName"),
]

Key Patterns

Domain models are rich - Include computed properties and business logic:

public struct Order: Identifiable, Codable, Sendable {
    public var items: [Item]
    public var total: Decimal { items.reduce(0) { $0 + $1.price } }
}

Protocols use @Mockable - Enables testing without real persistence:

@Mockable
public protocol OrderRepository: Sendable {
    func fetchAll() async throws -> [Order]
}

Views consume Domain directly - No ViewModel layer needed:

struct OrdersView: View {
    let orders: [Order]  // Domain model directly
}

Version Management

Version numbers are managed in Project.swift build settings:

settings: .settings(
    base: [
        "MARKETING_VERSION": "1.0.0",      // App Store version
        "CURRENT_PROJECT_VERSION": "1",     // Build number
    ],
    ...
)

The Info.plist references these via build setting variables:

  • CFBundleShortVersionString → $(MARKETING_VERSION)
  • CFBundleVersion → $(CURRENT_PROJECT_VERSION)

To bump version, edit Project.swift:

"MARKETING_VERSION": "1.1.0",
"CURRENT_PROJECT_VERSION": "2",

XCConfig

Build settings are managed via xcconfig files in Sources/App/Resources/XCConfig/:

FilePurpose
shared.xcconfigCommon settings (bundle ID, team ID, deployment target)
debug.xcconfigDebug configuration (Apple Development signing)
release.xcconfigRelease configuration (Apple Development signing)

Edit shared.xcconfig to customize:

PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.app
DEVELOPMENT_TEAM = YOUR_TEAM_ID
IPHONEOS_DEPLOYMENT_TARGET = 18.0

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.