Animation Patterns logo

Animation Patterns

Community
rshankras
animation-patterns

SwiftUI animation patterns including springs, transitions, PhaseAnimator, KeyframeAnimator, SF Symbol effects, scroll-driven effects, mesh gradients, text renderers, and shader effects. Use when implementing, reviewing, or fixing animation or visual-effect code on iOS/macOS.

Overview

Publisherrshankras
Repositoryclaude-code-apple-skills
Skill nameanimation-patterns
Stars
744
Forks
70
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by rshankras on GitHub. Read the source before you install it.

Installation

Install the Animation Patterns AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills.git /tmp/claude-code-apple-skills
mkdir -p .claude/skills
cp -r /tmp/claude-code-apple-skills/skills/design/animation-patterns .claude/skills/animation-patterns
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Animation Patterns in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Animation Patterns on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Animation Patterns is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Animation Patterns

Correct API shapes and patterns for SwiftUI animations. Prevents the most common mistakes: mixed spring parameter generations, wrong PhaseAnimator/KeyframeAnimator closure signatures, and using matchedGeometryEffect where matchedTransitionSource is needed.

When This Skill Activates

Use this skill when the user:

  • Asks to add, fix, or review animation code
  • Mentions spring, bounce, or snappy animations
  • Wants view transitions (insertion/removal, hero, zoom)
  • Asks about PhaseAnimator or KeyframeAnimator
  • Wants SF Symbol effects (bounce, pulse, wiggle, breathe)
  • Mentions matchedGeometryEffect or matchedTransitionSource
  • Asks about reduce motion / animation accessibility
  • Wants to sequence or chain animations
  • Mentions withAnimation, animation completions, or Transaction
  • Wants scroll-driven effects (parallax, carousels, scrollTransition, visualEffect)
  • Mentions MeshGradient, TextRenderer, or Metal shader effects (colorEffect, distortionEffect, layerEffect)

Decision Tree

Choose the right reference file based on what the user needs:

What are you animating?
├─ A state change (opacity, position, color)
│  └─ → core-animations.md
│     ├─ withAnimation { } — explicit animation
│     ├─ .animation(_:value:) — implicit animation
│     └─ Spring configuration — .spring, .bouncy, .snappy, .smooth
├─ A multi-step / sequenced animation
│  └─ → phase-keyframe-animators.md (PhaseAnimator)
│     └─ Cycles through discrete phases automatically or on trigger
├─ A complex multi-property animation (scale + rotation + offset)
│  └─ → phase-keyframe-animators.md (KeyframeAnimator)
│     └─ Timeline-based keyframes with per-property tracks
├─ A view appearing / disappearing
│  └─ → transitions.md
│     ├─ .transition() — insertion/removal
│     ├─ .contentTransition() — text/symbol changes
│     └─ .asymmetric() — different in/out
├─ A hero / zoom navigation transition
│  └─ → transitions.md (matchedTransitionSource section)
│     ├─ iOS 18+: matchedTransitionSource + .navigationTransition(.zoom)
│     ├─ UIKit: preferredTransition = .zoom (capture stable IDs, never views)
│     └─ iOS 14+: matchedGeometryEffect (NOT for NavigationStack)
├─ A UIKit view driven by SwiftUI state or gestures
│  └─ → transitions.md (Bridging UIKit and SwiftUI Animations)
│     └─ UIView.animate(.spring(...)) / context.animate in updateUIView
├─ An SF Symbol animation
│  └─ → symbol-effects.md
│     └─ .symbolEffect(.bounce), .pulse, .wiggle, .breathe, .rotate
├─ A scroll-driven, geometry-driven, or shader effect
│  └─ → visual-effects.md
│     ├─ .scrollTransition — carousel scale/parallax/caption fades
│     ├─ .visualEffect — position-based effects without GeometryReader
│     ├─ MeshGradient — animatable multi-point gradients
│     ├─ TextRenderer — per-line / per-glyph text animation
│     └─ ShaderLibrary + .colorEffect / .distortionEffect / .layerEffect
└─ Spring physics / timing configuration
   └─ → core-animations.md (Spring Configurations section)

API Availability

APIMinimum VersionReference
withAnimationiOS 13core-animations.md
.animation(_:value:)iOS 13core-animations.md
.spring(response:dampingFraction:)iOS 13core-animations.md
.matchedGeometryEffectiOS 14transitions.md
.transition(.push(from:))iOS 16transitions.md
.contentTransition(.numericText())iOS 16transitions.md
PhaseAnimatoriOS 17phase-keyframe-animators.md
KeyframeAnimatoriOS 17phase-keyframe-animators.md
.spring(duration:bounce:)iOS 17core-animations.md
Spring presets (.bouncy, .snappy, .smooth)iOS 17core-animations.md
withAnimation(_:completionCriteria:_:completion:)iOS 17core-animations.md
.symbolEffect()iOS 17symbol-effects.md
.transition(.blurReplace)iOS 17transitions.md
.contentTransition(.symbolEffect(.replace))iOS 17transitions.md
Transition protocol / TransitionPhaseiOS 17transitions.md
TransactionKey, scoped .animation / .transaction variantsiOS 17core-animations.md
KeyframeTimeline, .mapCameraKeyframeAnimatoriOS 17phase-keyframe-animators.md
.scrollTransition, .visualEffectiOS 17visual-effects.md
Shaders: .colorEffect / .distortionEffect / .layerEffectiOS 17visual-effects.md
MeshGradientiOS 18visual-effects.md
TextRenderer / TextAttributeiOS 18visual-effects.md
.matchedTransitionSourceiOS 18transitions.md
.navigationTransition(.zoom) — push, sheet, fullScreenCoveriOS 18transitions.md
UIViewController.preferredTransition = .zoomiOS 18transitions.md
UIView.animate(_: Animation) / context.animateiOS 18transitions.md

Top 5 Mistakes — Quick Reference

#MistakeFixDetails
1spring(response:bounce:) — mixing parameter generationsUse either spring(response:dampingFraction:) (iOS 13) or spring(duration:bounce:) (iOS 17)core-animations.md
2.animation(.spring()) without value: parameterAlways pass value: — the no-value variant is deprecated (iOS 15)core-animations.md
3Wrong PhaseAnimator closure signaturePhaseAnimator(phases) { content, phase in } — not { phase in }phase-keyframe-animators.md
4Using matchedGeometryEffect for NavigationStack transitionsUse matchedTransitionSource + .navigationTransition(.zoom) on iOS 18+transitions.md
5Using withAnimation for SF Symbol effectsUse .symbolEffect() modifier insteadsymbol-effects.md

Review Checklist

When reviewing animation code, verify:

  • Reduce motion — animations respect AccessibilityMotionEffect or UIAccessibility.isReduceMotionEnabled; provide non-motion alternatives
  • Duration limits — no animation exceeds ~0.5s for UI feedback; longer only for decorative/ambient effects
  • Spring vs linear — springs for interactive/physical motion; linear/easeInOut only for opacity fades or progress indicators
  • No deprecated APIs.animation(.spring()) without value: is deprecated; .animation(nil) is replaced by withTransaction
  • Correct spring generation — parameter names match the same API generation (never mix response with bounce)
  • Completion handlers — using withAnimation(_:completionCriteria:_:completion:) (iOS 17+), not inventing .onAnimationCompleted
  • Transition scope.transition() only affects views inside if/switch controlled by state; not for views that are always present
  • Per-frame closures stay cheap — KeyframeAnimator content closures, visualEffect closures, TextRenderer.draw, and Animatable view bodies run every frame; no allocation, formatting, or layout math inside

Reference Files

FileContent
core-animations.mdwithAnimation, springs, completions, transactions + TransactionKey, timing curves, Animatable mechanics, fluid-interface principles (momentum projection, rubber-banding, hysteresis)
phase-keyframe-animators.mdPhaseAnimator, KeyframeAnimator, KeyframeTimeline, MapKit camera keyframes, custom animations
transitions.mdView transitions, custom Transition protocol, matched geometry, navigation/zoom transitions (SwiftUI + UIKit), interruptibility, UIKit↔SwiftUI bridging, gesture-driven springs
symbol-effects.mdSF Symbol effects, accessibility
visual-effects.mdscrollTransition, visualEffect, MeshGradient, TextRenderer, shader effects (colorEffect/distortionEffect/layerEffect), effect pipelines, semantic alignment guides

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Animation Patterns AI skill do?

SwiftUI animation patterns including springs, transitions, PhaseAnimator, KeyframeAnimator, SF Symbol effects, scroll-driven effects, mesh gradients, text renderers, and shader effects. Use when implementing, reviewing, or fixing animation or visual-effect code on iOS/macOS.

Why use Animation Patterns on TypingMind?

Because you install it once and use it with any model. Animation Patterns is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Animation Patterns in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/rshankras/claude-code-apple-skills/tree/main/skills/design/animation-patterns. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Animation Patterns?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Animation Patterns?

As many as you like. As long as a model supports skills, you can use Animation Patterns with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Animation Patterns AI skill free?

Yes. It is published on GitHub by rshankras under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇