haptics — скилл для Claude Code: тактильная отдача в iOS
Скилл для Claude Code помогает добавить тактильную отдачу для подтверждений, ошибок и действий пользователя в iOS-приложении. Работает с UIKit и Core Haptics.
MIT ★ 233 обновлён 2026-01-18
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineeringЧто делает haptics
Скилл подсказывает, когда использовать UIFeedbackGenerator, а когда создавать собственный паттерн через CHHapticEngine. В его рабочем процессе есть выбор уровня сложности, подготовка генератора вызовом prepare() и проверка уместности тактильного отклика. Для справки предусмотрены материалы по AHAP-паттернам и принципам дизайна.
Учитывайте ограничения iOS: UIFeedbackGenerator доступен с iOS 10, Core Haptics — с iOS 13, а для Core Haptics требуется iPhone 8 или новее. Проверить отдачу в Simulator нельзя, нужен физический iPhone. Скилл также напоминает сочетать тактильный сигнал со звуковым или визуальным и учитывать системную настройку isHapticFeedbackEnabled.
Какие задачи решает
- добавить тактильное подтверждение нажатия кнопки или переключателя
- подобрать отклик для покупки, удаления или изменения настроек
- создать собственный тактильный паттерн через Core Haptics
- разобраться, почему тактильный отклик не тестируется в Simulator
Примеры запросов агенту
- Добавь тактильное подтверждение для переключателя в моём iOS-приложении.
- Создай паттерн Core Haptics для уведомления об ошибке.
- Проверь, как обработать отключённую пользователем тактильную отдачу.
Как установить haptics
1Через маркетплейс плагинов
/plugin marketplace add johnrogers/claude-swift-engineering/plugin install swift-engineering@claude-swift-engineeringКоманда ставит плагин swift-engineering целиком, со всеми его скиллами
2Через Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill haptics -a claude-code3Вручную: положить файлы
~/.claude/skills/haptics/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/haptics/
1Через Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill haptics -a codex2Вручную: положить файлы
.agents/skills/haptics/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill haptics -a cursor2Вручную: положить файлы
.cursor/skills/haptics/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install johnrogers/claude-swift-engineering plugins/swift-engineering/skills/haptics2Вручную: положить файлы
.github/skills/haptics/SKILL.md1Через Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill haptics -a gemini-cli2Командой платформы
gemini skills install https://github.com/johnrogers/claude-swift-engineering --path plugins/swift-engineering/skills/hapticsВручную: положить файлы
.devin/skills/haptics/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о haptics
Как установить haptics в Claude Code?
В Claude Code сначала добавьте маркетплейс командой /plugin marketplace add johnrogers/claude-swift-engineering, затем установите плагин командой /plugin install swift-engineering@claude-swift-engineering.
Что делает скилл haptics?
Он помогает выбрать между простыми откликами UIFeedbackGenerator и пользовательскими паттернами Core Haptics. Также описывает подготовку генератора и принципы уместного применения тактильной отдачи.
Можно ли проверить тактильную отдачу в Simulator?
Нет, для проверки нужен физический iPhone. Core Haptics требует iOS 13 и iPhone 8 или новее.
Исходный текст
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