01 · INTRODUCTION
How to Build an iOS App with AI Using the CFA AI Toolkit
To build an iOS app with AI, give your AI coding tool a blueprint before you ask it for code. Install the free, open-source CFA AI Toolkit once. It adds eight skills that teach your AI tool one clear way to lay out an iOS app. Then open a new conversation and ask for your app, starting with "Using CFA". The AI creates an Xcode project where every kind of code has a home, builds it and tests the first feature. You run it, read it, and keep going one feature at a time.
PROMPT
Using CFA, create a new iOS app that finds where I parked my car.
The short answer
1. Install the CFA AI Toolkit into your AI coding tool (Codex, Claude Code or another tool that reads skill folders).
2. Start a new conversation and ask for the app with "Using CFA, …".
3. Build and try the result in Xcode, then add features one prompt at a time.
4. Check the work with the toolkit's read-only inspector or dashboard, and test it yourself.
02 · TUTORIAL
Why AI-Built iOS Apps Often Turn Messy
AI coding tools are good at writing Swift. What they don't have, unless you give it to them, is a plan for the whole app.
Ask for a screen and you get a screen. Ask for a second feature and the AI has to decide again where the code goes, how data is saved and which object owns what. Each answer can be reasonable on its own and still not match the last one. After a few prompts the project is a pile of files: business rules inside SwiftUI views, the same logic written twice, and background work that nobody clearly owns.
AI also writes code much faster than we can read it. That's the real risk. The app can grow faster than your understanding of it.
The fix isn't to stop using AI. It's to give the AI the same blueprint every time, so each new feature lands in a predictable place.
Important terminology
AI skill = a small folder of instructions an AI coding tool can read. It tells the AI how to do one kind of job.
CFA (Cooperative Feature Architecture) = a modern architecture for commercial Xcode and SwiftUI projects. It gives every type of code one clear home.
03 · TUTORIAL
What Is CFA?
CFA gives SwiftUI, ViewModels, Feature Managers, repositories and Swift Concurrency clear jobs:
• View: says what the screen looks like.
• ViewModel: holds the screen's state and prepares it for the View.
• Feature Manager: owns the feature's business rules and feature state.
• Repository: reads and writes data, such as a local file, database or web service.
• AppModel: creates the real feature managers and repositories in one place. AppModel.shared is the app's composition root.
Every feature follows the same path:
EXECUTION DIAGRAM
View → dedicated ViewModel → Feature API → Feature Manager → Repository
You can see the structure in Xcode from day one. Each feature gets one named folder:
EXECUTION DIAGRAM
Application
├── 1 - View
├── 2 - AppModel
│ ├── AppModel.swift
│ └── Features
│ ├── Habits
│ ├── WeightLog
│ └── Progress
├── 3 - App Resources
└── 4 - Swift Extensions
When the AI knows these rules, "add a feature" stops being an open question. The feature gets a folder, a Feature Manager, a ViewModel for its screen and tests.
04 · TUTORIAL
What Is the CFA AI Toolkit?
The CFA AI Toolkit is a free, open-source collection of eight AI skills and one local analysis tool, released under the MIT licence. It also includes a native Xcode project template called CFA App.
The eight skills cover the whole life of an app. Use each one when you want to:
• CFA App Creation: create a new iOS app with CFA from the first screen onward.
• CFA Feature Work: add, change or remove a feature.
• CFA Architecture Adoption: move an existing modern app into CFA one feature at a time.
• Legacy GCD migration: replace GCD, operation queues and callbacks with CFA and Swift Concurrency.
• CFA Architecture Review: inspect architecture and concurrency without changing the app.
• CFA Codebase Tidy: simplify the project after feature work.
• CFA Unit Tests: write and audit tests that protect real feature behaviour.
• Swift Code Quality: apply Matt's Swift standards to production code.
Installing it doesn't change Xcode or your existing apps. It only makes the CFA instructions available to your AI coding tool.
FREE OPEN-SOURCE TOOLKIT · MIT
Get the CFA AI Toolkit
Eight AI skills, a local dashboard and the CFA App Xcode template. Install it once, then ask your AI coding tool for an iOS app “Using CFA”.
View → ViewModel → Feature API → Feature Manager → Repository
05 · TUTORIAL
Step 1: Install the Toolkit Once
Pick the setup that matches your AI tool. You only do this once per computer.
Codex
Download and extract the CFA Toolkit plugin release from the repository's Releases page, then double-click Install.command. In Terminal, the same install is:
TERMINAL
node scripts/install.mjs
This adds the toolkit to your personal Codex marketplace. It also adds a cfa command to ~/.local/bin for the inspector and dashboard.
Claude Code
The portable skills live in the repository's skills folder. This command copies all eight into Claude Code's skills folder:
TERMINAL
node scripts/install.mjs --mode skills --skills-directory ~/.claude/skills
Other AI coding tools
If your tool reads plain skill folders, copy all eight folders from skills/ into the folder where it reads skills. Don't rename them. Or run the command above with your tool's folder in place of ~/.claude/skills.
Check it worked
Restart the tool or open a new conversation and paste:
PROMPT
I have installed the CFA Toolkit for iOS from
https://github.com/3DaysOfSwift/cooperative-feature-architecture.
Do you have access to create and maintain iOS projects with CFA?
Your AI should confirm it can see the CFA skills. The Terminal installer and the dashboard need Node.js 20 or newer; on a Mac, Install.command can also use Codex's installed runtime.
06 · TUTORIAL
Step 2 (Optional): Start from the CFA App Template
Want to see a working CFA app before you prompt anything? Double-click Install Xcode Template.command in the toolkit folder. It doesn't need Node.js. Quit and reopen Xcode, then choose File → New → Project → iOS → CFA App.
You get a small, complete, runnable project: a tab bar, a launch refresh, a real network request, a JSON file cache, retry and failure states, persistent colour themes and focused tests. It's a good place to learn the structure, and your AI can keep building from it.
07 · TUTORIAL
Step 3: Ask Your AI for the App
Now ask for the app you want:
PROMPT
Using CFA, create a new iOS app that finds where I parked my car.
Saying "Using CFA" makes your intention clear. The CFA App Creation skill is written to apply whenever you ask for a new iOS app, unless you ask for a different architecture. It tells the AI to:
1. Define the first thing a user can actually do, including success and error states.
2. Apply CFA's folder map and decide which code owns what.
3. Add a ThemeManager with at least two colour themes and a remembered Settings choice.
4. Connect View → ViewModel → feature API → implementation, with no empty tabs or placeholder managers.
5. Give every cancellable task a clear owner.
6. Build the iPhone target, try the first journey and test the meaningful rules.
That's the big difference from an unguided prompt. You're asking for one small, complete, working slice, not a project that only compiles.
08 · TUTORIAL
Step 4: Grow the App One Feature at a Time
Keep using short, plain prompts. These come straight from the toolkit's guide:
PROMPT
Using CFA, add a new feature to the tab bar but keep it locked under an IAP.
Using CFA, now that we added a new feature, tidy up the code.
Using CFA, make sure each exposed feature is unit tested, for all features.
Using CFA, add colour themes to the application.
Using CFA, remove the new feature and all IAP code too.
Already have an older app full of DispatchQueue code? Try Using CFA, migrate this legacy GCD codebase to Swift Concurrency. The migration skill records how the app behaves first, then moves one feature at a time. It isn't a search-and-replace.
09 · TUTORIAL
Step 5: Check the AI's Work
AI-written code still needs a human look. The toolkit gives you two read-only helpers:
• CFA Inspector: run cfa inspect in your project folder. It maps each screen to its ViewModel, its AppModel.shared manager route and its named tests, and flags missing links.
• Xcode Project Dashboard: ask Using CFA, analyse my Xcode project and produce a dashboard. or run cfa dashboard. It creates a local HTML report showing where tasks are created, who owns them, possible suspension points and architecture notes.
Neither tool edits your app. They also can't prove your app has no bugs or race conditions. You still build it, run the tests and try it on a device. The difference is that you're reviewing a project with a shape you recognise.
10 · TUTORIAL
What You Need
• A Mac with Xcode, and a Simulator or iPhone to run the app.
• An AI coding tool you already use: Codex, Claude Code, or another tool that reads skill folders.
• Node.js 20 or newer for the Terminal installer and the dashboard.
You don't need to be a Swift expert to start. CFA's fixed layout makes the project easier to read, because each feature lives in one folder and each screen has one ViewModel.
11 · TUTORIAL
See Real Apps Built with CFA
These open-source iOS projects use the same blueprint, so you can read every file:
• Cuentiva
• Metro Mate iOS, an open-source app migrated with CFA and Swift Concurrency
12 · TUTORIAL
What to Remember
1. AI builds better iOS apps when it follows one blueprint for the whole project.
2. The CFA AI Toolkit is that blueprint: eight free, MIT-licensed skills, a dashboard and an Xcode template.
3. Install it once for Codex, Claude Code or another skill-reading tool.
4. Start prompts with "Using CFA" and ask for one small, complete feature at a time.
5. Check the result with cfa inspect or the dashboard, then build, test and try it yourself.
13 · TUTORIAL
Frequently Asked Questions
Can AI build a whole iOS app for me?
It can build a lot of it, and it does much better with a blueprint. Treat the result as a strong first draft: build it, test it, read it and keep improving it one feature at a time.
Which AI tools does the CFA AI Toolkit support?
The repository documents a Codex plugin install, a Claude Code install into ~/.claude/skills, and a manual option for other AI coding tools that read skill folders.
Does it change my existing app or Xcode?
No. Installing the skills only copies instruction folders. The optional template adds a "CFA App" choice to Xcode's new-project menu and never changes an existing project.
Is the CFA AI Toolkit free?
Yes. It's open source under the MIT licence, so you can use, change and share it, including in commercial apps.
14 · TUTORIAL
Continue Learning
Want the thinking behind the blueprint? Read What Is Modern iOS Architecture?, then get the free toolkit at github.com/3DaysOfSwift/iOS-App-Development-CFA-AI-Toolkit.
3 Days of Swift Concurrency builds in public, and our paid training programme is still being built. A soft launch is targeted for 1 December 2026 if deadlines are met; that date isn't guaranteed.
