tribunal-kit 4.2.0 → 4.3.1
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/.agent/ARCHITECTURE.md +21 -14
- package/.agent/agents/swarm-worker-contracts.md +5 -5
- package/.agent/agents/ui-ux-auditor.md +292 -0
- package/.agent/rules/GEMINI.md +8 -8
- package/.agent/scripts/__pycache__/_colors.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/_utils.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/case_law_manager.cpython-311.pyc +0 -0
- package/.agent/scripts/_colors.js +18 -0
- package/.agent/scripts/_utils.js +42 -0
- package/.agent/scripts/auto_preview.js +197 -0
- package/.agent/scripts/bundle_analyzer.js +290 -0
- package/.agent/scripts/case_law_manager.js +684 -0
- package/.agent/scripts/checklist.js +266 -0
- package/.agent/scripts/colors.js +17 -0
- package/.agent/scripts/compress_skills.js +141 -0
- package/.agent/scripts/consolidate_skills.js +149 -0
- package/.agent/scripts/context_broker.js +609 -0
- package/.agent/scripts/deep_compress.js +150 -0
- package/.agent/scripts/dependency_analyzer.js +272 -0
- package/.agent/scripts/graph_builder.js +199 -0
- package/.agent/scripts/graph_zoom.js +154 -0
- package/.agent/scripts/inner_loop_validator.js +465 -0
- package/.agent/scripts/lint_runner.js +187 -0
- package/.agent/scripts/minify_context.js +100 -0
- package/.agent/scripts/patch_skills_meta.js +156 -0
- package/.agent/scripts/patch_skills_output.js +244 -0
- package/.agent/scripts/schema_validator.js +297 -0
- package/.agent/scripts/security_scan.js +303 -0
- package/.agent/scripts/session_manager.js +276 -0
- package/.agent/scripts/skill_evolution.js +644 -0
- package/.agent/scripts/skill_integrator.js +313 -0
- package/.agent/scripts/strengthen_skills.js +193 -0
- package/.agent/scripts/strip_tribunal.js +47 -0
- package/.agent/scripts/swarm_dispatcher.js +360 -0
- package/.agent/scripts/test_runner.js +193 -0
- package/.agent/scripts/utils.js +32 -0
- package/.agent/scripts/verify_all.js +256 -0
- package/.agent/skills/agent-organizer/SKILL.md +12 -4
- package/.agent/skills/agentic-patterns/SKILL.md +12 -4
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +12 -4
- package/.agent/skills/api-patterns/SKILL.md +209 -201
- package/.agent/skills/api-security-auditor/SKILL.md +12 -4
- package/.agent/skills/app-builder/SKILL.md +12 -4
- package/.agent/skills/app-builder/templates/SKILL.md +76 -68
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +1 -1
- package/.agent/skills/appflow-wireframe/SKILL.md +12 -4
- package/.agent/skills/architecture/SKILL.md +12 -4
- package/.agent/skills/authentication-best-practices/SKILL.md +12 -4
- package/.agent/skills/bash-linux/SKILL.md +12 -4
- package/.agent/skills/behavioral-modes/SKILL.md +12 -4
- package/.agent/skills/brainstorming/SKILL.md +12 -4
- package/.agent/skills/building-native-ui/SKILL.md +12 -4
- package/.agent/skills/clean-code/SKILL.md +12 -4
- package/.agent/skills/code-review-checklist/SKILL.md +12 -4
- package/.agent/skills/config-validator/SKILL.md +12 -4
- package/.agent/skills/csharp-developer/SKILL.md +12 -4
- package/.agent/skills/data-validation-schemas/SKILL.md +290 -282
- package/.agent/skills/database-design/SKILL.md +202 -194
- package/.agent/skills/deployment-procedures/SKILL.md +12 -4
- package/.agent/skills/devops-engineer/SKILL.md +12 -4
- package/.agent/skills/devops-incident-responder/SKILL.md +12 -4
- package/.agent/skills/doc.md +1 -1
- package/.agent/skills/documentation-templates/SKILL.md +12 -4
- package/.agent/skills/edge-computing/SKILL.md +12 -4
- package/.agent/skills/error-resilience/SKILL.md +390 -382
- package/.agent/skills/extract-design-system/SKILL.md +12 -4
- package/.agent/skills/framer-motion-expert/SKILL.md +206 -199
- package/.agent/skills/frontend-design/SKILL.md +163 -155
- package/.agent/skills/game-design-expert/SKILL.md +12 -4
- package/.agent/skills/game-engineering-expert/SKILL.md +12 -4
- package/.agent/skills/geo-fundamentals/SKILL.md +12 -4
- package/.agent/skills/github-operations/SKILL.md +12 -4
- package/.agent/skills/gsap-core/SKILL.md +54 -48
- package/.agent/skills/gsap-frameworks/SKILL.md +54 -48
- package/.agent/skills/gsap-performance/SKILL.md +54 -48
- package/.agent/skills/gsap-plugins/SKILL.md +54 -48
- package/.agent/skills/gsap-react/SKILL.md +54 -48
- package/.agent/skills/gsap-scrolltrigger/SKILL.md +54 -48
- package/.agent/skills/gsap-timeline/SKILL.md +54 -48
- package/.agent/skills/gsap-utils/SKILL.md +54 -48
- package/.agent/skills/i18n-localization/SKILL.md +12 -4
- package/.agent/skills/intelligent-routing/SKILL.md +41 -33
- package/.agent/skills/knowledge-graph/SKILL.md +36 -0
- package/.agent/skills/lint-and-validate/SKILL.md +12 -4
- package/.agent/skills/llm-engineering/SKILL.md +12 -4
- package/.agent/skills/local-first/SKILL.md +12 -4
- package/.agent/skills/mcp-builder/SKILL.md +12 -4
- package/.agent/skills/mobile-design/SKILL.md +225 -217
- package/.agent/skills/monorepo-management/SKILL.md +296 -288
- package/.agent/skills/motion-engineering/SKILL.md +195 -187
- package/.agent/skills/nextjs-react-expert/SKILL.md +196 -188
- package/.agent/skills/nodejs-best-practices/SKILL.md +12 -4
- package/.agent/skills/observability/SKILL.md +12 -4
- package/.agent/skills/parallel-agents/SKILL.md +12 -4
- package/.agent/skills/performance-profiling/SKILL.md +12 -4
- package/.agent/skills/plan-writing/SKILL.md +12 -4
- package/.agent/skills/platform-engineer/SKILL.md +12 -4
- package/.agent/skills/playwright-best-practices/SKILL.md +12 -4
- package/.agent/skills/powershell-windows/SKILL.md +12 -4
- package/.agent/skills/project-idioms/SKILL.md +12 -4
- package/.agent/skills/python-patterns/SKILL.md +12 -4
- package/.agent/skills/python-pro/SKILL.md +285 -277
- package/.agent/skills/react-specialist/SKILL.md +239 -231
- package/.agent/skills/readme-builder/SKILL.md +12 -4
- package/.agent/skills/realtime-patterns/SKILL.md +12 -4
- package/.agent/skills/red-team-tactics/SKILL.md +12 -4
- package/.agent/skills/rust-pro/SKILL.md +12 -4
- package/.agent/skills/seo-fundamentals/SKILL.md +12 -4
- package/.agent/skills/server-management/SKILL.md +12 -4
- package/.agent/skills/shadcn-ui-expert/SKILL.md +12 -4
- package/.agent/skills/skill-creator/SKILL.md +12 -4
- package/.agent/skills/sql-pro/SKILL.md +12 -4
- package/.agent/skills/supabase-postgres-best-practices/SKILL.md +12 -4
- package/.agent/skills/swiftui-expert/SKILL.md +12 -4
- package/.agent/skills/systematic-debugging/SKILL.md +12 -4
- package/.agent/skills/tailwind-patterns/SKILL.md +12 -4
- package/.agent/skills/tdd-workflow/SKILL.md +12 -4
- package/.agent/skills/test-result-analyzer/SKILL.md +12 -4
- package/.agent/skills/testing-patterns/SKILL.md +12 -4
- package/.agent/skills/trend-researcher/SKILL.md +12 -4
- package/.agent/skills/typescript-advanced/SKILL.md +297 -289
- package/.agent/skills/ui-ux-pro-max/SKILL.md +12 -4
- package/.agent/skills/ui-ux-researcher/SKILL.md +12 -4
- package/.agent/skills/vue-expert/SKILL.md +237 -229
- package/.agent/skills/vulnerability-scanner/SKILL.md +12 -4
- package/.agent/skills/web-accessibility-auditor/SKILL.md +12 -4
- package/.agent/skills/web-design-guidelines/SKILL.md +12 -4
- package/.agent/skills/webapp-testing/SKILL.md +12 -4
- package/.agent/skills/whimsy-injector/SKILL.md +12 -4
- package/.agent/skills/workflow-optimizer/SKILL.md +12 -4
- package/.agent/workflows/audit.md +6 -6
- package/.agent/workflows/deploy.md +1 -1
- package/.agent/workflows/generate.md +23 -6
- package/.agent/workflows/session.md +5 -5
- package/.agent/workflows/swarm.md +2 -2
- package/README.md +242 -186
- package/bin/tribunal-kit.js +297 -57
- package/package.json +81 -77
- package/scripts/changelog.js +167 -0
- package/scripts/sync-version.js +81 -0
- package/scripts/validate-payload.js +73 -0
- package/.agent/scripts/__pycache__/auto_preview.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/bundle_analyzer.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/checklist.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/dependency_analyzer.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/security_scan.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/session_manager.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/skill_integrator.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/swarm_dispatcher.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/test_runner.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/verify_all.cpython-311.pyc +0 -0
- package/.agent/scripts/auto_preview.py +0 -180
- package/.agent/scripts/bundle_analyzer.py +0 -259
- package/.agent/scripts/case_law_manager.py +0 -755
- package/.agent/scripts/checklist.py +0 -209
- package/.agent/scripts/compress_skills.py +0 -167
- package/.agent/scripts/consolidate_skills.py +0 -173
- package/.agent/scripts/deep_compress.py +0 -202
- package/.agent/scripts/dependency_analyzer.py +0 -247
- package/.agent/scripts/lint_runner.py +0 -188
- package/.agent/scripts/minify_context.py +0 -80
- package/.agent/scripts/patch_skills_meta.py +0 -177
- package/.agent/scripts/patch_skills_output.py +0 -285
- package/.agent/scripts/schema_validator.py +0 -279
- package/.agent/scripts/security_scan.py +0 -224
- package/.agent/scripts/session_manager.py +0 -261
- package/.agent/scripts/skill_evolution.py +0 -563
- package/.agent/scripts/skill_integrator.py +0 -234
- package/.agent/scripts/strengthen_skills.py +0 -220
- package/.agent/scripts/strip_tribunal.py +0 -41
- package/.agent/scripts/swarm_dispatcher.py +0 -350
- package/.agent/scripts/test_runner.py +0 -192
- package/.agent/scripts/test_swarm_dispatcher.py +0 -163
- package/.agent/scripts/verify_all.py +0 -195
|
@@ -1,192 +1,192 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: motion-engineering
|
|
3
|
-
description: Motion Engineering mastery for 2026 web UI. Covers all 20 modern animation styles across 4 tiers (Core UX, Immersive, Advanced, Specialized). Use when designing motion strategy, choosing animation libraries (Framer, GSAP, WebGL, CSS), or implementing animated UI patterns.
|
|
4
|
-
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
5
|
-
version: 4.0.0
|
|
6
|
-
last-updated: 2026-04-07
|
|
7
|
-
applies-to-model: gemini-3-1-pro, claude-3-7-sonnet
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Motion Engineering (2026) — Comprehensive Reference
|
|
11
|
-
|
|
12
|
-
You are the Motion Engineering Specialist. Your purpose is to bridge the gap between static UI and fluid, intuitive, and high-performance digital experiences. You understand that motion is not decoration; it is usability, narrative, and state communication.
|
|
13
|
-
|
|
14
|
-
## Hallucination Traps & Motion Sins (Read First)
|
|
15
|
-
- ❌ Linear motion (`ease-linear`, CSS `transition: all`) → ✅ Spring physics (`stiffness/damping`) or custom cubic-beziers. Linear looks robotic.
|
|
16
|
-
- ❌ Animating layout properties (`width`, `margin`, `top`) → ✅ ONLY animate `transform` and `opacity` to maintain 120fps GPU compositing.
|
|
17
|
-
- ❌ Scrolljacking (hijacking native scroll wheel) → ✅ Smooth scrolling via Lenis, synchronized with native momentum.
|
|
18
|
-
- ❌ Heavy blocking entrance animations → ✅ Performance-first: let user interact immediately while ambient motion resolves.
|
|
19
|
-
- ❌ Forgetting `prefers-reduced-motion` → ✅ ALWAYS respect system accessibility. Fall back to instant opacity transitions.
|
|
20
|
-
- ❌ `view-transition-name` collision → ✅ Each name must be unique in the DOM at any given time.
|
|
21
|
-
- ❌ `element.animate()` (WAAPI) without `fill: "forwards"` → ✅ Animation resets on completion — add `fill: "forwards"` or commit state.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Master Library Decision Matrix (20 Animation Categories)
|
|
26
|
-
|
|
27
|
-
| Category / Style | Recommended Technology | Why / Use Case |
|
|
28
|
-
|:---|:---|:---|
|
|
29
|
-
| **Tier 1: Core UX (High Frequency)** | | |
|
|
30
|
-
| 1. Micro-interactions | Framer Motion / CSS Springs | Fast feedback, hover states, buttons |
|
|
31
|
-
| 2. Scroll-based | GSAP ScrollTrigger + Lenis | Parallax, timelines, storytelling |
|
|
32
|
-
| 3. Page Transitions | View Transitions API + Framer | SPA route navigation, modal expands |
|
|
33
|
-
| 4. Loading & Skeleton | CSS @keyframes / SVGs / Lottie | Non-blocking waits, shimmer, spinners |
|
|
34
|
-
| **Tier 2: Narrative & Immersive (Medium Frequency)** | | |
|
|
35
|
-
| 5. 3D & Immersive | React Three Fiber / WebGL | Interactive scenes, models, depth |
|
|
36
|
-
| 7. Kinetic Typography | GSAP SplitText / Framer | Emphasize headlines, word-by-word reveal |
|
|
37
|
-
| 8. Background Animations | CSS Gradients / WebGL Shaders | Ambient noise, particles, mesh gradients |
|
|
38
|
-
| 9. Illustration/Characters | Lottie / Rive | Mascots, onboarding storytelling |
|
|
39
|
-
| **Tier 3: Advanced & Emerging (Situational)** | | |
|
|
40
|
-
| 6. State Transitions | Framer Motion `layout` | Expanding cards, drag-and-drop |
|
|
41
|
-
| 10. Physics-based | Matter.js / Framer Springs | Bouncy, elastic real-world mimics |
|
|
42
|
-
| 11. Morphing & Shape | GSAP MorphSVG | Liquid motion, blobs, SVG path morphs |
|
|
43
|
-
| 12. Glassmorphism UI | CSS backdrop-filter + motion | Soft shadows, refraction on hover |
|
|
44
|
-
| 13. Cursor-based | Custom JS + CSS variables | Magnetic buttons, cursor trails |
|
|
45
|
-
| 14. AI-driven Adaptive | Headless logic + Framer | Context-aware, usage-based animation |
|
|
46
|
-
| 15. Gamified/Interactive | Canvas / React Three Fiber | Reward animations, mini-games |
|
|
47
|
-
| **Tier 4: Specialized (Niche/Structural)** | | |
|
|
48
|
-
| 16. Video + Motion | Scroll-sync Video (GSAP) | Cinematic hero sections |
|
|
49
|
-
| 17. Experimental | Custom shaders / Brutalist CSS | Glitch effects, collage |
|
|
50
|
-
| 18. Navigation | Framer `AnimatePresence` | Mega menus, magnetic nav |
|
|
51
|
-
| 19. Data Visualization | D3.js + Framer Motion | Animated charts, live updates |
|
|
52
|
-
| 20. Performance-first | CSS only (`opacity`, `transform`) | Ultra-minimal subtle fade-ins |
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## TIER 1: Core UX Motion (Dense Implementation)
|
|
57
|
-
|
|
58
|
-
*These are the foundational motions used in 80%+ of 2026 web applications.*
|
|
59
|
-
|
|
60
|
-
### 1. Micro-interactions
|
|
61
|
-
Used for immediate feedback, clarifying actions, and improving perceived responsiveness.
|
|
62
|
-
```tsx
|
|
63
|
-
// Framer Motion — button with spring micro-interaction
|
|
64
|
-
<motion.button
|
|
65
|
-
whileHover={{ scale: 1.02, filter: "brightness(1.08)" }}
|
|
66
|
-
whileTap={{ scale: 0.97 }}
|
|
67
|
-
transition={{ type: "spring", stiffness: 400, damping: 17 }}
|
|
68
|
-
>Submit</motion.button>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### 2. Scroll-based Animations (Most used in 2026)
|
|
72
|
-
Triggers narrative flow and depth based on user scrolling.
|
|
73
|
-
```javascript
|
|
74
|
-
// GSAP ScrollTrigger — industry standard
|
|
75
|
-
gsap.from(".reveal-section", {
|
|
76
|
-
scrollTrigger: { trigger: ".reveal-section", start: "top 80%", scrub: 1 },
|
|
77
|
-
y: 60, opacity: 0, stagger: 0.1
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// Lenis — smooth scroll compatible with GSAP
|
|
81
|
-
import Lenis from "lenis";
|
|
82
|
-
const lenis = new Lenis({ lerp: 0.1, wheelMultiplier: 0.8 });
|
|
83
|
-
lenis.on("scroll", ScrollTrigger.update);
|
|
84
|
-
gsap.ticker.add((time) => lenis.raf(time * 1000));
|
|
85
|
-
gsap.ticker.lagSmoothing(0);
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### 3. Page Transitions (View Transitions API)
|
|
89
|
-
```css
|
|
90
|
-
/* CSS — define shared elements */
|
|
91
|
-
.card-image { view-transition-name: active-image; } /* MUST BE UNIQUE */
|
|
92
|
-
::view-transition-old(active-image) { animation: fade-out 0.3s ease; }
|
|
93
|
-
::view-transition-new(active-image) { animation: scale-in 0.3s ease; }
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### 4. Loading & Skeleton Animations
|
|
97
|
-
Never block the UI entirely. Use structural loading.
|
|
98
|
-
```css
|
|
99
|
-
/* Shimmer structural animation */
|
|
100
|
-
.skeleton {
|
|
101
|
-
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
102
|
-
background-size: 200% 100%;
|
|
103
|
-
animation: shimmer 1.5s infinite linear;
|
|
104
|
-
}
|
|
105
|
-
@keyframes shimmer { 100% { background-position: -200% 0; } }
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## TIER 2: Narrative & Immersive (Medium Implementation)
|
|
111
|
-
|
|
112
|
-
*Used for brand storytelling, heroes, and engagement.*
|
|
113
|
-
|
|
114
|
-
### 5. 3D & Immersive Animations
|
|
115
|
-
The leading trend of 2026. Use React Three Fiber.
|
|
116
|
-
```tsx
|
|
117
|
-
// WebGL Scene basics
|
|
118
|
-
import { Canvas, useFrame } from '@react-three/fiber'
|
|
119
|
-
function RotatingCube() {
|
|
120
|
-
const meshRef = useRef();
|
|
121
|
-
useFrame((state, delta) => (meshRef.current.rotation.x += delta));
|
|
122
|
-
return <mesh ref={meshRef}><boxGeometry /><meshStandardMaterial color="hotpink" /></mesh>;
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### 7. Kinetic Typography
|
|
127
|
-
```tsx
|
|
128
|
-
// Word-by-word spring reveal (Framer Motion)
|
|
129
|
-
const words = "Immersive storytelling".split(" ");
|
|
130
|
-
const wordVariants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0 } };
|
|
131
|
-
|
|
132
|
-
<motion.h1 transition={{ staggerChildren: 0.05 }} initial="hidden" whileInView="visible" viewport={{ once: true }}>
|
|
133
|
-
{words.map((w, i) => <motion.span key={i} variants={wordVariants}>{w} </motion.span>)}
|
|
134
|
-
</motion.h1>
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### 8. Background Animations & 9. Illustrations
|
|
138
|
-
- **Backgrounds:** Use CSS `@keyframes` on pseudo-elements with `filter: blur()` for ambient gradients, avoiding repaints.
|
|
139
|
-
- **Illustrations:** Use Rive for interactive state machines, or Lottie via `lottie-react` for simple timeline playback.
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
## TIER 3: Advanced & Emerging (Concepts & Tools)
|
|
144
|
-
|
|
145
|
-
*Highly interactive components elevating standard UI.*
|
|
146
|
-
|
|
147
|
-
- **6. Motion UI & State Transitions:** Use Framer Motion's `layout` prop. Morphing a list item into a modal requires `<motion.div layoutId="item-1">` on both states. Wrap the app in `<LayoutGroup>`.
|
|
148
|
-
- **10. Physics-based:** Animate like real-world objects. Instead of `duration`, define `mass`, `stiffness`, and `damping` in physics springs to simulate gravity and tension.
|
|
149
|
-
- **11. Morphing & Shape:** GSAP `MorphSVGPlugin`. Requires SVGs with comparable path points or GSAP will interpolate poorly. Alternatively, animate CSS `border-radius` for fluid blobs.
|
|
150
|
-
- **12. Glassmorphism:** Animate `backdrop-filter: blur(10px)` but beware of performance costs on mobile. Render shadows via `filter: drop-shadow()` combined with slight `translateY` on hover.
|
|
151
|
-
- **13. Cursor-based:** Modern standard is CSS variables bound to mouse position. Calculate `clientX` relative to the element bounding box and update `--mouse-x` to drive `radial-gradient` masks.
|
|
152
|
-
- **14. AI-driven Adaptive:** Motion that learns. If a user speeds through a form, UI transitions accelerate. If they linger, ambient motion plays. Controlled by tracking interaction deltas and mapping them to global spring configurations.
|
|
153
|
-
- **15. Gamified:** Progress bars that burst on completion, haptic-synchronized checkmarks. Combine SVGs with explicit, highly exaggerated elastic overshoot scales (`scale: [1, 1.2, 0.9, 1]`) on reward thresholds.
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## TIER 4: Specialized (Rules & Fallbacks)
|
|
158
|
-
|
|
159
|
-
*Niche requirements where performance or specific constraints dominate.*
|
|
160
|
-
|
|
161
|
-
- **16. Video + Motion Hybrid:** Scrubbing `<video>` tags with scroll. Requires pre-encoding video rapidly with keyframes every 1 frame, drawing frames to a `<canvas>` element via `requestAnimationFrame` linked to scroll progress.
|
|
162
|
-
- **17. Experimental:** Glitch effects via overlapping CSS `clip-path` animations. High processing cost.
|
|
163
|
-
- **18. Navigation:** Mega-menus must use `<AnimatePresence>` to prevent DOM unmount before the exit animation resolves. Include exit delays so users don't trigger flickering by rapidly moving the mouse off the nav.
|
|
164
|
-
- **19. Data Visualization:** D3 handles math, React handles DOM, Framer/Spring handles interpolation between D3 datasets. Never let D3 mutate the DOM directly inside a React app.
|
|
165
|
-
- **20. Performance-first Subtle Motion:** Strictly `opacity`, `transform`, CSS-only. Use `@starting-style` for popovers and dialogs to avoid JS intervention.
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Accessibility & Performance Invariants (Global Rules)
|
|
170
|
-
|
|
171
|
-
1. **The WCAG 2.2 AA Motion Rule:**
|
|
172
|
-
```tsx
|
|
173
|
-
import { useReducedMotion } from "framer-motion";
|
|
174
|
-
const reduce = useReducedMotion();
|
|
175
|
-
// Safe: opacity, color
|
|
176
|
-
// Conditional: translate, scale, rotate
|
|
177
|
-
<motion.div animate={{ x: reduce ? 0 : 100, opacity: 1 }} transition={{ duration: reduce ? 0 : 0.5 }} />
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
2. **The 120fps GPU Rule:**
|
|
181
|
-
Never animate `width`, `height`, `left`, `top`, `margin`, or `padding`. This triggers layout recalculation algorithms. Use `transform: scale()` or `transform: translate()` instead.
|
|
182
|
-
|
|
183
|
-
3. **The Cleanup Rule:**
|
|
184
|
-
Any GSAP ScrollTrigger timeline must use `ScrollTrigger.killAll()` or React's `useGSAP` cleanup functions to avoid memory leaks on SPA route changes.
|
|
1
|
+
---
|
|
2
|
+
name: motion-engineering
|
|
3
|
+
description: Motion Engineering mastery for 2026 web UI. Covers all 20 modern animation styles across 4 tiers (Core UX, Immersive, Advanced, Specialized). Use when designing motion strategy, choosing animation libraries (Framer, GSAP, WebGL, CSS), or implementing animated UI patterns.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
5
|
+
version: 4.0.0
|
|
6
|
+
last-updated: 2026-04-07
|
|
7
|
+
applies-to-model: gemini-3-1-pro, claude-3-7-sonnet
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Motion Engineering (2026) — Comprehensive Reference
|
|
11
|
+
|
|
12
|
+
You are the Motion Engineering Specialist. Your purpose is to bridge the gap between static UI and fluid, intuitive, and high-performance digital experiences. You understand that motion is not decoration; it is usability, narrative, and state communication.
|
|
13
|
+
|
|
14
|
+
## Hallucination Traps & Motion Sins (Read First)
|
|
15
|
+
- ❌ Linear motion (`ease-linear`, CSS `transition: all`) → ✅ Spring physics (`stiffness/damping`) or custom cubic-beziers. Linear looks robotic.
|
|
16
|
+
- ❌ Animating layout properties (`width`, `margin`, `top`) → ✅ ONLY animate `transform` and `opacity` to maintain 120fps GPU compositing.
|
|
17
|
+
- ❌ Scrolljacking (hijacking native scroll wheel) → ✅ Smooth scrolling via Lenis, synchronized with native momentum.
|
|
18
|
+
- ❌ Heavy blocking entrance animations → ✅ Performance-first: let user interact immediately while ambient motion resolves.
|
|
19
|
+
- ❌ Forgetting `prefers-reduced-motion` → ✅ ALWAYS respect system accessibility. Fall back to instant opacity transitions.
|
|
20
|
+
- ❌ `view-transition-name` collision → ✅ Each name must be unique in the DOM at any given time.
|
|
21
|
+
- ❌ `element.animate()` (WAAPI) without `fill: "forwards"` → ✅ Animation resets on completion — add `fill: "forwards"` or commit state.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Master Library Decision Matrix (20 Animation Categories)
|
|
26
|
+
|
|
27
|
+
| Category / Style | Recommended Technology | Why / Use Case |
|
|
28
|
+
|:---|:---|:---|
|
|
29
|
+
| **Tier 1: Core UX (High Frequency)** | | |
|
|
30
|
+
| 1. Micro-interactions | Framer Motion / CSS Springs | Fast feedback, hover states, buttons |
|
|
31
|
+
| 2. Scroll-based | GSAP ScrollTrigger + Lenis | Parallax, timelines, storytelling |
|
|
32
|
+
| 3. Page Transitions | View Transitions API + Framer | SPA route navigation, modal expands |
|
|
33
|
+
| 4. Loading & Skeleton | CSS @keyframes / SVGs / Lottie | Non-blocking waits, shimmer, spinners |
|
|
34
|
+
| **Tier 2: Narrative & Immersive (Medium Frequency)** | | |
|
|
35
|
+
| 5. 3D & Immersive | React Three Fiber / WebGL | Interactive scenes, models, depth |
|
|
36
|
+
| 7. Kinetic Typography | GSAP SplitText / Framer | Emphasize headlines, word-by-word reveal |
|
|
37
|
+
| 8. Background Animations | CSS Gradients / WebGL Shaders | Ambient noise, particles, mesh gradients |
|
|
38
|
+
| 9. Illustration/Characters | Lottie / Rive | Mascots, onboarding storytelling |
|
|
39
|
+
| **Tier 3: Advanced & Emerging (Situational)** | | |
|
|
40
|
+
| 6. State Transitions | Framer Motion `layout` | Expanding cards, drag-and-drop |
|
|
41
|
+
| 10. Physics-based | Matter.js / Framer Springs | Bouncy, elastic real-world mimics |
|
|
42
|
+
| 11. Morphing & Shape | GSAP MorphSVG | Liquid motion, blobs, SVG path morphs |
|
|
43
|
+
| 12. Glassmorphism UI | CSS backdrop-filter + motion | Soft shadows, refraction on hover |
|
|
44
|
+
| 13. Cursor-based | Custom JS + CSS variables | Magnetic buttons, cursor trails |
|
|
45
|
+
| 14. AI-driven Adaptive | Headless logic + Framer | Context-aware, usage-based animation |
|
|
46
|
+
| 15. Gamified/Interactive | Canvas / React Three Fiber | Reward animations, mini-games |
|
|
47
|
+
| **Tier 4: Specialized (Niche/Structural)** | | |
|
|
48
|
+
| 16. Video + Motion | Scroll-sync Video (GSAP) | Cinematic hero sections |
|
|
49
|
+
| 17. Experimental | Custom shaders / Brutalist CSS | Glitch effects, collage |
|
|
50
|
+
| 18. Navigation | Framer `AnimatePresence` | Mega menus, magnetic nav |
|
|
51
|
+
| 19. Data Visualization | D3.js + Framer Motion | Animated charts, live updates |
|
|
52
|
+
| 20. Performance-first | CSS only (`opacity`, `transform`) | Ultra-minimal subtle fade-ins |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## TIER 1: Core UX Motion (Dense Implementation)
|
|
57
|
+
|
|
58
|
+
*These are the foundational motions used in 80%+ of 2026 web applications.*
|
|
59
|
+
|
|
60
|
+
### 1. Micro-interactions
|
|
61
|
+
Used for immediate feedback, clarifying actions, and improving perceived responsiveness.
|
|
62
|
+
```tsx
|
|
63
|
+
// Framer Motion — button with spring micro-interaction
|
|
64
|
+
<motion.button
|
|
65
|
+
whileHover={{ scale: 1.02, filter: "brightness(1.08)" }}
|
|
66
|
+
whileTap={{ scale: 0.97 }}
|
|
67
|
+
transition={{ type: "spring", stiffness: 400, damping: 17 }}
|
|
68
|
+
>Submit</motion.button>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 2. Scroll-based Animations (Most used in 2026)
|
|
72
|
+
Triggers narrative flow and depth based on user scrolling.
|
|
73
|
+
```javascript
|
|
74
|
+
// GSAP ScrollTrigger — industry standard
|
|
75
|
+
gsap.from(".reveal-section", {
|
|
76
|
+
scrollTrigger: { trigger: ".reveal-section", start: "top 80%", scrub: 1 },
|
|
77
|
+
y: 60, opacity: 0, stagger: 0.1
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// Lenis — smooth scroll compatible with GSAP
|
|
81
|
+
import Lenis from "lenis";
|
|
82
|
+
const lenis = new Lenis({ lerp: 0.1, wheelMultiplier: 0.8 });
|
|
83
|
+
lenis.on("scroll", ScrollTrigger.update);
|
|
84
|
+
gsap.ticker.add((time) => lenis.raf(time * 1000));
|
|
85
|
+
gsap.ticker.lagSmoothing(0);
|
|
86
|
+
```
|
|
185
87
|
|
|
88
|
+
### 3. Page Transitions (View Transitions API)
|
|
89
|
+
```css
|
|
90
|
+
/* CSS — define shared elements */
|
|
91
|
+
.card-image { view-transition-name: active-image; } /* MUST BE UNIQUE */
|
|
92
|
+
::view-transition-old(active-image) { animation: fade-out 0.3s ease; }
|
|
93
|
+
::view-transition-new(active-image) { animation: scale-in 0.3s ease; }
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 4. Loading & Skeleton Animations
|
|
97
|
+
Never block the UI entirely. Use structural loading.
|
|
98
|
+
```css
|
|
99
|
+
/* Shimmer structural animation */
|
|
100
|
+
.skeleton {
|
|
101
|
+
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
102
|
+
background-size: 200% 100%;
|
|
103
|
+
animation: shimmer 1.5s infinite linear;
|
|
104
|
+
}
|
|
105
|
+
@keyframes shimmer { 100% { background-position: -200% 0; } }
|
|
106
|
+
```
|
|
186
107
|
|
|
187
108
|
---
|
|
188
109
|
|
|
189
|
-
##
|
|
110
|
+
## TIER 2: Narrative & Immersive (Medium Implementation)
|
|
111
|
+
|
|
112
|
+
*Used for brand storytelling, heroes, and engagement.*
|
|
113
|
+
|
|
114
|
+
### 5. 3D & Immersive Animations
|
|
115
|
+
The leading trend of 2026. Use React Three Fiber.
|
|
116
|
+
```tsx
|
|
117
|
+
// WebGL Scene basics
|
|
118
|
+
import { Canvas, useFrame } from '@react-three/fiber'
|
|
119
|
+
function RotatingCube() {
|
|
120
|
+
const meshRef = useRef();
|
|
121
|
+
useFrame((state, delta) => (meshRef.current.rotation.x += delta));
|
|
122
|
+
return <mesh ref={meshRef}><boxGeometry /><meshStandardMaterial color="hotpink" /></mesh>;
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 7. Kinetic Typography
|
|
127
|
+
```tsx
|
|
128
|
+
// Word-by-word spring reveal (Framer Motion)
|
|
129
|
+
const words = "Immersive storytelling".split(" ");
|
|
130
|
+
const wordVariants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0 } };
|
|
131
|
+
|
|
132
|
+
<motion.h1 transition={{ staggerChildren: 0.05 }} initial="hidden" whileInView="visible" viewport={{ once: true }}>
|
|
133
|
+
{words.map((w, i) => <motion.span key={i} variants={wordVariants}>{w} </motion.span>)}
|
|
134
|
+
</motion.h1>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 8. Background Animations & 9. Illustrations
|
|
138
|
+
- **Backgrounds:** Use CSS `@keyframes` on pseudo-elements with `filter: blur()` for ambient gradients, avoiding repaints.
|
|
139
|
+
- **Illustrations:** Use Rive for interactive state machines, or Lottie via `lottie-react` for simple timeline playback.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## TIER 3: Advanced & Emerging (Concepts & Tools)
|
|
144
|
+
|
|
145
|
+
*Highly interactive components elevating standard UI.*
|
|
146
|
+
|
|
147
|
+
- **6. Motion UI & State Transitions:** Use Framer Motion's `layout` prop. Morphing a list item into a modal requires `<motion.div layoutId="item-1">` on both states. Wrap the app in `<LayoutGroup>`.
|
|
148
|
+
- **10. Physics-based:** Animate like real-world objects. Instead of `duration`, define `mass`, `stiffness`, and `damping` in physics springs to simulate gravity and tension.
|
|
149
|
+
- **11. Morphing & Shape:** GSAP `MorphSVGPlugin`. Requires SVGs with comparable path points or GSAP will interpolate poorly. Alternatively, animate CSS `border-radius` for fluid blobs.
|
|
150
|
+
- **12. Glassmorphism:** Animate `backdrop-filter: blur(10px)` but beware of performance costs on mobile. Render shadows via `filter: drop-shadow()` combined with slight `translateY` on hover.
|
|
151
|
+
- **13. Cursor-based:** Modern standard is CSS variables bound to mouse position. Calculate `clientX` relative to the element bounding box and update `--mouse-x` to drive `radial-gradient` masks.
|
|
152
|
+
- **14. AI-driven Adaptive:** Motion that learns. If a user speeds through a form, UI transitions accelerate. If they linger, ambient motion plays. Controlled by tracking interaction deltas and mapping them to global spring configurations.
|
|
153
|
+
- **15. Gamified:** Progress bars that burst on completion, haptic-synchronized checkmarks. Combine SVGs with explicit, highly exaggerated elastic overshoot scales (`scale: [1, 1.2, 0.9, 1]`) on reward thresholds.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## TIER 4: Specialized (Rules & Fallbacks)
|
|
158
|
+
|
|
159
|
+
*Niche requirements where performance or specific constraints dominate.*
|
|
160
|
+
|
|
161
|
+
- **16. Video + Motion Hybrid:** Scrubbing `<video>` tags with scroll. Requires pre-encoding video rapidly with keyframes every 1 frame, drawing frames to a `<canvas>` element via `requestAnimationFrame` linked to scroll progress.
|
|
162
|
+
- **17. Experimental:** Glitch effects via overlapping CSS `clip-path` animations. High processing cost.
|
|
163
|
+
- **18. Navigation:** Mega-menus must use `<AnimatePresence>` to prevent DOM unmount before the exit animation resolves. Include exit delays so users don't trigger flickering by rapidly moving the mouse off the nav.
|
|
164
|
+
- **19. Data Visualization:** D3 handles math, React handles DOM, Framer/Spring handles interpolation between D3 datasets. Never let D3 mutate the DOM directly inside a React app.
|
|
165
|
+
- **20. Performance-first Subtle Motion:** Strictly `opacity`, `transform`, CSS-only. Use `@starting-style` for popovers and dialogs to avoid JS intervention.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Accessibility & Performance Invariants (Global Rules)
|
|
170
|
+
|
|
171
|
+
1. **The WCAG 2.2 AA Motion Rule:**
|
|
172
|
+
```tsx
|
|
173
|
+
import { useReducedMotion } from "framer-motion";
|
|
174
|
+
const reduce = useReducedMotion();
|
|
175
|
+
// Safe: opacity, color
|
|
176
|
+
// Conditional: translate, scale, rotate
|
|
177
|
+
<motion.div animate={{ x: reduce ? 0 : 100, opacity: 1 }} transition={{ duration: reduce ? 0 : 0.5 }} />
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
2. **The 120fps GPU Rule:**
|
|
181
|
+
Never animate `width`, `height`, `left`, `top`, `margin`, or `padding`. This triggers layout recalculation algorithms. Use `transform: scale()` or `transform: translate()` instead.
|
|
182
|
+
|
|
183
|
+
3. **The Cleanup Rule:**
|
|
184
|
+
Any GSAP ScrollTrigger timeline must use `ScrollTrigger.killAll()` or React's `useGSAP` cleanup functions to avoid memory leaks on SPA route changes.
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
|
|
190
190
|
|
|
191
191
|
AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
|
|
192
192
|
|
|
@@ -198,7 +198,7 @@ AI coding assistants often fall into specific bad habits when dealing with this
|
|
|
198
198
|
|
|
199
199
|
---
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
|
|
202
202
|
|
|
203
203
|
**Slash command: `/review` or `/tribunal-full`**
|
|
204
204
|
**Active reviewers: `logic-reviewer` · `security-auditor`**
|
|
@@ -209,7 +209,7 @@ AI coding assistants often fall into specific bad habits when dealing with this
|
|
|
209
209
|
2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
|
|
210
210
|
3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
|
|
213
213
|
|
|
214
214
|
Review these questions before confirming output:
|
|
215
215
|
```
|
|
@@ -224,3 +224,11 @@ Review these questions before confirming output:
|
|
|
224
224
|
**CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
|
|
225
225
|
- ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
|
|
226
226
|
- ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
## Pre-Flight Checklist
|
|
230
|
+
- [ ] Have I reviewed the user's specific constraints and requests?
|
|
231
|
+
- [ ] Have I checked the environment for relevant existing implementations?
|
|
232
|
+
|
|
233
|
+
## VBC Protocol (Verification-Before-Completion)
|
|
234
|
+
You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
|