@skilly-hand/skilly-hand 0.26.1 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +2 -0
- package/catalog/README.md +2 -1
- package/catalog/catalog-index.json +1 -0
- package/catalog/skills/frontend-design/SKILL.md +8 -6
- package/catalog/skills/frontend-design/agents/motion-designer.md +22 -5
- package/catalog/skills/frontend-design/manifest.json +4 -4
- package/catalog/skills/motion-animation/SKILL.md +148 -0
- package/catalog/skills/motion-animation/manifest.json +28 -0
- package/catalog/skills/motion-animation/references/js-patterns.md +81 -0
- package/catalog/skills/motion-animation/references/official-source-map.md +32 -0
- package/catalog/skills/motion-animation/references/performance-accessibility.md +49 -0
- package/catalog/skills/motion-animation/references/react-patterns.md +86 -0
- package/package.json +1 -1
- package/packages/catalog/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/core/package.json +1 -1
- package/packages/detectors/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,22 @@ All notable changes to this project are documented in this file.
|
|
|
16
16
|
### Removed
|
|
17
17
|
- _None._
|
|
18
18
|
|
|
19
|
+
## [0.26.2] - 2026-05-03
|
|
20
|
+
[View on npm](https://www.npmjs.com/package/@skilly-hand/skilly-hand/v/0.26.2)
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- Added portable `motion-animation` skill with official Motion guidance for JavaScript, React components, gestures, scroll animation, layout animation, exit animation, performance, accessibility, and source verification.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Updated `frontend-design` to route Motion-native animation work through `motion-animation` alongside existing GSAP routing.
|
|
27
|
+
- Updated catalog and install expectations so Motion guidance is included in generated skill lists and frontend-design dependencies.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- _None._
|
|
31
|
+
|
|
32
|
+
### Removed
|
|
33
|
+
- _None._
|
|
34
|
+
|
|
19
35
|
## [0.26.1] - 2026-05-03
|
|
20
36
|
[View on npm](https://www.npmjs.com/package/@skilly-hand/skilly-hand/v/0.26.1)
|
|
21
37
|
|
package/README.md
CHANGED
package/catalog/README.md
CHANGED
|
@@ -8,8 +8,9 @@ Published portable skills consumed by the `skilly-hand` CLI.
|
|
|
8
8
|
| `agents-root-orchestrator` | Author root AGENTS.md as a Where/What/When orchestrator that routes tasks and skill invocation clearly. | core, workflow, orchestration | all |
|
|
9
9
|
| `angular-guidelines` | Guide Angular code generation, review, and performance tuning using latest stable Angular verification, official Angular skill guidance, and modern framework best practices. Trigger: generating, reviewing, refactoring, or optimizing Angular code artifacts in Angular projects. | angular, frontend, workflow, best-practices | all |
|
|
10
10
|
| `figma-mcp-0to1` | Guide users from Figma MCP installation and authentication through first canvas creation, with function-level tool coverage and operational recovery patterns. | figma, mcp, workflow, design | all |
|
|
11
|
-
| `frontend-design` | Project-aware frontend design skill that detects the existing tech stack, UI libraries, CSS variables, and design tokens before proposing any UI work. Supports greenfield projects via DESIGN.md context setup, post-generation critique, visual refinement, and GSAP-aware motion polish. | frontend, design, workflow, ui, motion, greenfield | all |
|
|
11
|
+
| `frontend-design` | Project-aware frontend design skill that detects the existing tech stack, UI libraries, CSS variables, and design tokens before proposing any UI work. Supports greenfield projects via DESIGN.md context setup, post-generation critique, visual refinement, and Motion/GSAP-aware motion polish. | frontend, design, workflow, ui, motion, greenfield | all |
|
|
12
12
|
| `gsap-animation` | Guide GSAP animation implementation using only official GSAP documentation and the official greensock/gsap-skills source material. Trigger: implementing, reviewing, or choosing GSAP for frontend motion, timelines, ScrollTrigger, React useGSAP, JavaScript animation libraries, or advanced UI animation. | frontend, animation, motion, gsap, workflow | all |
|
|
13
|
+
| `motion-animation` | Guide Motion, formerly Framer Motion, animation implementation using only official Motion documentation. Trigger: implementing, reviewing, or choosing Motion for JavaScript animation, React motion components, gestures, scroll animation, layout animation, exit animation, or framework-agnostic UI motion. | frontend, animation, motion, framer-motion, workflow | all |
|
|
13
14
|
| `output-optimizer` | Optimize output token consumption through compact interpreter modes with controlled expansion when complexity, ambiguity, or risk requires more detail. Trigger: minimizing response verbosity while preserving clarity and correctness. | core, workflow, efficiency, communication | all |
|
|
14
15
|
| `project-security` | Scan project configuration and release surfaces for leak and security risks, and enforce security gates on commit, push, and publish workflows across GitHub, GitLab, npm, pnpm, yarn, and generic CI. Trigger: validating repository security posture, preventing secret leaks, or hardening delivery pipelines. | security, workflow, quality, core | all |
|
|
15
16
|
| `project-teacher` | Scan the active project and teach any concept, code path, or decision using verified information, interactive questions, and simple explanations. Trigger: user asks to explain, understand, clarify, or learn about anything in the project or codebase. | core, workflow, education | all |
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "frontend-design"
|
|
3
|
-
description: "Project-aware frontend design skill that detects the existing tech stack, UI libraries, CSS variables, and design tokens before proposing any UI work. Supports greenfield projects via DESIGN.md context setup, post-generation critique, visual refinement, and GSAP-aware motion polish."
|
|
3
|
+
description: "Project-aware frontend design skill that detects the existing tech stack, UI libraries, CSS variables, and design tokens before proposing any UI work. Supports greenfield projects via DESIGN.md context setup, post-generation critique, visual refinement, and Motion/GSAP-aware motion polish."
|
|
4
4
|
skillMetadata:
|
|
5
5
|
author: "skilly-hand"
|
|
6
6
|
last-edit: "2026-05-03"
|
|
7
7
|
license: "Apache-2.0"
|
|
8
|
-
version: "1.
|
|
9
|
-
changelog: "Added
|
|
8
|
+
version: "1.4.0"
|
|
9
|
+
changelog: "Added Motion-aware routing through motion-animation alongside gsap-animation; improves animation handoffs for Motion-native JavaScript and React projects; affects frontend-design motion sequencing, metadata, and catalog dependencies"
|
|
10
10
|
auto-invoke: "Designing or generating UI components, pages, or layouts in a web or mobile project; setting up visual direction for a greenfield project; critiquing generated UI for AI slop; adding motion or micro-interactions to existing UI; refining or polishing generated UI output"
|
|
11
11
|
allowed-tools:
|
|
12
12
|
- "Read"
|
|
@@ -49,7 +49,7 @@ Always run stack detection first. Never skip to design.
|
|
|
49
49
|
| 1 (only after confirmation) | Design and implement components using confirmed stack | [agents/component-designer.md](agents/component-designer.md) |
|
|
50
50
|
| 2 (mandatory after generation) | Challenge the output for AI slop, weak hierarchy, heuristic failures, and unclear product fit | [agents/critique.md](agents/critique.md) |
|
|
51
51
|
| 3 (after critique) | Apply visual quality refinements routed by critique | [agents/visual-refiner.md](agents/visual-refiner.md) |
|
|
52
|
-
| 4 (optional) | Add motion and micro-interactions,
|
|
52
|
+
| 4 (optional) | Add motion and micro-interactions, routing Motion-native and GSAP-native work to the matching official-source skill | [agents/motion-designer.md](agents/motion-designer.md) |
|
|
53
53
|
|
|
54
54
|
---
|
|
55
55
|
|
|
@@ -63,7 +63,7 @@ Always run stack detection first. Never skip to design.
|
|
|
63
63
|
6. **Design with confirmed context only** — hand off to `component-designer` only after steps 2–4 are complete.
|
|
64
64
|
7. **Critique after generation** — invoke `critique` for a frontend-only challenge pass before polish.
|
|
65
65
|
8. **Refine from critique** — invoke `visual-refiner` for visual fixes routed by critique.
|
|
66
|
-
9. **Optionally add motion** — invoke `motion-designer` if critique, refinement, or the user identifies a motion need.
|
|
66
|
+
9. **Optionally add motion** — invoke `motion-designer` if critique, refinement, or the user identifies a motion need. Route Motion-native JavaScript/React animation through `motion-animation`; route GSAP timelines, ScrollTrigger, and plugin decisions through `gsap-animation`.
|
|
67
67
|
|
|
68
68
|
---
|
|
69
69
|
|
|
@@ -197,7 +197,9 @@ After generation:
|
|
|
197
197
|
-> Invoke critique to challenge design quality and route fixes
|
|
198
198
|
-> Invoke visual-refiner for critique-routed visual fixes
|
|
199
199
|
-> Does the component need motion? -> Invoke motion-designer
|
|
200
|
-
-> Does motion
|
|
200
|
+
-> Does motion match existing Motion/Framer Motion, React motion props, layout, exit, gestures, or lightweight JS animation?
|
|
201
|
+
YES -> Use motion-animation for official-source Motion guidance
|
|
202
|
+
-> Does motion need GSAP timelines, ScrollTrigger, pin/scrub behavior, or GSAP plugins?
|
|
201
203
|
YES -> Use gsap-animation for official-source GSAP guidance
|
|
202
204
|
NO -> Use confirmed stack primitives
|
|
203
205
|
```
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
Motion must be implemented using the animation primitives already available in the project's stack. Never introduce a new animation library without the user's explicit approval.
|
|
8
8
|
|
|
9
|
-
For
|
|
9
|
+
For Motion-native animation needs, prefer a handoff to `motion-animation` when Motion or Framer Motion is already installed, explicitly requested, or approved as a new dependency. Use that skill for framework-agnostic JavaScript Motion APIs, React `motion` components, gestures, scroll-linked animation, scroll-triggered animation, layout animation, and exit animation.
|
|
10
|
+
|
|
11
|
+
For GSAP-native animation needs, prefer a handoff to `gsap-animation` when GSAP is already installed, explicitly requested, or approved as a new dependency. Use that skill for GSAP timelines, ScrollTrigger pin/scrub behavior, and GSAP plugin decisions.
|
|
10
12
|
|
|
11
13
|
---
|
|
12
14
|
|
|
@@ -56,7 +58,9 @@ Animation stack:
|
|
|
56
58
|
|
|
57
59
|
If no animation primitives are found, ask: "This project has no existing animation setup. Should I use CSS transitions only (no new dependencies), or would you like to add a library? If so, which one?"
|
|
58
60
|
|
|
59
|
-
If
|
|
61
|
+
If Motion or Framer Motion is already established, or the user asks for Motion, React motion props, gestures, layout animation, exit animation, lightweight framework-agnostic JavaScript animation, `whileInView`, or `useScroll`, invoke `motion-animation`. If `motion` is not already installed, ask for approval before adding it.
|
|
62
|
+
|
|
63
|
+
If the motion needs GSAP timeline sequencing, ScrollTrigger pinning/scrub, GSAP plugins, or explicit GSAP behavior, invoke `gsap-animation`. If `gsap` is not already installed, ask for approval before adding it. If another animation library is already established and the user did not ask to switch, respect the existing library.
|
|
60
64
|
|
|
61
65
|
---
|
|
62
66
|
|
|
@@ -105,13 +109,25 @@ Moments where a small motion adds personality without adding noise:
|
|
|
105
109
|
|
|
106
110
|
**Fix**: These are always optional and always ask the user first. Never add delight motion without explicit approval.
|
|
107
111
|
|
|
108
|
-
### 5.
|
|
112
|
+
### 5. Motion Handoff Opportunities
|
|
113
|
+
|
|
114
|
+
Some motion work is better handled with official Motion guidance instead of local heuristics:
|
|
115
|
+
|
|
116
|
+
- The project already uses `motion`, `framer-motion`, or `@motionone/dom`.
|
|
117
|
+
- The user asks for Motion or Framer Motion.
|
|
118
|
+
- React animation should use `motion` components, `AnimatePresence`, `whileHover`, `whileTap`, `whileInView`, `useScroll`, `layout`, or `layoutId`.
|
|
119
|
+
- Framework-agnostic JavaScript animation should use Motion `animate()`, `scroll()`, `inView()`, `hover()`, `press()`, or `stagger()`.
|
|
120
|
+
- The project needs lightweight DOM/SVG/object animation and the user approves Motion as the dependency.
|
|
121
|
+
|
|
122
|
+
**Fix**: Invoke `motion-animation` and include the detected project stack, dependency status, component scope, requested motion behavior, and reduced-motion expectations. Do not add `motion` without user approval.
|
|
123
|
+
|
|
124
|
+
### 6. GSAP Handoff Opportunities
|
|
109
125
|
|
|
110
126
|
Some motion work is better handled with official GSAP guidance instead of local heuristics:
|
|
111
127
|
|
|
112
128
|
- Multi-step entrance or page choreography that needs timeline sequencing.
|
|
113
129
|
- Scroll reveals, scrubbed animation, pinned sections, or parallax-like effects.
|
|
114
|
-
-
|
|
130
|
+
- Existing GSAP, React `useGSAP()`, Next.js, Vue, Svelte, or Angular animation that needs GSAP lifecycle-safe cleanup.
|
|
115
131
|
- Flip, Draggable, ScrollTrigger, SplitText, SVG, custom easing, or other GSAP plugin decisions.
|
|
116
132
|
- Runtime controls such as pause, play, reverse, seek, progress, or timeScale.
|
|
117
133
|
|
|
@@ -192,7 +208,8 @@ If the existing project has no `prefers-reduced-motion` handling anywhere, note
|
|
|
192
208
|
Before finalizing any motion work:
|
|
193
209
|
|
|
194
210
|
- [ ] All animation primitives are from the confirmed stack — no new dependencies added without approval.
|
|
195
|
-
- [ ]
|
|
211
|
+
- [ ] Motion-suitable work was routed through `motion-animation`.
|
|
212
|
+
- [ ] GSAP-suitable work was routed through `gsap-animation`.
|
|
196
213
|
- [ ] No layout-triggering properties are animated.
|
|
197
214
|
- [ ] All animations have a `prefers-reduced-motion` fallback.
|
|
198
215
|
- [ ] Timing values are within the reference ranges above.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "frontend-design",
|
|
3
3
|
"title": "Frontend Design",
|
|
4
|
-
"description": "Project-aware frontend design skill that detects the existing tech stack, UI libraries, CSS variables, and design tokens before proposing any UI work. Supports greenfield projects via DESIGN.md context setup, post-generation critique, visual refinement, and GSAP-aware motion polish.",
|
|
4
|
+
"description": "Project-aware frontend design skill that detects the existing tech stack, UI libraries, CSS variables, and design tokens before proposing any UI work. Supports greenfield projects via DESIGN.md context setup, post-generation critique, visual refinement, and Motion/GSAP-aware motion polish.",
|
|
5
5
|
"portable": true,
|
|
6
6
|
"tags": ["frontend", "design", "workflow", "ui", "motion", "greenfield"],
|
|
7
7
|
"detectors": ["always"],
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"author": "skilly-hand",
|
|
13
13
|
"last-edit": "2026-05-03",
|
|
14
14
|
"license": "Apache-2.0",
|
|
15
|
-
"version": "1.
|
|
16
|
-
"changelog": "Added
|
|
15
|
+
"version": "1.4.0",
|
|
16
|
+
"changelog": "Added Motion-aware routing through motion-animation alongside gsap-animation; improves animation handoffs for Motion-native JavaScript and React projects; affects frontend-design motion sequencing, metadata, and catalog dependencies",
|
|
17
17
|
"auto-invoke": "Designing or generating UI components, pages, or layouts in a web or mobile project; setting up visual direction for a greenfield project; critiquing generated UI for AI slop; adding motion or micro-interactions to existing UI; refining or polishing generated UI output",
|
|
18
18
|
"allowed-modes": [
|
|
19
19
|
"stack-detector",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
{ "path": "assets/stack-scan-checklist.md", "kind": "asset" },
|
|
37
37
|
{ "path": "assets/aesthetic-archetypes.md", "kind": "asset" }
|
|
38
38
|
],
|
|
39
|
-
"dependencies": ["gsap-animation"]
|
|
39
|
+
"dependencies": ["motion-animation", "gsap-animation"]
|
|
40
40
|
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "motion-animation"
|
|
3
|
+
description: "Guide Motion, formerly Framer Motion, animation implementation using only official Motion documentation. Trigger: implementing, reviewing, or choosing Motion for JavaScript animation, React motion components, gestures, scroll animation, layout animation, exit animation, or framework-agnostic UI motion."
|
|
4
|
+
skillMetadata:
|
|
5
|
+
author: "skilly-hand"
|
|
6
|
+
last-edit: "2026-05-03"
|
|
7
|
+
license: "Apache-2.0"
|
|
8
|
+
version: "1.0.0"
|
|
9
|
+
changelog: "Added official-source Motion animation guidance for JavaScript and React; improves framework-agnostic and React-native motion implementation with verified Motion APIs; affects frontend animation routing and catalog discovery"
|
|
10
|
+
auto-invoke: "Implementing, reviewing, or choosing Motion for JavaScript animation, React motion components, gestures, scroll animation, layout animation, exit animation, or framework-agnostic UI motion"
|
|
11
|
+
allowed-tools:
|
|
12
|
+
- "Read"
|
|
13
|
+
- "Edit"
|
|
14
|
+
- "Write"
|
|
15
|
+
- "Glob"
|
|
16
|
+
- "Grep"
|
|
17
|
+
- "Bash"
|
|
18
|
+
- "WebFetch"
|
|
19
|
+
- "WebSearch"
|
|
20
|
+
- "Task"
|
|
21
|
+
- "SubAgent"
|
|
22
|
+
---
|
|
23
|
+
# Motion Animation Guide
|
|
24
|
+
|
|
25
|
+
## When to Use
|
|
26
|
+
|
|
27
|
+
Use this skill when:
|
|
28
|
+
|
|
29
|
+
- The user asks for Motion, Framer Motion, Motion One, JavaScript animation with `motion`, React `motion` components, gestures, scroll-triggered animation, scroll-linked animation, layout animation, or exit animation.
|
|
30
|
+
- Another skill needs a verified Motion handoff for lightweight UI motion, React-native animation props, or framework-agnostic JavaScript animation.
|
|
31
|
+
- A project already uses `motion`, `framer-motion`, or `@motionone/dom` and the user has not asked to migrate away.
|
|
32
|
+
|
|
33
|
+
Do not use this skill when:
|
|
34
|
+
|
|
35
|
+
- The project already uses another animation library and the user has not asked to add or migrate to Motion.
|
|
36
|
+
- A simple CSS transition is sufficient and no JavaScript, React prop, layout, gesture, scroll, or exit animation behavior is needed.
|
|
37
|
+
- The work needs GSAP-specific timelines, ScrollTrigger pin/scrub behavior, GSAP plugins, or existing GSAP patterns. Use `gsap-animation` for that.
|
|
38
|
+
- The work is backend-only or has no user-facing motion surface.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Official-Only Source Rule
|
|
43
|
+
|
|
44
|
+
Before generating Motion-specific guidance, verify the pattern against official sources in [references/official-source-map.md](references/official-source-map.md).
|
|
45
|
+
|
|
46
|
+
Use only:
|
|
47
|
+
|
|
48
|
+
- Motion docs at `https://motion.dev/docs/quick-start`.
|
|
49
|
+
- Motion for React docs at `https://motion.dev/docs/react`.
|
|
50
|
+
- Official `motion.dev/docs/*` pages linked from those pages when a referenced API needs more detail.
|
|
51
|
+
|
|
52
|
+
Do not use blog posts, snippets, Stack Overflow answers, social posts, or memory-only claims as source material for Motion API behavior. If a detail is not covered by the reference files, check official Motion docs before using it.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Routing
|
|
57
|
+
|
|
58
|
+
| Need | Use |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| Framework-agnostic DOM/SVG/object animation | [references/js-patterns.md](references/js-patterns.md) |
|
|
61
|
+
| Plain HTML, Webflow, no-code, or script tag usage | Script-tag guidance in [references/js-patterns.md](references/js-patterns.md) |
|
|
62
|
+
| React or Next.js prop-based UI animation | [references/react-patterns.md](references/react-patterns.md) |
|
|
63
|
+
| React exit, layout, gesture, scroll, and SVG animation | [references/react-patterns.md](references/react-patterns.md) |
|
|
64
|
+
| Reduced motion, cleanup, and performance guidance | [references/performance-accessibility.md](references/performance-accessibility.md) |
|
|
65
|
+
|
|
66
|
+
When the user asks for an animation library without naming one, prefer Motion when the need is lightweight JavaScript animation, React prop-based animation, gestures, layout animation, exit animation, or a project already uses Motion/Framer Motion. Prefer GSAP for GSAP timelines, ScrollTrigger pin/scrub choreography, GSAP plugins, or an existing GSAP stack.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Project Preflight
|
|
71
|
+
|
|
72
|
+
Always inspect the target project before proposing implementation:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
grep -E '"motion"|"framer-motion"|"@motionone/dom"|"gsap"|"@gsap/react"|"animejs"' package.json
|
|
76
|
+
grep -rn "from \"motion\"|from 'motion'|from \"motion/react\"|from 'motion/react'|framer-motion|motion\\.|AnimatePresence|useScroll|useReducedMotion" src --include="*.js" --include="*.jsx" --include="*.ts" --include="*.tsx" 2>/dev/null
|
|
77
|
+
grep -rn "prefers-reduced-motion|transition|@keyframes" src --include="*.css" --include="*.scss" --include="*.tsx" --include="*.jsx" 2>/dev/null
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If `motion` is not installed, ask before adding it. This skill teaches target projects how to use Motion; it does not add Motion to skilly-hand itself.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Implementation Rules
|
|
85
|
+
|
|
86
|
+
- Use the official package name `motion`.
|
|
87
|
+
- Prefer JavaScript imports from `"motion"` for framework-agnostic work.
|
|
88
|
+
- Prefer React imports from `"motion/react"` for React components and hooks.
|
|
89
|
+
- Use `animate()` for DOM, SVG, object, value, and sequence animation where JavaScript control is needed.
|
|
90
|
+
- Use `motion` components for React UI state animation through `initial`, `animate`, `whileHover`, `whileTap`, `whileInView`, `layout`, `layoutId`, and `exit`.
|
|
91
|
+
- Use `AnimatePresence` when React elements need exit animations before DOM removal.
|
|
92
|
+
- Use `scroll()` or `useScroll()` for scroll-linked animation; use `inView()` or `whileInView` for scroll-triggered animation.
|
|
93
|
+
- Use `stagger()` for sibling offsets instead of manually stacking delay values.
|
|
94
|
+
- Respect reduced-motion preferences. Skip, simplify, or replace non-essential motion when users request reduced motion.
|
|
95
|
+
- Clean up JavaScript animations, gestures, scroll listeners, and observers during component or page teardown.
|
|
96
|
+
- Avoid introducing Motion Studio, Motion+ premium APIs, or MCP tooling unless the user explicitly asks for those products.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Framework Guidance
|
|
101
|
+
|
|
102
|
+
JavaScript and other frameworks:
|
|
103
|
+
|
|
104
|
+
- Run Motion setup after DOM nodes exist.
|
|
105
|
+
- Pass elements directly when possible, or scope selector text to the component/page root.
|
|
106
|
+
- Store returned animation controls or cleanup functions when teardown or runtime control is needed.
|
|
107
|
+
- For script tag usage, prefer a pinned CDN version instead of `latest`.
|
|
108
|
+
|
|
109
|
+
React and Next.js:
|
|
110
|
+
|
|
111
|
+
- Import `motion`, `AnimatePresence`, and hooks from `"motion/react"`.
|
|
112
|
+
- Components using Motion in React Server Component projects must run on the client.
|
|
113
|
+
- Use stable unique keys for `AnimatePresence` children.
|
|
114
|
+
- Use `layout` for size/position/reorder animation and `layoutId` for shared layout transitions.
|
|
115
|
+
- Use `useReducedMotion()` to branch React animation values when needed.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Output Contract
|
|
120
|
+
|
|
121
|
+
When using this skill, include:
|
|
122
|
+
|
|
123
|
+
- The official Motion source you used.
|
|
124
|
+
- Whether Motion or legacy Framer Motion usage is already installed or requires approval.
|
|
125
|
+
- Which Motion primitive is appropriate: `animate()`, `scroll()`, `inView()`, gesture function, `motion` component, `AnimatePresence`, `useScroll()`, `layout`, `layoutId`, or `useReducedMotion()`.
|
|
126
|
+
- Cleanup and reduced-motion behavior.
|
|
127
|
+
- A verification step appropriate to the project, such as unit tests, interaction tests, browser smoke checks, or visual inspection.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Commands
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Install Motion in a target project only after user approval
|
|
135
|
+
npm install motion
|
|
136
|
+
|
|
137
|
+
# Check for existing Motion usage
|
|
138
|
+
grep -rn "from \"motion\"|from \"motion/react\"|framer-motion|AnimatePresence|useScroll|useReducedMotion" src --include="*.js" --include="*.jsx" --include="*.ts" --include="*.tsx"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Resources
|
|
144
|
+
|
|
145
|
+
- Source map: [references/official-source-map.md](references/official-source-map.md)
|
|
146
|
+
- JavaScript patterns: [references/js-patterns.md](references/js-patterns.md)
|
|
147
|
+
- React patterns: [references/react-patterns.md](references/react-patterns.md)
|
|
148
|
+
- Performance and accessibility: [references/performance-accessibility.md](references/performance-accessibility.md)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "motion-animation",
|
|
3
|
+
"title": "Motion Animation",
|
|
4
|
+
"description": "Guide Motion, formerly Framer Motion, animation implementation using only official Motion documentation. Trigger: implementing, reviewing, or choosing Motion for JavaScript animation, React motion components, gestures, scroll animation, layout animation, exit animation, or framework-agnostic UI motion.",
|
|
5
|
+
"portable": true,
|
|
6
|
+
"tags": ["frontend", "animation", "motion", "framer-motion", "workflow"],
|
|
7
|
+
"detectors": ["react", "nextjs", "angular", "vue", "vite", "tailwindcss", "storybook"],
|
|
8
|
+
"detectionTriggers": ["auto"],
|
|
9
|
+
"installsFor": ["all"],
|
|
10
|
+
"agentSupport": ["codex", "claude", "cursor", "gemini", "copilot", "antigravity", "windsurf", "trae"],
|
|
11
|
+
"skillMetadata": {
|
|
12
|
+
"author": "skilly-hand",
|
|
13
|
+
"last-edit": "2026-05-03",
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"version": "1.0.0",
|
|
16
|
+
"changelog": "Added official-source Motion animation guidance for JavaScript and React; improves framework-agnostic and React-native motion implementation with verified Motion APIs; affects frontend animation routing and catalog discovery",
|
|
17
|
+
"auto-invoke": "Implementing, reviewing, or choosing Motion for JavaScript animation, React motion components, gestures, scroll animation, layout animation, exit animation, or framework-agnostic UI motion",
|
|
18
|
+
"allowed-tools": ["Read", "Edit", "Write", "Glob", "Grep", "Bash", "WebFetch", "WebSearch", "Task", "SubAgent"]
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
{ "path": "SKILL.md", "kind": "instruction" },
|
|
22
|
+
{ "path": "references/official-source-map.md", "kind": "reference" },
|
|
23
|
+
{ "path": "references/js-patterns.md", "kind": "reference" },
|
|
24
|
+
{ "path": "references/react-patterns.md", "kind": "reference" },
|
|
25
|
+
{ "path": "references/performance-accessibility.md", "kind": "reference" }
|
|
26
|
+
],
|
|
27
|
+
"dependencies": []
|
|
28
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Motion JavaScript Patterns
|
|
2
|
+
|
|
3
|
+
Extracted: 2026-05-03
|
|
4
|
+
|
|
5
|
+
Sources:
|
|
6
|
+
|
|
7
|
+
- https://motion.dev/docs/quick-start
|
|
8
|
+
- https://motion.dev/docs/animate
|
|
9
|
+
- https://motion.dev/docs/scroll
|
|
10
|
+
- https://motion.dev/docs/inview
|
|
11
|
+
- https://motion.dev/docs/hover
|
|
12
|
+
- https://motion.dev/docs/press
|
|
13
|
+
|
|
14
|
+
## Selection
|
|
15
|
+
|
|
16
|
+
Use Motion JavaScript when animation should work across frameworks or plain pages, when a project already uses Motion, or when the need is lightweight DOM/SVG/object animation without a framework-specific component model.
|
|
17
|
+
|
|
18
|
+
Prefer CSS transitions for small hover/focus/press states that need no JavaScript control. Prefer `gsap-animation` for GSAP-specific timelines, ScrollTrigger pin/scrub choreography, or GSAP plugins.
|
|
19
|
+
|
|
20
|
+
## Installation and Imports
|
|
21
|
+
|
|
22
|
+
For package-managed projects, the official install command is:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install motion
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use module imports in bundled JavaScript:
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
import { animate, scroll } from "motion";
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
For smaller HTML/SVG-only animation, Motion also documents:
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
import { animate } from "motion/mini";
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For plain HTML or no-code contexts, Motion can be imported by script tag. Prefer pinning a specific version in CDN URLs instead of using `latest`.
|
|
41
|
+
|
|
42
|
+
Ask before adding `motion` when it is not already present.
|
|
43
|
+
|
|
44
|
+
## animate()
|
|
45
|
+
|
|
46
|
+
Use `animate()` for one-step animations and controlled JavaScript animation:
|
|
47
|
+
|
|
48
|
+
- It accepts CSS selectors or element collections.
|
|
49
|
+
- It can animate HTML/CSS, SVG attributes and paths, independent transforms, JavaScript objects, colors, strings, numbers, and single values.
|
|
50
|
+
- The hybrid import from `"motion"` supports independent transform axes like `x`, `y`, `rotate`, `scale`, skew, perspective, CSS variables, SVG paths, object animation, and sequences.
|
|
51
|
+
- The mini import from `"motion/mini"` focuses on HTML/SVG styles through native browser APIs.
|
|
52
|
+
|
|
53
|
+
Use transition options such as `duration`, `delay`, `ease`, `repeat`, `repeatType`, and spring options when the official API supports the chosen transition type.
|
|
54
|
+
|
|
55
|
+
## Sequences and Stagger
|
|
56
|
+
|
|
57
|
+
Use hybrid `animate()` sequences when several targets or values need ordered animation. Use each segment's transition options or `at` scheduling instead of hand-stacking unrelated timers.
|
|
58
|
+
|
|
59
|
+
Use `stagger()` as a `delay` function when sibling animations should be offset:
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
import { animate, stagger } from "motion";
|
|
63
|
+
|
|
64
|
+
animate(".item", { opacity: 1, y: 0 }, { delay: stagger(0.1) });
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Scroll and Viewport
|
|
68
|
+
|
|
69
|
+
Use `scroll()` for scroll-linked animation where an animation progress should follow scroll progress.
|
|
70
|
+
|
|
71
|
+
Use `inView()` for scroll-triggered animation when an element entering or leaving the viewport should start behavior. Store and run its cleanup in framework teardown when used inside component lifecycles.
|
|
72
|
+
|
|
73
|
+
## Gestures
|
|
74
|
+
|
|
75
|
+
Use `hover()` and `press()` for JavaScript gesture animation outside React. Store cleanup functions returned by gesture helpers and call them during teardown.
|
|
76
|
+
|
|
77
|
+
For React, prefer `whileHover`, `whileTap`, and related `motion` component props instead of manual DOM gesture listeners.
|
|
78
|
+
|
|
79
|
+
## Cleanup
|
|
80
|
+
|
|
81
|
+
Store returned animation controls or cleanup functions when an animation, scroll listener, observer, or gesture belongs to a component/page lifecycle. Stop animations and call cleanup during teardown.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Official Motion Source Map
|
|
2
|
+
|
|
3
|
+
Extracted: 2026-05-03
|
|
4
|
+
|
|
5
|
+
This skill may only use official Motion sources. Motion was previously Framer Motion for React; the official React docs identify the current package and imports.
|
|
6
|
+
|
|
7
|
+
## Primary Sources
|
|
8
|
+
|
|
9
|
+
| Source | Use |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| https://motion.dev/docs/quick-start | JavaScript quick start, package install, script tag options, `animate`, `scroll`, `stagger`, animatable value categories |
|
|
12
|
+
| https://motion.dev/docs/react | React quick start, `motion` components, gestures, scroll, layout, exit, SVG animation, Framer Motion naming context |
|
|
13
|
+
|
|
14
|
+
## Linked Official API Sources
|
|
15
|
+
|
|
16
|
+
| Source | Use |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| https://motion.dev/docs/animate | `animate()` hybrid/mini imports, subjects, transforms, SVG paths, sequences, transition options, controls |
|
|
19
|
+
| https://motion.dev/docs/scroll | JavaScript scroll-linked animation |
|
|
20
|
+
| https://motion.dev/docs/inview | JavaScript scroll-triggered animation |
|
|
21
|
+
| https://motion.dev/docs/hover | JavaScript hover gesture animation and cleanup |
|
|
22
|
+
| https://motion.dev/docs/press | JavaScript press gesture animation and cleanup |
|
|
23
|
+
| https://motion.dev/docs/react-motion-component | React `motion` component props, animation targets, variants, and gestures |
|
|
24
|
+
| https://motion.dev/docs/react-animate-presence | React exit animations, child keys, presence modes, troubleshooting |
|
|
25
|
+
| https://motion.dev/docs/react-use-scroll | React scroll-linked animation with `useScroll()` |
|
|
26
|
+
| https://motion.dev/docs/react-use-reduced-motion | React reduced-motion hook |
|
|
27
|
+
| https://motion.dev/docs/performance | Motion performance guidance |
|
|
28
|
+
| https://motion.dev/docs/react-accessibility | React accessibility guidance |
|
|
29
|
+
|
|
30
|
+
## Verification Rule
|
|
31
|
+
|
|
32
|
+
When a Motion API or behavior is not represented in these local reference files, check official Motion docs before generating implementation guidance. If the official docs conflict with a local reference, the official docs page wins and this skill should be updated.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Motion Performance and Accessibility
|
|
2
|
+
|
|
3
|
+
Extracted: 2026-05-03
|
|
4
|
+
|
|
5
|
+
Sources:
|
|
6
|
+
|
|
7
|
+
- https://motion.dev/docs/quick-start
|
|
8
|
+
- https://motion.dev/docs/animate
|
|
9
|
+
- https://motion.dev/docs/react
|
|
10
|
+
- https://motion.dev/docs/react-use-reduced-motion
|
|
11
|
+
- https://motion.dev/docs/performance
|
|
12
|
+
- https://motion.dev/docs/react-accessibility
|
|
13
|
+
|
|
14
|
+
## Performance
|
|
15
|
+
|
|
16
|
+
Motion's hybrid engine uses browser animation capabilities where possible and JavaScript where browser APIs cannot provide the needed behavior. Prefer the smallest Motion surface that solves the job:
|
|
17
|
+
|
|
18
|
+
- Use CSS transitions for simple static hover/focus transitions.
|
|
19
|
+
- Use `motion/mini` for small HTML/SVG style animation when independent transforms, sequences, object animation, or advanced hybrid behavior are unnecessary.
|
|
20
|
+
- Use the hybrid `"motion"` import for independent transforms, SVG paths, CSS variables, JavaScript objects, values, sequences, and spring/inertia behavior.
|
|
21
|
+
- In React, use `motion` components and hooks from `"motion/react"` rather than manual DOM animation when animation is tied to React render state.
|
|
22
|
+
|
|
23
|
+
Prefer `opacity` and transform-style motion for routine UI animation. Avoid layout-heavy animation unless the official React layout animation API is the intended feature.
|
|
24
|
+
|
|
25
|
+
## Reduced Motion
|
|
26
|
+
|
|
27
|
+
Respect user reduced-motion preferences. In React, use `useReducedMotion()` when animation values need to change based on preference.
|
|
28
|
+
|
|
29
|
+
Reduced-motion behavior may:
|
|
30
|
+
|
|
31
|
+
- Skip non-essential animation.
|
|
32
|
+
- Shorten motion to a near-instant transition.
|
|
33
|
+
- Replace spatial movement with opacity or a static final state.
|
|
34
|
+
- Disable looping or decorative animation.
|
|
35
|
+
|
|
36
|
+
## Cleanup
|
|
37
|
+
|
|
38
|
+
For framework-agnostic JavaScript, store animation controls and cleanup functions returned by Motion APIs that attach listeners, observers, or active animations. Stop animations and call cleanup during component/page teardown.
|
|
39
|
+
|
|
40
|
+
For React `motion` components, React handles component lifecycle for prop-based animation. Manual timers, callbacks, or JavaScript Motion APIs used inside React still need normal effect cleanup.
|
|
41
|
+
|
|
42
|
+
## Checklist
|
|
43
|
+
|
|
44
|
+
- [ ] The official Motion source for the chosen API was checked.
|
|
45
|
+
- [ ] Motion is already installed or dependency approval was obtained.
|
|
46
|
+
- [ ] Imports match the environment: `"motion"` for JavaScript, `"motion/react"` for React.
|
|
47
|
+
- [ ] Component/page-owned JavaScript animations and listeners are cleaned up.
|
|
48
|
+
- [ ] Reduced-motion users get static, skipped, or simplified motion.
|
|
49
|
+
- [ ] The implementation uses Motion for Motion-shaped needs and GSAP only for GSAP-shaped needs.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Motion React Patterns
|
|
2
|
+
|
|
3
|
+
Extracted: 2026-05-03
|
|
4
|
+
|
|
5
|
+
Sources:
|
|
6
|
+
|
|
7
|
+
- https://motion.dev/docs/react
|
|
8
|
+
- https://motion.dev/docs/react-motion-component
|
|
9
|
+
- https://motion.dev/docs/react-animate-presence
|
|
10
|
+
- https://motion.dev/docs/react-use-scroll
|
|
11
|
+
- https://motion.dev/docs/react-use-reduced-motion
|
|
12
|
+
|
|
13
|
+
## Selection
|
|
14
|
+
|
|
15
|
+
Use Motion for React when a React project already uses Motion/Framer Motion, when animation should be expressed through component props, or when the desired behavior is gestures, exit animation, layout animation, scroll animation, or SVG animation in React.
|
|
16
|
+
|
|
17
|
+
Use JavaScript patterns from [js-patterns.md](js-patterns.md) for framework-agnostic utilities. Use `gsap-animation` when the project requires GSAP-specific timelines, ScrollTrigger behavior, plugins, or existing GSAP conventions.
|
|
18
|
+
|
|
19
|
+
## Installation and Imports
|
|
20
|
+
|
|
21
|
+
Motion for React uses the same package:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install motion
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Import React APIs from `"motion/react"`:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { motion } from "motion/react";
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Ask before adding `motion` when it is not already present.
|
|
34
|
+
|
|
35
|
+
## motion Components
|
|
36
|
+
|
|
37
|
+
Use `motion` components for animating HTML and SVG elements with props:
|
|
38
|
+
|
|
39
|
+
- `initial` defines the starting visual state.
|
|
40
|
+
- `animate` defines the current target visual state.
|
|
41
|
+
- `transition` defines duration, easing, spring, and related transition behavior.
|
|
42
|
+
- Variants can coordinate named states across parent/child component trees.
|
|
43
|
+
|
|
44
|
+
Use `motion.create()` for custom components only when the official component integration pattern is needed.
|
|
45
|
+
|
|
46
|
+
## Gestures
|
|
47
|
+
|
|
48
|
+
Use React gesture props for interaction feedback:
|
|
49
|
+
|
|
50
|
+
- `whileHover` for hover targets.
|
|
51
|
+
- `whileTap` for press/tap targets.
|
|
52
|
+
- Hover, tap, focus, and drag are supported gesture categories in the React quick start.
|
|
53
|
+
|
|
54
|
+
Keep gesture motion brief and meaningful, and pair it with accessible non-motion feedback when needed.
|
|
55
|
+
|
|
56
|
+
## Scroll Animation
|
|
57
|
+
|
|
58
|
+
Use `whileInView` for scroll-triggered animation when an element should animate as it enters or leaves the viewport.
|
|
59
|
+
|
|
60
|
+
Use `useScroll()` when a MotionValue should be linked directly to scroll progress, such as a progress bar scale.
|
|
61
|
+
|
|
62
|
+
## Layout Animation
|
|
63
|
+
|
|
64
|
+
Use `layout` when React layout changes in size, position, or reorder should animate smoothly.
|
|
65
|
+
|
|
66
|
+
Use `layoutId` for shared layout transitions between different elements.
|
|
67
|
+
|
|
68
|
+
When mixing layout animation with exits, consider official `AnimatePresence` mode guidance and `LayoutGroup` guidance if surrounding components need coordinated layout updates.
|
|
69
|
+
|
|
70
|
+
## Exit Animation
|
|
71
|
+
|
|
72
|
+
Use `AnimatePresence` when removed React elements should animate out before leaving the DOM:
|
|
73
|
+
|
|
74
|
+
- Place the conditional child inside `AnimatePresence`; do not unmount `AnimatePresence` at the same time as the child.
|
|
75
|
+
- Give every direct child a stable unique `key`.
|
|
76
|
+
- Use the `exit` prop on `motion` components.
|
|
77
|
+
- Use `mode="wait"` only for one child at a time.
|
|
78
|
+
- Use `mode="popLayout"` carefully with positioned parents and forwarded refs for custom immediate children.
|
|
79
|
+
|
|
80
|
+
## SVG Animation
|
|
81
|
+
|
|
82
|
+
Motion for React supports SVG animation. Use `motion` SVG elements and official SVG props such as `pathLength` for path drawing effects where appropriate.
|
|
83
|
+
|
|
84
|
+
## React Server Components
|
|
85
|
+
|
|
86
|
+
In React Server Component projects, components that use Motion runtime behavior must be client components. Keep Motion imports and animated components in client-side files.
|
package/package.json
CHANGED