axiom-uikit-animation-debugging

charleswiltgen/axiom · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/charleswiltgen/axiom --skill axiom-uikit-animation-debugging
0 commentsdiscussion
summary

CAAnimation issues manifest as missing completion handlers, wrong timing, or jank under specific conditions. Core principle 90% of CAAnimation problems are CATransaction timing, layer state, or frame rate assumptions, not Core Animation bugs.

skill.md

UIKit Animation Debugging

Overview

CAAnimation issues manifest as missing completion handlers, wrong timing, or jank under specific conditions. Core principle 90% of CAAnimation problems are CATransaction timing, layer state, or frame rate assumptions, not Core Animation bugs.

Red Flags — Suspect CAAnimation Issue

If you see ANY of these, suspect animation logic not device behavior:

  • Completion handler fires on simulator but not device
  • Animation duration (0.5s) doesn't match visual duration (1.2s)
  • Spring animation looks correct on iPhone 15 Pro but janky on older devices
  • Gesture + animation together causes stuttering (fine separately)
  • [weak self] in completion handler and you're not sure why
  • FORBIDDEN Hardcoding duration/values to "match what actually happens"
    • This ships device-specific bugs to users on different hardware
    • Do not rationalize this as a "temporary fix" or "good enough"

Critical distinction Simulator often hides timing issues (60Hz only, no throttling). Real devices expose them (variable frame rate, CPU throttling, background pressure). MANDATORY: Test on real device (oldest supported model) before shipping.

Mandatory First Steps

ALWAYS run these FIRST (before changing code):

// 1. Check if completion is firing at all
animation.completion = { [weak self] finished in
    print("🔥 COMPLETION FIRED: finished=\(finished)")
    guard let self = self else {
        print("🔥 SELF WAS NIL")
        return
    }
    // original code
}

// 2. Check actual duration vs declared
let startTime = Date()
let anim = CABasicAnimation(keyPath: "position.x")
anim.duration = 0.5  // Declared
layer.add(anim, forKey: "test")

DispatchQueue.main.asyncAfter(deadline: .now() + 0.51) {
    print("Elapsed: \(Date().timeIntervalSince(startTime))")  // Actual
}

// 3. Check what animations are active
if let keys = layer.animationKeys() {
    print("Active animations: \(keys)")
    for key in keys {
        if let anim = layer.animation(forKey: key) {
            print("\(key): duration=\(anim.duration), removed=\(anim.isRemovedOnCompletion)")
        }
    }
}

// 4. Check layer state
print("Layer speed: \(layer.speed)")  // != 1.0 means timing is scaled
print("Layer timeOffset: \(layer.timeOffset)")  // != 0 means animation is offset

What this tells you

  • Completion print appears → Handler fires, issue is in callback code
  • Completion print missing → Handler not firing, check CATransaction/layer state
  • Elapsed time == declared → Duration is correct, visual jank is from frames
  • Elapsed time != declared → CATransaction wrapping is changing duration
  • layer.speed != 1.0 → Something is slowing animation
  • Active animations list is long → Multiple animations competing

MANDATORY INTERPRETATION

Before changing ANY code, you must identify which ONE diagnostic is the root cause:

  1. If completion fires but elapsed time != declared duration → Apply Pattern 2 (CATransaction)
  2. If completion doesn't fire AND isRemovedOnCompletion is true → Apply Pattern 3
  3. If completion fires but visual is janky → MUST profile with Instruments first
    • You cannot guess "it's probably frames" - prove it with data
    • Profile > Core Animation instrument shows frame drops with certainty
    • If you skip Instruments, you're guessing

If diagnostics are contradictory or unclear

  • STOP. Do NOT proceed to patterns yet
  • Add more print statements to narrow the cause
  • Ask: "The diagnostics show X and Y but Z doesn't match. What am I missing?"
  • Profile with Instruments > Core Animation if unsure

Decision Tree

CAAnimation problem?
├─ Completion handler never fires?
│  ├─ On simulator only?
│  │  └─ Simulator timing is different (60Hz). Test on real device.
│  ├─ On real device only?
│  │  ├─ Check: isRemovedOnCompletion and fillMode
│  │  ├─ Check: CATransaction wrapping
│  │  └─ Check: app goes to background during animation
│  └─ On both simulator and device?
│     ├─ Check: completion handler is set BEFORE adding animation
│     └─ Check: [weak self] is actually captured (not nil before completion)
├─ Duration mismatch (declared != visual)?
│  ├─ Is layer.speed != 1.0?
│  │  └─ Something scaled animation duration. Find and fix.
│  ├─ Is animation wrapped in CATransaction?
│  │  └─ CATransaction.setAnimationDuration() overrides animation.duration
│  └─ Is visual duration LONGER than declared?
│     └─ Simulator (60Hz) vs device frame rate (120Hz). Recalculate for real hardware.
├─ Spring physics wrong on device?
│  ├─ Are values hardcoded for one device?
│  │  └─ Use device performance class, not model
│  ├─ Are damping/stiffness values swapped with mass/stiffness?
│  │  └─ Check CASpringAnimation parameter meanings
│  └─ Does it work on simulator but not device?
│     └─ Simulator uses 60Hz. Device may use 120Hz. Recalculate.
└─ Gesture + animation jank?
   ├─ Are animations competing (same keyPath)?
   │  └─ Remove old animation before adding new
   ├─ Is gesture updating layer while animation runs?
   │  └─ Use CADisplayLink for synchronized updates
   └─ Is gesture blocking the main thread?
      └─ Profile with Instruments > Core Animation

Common Patterns

Pattern Selection Rules (MANDATORY)

Apply ONE pattern at a time, in this order

  1. Always start with Pattern 1 (Completion Handler Basics)

    • If completion NEVER fires → Pattern 1
    • Verify completion is set BEFORE add() with print statement (line 33)
    • Only proceed to Pattern 2 if completion FIRES but timing is wrong
  2. Then Pattern 2 (CATransaction duration mismatch)

    • Only if completion fires but elapsed time != declared duration
    • Check logs from Mandatory First Steps (line 40-47)
  3. Then Pattern 3 (isRemovedOnCompletion)

    • Only if animation completes but visual state reverts
  4. Patterns 4-7 Apply based on specific symptom (see Decision Tree line 91+)

FORBIDDEN

  • ❌ Applying multiple patterns at once ("let me try Pattern 2 AND Pattern 4 together")
  • ❌ Skipping Pattern 1 because "I already know it's not that"
  • ❌ Combining patterns without understanding why each is needed
  • ❌ Trying patterns randomly and hoping one works

Pattern 1: Completion Handler Basics

❌ WRONG (Handler set AFTER adding animation)

layer.add(animation, forKey: "myAnimation")
animation.completion = { finished in  // ❌ Too late!
    print("Done")
}

✅ CORRECT (Handler set BEFORE adding)

animation.completion = { [weak self] finished in
    print("🔥 Animation finished: \(finished)")
    guard let self = self else { return }
    self.doNextStep()
}
layer.add(animation, forKey: "myAnimation")

Why Completion handler must be set before animation is added to layer. Setting after does nothing.


Pattern 2: CATransaction vs animation.duration

❌ WRONG (CATransaction overrides animation duration)

CATransaction.begin()
CATransaction.setAnimationDuration(2.0)  // ❌ Overrides all animations!
let anim = CABasicAnimation(keyPath: "position")
anim.duration = 0.5  // This is ignored
layer.add(anim, forKey: nil)
CATransaction.commit()  // Animation takes 2.0 seconds, not 0.5

✅ CORRECT (Set duration on animation, not transaction)

let anim = CABasicAnimation(keyPath: "position")
anim.duration = 0.5
layer.add(anim, forKey: nil)
// No CATransaction wrapping

Why CATransaction.setAnimationDuration() affects ALL animations in the transaction block. Use it only if you want to change all animations uniformly.


Pattern 3: isRemovedOnCompletion & fillMode

❌ WRONG (Animation disappears after completion)

let anim = CABasicAnimation(keyPath: "opacity")
anim.fromValue = 1.0
anim.toValue = 0.0
anim.duration = 0.5
layer.add(anim, forKey: nil)
how to use axiom-uikit-animation-debugging

How to use axiom-uikit-animation-debugging on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add axiom-uikit-animation-debugging
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/charleswiltgen/axiom --skill axiom-uikit-animation-debugging

The skills CLI fetches axiom-uikit-animation-debugging from GitHub repository charleswiltgen/axiom and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/axiom-uikit-animation-debugging

Reload or restart Cursor to activate axiom-uikit-animation-debugging. Access the skill through slash commands (e.g., /axiom-uikit-animation-debugging) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.640 reviews
  • Maya Tandon· Dec 20, 2024

    axiom-uikit-animation-debugging is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Dev Harris· Dec 12, 2024

    I recommend axiom-uikit-animation-debugging for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Rahul Santra· Nov 15, 2024

    axiom-uikit-animation-debugging is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Arya Smith· Nov 3, 2024

    axiom-uikit-animation-debugging reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Arya Martinez· Oct 22, 2024

    Registry listing for axiom-uikit-animation-debugging matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Pratham Ware· Oct 6, 2024

    Keeps context tight: axiom-uikit-animation-debugging is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Fatima Gill· Sep 13, 2024

    axiom-uikit-animation-debugging fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Sakshi Patil· Sep 5, 2024

    Registry listing for axiom-uikit-animation-debugging matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Ama Taylor· Sep 5, 2024

    Solid pick for teams standardizing on skills: axiom-uikit-animation-debugging is focused, and the summary matches what you get after install.

  • Noah Ramirez· Sep 5, 2024

    Registry listing for axiom-uikit-animation-debugging matched our evaluation — installs cleanly and behaves as described in the markdown.

showing 1-10 of 40

1 / 4