Skip to main content
skill CX Codex

haptics — Claude Code skill for iOS tactile feedback

Add tactile responses for confirmations, errors, and custom patterns in an iOS app. The skill helps choose between UIKit feedback generators and Core Haptics.

MIT ★ 233 updated 2026-01-18

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineering
Open on GitHub

What haptics does

The skill guides the choice between UIFeedbackGenerator for common feedback and CHHapticEngine for custom patterns. Its workflow covers selecting the approach, preparing the generator with prepare(), and checking whether a haptic response fits the interaction. Reference material also covers AHAP patterns and design principles.

There are platform limits to plan for: UIFeedbackGenerator works from iOS 10, while Core Haptics needs iOS 13 and an iPhone 8 or newer. The Simulator cannot test haptics; use a physical iPhone. The skill also advises pairing tactile responses with audio or visuals and checking isHapticFeedbackEnabled before triggering feedback.

What it helps with

  • add tactile confirmation to a button or toggle
  • choose feedback for a purchase, deletion, or settings change
  • build a custom pattern with Core Haptics
  • check why haptics cannot be tested in the Simulator

Example prompts for the agent

  • Add tactile feedback when a user switches this setting on or off.
  • Create a Core Haptics pattern for an error notification.
  • Check how the app should respond when haptic feedback is disabled.

How to install haptics

1Plugin marketplace

/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineering

This installs the whole swift-engineering plugin with all its skills

2Skills CLI (Vercel)

npx skills add johnrogers/claude-swift-engineering --skill haptics -a claude-code

3Manually: put the files in place

~/.claude/skills/haptics/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/haptics/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about haptics

How do I install haptics in Claude Code?

First add the marketplace with /plugin marketplace add johnrogers/claude-swift-engineering. Then install the plugin with /plugin install swift-engineering@claude-swift-engineering.

What does the haptics skill do?

It helps choose between UIFeedbackGenerator and custom Core Haptics patterns. It also covers preparing feedback and applying haptics to meaningful interactions.

Can I test haptics in the Simulator?

No. Haptics require a physical iPhone for testing. Core Haptics also requires iOS 13 and an iPhone 8 or newer.

Source text

SKILL.md · MIT
---
name: haptics
description: Use when adding haptic feedback for user confirmations (button presses, toggles, purchases), error notifications, or custom tactile patterns (Core Haptics). Covers UIFeedbackGenerator and CHHapticEngine patterns.
---

# Haptics

Haptic feedback provides tactile confirmation of user actions and system events. When designed thoughtfully, haptics transform interfaces from functional to delightful.

## Overview

Haptics should enhance interactions, not dominate them. The core principle: haptic feedback is like sound design—every haptic should have purpose (confirmation, error, warning), timing (immediate or delayed), and restraint (less is more).

## Reference Loading Guide

**ALWAYS load reference files if there is even a small chance the content may be required.** It's better to have the context than to miss a pattern or make a mistake.

| Reference | Load When |
|-----------|-----------|
| **[UIFeedbackGenerator](references/uifeedbackgenerator.md)** | Using simple impact/selection/notification haptics |
| **[Core Haptics](references/core-haptics.md)** | Creating custom patterns with CHHapticEngine |
| **[AHAP Patterns](references/ahap-patterns.md)** | Working with Apple Haptic Audio Pattern files |
| **[Design Principles](references/design-principles.md)** | Applying Causality, Harmony, Utility framework |

## Core Workflow

1. **Choose complexity level**: Simple (UIFeedbackGenerator) vs Custom (Core Haptics)
2. **For simple haptics**: Use UIImpactFeedbackGenerator, UISelectionFeedbackGenerator, or UINotificationFeedbackGenerator
3. **For custom patterns**: Create CHHapticEngine, define CHHapticEvents, build CHHapticPattern
4. **Prepare before triggering**: Call `prepare()` to reduce latency
5. **Apply design principles**: Ensure Causality (timing), Harmony (multimodal), Utility (meaningful)

## System Requirements

- **iOS 10+** for UIFeedbackGenerator
- **iOS 13+** for Core Haptics (CHHapticEngine)
- **iPhone 8+** for Core Haptics hardware support
- **Physical device required** - haptics cannot be tested in Simulator

## Common Mistakes

1. **Haptic feedback on every action** — Every button doesn't need haptics. Reserve haptics for critical confirmations (purchase, delete, settings change). Over-haptics are annoying and drain battery.

2. **Triggering haptics on main thread blocks** — Long haptic patterns can freeze UI briefly. Use background threads or async for Core Haptics `prepare()` calls to prevent jank.

3. **Haptic without audio/visual feedback** — Relying ONLY on haptics means deaf or deaf-blind users miss feedback. Always pair haptics with sound or visual response.

4. **Ignoring haptic settings** — Some users disable haptics system-wide. Check `UIFeedbackGenerator.isHapticFeedbackEnabled` before triggering. Graceful degradation is required.

5. **AHAP file errors silently** — Invalid AHAP files fail silently without errors. Test with Xcode's haptic designer and validate file syntax before shipping.

6. **Forgetting battery impact** — Continuous haptic patterns (progress bars, loading states) drain battery fast. Use haptics for state changes only, not ongoing feedback.

© John Rogers (@johnrogers) · MIT · johnrogers/claude-swift-engineering

Similar skills

All skills for Mobile →

From the same set33

The whole set →
grdb Guides Claude Code in writing direct SQLite queries, schema migrations, and reactive observations with GRDB.swift on iOS and macOS. CX Codex +1 ★ 233repo stars swift-diagnostics The swift-diagnostics skill guides investigations into navigation, build, and memory issues in iOS and macOS projects. Use it to follow diagnostic checks before changing code. CX Codex +1 ★ 233repo stars localization Walks the agent through iOS localization: String Catalogs, plural forms, locale-aware formats and right-to-left layout. CX Codex +1 ★ 233repo stars swiftui-advanced swiftui-advanced — a Claude Code skill providing advanced SwiftUI workflows for multi-gesture composition, layout adaptation, architecture choice, and profiling. CX Codex +1 ★ 233repo stars storekit Walks an agent through StoreKit 2 purchases: the .storekit config, a StoreManager, transaction verification and SwiftUI product views. CX Codex +1 ★ 233repo stars swift-code-reviewer swift-code-reviewer inspects Swift and iOS implementations for concurrency safety, HIG rules, TCA patterns, and security before testing. CX Codex ★ 233repo stars ios-26-platform The ios-26-platform skill guides iOS 26 feature work in SwiftUI and helps preserve support for iOS 17/18. Use it when updating an interface or handling backward compatibility. CX Codex +1 ★ 233repo stars swiftui-specialist swiftui-specialist builds SwiftUI screens that follow Apple HIG once the core logic and TCA layer are already in place. CX Codex ★ 233repo stars

Project sponsors

Companies that keep this analytics open