apps/cli/src/resources/skills/swiftui/SKILL.md
SwiftUI apps from scratch through App Store. Full lifecycle - create, debug, test, optimize, ship.
npx skillsauth add gannonh/kata-cloud-agents swiftuiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<essential_principles>
The user is the product owner. Claude is the developer.
The user does not write code. The user does not read code. The user describes what they want and judges whether the result is acceptable. Claude implements, verifies, and reports outcomes.
Never say "this should work." Prove it:
xcodebuild build 2>&1 | xcsift # Build passes
xcodebuild test # Tests pass
open .../App.app # App launches
If you didn't run it, you don't know it works.
| Question | How to Answer | |----------|---------------| | Does the logic work? | Write test, see it pass | | Does it look right? | Launch app, user looks at it | | Does it feel right? | User uses it | | Does it crash? | Test + launch | | Is it fast enough? | Profiler |
Tests verify correctness. The user verifies desirability.
Bad: "I refactored the view model to use @Observable with environment injection" Good: "Fixed the state bug. App now updates correctly when you add items. Ready for you to verify."
The user doesn't care what you changed. The user cares what's different.
Change → Verify → Report → Next change
Never batch up work. Never say "I made several changes." Each change is verified before the next. If something breaks, you know exactly what caused it.
Unclear requirement? Ask now. Multiple valid approaches? Ask which. Scope creep? Ask if wanted. Big refactor needed? Ask permission.
Wrong: Build for 30 minutes, then "is this what you wanted?" Right: "Before I start, does X mean Y or Z?"
Every stopping point = working state. Tests pass, app launches, changes committed. The user can walk away anytime and come back to something that works. </essential_principles>
<swiftui_principles>
Describe what the UI should look like for a given state, not how to mutate it. Let SwiftUI manage the rendering. Never force updates - change the state and let the framework react.
Every piece of data has one authoritative location. Use the right property wrapper: @State for view-local, @Observable for shared objects, @Environment for app-wide. Derived data should be computed, not stored.
Build complex UIs by composing small, focused views. Extract reusable components when patterns emerge. Prefer many small views over few large ones.
Write once but respect platform idioms. Use native navigation patterns, respect safe areas, adapt to screen sizes. Test on all target platforms. </swiftui_principles>
<intake> **What would you like to do?**Then read the matching workflow from workflows/ and follow it.
</intake>
<verification_loop>
# 1. Does it build?
xcodebuild -scheme AppName build 2>&1 | xcsift
# 2. Do tests pass? (use Core scheme for SwiftUI apps to avoid @main hang)
xcodebuild -scheme AppNameCore test
# 3. Does it launch?
# macOS:
open ./build/Build/Products/Debug/AppName.app
# iOS Simulator:
xcrun simctl boot "iPhone 15 Pro" 2>/dev/null || true
xcrun simctl install booted ./build/Build/Products/Debug-iphonesimulator/AppName.app
xcrun simctl launch booted com.yourcompany.appname
Note: If tests hang, the test target likely depends on the app target which has @main. Extract testable code to a framework target. See ../macos-apps/references/testing-tdd.md for the pattern.
Report to the user:
<cli_infrastructure>
For building, debugging, testing, and shipping from CLI without opening Xcode, read these from ../macos-apps/references/:
| Reference | Use For |
|-----------|---------|
| cli-workflow.md | Build, run, test commands; xcodebuild usage; code signing |
| cli-observability.md | Log streaming, crash analysis, memory debugging, LLDB |
| project-scaffolding.md | XcodeGen project.yml templates, file structure, entitlements |
| testing-tdd.md | Test patterns that work from CLI, avoiding @main hangs |
These docs are platform-agnostic. For iOS, change destinations:
# iOS Simulator
xcodebuild -scheme AppName -destination 'platform=iOS Simulator,name=iPhone 15 Pro' build
# macOS
xcodebuild -scheme AppName build
</cli_infrastructure>
<reference_index>
All in references/:
Core:
Navigation & Animation:
Data & Platform:
Support:
<workflows_index>
All in workflows/:
| Workflow | Purpose | |----------|---------| | build-new-app.md | Create new SwiftUI app from scratch | | debug-swiftui.md | Find and fix SwiftUI bugs | | add-feature.md | Add functionality to existing app | | write-tests.md | Write UI and unit tests | | optimize-performance.md | Profile and improve performance | | ship-app.md | App Store submission, TestFlight, distribution | </workflows_index>
<canonical_terminology>
Use these terms consistently:
tools
This skill should be used when a new project session starts and the user expresses what they want to build, asks to "start a project", "spec this out", "help me plan", or describes a feature/tool/system they want to create. Guides structured intent capture through goal, constraints, architecture, acceptance criteria, tasks, and non-goals.
tools
Push current branch changes to origin and create or update the corresponding pull request (with the correct base branch); use when asked to push, publish updates, or create pull request.
development
Pull latest origin/<base-branch> into the current local branch and resolve merge conflicts (aka update-branch). Use when Codex needs to sync a feature branch with origin, perform a merge-based update (not rebase), and guide conflict resolution best practices.
tools
Use Symphony's `linear_graphql` client tool for raw Linear GraphQL operations such as comment editing and upload flows.