Agent skill
ios-animation-code-review
Reviews iOS animation code for correctness, performance, accessibility, and Apple API best practices. Use when reviewing .swift files containing animation code — withAnimation, .animation(), PhaseAnimator, KeyframeAnimator, matchedGeometryEffect, navigationTransition, CABasicAnimation, CASpringAnimation, UIViewPropertyAnimator, UIDynamicAnimator, symbolEffect, scrollTransition, contentTransition, or custom Transition conformances.
Install this agent skill to your Project
npx add-skill https://github.com/existential-birds/beagle/tree/main/plugins/beagle-ios/skills/ios-animation-code-review
SKILL.md
iOS Animation Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| Spring parameters, withAnimation misuse, phase/keyframe bugs | references/swiftui-animation-patterns.md |
| Frame drops, offscreen rendering, main thread blocking | references/performance.md |
| Reduce Motion, VoiceOver, motion sensitivity | references/accessibility.md |
| Transition protocol, matchedGeometryEffect, navigation transitions | references/transitions.md |
Output Format
Report each finding as:
[FILE:LINE] ISSUE_TITLE
Example: [AnimatedCard.swift:42] Missing Reduce Motion fallback for spring animation
All details, code suggestions, and rationale follow after the header line.
Review Checklist
-
@Environment(\.accessibilityReduceMotion)checked — animations have Reduce Motion fallback - Animation is not the sole feedback channel — important state changes pair with haptics (
.sensoryFeedback) or audio - Custom animation isn't duplicating system-provided motion (standard nav transitions, sheet presentation, SF Symbol effects)
- Animations on frequent interactions are brief and unobtrusive — or absent (system handles it)
- All animations are interruptible — user is never forced to wait for completion before interacting
- Spring animations use
duration/bounceparameters (not raw mass/stiffness/damping unless UIKit/CA) - No deprecated
.animation()withoutvalue:parameter -
withAnimationwraps state changes, not view declarations -
matchedGeometryEffectIDs are stable and unique within the namespace -
geometryGroup()used when parent geometry animates with child views appearing - Looping animations (
PhaseAnimator,symbolEffect) have finite phases or appropriate trigger - No
CATransaction.setAnimationDuration()in UIView-backed layers (use UIView.animate instead) - Interactive animations handle interruption (re-trigger mid-flight doesn't break state)
- Shadow animations provide explicit
shadowPath(avoids per-frame recalculation) - Gesture-driven animations preserve velocity on release for natural completion
- Gesture-driven feedback follows spatial expectations (dismiss direction matches reveal direction)
- No animation of
.id()modifier (destroys view identity — usetransitionormatchedGeometryEffectinstead)
When to Load References
- Incorrect spring setup or
withAnimationscope issues → swiftui-animation-patterns.md - Hitches, dropped frames, or expensive animations in scroll views → performance.md
- Missing Reduce Motion handling or motion accessibility → accessibility.md
matchedGeometryEffectglitches or customTransitionbugs → transitions.md
Review Questions
- Does every animation have a Reduce Motion fallback that preserves the information conveyed? Is animation the only feedback channel, or are haptics/audio supplementing it?
- Is this custom animation necessary, or does the system already provide it (standard transitions, SF Symbol effects, Liquid Glass)?
- Could this animation cause frame drops — is it animating expensive properties (blur, shadow without path, mask) in a list or scroll view?
- Are all animations interruptible? Can the user act without waiting for completion? Does gesture-driven feedback follow spatial expectations?
- Is
withAnimationscoped to the minimal state change needed, or is it wrapping unrelated mutations? - For
matchedGeometryEffect— are source and destination using the same ID and namespace, and is only one visible at a time?
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
review-python
Comprehensive Python/FastAPI backend code review with optional parallel agents
review-verification-protocol
Mandatory verification steps for all code reviews to reduce false positives. Load this skill before reporting ANY code review findings.
sqlalchemy-code-review
Reviews SQLAlchemy code for session management, relationships, N+1 queries, and migration patterns. Use when reviewing SQLAlchemy 2.0 code, checking session lifecycle, relationship() usage, or Alembic migrations.
fastapi-code-review
Reviews FastAPI code for routing patterns, dependency injection, validation, and async handlers. Use when reviewing FastAPI apps, checking APIRouter setup, Depends() usage, or response models.
pytest-code-review
Reviews pytest test code for async patterns, fixtures, parametrize, and mocking. Use when reviewing test_*.py files, checking async test functions, fixture usage, or mock patterns.
postgres-code-review
Reviews PostgreSQL code for indexing strategies, JSONB operations, connection pooling, and transaction safety. Use when reviewing SQL queries, database schemas, JSONB usage, or connection management.
Didn't find tool you were looking for?