[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72Y0BAWPMZF47CPTV64KHXG":3,"skill-same:01M72Y0BAWPMZF47CPTV64KHXG":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M72Y0BAWPMZF47CPTV64KHXG","gestures",null,"Build drag, swipe, and sheet interactions that track the finger 1:1 and stay interruptible. Use when building or fixing anything the user drags, swipes, flings, holds, or dismisses with a gesture — drawers, sheets, swipe-to-dismiss toasts and cards, drag-to-reorder, pull-to-refresh, hold-to-confirm — or when a gesture feels laggy, disconnected from the finger, jumps on release, or can't be caught mid-animation. Triggers on — gesture, drag, draggable, swipe, swipe to dismiss, fling, momentum, velocity, drawer, sheet, bottom sheet, snap points, Vaul, dragConstraints, dragElastic, dragMomentum, onDragEnd, whileDrag, useMotionValue, rubber-band, overscroll, pull to refresh, hold to delete, press and hold, touch-action, dismiss threshold, \"doesn't follow my finger\", \"jumps when I let go\", \"can't grab it mid-animation\".","h00mankind\u002Fworkflow","h00mankind","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F105175148?v=4","01M72XXA2JP2H3BBK5GP9AP4P6","h00man","01M72XXA3824K52XFYWJDBFJ06",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fh00mankind\u002Fworkflow\u002Fblob\u002Fmain\u002Fplugins\u002Femil\u002Fskills\u002Fgestures\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: gestures\ndescription: Build drag, swipe, and sheet interactions that track the finger 1:1 and stay interruptible. Use when building or fixing anything the user drags, swipes, flings, holds, or dismisses with a gesture — drawers, sheets, swipe-to-dismiss toasts and cards, drag-to-reorder, pull-to-refresh, hold-to-confirm — or when a gesture feels laggy, disconnected from the finger, jumps on release, or can't be caught mid-animation. Triggers on — gesture, drag, draggable, swipe, swipe to dismiss, fling, momentum, velocity, drawer, sheet, bottom sheet, snap points, Vaul, dragConstraints, dragElastic, dragMomentum, onDragEnd, whileDrag, useMotionValue, rubber-band, overscroll, pull to refresh, hold to delete, press and hold, touch-action, dismiss threshold, \"doesn't follow my finger\", \"jumps when I let go\", \"can't grab it mid-animation\".\n---\n\n# Gesture-Driven UI\n\nHow to build gestures that feel physical. A gesture is direct manipulation: while the finger is down, the UI is the finger; the moment it lifts, physics takes over. Every rule below follows from that split.\n\n## First decision: build it, or use a solution that exists?\n\nDoing a drawer gesture *right* means momentum-based dragging, overlay opacity matched to drag progress, velocity-aware dismissal, focus trapping, and Escape-to-close. That is weeks of edge cases, not an afternoon. **For a bottom sheet \u002F drawer, default to [Vaul](https:\u002F\u002Fvaul.emilkowal.ski\u002F)** — it exists precisely because this is hard to hand-roll. Build the gesture yourself only when no library covers the interaction (custom swipe cards, bespoke drag interactions). Use the `pick-ui-library` skill when unsure.\n\n## The two phases of every gesture\n\nWalk this split for any gesture you build. Mixing the phases up is the #1 cause of gestures that feel wrong.\n\n```\nIs the pointer currently down?\n├── Yes → TRACK phase: position maps 1:1 to the pointer.\n│         No easing. No duration. No spring. The element IS the finger.\n└── No  → RELEASE phase: physics finishes the motion.\n          A spring seeded with the release velocity. Never a keyframe.\n```\n\n### Track phase rules\n\n- **1:1 means 1:1.** Drive position from a `useMotionValue` (or direct `transform` writes), never a spring or a transition — a spring during tracking makes the element trail the finger and feel disconnected, like dragging something through syrup.\n- **Write `transform` directly on the dragged element.** Never update a CSS variable on a parent to move children: CSS variables are inheritable, so every change recalculates styles for all descendants. This exact bug made Vaul's drag laggy past ~20 list items; setting `transform` on the element fixed it.\n- **No React state per move event.** A re-render every pointermove drops frames. Motion values and direct style writes bypass the render cycle.\n- **Rubber-band at the edges.** Dragging past a boundary should move the element a fraction of the distance (Motion: `dragElastic` ≈ 0.2), not stop dead — hard stops feel like hitting a wall; resistance communicates \"there's nothing further\" physically.\n\n### Release phase rules\n\n- **Finish with a spring, seeded with the gesture's velocity.** The element should leave the finger at the speed it was moving. A fixed-duration ease here makes every fling land identically, which reads as fake.\n- **Dismiss on distance OR velocity.** Passing a distance threshold (~40–50% of travel) dismisses, but so does a fast flick over a short distance. In Motion, read both from `onDragEnd`'s `info.offset` and `info.velocity`. Distance-only thresholds make flicks feel ignored.\n- **Bounce belongs only at the end of a drag.** A drag applies force — like throwing a ball at a wall — so a slight bounce on release feels physical. The same element closed by a button press gets **zero** bounce: no force was applied. Keep the value small, and remember bounce scales inversely with element size (smaller elements need more bounce to read the same).\n- **Snap-back is fast.** If the gesture doesn't pass the threshold, return quickly with the spring — a slow snap-back feels like the UI is disagreeing with the user in slow motion.\n\n## Interruptibility is non-negotiable\n\nThe user must be able to catch a sheet mid-close and drag it back. Springs allow this: when retargeted mid-flight they keep their current velocity, so the redirect is seamless. CSS `@keyframes` restart from zero and cannot be caught — this is why Sonner's early CSS enter animation made toasts jump when a second toast arrived. **Never use a keyframe animation on anything a gesture can touch.** CSS transitions and springs only.\n\n## Linked values\n\nThe dragged element is rarely alone — an overlay fades, the page behind scales. Derive these from drag progress, don't animate them separately:\n\n```jsx\nconst y = useMotionValue(0);\nconst overlayOpacity = useTransform(y, [0, drawerHeight], [1, 0]);\n```\n\nOne source of truth means the overlay is always exactly as faded as the drawer is dismissed — including mid-gesture, including when the user reverses. Two separate animations drift apart the moment a gesture is interrupted.\n\n## Motion drag props\n\n```jsx\n\u003Cmotion.div\n  drag=\"y\"\n  dragConstraints={{ top: 0 }}\n  dragElastic={0.2}\n  onDragEnd={(e, info) => {\n    if (info.offset.y > threshold || info.velocity.y > 500) dismiss();\n  }}\n\u002F>\n```\n\n`dragMomentum` is on by default — right for a flung card, wrong for a simple reposition; disable it when the element should stop where the finger stops. `dragConstraints` takes a ref or bounds object.\n\n## Sheets without springs: the Vaul curve\n\nVaul mimics the iOS sheet with pure CSS to stay small: `cubic-bezier(0.32, 0.72, 0, 1)` over **500ms**. The curve is extremely steep at the start — that's what lets a 500ms duration still feel snappy while landing with a spring-like gentle settle. Two rules from it:\n\n- A **small floating drawer** (not touching the screen edge) should override to ~200ms — the 500ms iOS timing only reads right on a full-width edge-attached sheet:\n  ```css\n  [vaul-drawer]  { transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1); }\n  [vaul-overlay] { transition: opacity  0.2s cubic-bezier(0.165, 0.84, 0.44, 1); }\n  ```\n- **The component must feel like a single entity.** If the drawer opens in 200ms, its height changes and content crossfades must live in the same timing family — one slow sub-animation makes the whole thing feel broken.\n\nMark interactive children with `data-vaul-no-drag` so pressing a button inside the drawer doesn't start a drag.\n\n## Spatial consistency\n\n**An element dismisses in the direction it entered.** Sonner's toast slides up from the bottom, so swipe-down dismisses it — enter and exit share one axis, which is what makes the gesture feel discoverable and intuitive without instruction. A gesture that dismisses along an axis the element never moved on has to be learned; one that reverses the entrance is *felt*.\n\n## Hold gestures are asymmetric\n\nHold-to-delete and similar press-and-hold interactions use **`linear`** during the hold — the animation visualizes time passing, and time passes linearly; any other curve lies about how long is left. On release before completion, snap back fast with `ease-out`. The deliberate phase is slow and honest; the cancel is instant. Symmetric timing here is a bug.\n\n## Touch checklist\n\nRun through this for every gesture you ship:\n\n- **Test on a real phone** — hit the dev server by local IP. Trackpad simulation lies about touch, and a 60Hz desktop monitor hides opacity-transition roughness that a 120Hz phone shows.\n- **Hit targets ≥ 44×44px.** Enlarge small visual targets with an invisible `::before` hitbox instead of growing the layout.\n- **`touch-action`** on the drag axis (`touch-action: pan-x` for a vertical drag, etc.) so the browser doesn't fight the gesture with native scrolling.\n- **Gate hover effects** behind `@media (hover: hover) and (pointer: fine)` — touch fires phantom hovers on tap.\n\n## Reduced motion\n\nTracking is direct manipulation — the user is producing the motion — so it stays. What reduces: momentum flings, bounce, and any decorative motion around the gesture. On release under `prefers-reduced-motion`, settle with a short opacity\u002Fposition change instead of a bouncy spring. See the `animation-accessibility` skill for the full two-variant workflow.\n\n## When it still feels wrong\n\nA \"weird\" spring is usually fixed by increasing `damping`. A gesture that stutters is a performance problem — check the track-phase rules above first, then use the `animation-performance` skill. To diagnose a feeling you can't name, use the `debug-animation` skill: record the gesture and scrub it frame by frame.\n","# Gesture-Driven UI\n\nHow to build gestures that feel physical. A gesture is direct manipulation: while the finger is down, the UI is the finger; the moment it lifts, physics takes over. Every rule below follows from that split.\n\n## First decision: build it, or use a solution that exists?\n\nDoing a drawer gesture *right* means momentum-based dragging, overlay opacity matched to drag progress, velocity-aware dismissal, focus trapping, and Escape-to-close. That is weeks of edge cases, not an afternoon. **For a bottom sheet \u002F drawer, default to [Vaul](https:\u002F\u002Fvaul.emilkowal.ski\u002F)** — it exists precisely because this is hard to hand-roll. Build the gesture yourself only when no library covers the interaction (custom swipe cards, bespoke drag interactions). Use the `pick-ui-library` skill when unsure.\n\n## The two phases of every gesture\n\nWalk this split for any gesture you build. Mixing the phases up is the #1 cause of gestures that feel wrong.\n\n```\nIs the pointer currently down?\n├── Yes → TRACK phase: position maps 1:1 to the pointer.\n│         No easing. No duration. No spring. The element IS the finger.\n└── No  → RELEASE phase: physics finishes the motion.\n          A spring seeded with the release velocity. Never a keyframe.\n```\n\n### Track phase rules\n\n- **1:1 means 1:1.** Drive position from a `useMotionValue` (or direct `transform` writes), never a spring or a transition — a spring during tracking makes the element trail the finger and feel disconnected, like dragging something through syrup.\n- **Write `transform` directly on the dragged element.** Never update a CSS variable on a parent to move children: CSS variables are inheritable, so every change recalculates styles for all descendants. This exact bug made Vaul's drag laggy past ~20 list items; setting `transform` on the element fixed it.\n- **No React state per move event.** A re-render every pointermove drops frames. Motion values and direct style writes bypass the render cycle.\n- **Rubber-band at the edges.** Dragging past a boundary should move the element a fraction of the distance (Motion: `dragElastic` ≈ 0.2), not stop dead — hard stops feel like hitting a wall; resistance communicates \"there's nothing further\" physically.\n\n### Release phase rules\n\n- **Finish with a spring, seeded with the gesture's velocity.** The element should leave the finger at the speed it was moving. A fixed-duration ease here makes every fling land identically, which reads as fake.\n- **Dismiss on distance OR velocity.** Passing a distance threshold (~40–50% of travel) dismisses, but so does a fast flick over a short distance. In Motion, read both from `onDragEnd`'s `info.offset` and `info.velocity`. Distance-only thresholds make flicks feel ignored.\n- **Bounce belongs only at the end of a drag.** A drag applies force — like throwing a ball at a wall — so a slight bounce on release feels physical. The same element closed by a button press gets **zero** bounce: no force was applied. Keep the value small, and remember bounce scales inversely with element size (smaller elements need more bounce to read the same).\n- **Snap-back is fast.** If the gesture doesn't pass the threshold, return quickly with the spring — a slow snap-back feels like the UI is disagreeing with the user in slow motion.\n\n## Interruptibility is non-negotiable\n\nThe user must be able to catch a sheet mid-close and drag it back. Springs allow this: when retargeted mid-flight they keep their current velocity, so the redirect is seamless. CSS `@keyframes` restart from zero and cannot be caught — this is why Sonner's early CSS enter animation made toasts jump when a second toast arrived. **Never use a keyframe animation on anything a gesture can touch.** CSS transitions and springs only.\n\n## Linked values\n\nThe dragged element is rarely alone — an overlay fades, the page behind scales. Derive these from drag progress, don't animate them separately:\n\n```jsx\nconst y = useMotionValue(0);\nconst overlayOpacity = useTransform(y, [0, drawerHeight], [1, 0]);\n```\n\nOne source of truth means the overlay is always exactly as faded as the drawer is dismissed — including mid-gesture, including when the user reverses. Two separate animations drift apart the moment a gesture is interrupted.\n\n## Motion drag props\n\n```jsx\n\u003Cmotion.div\n  drag=\"y\"\n  dragConstraints={{ top: 0 }}\n  dragElastic={0.2}\n  onDragEnd={(e, info) => {\n    if (info.offset.y > threshold || info.velocity.y > 500) dismiss();\n  }}\n\u002F>\n```\n\n`dragMomentum` is on by default — right for a flung card, wrong for a simple reposition; disable it when the element should stop where the finger stops. `dragConstraints` takes a ref or bounds object.\n\n## Sheets without springs: the Vaul curve\n\nVaul mimics the iOS sheet with pure CSS to stay small: `cubic-bezier(0.32, 0.72, 0, 1)` over **500ms**. The curve is extremely steep at the start — that's what lets a 500ms duration still feel snappy while landing with a spring-like gentle settle. Two rules from it:\n\n- A **small floating drawer** (not touching the screen edge) should override to ~200ms — the 500ms iOS timing only reads right on a full-width edge-attached sheet:\n  ```css\n  [vaul-drawer]  { transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1); }\n  [vaul-overlay] { transition: opacity  0.2s cubic-bezier(0.165, 0.84, 0.44, 1); }\n  ```\n- **The component must feel like a single entity.** If the drawer opens in 200ms, its height changes and content crossfades must live in the same timing family — one slow sub-animation makes the whole thing feel broken.\n\nMark interactive children with `data-vaul-no-drag` so pressing a button inside the drawer doesn't start a drag.\n\n## Spatial consistency\n\n**An element dismisses in the direction it entered.** Sonner's toast slides up from the bottom, so swipe-down dismisses it — enter and exit share one axis, which is what makes the gesture feel discoverable and intuitive without instruction. A gesture that dismisses along an axis the element never moved on has to be learned; one that reverses the entrance is *felt*.\n\n## Hold gestures are asymmetric\n\nHold-to-delete and similar press-and-hold interactions use **`linear`** during the hold — the animation visualizes time passing, and time passes linearly; any other curve lies about how long is left. On release before completion, snap back fast with `ease-out`. The deliberate phase is slow and honest; the cancel is instant. Symmetric timing here is a bug.\n\n## Touch checklist\n\nRun through this for every gesture you ship:\n\n- **Test on a real phone** — hit the dev server by local IP. Trackpad simulation lies about touch, and a 60Hz desktop monitor hides opacity-transition roughness that a 120Hz phone shows.\n- **Hit targets ≥ 44×44px.** Enlarge small visual targets with an invisible `::before` hitbox instead of growing the layout.\n- **`touch-action`** on the drag axis (`touch-action: pan-x` for a vertical drag, etc.) so the browser doesn't fight the gesture with native scrolling.\n- **Gate hover effects** behind `@media (hover: hover) and (pointer: fine)` — touch fires phantom hovers on tap.\n\n## Reduced motion\n\nTracking is direct manipulation — the user is producing the motion — so it stays. What reduces: momentum flings, bounce, and any decorative motion around the gesture. On release under `prefers-reduced-motion`, settle with a short opacity\u002Fposition change instead of a bouncy spring. See the `animation-accessibility` skill for the full two-variant workflow.\n\n## When it still feels wrong\n\nA \"weird\" spring is usually fixed by increasing `damping`. A gesture that stutters is a performance problem — check the track-phase rules above first, then use the `animation-performance` skill. To diagnose a feeling you can't name, use the `debug-animation` skill: record the gesture and scrub it frame by frame.\n",{"name":5,"description":7},"main","2b813251957e3e80c45cc5f55bf9c228d818d05b","plugins\u002Femil\u002Fskills\u002Fgestures","https:\u002F\u002Fgithub.com\u002Fh00mankind\u002Fworkflow","https:\u002F\u002Fgithub.com\u002Fh00mankind","an ordinary mortal h00man","2026-11-13 01:29:34",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add h00mankind\u002Fworkflow --skill gestures",{"tool":37,"command":38},"bunx","bunx skills add h00mankind\u002Fworkflow --skill gestures",{"tool":40,"command":41},"pnpm","pnpm dlx skills add h00mankind\u002Fworkflow --skill gestures","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fh00mankind\u002Fworkflow\u002Fblob\u002Fmain\u002Fplugins\u002Femil\u002Fskills\u002Fgestures\u002FSKILL.md",true,[],[46,54,61,69,76,83],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":53},"01M78R7TT830V3BYFNDX1EHF0V","teach","Teach the user a subject, in explain mode (one plain account of code, a change, or a concept, in chat) or course mode (a learning workspace with a mission, lessons, and records over many sessions). Runs only when the user types \u002Fteach.","https:\u002F\u002Fgithub.com\u002Fh00mankind\u002Fworkflow\u002Fblob\u002Fmain\u002Fplugins\u002Fh00man\u002Fskills\u002Fteach\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":53},"01M78R7RSGFF5TFE0JBGY3WKEJ","council","Get a review or a second opinion on existing work from several strong models of different providers. Runs only when the user types \u002Fcouncil.","https:\u002F\u002Fgithub.com\u002Fh00mankind\u002Fworkflow\u002Fblob\u002Fmain\u002Fplugins\u002Fh00man\u002Fskills\u002Fcouncil\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":68},"01M74AAVCZZREXPZEE5HRN5WF5","variant","Builds multiple variants of a component you're working on and helps you iterate and pick one.","https:\u002F\u002Fgithub.com\u002Fh00mankind\u002Fworkflow\u002Fblob\u002Fmain\u002Fplugins\u002Fjakub\u002Fskills\u002Fvariant\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":68},"01M74AAR3M07M86YX2CXPD79EX","teardown","Creates technical illustrations of physical objects and of how things work, such as display pixels or interface layers, with coherent views, fine linework and part fills.","https:\u002F\u002Fgithub.com\u002Fh00mankind\u002Fworkflow\u002Fblob\u002Fmain\u002Fplugins\u002Fjakub\u002Fskills\u002Fteardown\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":68},"01M74AAMKJ8MKP9M99K37A82ZM","state-machine","Renders every state of a component you choose on a throwaway page, with mock data and a switcher, so you can work on each state.","https:\u002F\u002Fgithub.com\u002Fh00mankind\u002Fworkflow\u002Fblob\u002Fmain\u002Fplugins\u002Fjakub\u002Fskills\u002Fstate-machine\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":68},"01M74AAHF2A498F7F2E74696KF","interface-review","Reviews a branch, pull request or uncommitted change for the interface problems it introduced or regressed, across accessibility, layout, writing, typography, color and UI.","https:\u002F\u002Fgithub.com\u002Fh00mankind\u002Fworkflow\u002Fblob\u002Fmain\u002Fplugins\u002Fjakub\u002Fskills\u002Finterface-review\u002FSKILL.md",[],[]]