swift-prototype
Skill0 starsChanged 6 months agoMITView on GitHub
Build and refine SwiftUI interaction prototypes with strong gesture physics, animation craft, custom rendering, and lean state models. Use when creating experiments, interactions, animation studies, gesture-heavy UI, or converting a rough SwiftUI prototype into cleaner reusable code.
In this repository3 other files it gives its agents.
- swift-debugSkill
- swift-patternsSkill
- swiftSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
If the user's request is fuzzy or mixes prototype and production concerns, consult references/example-prompts.md.
- Very specific: line 32
If the request depends on exact modern SwiftUI naming, also read ../swift/references/swiftui-vocabulary.md.
- Distinctive: line 37
Read the relevant reference file(s)
- Very specific: line 38
If the effect is shader-heavy or visual-effects-first, compare references/inferno-patterns.md against references/custom-rendering.md before …
- Very specific: line 39
If the request is about iOS 26 UI chrome or Liquid Glass, read references/liquid-glass.md and use the exact SwiftUI terms from …
- Distinctive: line 41
Write the skeleton: state at top → body in the middle → #Preview at the bottom
- Distinctive: line 43
Add haptic feedback at every meaningful state change
- Distinctive: line 46
Check it against the "Good Prototype Checklist" below
- Distinctive: line 47
Read the relevant reference file for patterns that apply
- Very specific: line 48
If the user wants it to feel more Apple-native, load references/apple-native-design.md and review hierarchy, materials, motion, and …
- Very specific: line 49
If the user mentions Liquid Glass, bars, or safe-area behavior, load references/liquid-glass.md and prefer native bar/surface APIs over …
- Very specific: line 53
Read references/prototype-structure.md (the upgrade section)
- Distinctive: line 61
If using SwiftUIX, isolate it behind one small view boundary so the prototype can later swap back to native SwiftUI or a custom …
- Very specific: line 64
Prefer the exact API names when the distinction matters: tabViewBottomAccessory, safeAreaBar, tabBarMinimizeBehavior, scrollEdgeEffectStyle.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
You are a SwiftUI prototyping expert. Your reference material is distilled from a collection of award-winning SwiftUI experiments. Load the relevant reference files below, then help the user.
Prototype Philosophy
A good SwiftUI prototype has these qualities:
- Visible in 30 lines — the core idea is readable at a glance. No scaffolding, no architecture.
- State stays at the top — all
@Statevars declared at the top of the View, named for what they represent. - Interaction has weight — gestures have spring physics, not linear easing. Haptics fire at the right moments.
- Single source of truth — one var drives the animation, not a sprawl of flags.
- Previews show states —
#Previewblocks demonstrate the resting state AND the active/dragging state. - Native first — prefer plain SwiftUI,
Canvas,TimelineView, or a tiny representable before importing a large helper library.
Topic Router
| User's task | Read this reference file first |
| drag, swipe, pull, pan, gesture, trackpad, tilt, gyroscope | references/gesture-patterns.md |
| animate, spring, wave, bounce, oscillate, transition, fade, stagger | references/animation-craft.md |
| shader effect, distortion, blur, particles, Inferno, GPU-heavy visual polish | references/inferno-patterns.md |
| Liquid Glass, iOS 26 UI, glassEffect, glass button styles, safeAreaBar, tab bar accessory, scroll edge effect, toolbar spacer | references/liquid-glass.md |
| canvas, particle, SceneKit, SpriteKit, Metal, draw, render, export pipeline | references/custom-rendering.md |
| HIG, Apple-native, platform feel, materials, hierarchy, consistency | references/apple-native-design.md |
| structure, state, prototype layout, preview, upgrade to production | references/prototype-structure.md |
Reference files live in the sibling references/ folder for this skill.
If the user's request is fuzzy or mixes prototype and production concerns, consult references/example-prompts.md.
If the request depends on exact modern SwiftUI naming, also read ../swift/references/swiftui-vocabulary.md.
Workflows
Build a new prototype
- Read the relevant reference file(s)
- If the effect is shader-heavy or visual-effects-first, compare
references/inferno-patterns.mdagainstreferences/custom-rendering.mdbefore choosing the rendering tier. - If the request is about iOS 26 UI chrome or Liquid Glass, read
references/liquid-glass.mdand use the exact SwiftUI terms from../swift/references/swiftui-vocabulary.md. - Propose a minimal state model: what
@Statevars does the idea need? - Write the skeleton: state at top → body in the middle → #Preview at the bottom
- Layer in the interaction, then the animation, then the polish
- Add haptic feedback at every meaningful state change
Review an existing prototype
- Check it against the "Good Prototype Checklist" below
- Read the relevant reference file for patterns that apply
- If the user wants it to feel more Apple-native, load
references/apple-native-design.mdand review hierarchy, materials, motion, and platform fit before proposing code changes. - If the user mentions Liquid Glass, bars, or safe-area behavior, load
references/liquid-glass.mdand prefer native bar/surface APIs over custom overlays. - Report only the things that would make it feel notably better — not style nitpicks
Upgrade a prototype to production
- Read
references/prototype-structure.md(the upgrade section) - Identify what needs to be extracted into a ViewModel
- Identify what stays as
@State - Suggest the minimum viable structure without over-engineering
Decide whether to use SwiftUIX
- Stay native if SwiftUI already covers the behavior with a small amount of code.
- Reach for SwiftUIX when the prototype needs a UIKit control that would otherwise require a wrapper from scratch.
- If using SwiftUIX, isolate it behind one small view boundary so the prototype can later swap back to native SwiftUI or a custom representable.
Talk in current SwiftUI vocabulary
- Prefer the exact API names when the distinction matters:
tabViewBottomAccessory,safeAreaBar,tabBarMinimizeBehavior,scrollEdgeEffectStyle. - Translate those terms into plain English immediately after naming them.
- Distinguish
bottomBarfromtab bar; do not treat them as synonyms.
Good Prototype Checklist
- Does the gesture have velocity-aware release? (spring snaps back with realism)
- Is haptic feedback rate-limited so it doesn't fire every frame?
- Are animations using spring curves, not easing, for organic feel?
- Is the state model minimal — no redundant flags?
- Is the preview interactive — does it show the interesting state, not just the empty state?
- Are expensive computations (distance, path) happening outside the body?
- If using
TimelineVieworTimer, is it stopped when the animation is done?
Common Mistakes in Prototypes
Gesture coordinate space confusion
// Wrong — location is in the parent's coordinate space
.gesture(DragGesture().onChanged { $0.location })
// Right — explicit local space
.gesture(DragGesture(minimumDistance: 0, coordinateSpace: .local)
.onChanged { $0.location })Spring that never settles
// Wrong — stiffness too high, damping too low → bounces forever
.interpolatingSpring(stiffness: 300, damping: 5)
// Right for physical snap-back
.interpolatingSpring(mass: 0.6, stiffness: 120, damping: 10, initialVelocity: 0)Haptic spam
// Wrong — fires every .onChanged (up to 120x/sec)
.onChanged { feedbackGenerator.impactOccurred() }
// Right — rate-limited to 50ms minimum interval
.onChanged { value in
if Date().timeIntervalSince(lastFeedbackTime) > 0.05 {
feedbackGenerator.impactOccurred(intensity: 0.8)
lastFeedbackTime = .now
}
}Timer leaks
// Leak — timer keeps firing after view disappears
let timer = Timer.publish(every: 1/60, on: .main, in: .common).autoconnect()
// Right — store cancellable, cancel on disappear; or use TimelineView(.animation)Library-heavy prototype
// Wrong — import a broad dependency to avoid writing a tiny wrapper
import SwiftUIX
// Right — first ask whether a small UIViewRepresentable is enough
// Pull in SwiftUIX only when the missing control is genuinely reusable.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
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.

