tribunal-kit 4.0.1 → 4.2.0

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.
Files changed (108) hide show
  1. package/.agent/GEMINI.md +4 -2
  2. package/.agent/agents/api-architect.md +66 -0
  3. package/.agent/agents/db-latency-auditor.md +216 -0
  4. package/.agent/agents/precedence-reviewer.md +41 -4
  5. package/.agent/agents/resilience-reviewer.md +88 -0
  6. package/.agent/agents/schema-reviewer.md +67 -0
  7. package/.agent/agents/throughput-optimizer.md +299 -0
  8. package/.agent/agents/vitals-reviewer.md +223 -0
  9. package/.agent/history/case-law/cases/case-0001.json +33 -0
  10. package/.agent/history/case-law/index.json +35 -0
  11. package/.agent/rules/GEMINI.md +20 -3
  12. package/.agent/scripts/case_law_manager.py +237 -7
  13. package/.agent/skills/agent-organizer/SKILL.md +42 -0
  14. package/.agent/skills/agentic-patterns/SKILL.md +42 -0
  15. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +42 -0
  16. package/.agent/skills/api-patterns/SKILL.md +42 -0
  17. package/.agent/skills/api-security-auditor/SKILL.md +42 -0
  18. package/.agent/skills/app-builder/SKILL.md +42 -0
  19. package/.agent/skills/app-builder/templates/SKILL.md +70 -0
  20. package/.agent/skills/appflow-wireframe/SKILL.md +42 -0
  21. package/.agent/skills/architecture/SKILL.md +42 -0
  22. package/.agent/skills/authentication-best-practices/SKILL.md +42 -0
  23. package/.agent/skills/bash-linux/SKILL.md +42 -0
  24. package/.agent/skills/behavioral-modes/SKILL.md +42 -0
  25. package/.agent/skills/brainstorming/SKILL.md +42 -0
  26. package/.agent/skills/building-native-ui/SKILL.md +42 -0
  27. package/.agent/skills/clean-code/SKILL.md +42 -0
  28. package/.agent/skills/code-review-checklist/SKILL.md +42 -0
  29. package/.agent/skills/config-validator/SKILL.md +42 -0
  30. package/.agent/skills/csharp-developer/SKILL.md +42 -0
  31. package/.agent/skills/data-validation-schemas/SKILL.md +320 -0
  32. package/.agent/skills/database-design/SKILL.md +42 -0
  33. package/.agent/skills/deployment-procedures/SKILL.md +42 -0
  34. package/.agent/skills/devops-engineer/SKILL.md +42 -0
  35. package/.agent/skills/devops-incident-responder/SKILL.md +42 -0
  36. package/.agent/skills/documentation-templates/SKILL.md +42 -0
  37. package/.agent/skills/edge-computing/SKILL.md +42 -0
  38. package/.agent/skills/error-resilience/SKILL.md +420 -0
  39. package/.agent/skills/extract-design-system/SKILL.md +42 -0
  40. package/.agent/skills/framer-motion-expert/SKILL.md +42 -0
  41. package/.agent/skills/frontend-design/SKILL.md +42 -0
  42. package/.agent/skills/game-design-expert/SKILL.md +42 -0
  43. package/.agent/skills/game-engineering-expert/SKILL.md +42 -0
  44. package/.agent/skills/geo-fundamentals/SKILL.md +42 -0
  45. package/.agent/skills/github-operations/SKILL.md +42 -0
  46. package/.agent/skills/gsap-core/SKILL.md +302 -0
  47. package/.agent/skills/gsap-frameworks/SKILL.md +201 -0
  48. package/.agent/skills/gsap-performance/SKILL.md +127 -0
  49. package/.agent/skills/gsap-plugins/SKILL.md +474 -0
  50. package/.agent/skills/gsap-react/SKILL.md +183 -0
  51. package/.agent/skills/gsap-scrolltrigger/SKILL.md +344 -0
  52. package/.agent/skills/gsap-timeline/SKILL.md +155 -0
  53. package/.agent/skills/gsap-utils/SKILL.md +332 -0
  54. package/.agent/skills/i18n-localization/SKILL.md +42 -0
  55. package/.agent/skills/intelligent-routing/SKILL.md +72 -1
  56. package/.agent/skills/lint-and-validate/SKILL.md +42 -0
  57. package/.agent/skills/llm-engineering/SKILL.md +42 -0
  58. package/.agent/skills/local-first/SKILL.md +42 -0
  59. package/.agent/skills/mcp-builder/SKILL.md +42 -0
  60. package/.agent/skills/mobile-design/SKILL.md +42 -0
  61. package/.agent/skills/monorepo-management/SKILL.md +326 -0
  62. package/.agent/skills/motion-engineering/SKILL.md +42 -0
  63. package/.agent/skills/nextjs-react-expert/SKILL.md +42 -0
  64. package/.agent/skills/nodejs-best-practices/SKILL.md +42 -0
  65. package/.agent/skills/observability/SKILL.md +42 -0
  66. package/.agent/skills/parallel-agents/SKILL.md +42 -0
  67. package/.agent/skills/performance-profiling/SKILL.md +42 -0
  68. package/.agent/skills/plan-writing/SKILL.md +42 -0
  69. package/.agent/skills/platform-engineer/SKILL.md +42 -0
  70. package/.agent/skills/playwright-best-practices/SKILL.md +42 -0
  71. package/.agent/skills/powershell-windows/SKILL.md +42 -0
  72. package/.agent/skills/project-idioms/SKILL.md +42 -0
  73. package/.agent/skills/python-patterns/SKILL.md +42 -0
  74. package/.agent/skills/python-pro/SKILL.md +42 -0
  75. package/.agent/skills/react-specialist/SKILL.md +42 -0
  76. package/.agent/skills/readme-builder/SKILL.md +42 -0
  77. package/.agent/skills/realtime-patterns/SKILL.md +42 -0
  78. package/.agent/skills/red-team-tactics/SKILL.md +42 -0
  79. package/.agent/skills/rust-pro/SKILL.md +42 -0
  80. package/.agent/skills/seo-fundamentals/SKILL.md +42 -0
  81. package/.agent/skills/server-management/SKILL.md +42 -0
  82. package/.agent/skills/shadcn-ui-expert/SKILL.md +42 -0
  83. package/.agent/skills/skill-creator/SKILL.md +42 -0
  84. package/.agent/skills/sql-pro/SKILL.md +42 -0
  85. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +42 -0
  86. package/.agent/skills/swiftui-expert/SKILL.md +42 -0
  87. package/.agent/skills/systematic-debugging/SKILL.md +42 -0
  88. package/.agent/skills/tailwind-patterns/SKILL.md +42 -0
  89. package/.agent/skills/tdd-workflow/SKILL.md +42 -0
  90. package/.agent/skills/test-result-analyzer/SKILL.md +42 -0
  91. package/.agent/skills/testing-patterns/SKILL.md +42 -0
  92. package/.agent/skills/trend-researcher/SKILL.md +42 -0
  93. package/.agent/skills/typescript-advanced/SKILL.md +327 -0
  94. package/.agent/skills/ui-ux-pro-max/SKILL.md +42 -0
  95. package/.agent/skills/ui-ux-researcher/SKILL.md +42 -0
  96. package/.agent/skills/vue-expert/SKILL.md +42 -0
  97. package/.agent/skills/vulnerability-scanner/SKILL.md +42 -0
  98. package/.agent/skills/web-accessibility-auditor/SKILL.md +42 -0
  99. package/.agent/skills/web-design-guidelines/SKILL.md +42 -0
  100. package/.agent/skills/webapp-testing/SKILL.md +42 -0
  101. package/.agent/skills/whimsy-injector/SKILL.md +42 -0
  102. package/.agent/skills/workflow-optimizer/SKILL.md +42 -0
  103. package/.agent/workflows/tribunal-backend.md +13 -2
  104. package/.agent/workflows/tribunal-full.md +15 -8
  105. package/.agent/workflows/tribunal-speed.md +183 -0
  106. package/bin/tribunal-kit.js +10 -2
  107. package/package.json +2 -2
  108. package/.agent/skills/gsap-expert/SKILL.md +0 -194
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: gsap-performance
3
+ description: Official GSAP skill for performance — prefer transforms, avoid layout thrashing, will-change, batching. Use when optimizing GSAP animations, reducing jank, or when the user asks about animation performance, FPS, or smooth 60fps.
4
+ license: MIT
5
+ ---
6
+
7
+ # GSAP Performance
8
+
9
+ ## When to Use This Skill
10
+
11
+ Apply when optimizing GSAP animations for smooth 60fps, reducing layout/paint cost, or when the user asks about performance, jank, or best practices for fast animations.
12
+
13
+ **Related skills:** Build animations with **gsap-core** (transforms, autoAlpha) and **gsap-timeline**; for ScrollTrigger performance see **gsap-scrolltrigger**.
14
+
15
+ ## Prefer Transform and Opacity
16
+
17
+ Animating **transform** (`x`, `y`, `scaleX`, `scaleY`, `rotation`, `rotationX`, `rotationY`, `skewX`, `skewY`) and **opacity** keeps work on the compositor and avoids layout and most paint. Avoid animating layout-heavy properties when a transform can achieve the same effect.
18
+
19
+ - ✅ Prefer: **x**, **y**, **scale**, **rotation**, **opacity**.
20
+ - ❌ Avoid when possible: **width**, **height**, **top**, **left**, **margin**, **padding** (they trigger layout and can cause jank).
21
+
22
+ GSAP’s **x** and **y** use transforms (translate) by default; use them instead of **left**/**top** for movement.
23
+
24
+ ## will-change
25
+
26
+ Use **will-change** in CSS on elements that will animate. It hints the browser to promote the layer.
27
+
28
+ ```css
29
+ will-change: transform;
30
+ ```
31
+
32
+ ## Batch Reads and Writes
33
+
34
+ GSAP batches updates internally. When mixing GSAP with direct DOM reads/writes or layout-dependent code, avoid interleaving reads and writes in a way that causes repeated layout thrashing. Prefer doing all reads first, then all writes (or let GSAP handle the writes in one go).
35
+
36
+ ## Many Elements (Stagger, Lists)
37
+
38
+ - Use **stagger** instead of many separate tweens with manual delays when the animation is the same; it’s more efficient.
39
+ - For long lists, consider **virtualization** or animating only visible items; avoid creating hundreds of simultaneous tweens if it causes jank.
40
+ - Reuse timelines where possible; avoid creating new timelines every frame.
41
+
42
+ ## Frequently updated properties (e.g. mouse followers)
43
+
44
+ Prefer **gsap.quickTo()** for properties that are updated often (e.g. mouse-follower x/y). It reuses a single tween instead of creating new tweens on each update.
45
+
46
+ ```javascript
47
+ let xTo = gsap.quickTo("#id", "x", { duration: 0.4, ease: "power3" }),
48
+ yTo = gsap.quickTo("#id", "y", { duration: 0.4, ease: "power3" });
49
+
50
+ document.querySelector("#container").addEventListener("mousemove", (e) => {
51
+ xTo(e.pageX);
52
+ yTo(e.pageY);
53
+ });
54
+ ```
55
+
56
+ ## ScrollTrigger and Performance
57
+
58
+ - **pin: true** promotes the pinned element; pin only what’s needed.
59
+ - **scrub** with a small value (e.g. `scrub: 1`) can reduce work during scroll; test on low-end devices.
60
+ - Call **ScrollTrigger.refresh()** only when layout actually changes (e.g. after content load), not on every resize; debounce when possible.
61
+
62
+ ## Reduce Simultaneous Work
63
+
64
+ - Pause or kill off-screen or inactive animations when they’re not visible (e.g. when the user navigates away).
65
+ - Avoid animating huge numbers of properties on many elements at once; simplify or sequence if needed.
66
+
67
+ ## Best practices
68
+
69
+ - ✅ Animate **transform** and **opacity**; use **will-change** in CSS only on elements that animate.
70
+ - ✅ Use **stagger** instead of many separate tweens with manual delays when the animation is the same.
71
+ - ✅ Use **gsap.quickTo()** for frequently updated properties (e.g. mouse followers).
72
+ - ✅ Clean up or kill off-screen animations; call **ScrollTrigger.refresh()** when layout changes, debounced when possible.
73
+
74
+ ## Do Not
75
+
76
+ - ❌ Animate **width**/ **height**/ **top**/ **left** for movement when **x**/ **y**/ **scale** can achieve the same look.
77
+ - ❌ Set **will-change** or **force3D** on every element “just in case”; use for elements that are actually animating.
78
+ - ❌ Create hundreds of overlapping tweens or ScrollTriggers without testing on low-end devices.
79
+ - ❌ Ignore cleanup; stray tweens and ScrollTriggers keep running and can hurt performance and correctness.
80
+
81
+ ---
82
+
83
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
84
+
85
+ **Slash command: `/review` or `/tribunal-full`**
86
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
87
+
88
+ ### ❌ Forbidden AI Tropes
89
+
90
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
91
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
92
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
93
+
94
+ ---
95
+
96
+ ## 🚨 LLM Trap Table
97
+
98
+ |Pattern|What AI Does Wrong|What Is Actually Correct|
99
+ |:---|:---|:---|
100
+ |gsap-performance|Layout caching issues|Call ScrollTrigger.refresh() on height/layout changes|
101
+ |gsap-performance|Multiple separate tweens with delay|Use a single tween with stagger: 0.1|
102
+ |gsap-performance|will-change on everything|Use sparingly, or let GSAP handle it via willChange: "transform" option|
103
+
104
+ ---
105
+
106
+ ## ✅ Pre-Flight Self-Audit
107
+
108
+ Before producing any output, verify:
109
+ ```
110
+ ✅ Did I read the actual files before making claims about them?
111
+ ✅ Did I verify all method names against official GSAP documentation?
112
+ ✅ Did I add // VERIFY: on any uncertain API calls?
113
+ ✅ Are all imports from packages that actually exist in package.json?
114
+ ✅ Did I test my logic with edge cases (null, empty, 0, max)?
115
+ ✅ Did I avoid generating code for more than one module at a time?
116
+ ✅ Am I working from evidence, not assumption?
117
+ ```
118
+
119
+ ---
120
+
121
+ ## 🔁 VBC Protocol (Verify → Build → Confirm)
122
+
123
+ ```
124
+ VERIFY: Read the actual codebase before writing anything
125
+ BUILD: Generate the smallest meaningful unit of code
126
+ CONFIRM: Verify the output is correct before presenting
127
+ ```
@@ -0,0 +1,474 @@
1
+ ---
2
+ name: gsap-plugins
3
+ description: Official GSAP skill for GSAP plugins — registration, ScrollToPlugin, ScrollSmoother, Flip, Draggable, Inertia, Observer, SplitText, ScrambleText, SVG and physics plugins, CustomEase, EasePack, CustomWiggle, CustomBounce, GSDevTools. Use when the user asks about a GSAP plugin, scroll-to, flip animations, draggable, SVG drawing, or plugin registration.
4
+ license: MIT
5
+ ---
6
+
7
+ # GSAP Plugins
8
+
9
+ ## When to Use This Skill
10
+
11
+ Apply when using or reviewing code that uses GSAP plugins: registering plugins, scroll-to, flip/FLIP animations, draggable elements, SVG (DrawSVG, MorphSVG, MotionPath), text (SplitText, ScrambleText), physics, easing plugins (CustomEase, EasePack, CustomWiggle, CustomBounce), or GSDevTools. ScrollTrigger has its own skill (gsap-scrolltrigger).
12
+
13
+ **Related skills:** For core tweens use **gsap-core**; for ScrollTrigger use **gsap-scrolltrigger**; for React use **gsap-react**.
14
+
15
+ ## Registering Plugins
16
+
17
+ Register each plugin once so GSAP (and bundlers) know to include it. Use **gsap.registerPlugin()** with every plugin used in the project:
18
+
19
+ ```javascript
20
+ import gsap from "gsap";
21
+ import { ScrollToPlugin } from "gsap/ScrollToPlugin";
22
+ import { Flip } from "gsap/Flip";
23
+ import { Draggable } from "gsap/Draggable";
24
+
25
+ gsap.registerPlugin(ScrollToPlugin, Flip, Draggable);
26
+ ```
27
+
28
+ - ✅ Register before using the plugin in any tween or API call.
29
+ - ✅ In React, register at top level or once in the app (e.g. before first useGSAP); do not register inside a component that re-renders. useGSAP is a plugin that needs to be registered before use.
30
+
31
+ ## Scroll
32
+
33
+ ### ScrollToPlugin
34
+
35
+ Animates scroll position (window or a scrollable element). Use for “scroll to element” or “scroll to position” without ScrollTrigger.
36
+
37
+ ```javascript
38
+ gsap.registerPlugin(ScrollToPlugin);
39
+
40
+ gsap.to(window, { duration: 1, scrollTo: { y: 500 } });
41
+ gsap.to(window, { duration: 1, scrollTo: { y: "#section", offsetY: 50 } });
42
+ gsap.to(scrollContainer, { duration: 1, scrollTo: { x: "max" } });
43
+ ```
44
+
45
+ **ScrollToPlugin — key config (scrollTo object):**
46
+
47
+ | Option | Description |
48
+ |--------|-------------|
49
+ | `x`, `y` | Target scroll position (number), or `"max"` for maximum |
50
+ | `element` | Selector or element to scroll to (for scroll-into-view) |
51
+ | `offsetX`, `offsetY` | Offset in pixels from the target position |
52
+
53
+ ### ScrollSmoother
54
+
55
+ Smooth scroll wrapper (smooths native scroll). Requires ScrollTrigger and a specific DOM structure (content wrapper + smooth wrapper). Use when smooth, momentum-style scroll is needed. See GSAP docs for setup; register after ScrollTrigger. DOM structure would look like:
56
+
57
+ ```html
58
+ <body>
59
+ <div id="smooth-wrapper">
60
+ <div id="smooth-content">
61
+ <!--- ALL YOUR CONTENT HERE --->
62
+ </div>
63
+ </div>
64
+ <!-- position: fixed elements can go outside --->
65
+ </body>
66
+ ```
67
+
68
+ ## DOM / UI
69
+
70
+ ### Flip
71
+
72
+ Capture state with `Flip.getState()`, then apply changes (e.g. layout or class changes), then use `Flip.from()` to animate from the previous state to the new state (FLIP: First, Last, Invert, Play). Use when animating between two layout states (lists, grids, expanded/collapsed).
73
+
74
+ ```javascript
75
+ gsap.registerPlugin(Flip);
76
+
77
+ const state = Flip.getState(".item");
78
+ // change DOM (reorder, add/remove, change classes)
79
+ Flip.from(state, { duration: 0.5, ease: "power2.inOut" });
80
+ ```
81
+
82
+ **Flip — key config (Flip.from vars):**
83
+
84
+ | Option | Description |
85
+ |--------|-------------|
86
+ | `absolute` | Use `position: absolute` during the flip (default: `false`) |
87
+ | `nested` | When true, only the first level of children is measured (better for nested transforms) |
88
+ | `scale` | When true, scale elements to fit (avoids stretch); default `true` |
89
+ | `simple` | When true, only position/scale are animated (faster, less accurate) |
90
+ | `duration`, `ease` | Standard tween options |
91
+
92
+ #### More information
93
+
94
+ https://gsap.com/docs/v3/Plugins/Flip
95
+
96
+ ### Draggable
97
+
98
+ Makes elements draggable, spinnable, or throwable with mouse/touch. Use for sliders, cards, reorderable lists, or any drag interaction.
99
+
100
+ ```javascript
101
+ gsap.registerPlugin(Draggable, InertiaPlugin);
102
+
103
+ Draggable.create(".box", { type: "x,y", bounds: "#container", inertia: true });
104
+ Draggable.create(".knob", { type: "rotation" });
105
+ ```
106
+
107
+ **Draggable — key config options:**
108
+
109
+ | Option | Description |
110
+ |--------|-------------|
111
+ | `type` | `"x"`, `"y"`, `"x,y"`, `"rotation"`, `"scroll"` |
112
+ | `bounds` | Element, selector, or `{ minX, maxX, minY, maxY }` to constrain drag |
113
+ | `inertia` | `true` to enable throw/momentum (requires InertiaPlugin) |
114
+ | `edgeResistance` | 0–1; resistance when dragging past bounds |
115
+ | `cursor` | CSS cursor during drag |
116
+ | `onDragStart`, `onDrag`, `onDragEnd` | Callbacks; receive event and target |
117
+ | `onThrowUpdate`, `onThrowComplete` | Callbacks when inertia is active |
118
+
119
+ ### Inertia (InertiaPlugin)
120
+
121
+ Works with Draggable for momentum after release, or track the inertia/velocity of any property of any object so that it can then seamlessly glide to a stop using a simple tween. Register with Draggable when using `inertia: true`:
122
+
123
+ ```javascript
124
+ gsap.registerPlugin(Draggable, InertiaPlugin);
125
+ Draggable.create(".box", { type: "x,y", inertia: true });
126
+ ```
127
+
128
+ Or track velocity of a property:
129
+ ```javascript
130
+ InertiaPlugin.track(".box", "x");
131
+ ```
132
+
133
+ Then use `"auto"` to continue the current velocity and glide to a stop:
134
+
135
+ ```javascript
136
+ gsap.to(obj, { inertia: { x: "auto" } });
137
+ ```
138
+
139
+ ### Observer
140
+
141
+ Normalizes pointer and scroll input across devices. Use for swipe, scroll direction, or custom gesture logic without tying directly to scroll position like ScrollTrigger.
142
+
143
+ ```javascript
144
+ gsap.registerPlugin(Observer);
145
+
146
+ Observer.create({
147
+ target: "#area",
148
+ onUp: () => {},
149
+ onDown: () => {},
150
+ onLeft: () => {},
151
+ onRight: () => {},
152
+ tolerance: 10
153
+ });
154
+ ```
155
+
156
+ **Observer — key config options:**
157
+
158
+ | Option | Description |
159
+ |--------|-------------|
160
+ | `target` | Element or selector to observe |
161
+ | `onUp`, `onDown`, `onLeft`, `onRight` | Callbacks when swipe/scroll passes tolerance in that direction |
162
+ | `tolerance` | Pixels before direction is detected; default 10 |
163
+ | `type` | `"touch"`, `"pointer"`, or `"wheel"` (default: `"touch,pointer"`) |
164
+
165
+ ## Text
166
+
167
+ ### SplitText
168
+
169
+ Splits an element’s text into characters, words, and/or lines (each in its own element) for staggered or per-unit animation. Use when animating text character-by-character, word-by-word, or line-by-line. Returns an instance with **chars**, **words**, **lines** (and **masks** when `mask` is set). Restore original markup with **revert()** or let **gsap.context()** revert. Integrates with **gsap.context()**, **matchMedia()**, and **useGSAP()**. API: **SplitText.create(target, vars)** (target = selector, element, or array).
170
+
171
+ ```javascript
172
+ gsap.registerPlugin(SplitText);
173
+
174
+ const split = SplitText.create(".heading", { type: "words, chars" });
175
+ gsap.from(split.chars, { opacity: 0, y: 20, stagger: 0.03, duration: 0.4 });
176
+ // later: split.revert() or let gsap.context() cleanup revert
177
+ ```
178
+
179
+ With **onSplit()** (v3.13.0+), animations run on each split and on re-split when **autoSplit** is used; returning a tween/timeline from **onSplit()** lets SplitText clean up and sync progress on re-split:
180
+
181
+ ```javascript
182
+ SplitText.create(".split", {
183
+ type: "lines",
184
+ autoSplit: true,
185
+ onSplit(self) {
186
+ return gsap.from(self.lines, { y: 100, opacity: 0, stagger: 0.05, duration: 0.5 });
187
+ }
188
+ });
189
+ ```
190
+
191
+ **SplitText — key config (SplitText.create vars):**
192
+
193
+ | Option | Description |
194
+ |--------|-------------|
195
+ | **type** | Comma-separated: `"chars"`, `"words"`, `"lines"`. Default `"chars,words,lines"`. Only split what is needed (e.g. `"words, chars"` if not using lines) for performance. Avoid chars-only without words/lines or use **smartWrap: true** to prevent odd line breaks. |
196
+ | **charsClass**, **wordsClass**, **linesClass** | CSS class on each split element. Append `"++"` to add an incremented class (e.g. `linesClass: "line++"` → `line1`, `line2`, …). |
197
+ | **aria** | `"auto"` (default), `"hidden"`, or `"none"`. Accessibility: `"auto"` adds `aria-label` on the split element and `aria-hidden` on line/word/char elements so screen readers read the label; `"hidden"` hides all from readers; `"none"` leaves aria unchanged. Use `"none"` plus a screen-reader-only duplicate if nested links/semantics must be exposed. |
198
+ | **autoSplit** | When `true`, reverts and re-splits when fonts finish loading or when the element width changes (and lines are split), avoiding wrong line breaks. **Animations must be created inside onSplit()** so they target the newly split elements; **return** the animation from **onSplit()** for automatic cleanup and time-sync on re-split. |
199
+ | **onSplit(self)** | Callback when split completes (and on each re-split if **autoSplit** is `true`). Receives the SplitText instance. Returning a GSAP tween or timeline enables automatic revert/sync of that animation when re-splitting. |
200
+ | **mask** | `"lines"`, `"words"`, or `"chars"`. Wraps each unit in an extra element with `overflow: clip` for mask/reveal effects. Only one type; access wrappers on the instance’s **masks** array (or use class `-mask` if a class is set). |
201
+ | **tag** | Wrapper element tag; default `"div"`. Use `"span"` for inline (note: transforms like rotation/scale may not render on inline elements in some browsers). |
202
+ | **deepSlice** | When `true` (default), nested elements (e.g. `<strong>`) that span multiple lines are subdivided so lines don’t stretch vertically. Only applies when splitting lines. |
203
+ | **ignore** | Selector or element(s) to leave unsplit (e.g. `ignore: "sup"`). |
204
+ | **smartWrap** | When splitting **chars** only, wraps words in a `white-space: nowrap` span to avoid mid-word line breaks. Ignored if words or lines are split. Default `false`. |
205
+ | **wordDelimiter** | Word boundary: string (default `" "`), RegExp, or `{ delimiter: RegExp, replaceWith: string }` for custom splitting (e.g. zero-width joiner for hashtags, or non-Latin). |
206
+ | **prepareText(text, parent)** | Function that receives raw text and parent element; return modified text before splitting (e.g. to insert break markers for languages without spaces). |
207
+ | **propIndex** | When `true`, adds a CSS variable with index on each split element (e.g. `--word: 1`, `--char: 2`). |
208
+ | **reduceWhiteSpace** | Collapse consecutive spaces; default `true`. From v3.13.0 also honors line breaks and can insert `<br>` for `<pre>`. |
209
+ | **onRevert** | Callback when the instance is reverted. |
210
+
211
+ **Tips:** Split only what is animated (e.g. skip chars if only animating words). For custom fonts, split after they load (e.g. `document.fonts.ready.then(...)`) or use **autoSplit: true** with **onSplit()**. To avoid kerning shift when splitting chars, use CSS `font-kerning: none; text-rendering: optimizeSpeed;`. Avoid `text-wrap: balance`; it can interfere with splitting. SplitText does not support SVG `<text>`.
212
+
213
+ **Learn more:** [SplitText](https://gsap.com/docs/v3/Plugins/SplitText/)
214
+
215
+ ### ScrambleText
216
+
217
+ Animates text with a scramble/glitch effect. Use when revealing or transitioning text with a scramble.
218
+
219
+ ```javascript
220
+ gsap.registerPlugin(ScrambleTextPlugin);
221
+
222
+ gsap.to(".text", {
223
+ duration: 1,
224
+ scrambleText: { text: "New message", chars: "01", revealDelay: 0.5 }
225
+ });
226
+ ```
227
+
228
+ ## SVG
229
+
230
+ ### DrawSVG (DrawSVGPlugin)
231
+
232
+ Reveals or hides the stroke of SVG elements by animating `stroke-dashoffset` / `stroke-dasharray`. Works on `<path>`, `<line>`, `<polyline>`, `<polygon>`, `<rect>`, `<ellipse>`. Use when “drawing” or “erasing” strokes.
233
+
234
+ **drawSVG value:** Describes the **visible segment** of the stroke along the path (start and end positions), not “animate from A to B over time.” Format: `"start end"` in percent or length. Examples: `"0% 100%"` = full stroke; `"20% 80%"` = stroke only between 20% and 80% (gaps at both ends). The tween animates from the element’s **current** segment to the **target** segment — e.g. `gsap.to("#path", { drawSVG: "0% 100%" })` goes from whatever it is now to full stroke. Single value (e.g. `0`, `"100%"`) means start is 0: `"100%"` is equivalent to `"0% 100%"`.
235
+
236
+ **Required:** The element must have a visible stroke — set `stroke` and `stroke-width` in CSS or as SVG attributes; otherwise nothing is drawn.
237
+
238
+ ```javascript
239
+ gsap.registerPlugin(DrawSVGPlugin);
240
+
241
+ // draw from nothing to full stroke
242
+ gsap.from("#path", { duration: 1, drawSVG: 0 });
243
+ // or explicit segment: from 0–0 to 0–100%
244
+ gsap.fromTo("#path", { drawSVG: "0% 0%" }, { drawSVG: "0% 100%", duration: 1 });
245
+ // stroke only in the middle (gaps at ends)
246
+ gsap.to("#path", { duration: 1, drawSVG: "20% 80%" });
247
+ ```
248
+
249
+ **Caveats:** Only affects stroke (not fill). Prefer single-segment `<path>` elements; multi-segment paths can render oddly in some browsers. Contents of `<use>` cannot be visually changed. **DrawSVGPlugin.getLength(element)** and **DrawSVGPlugin.getPosition(element)** return stroke length and current position.
250
+
251
+ **Learn more:** [DrawSVG](https://gsap.com/docs/v3/Plugins/DrawSVGPlugin)
252
+
253
+ ### MorphSVG (MorphSVGPlugin)
254
+
255
+ Morphs one SVG shape into another by animating the `d` attribute (path data). Start and end shapes do not need the same number of points — MorphSVG converts to cubic beziers and adds points as needed. Use for icon-to-icon morphs, shape transitions, or path-based animations. Works on `<path>`, `<polyline>`, and `<polygon>`; `<circle>`, `<rect>`, `<ellipse>`, and `<line>` are converted internally or via **MorphSVGPlugin.convertToPath(selector | element)** (replaces the element in the DOM with a `<path>`).
256
+
257
+ **morphSVG value:** Can be a **selector** (e.g. `"#lightning"`), an **element**, **raw path data** (e.g. `"M47.1,0.8 73.3,0.8..."`), or for polygon/polyline a **points string** (e.g. `"240,220 240,70 70,70 70,220"`). For full config use the **object form** with **shape** as the only required property.
258
+
259
+ ```javascript
260
+ gsap.registerPlugin(MorphSVGPlugin);
261
+
262
+ // convert primitives to path first if needed:
263
+ MorphSVGPlugin.convertToPath("circle, rect, ellipse, line");
264
+
265
+ gsap.to("#diamond", { duration: 1, morphSVG: "#lightning", ease: "power2.inOut" });
266
+ // object form:
267
+ gsap.to("#diamond", {
268
+ duration: 1,
269
+ morphSVG: { shape: "#lightning", type: "rotational", shapeIndex: 2 }
270
+ });
271
+
272
+ ```
273
+
274
+ **MorphSVG — key config (morphSVG object):**
275
+
276
+ | Option | Description |
277
+ |--------|-------------|
278
+ | **shape** | _(Required.)_ Target shape: selector, element, or raw path string. |
279
+ | **type** | `"linear"` (default) or `"rotational"`. Rotational uses angle/length interpolation and can avoid kinks mid-morph; try it when linear looks wrong. |
280
+ | **map** | How segments are matched: `"size"` (default), `"position"`, or `"complexity"`. Use when start/end segments don’t line up; if none work, split into multiple paths and morph each. |
281
+ | **shapeIndex** | Offsets which point in the start path maps to the first point in the end path (avoids shape “crossing over” or inverting). Number for single-segment paths; **array** for multi-segment (e.g. `[5, 1, -8]`). Negative reverses that segment. Use **shapeIndex: "log"** once to log the auto-calculated value, then paste the number/array into the tween. **findShapeIndex(start, end)** (separate utility) provides an interactive UI to find a good value. Only applies to closed paths. |
282
+ | **smooth** | (v3.14+). Adds smoothing points. Number (e.g. `80`), `"auto"`, or object: `{ points: 40 \| "auto", redraw: true \| false, persist: true \| false }`. `redraw: false` keeps original anchors (perfect fidelity, less even spacing). `persist: false` removes added points when the tween ends. Use when the default morph looks jagged or unnatural. |
283
+ | **curveMode** | Boolean (v3.14+). Interpolates control-handle angle/length instead of raw x/y to avoid kinks on curves. Try if a morph has a mid-morph kink. |
284
+ | **origin** | Rotation origin for **type: "rotational"**. String: `"50% 50%"` (default) or `"20% 60%, 35% 90%"` for different start/end origins. |
285
+ | **precision** | Decimal places for output path data; default `2`. |
286
+ | **precompile** | Array of precomputed path strings (or use **precompile: "log"** once, copy from console). Skips expensive startup calculations; use for very complex morphs. Only for `<path>` (convert polygon/polyline first). |
287
+ | **render** | Function(rawPath, target) called each update — e.g. draw to canvas. RawPath is an array of segments (each segment = array of alternating x,y cubic bezier coords). |
288
+ | **updateTarget** | When using **render** (e.g. canvas-only), set **updateTarget: false** so the original `<path>` is not updated. **MorphSVGPlugin.defaultUpdateTarget** sets default. |
289
+
290
+ **Utilities:** **MorphSVGPlugin.convertToPath(selector | element)** converts circle/rect/ellipse/line/polygon/polyline to `<path>` in the DOM. **MorphSVGPlugin.rawPathToString(rawPath)** and **stringToRawPath(d)** convert between path strings and raw arrays. The plugin stores the original `d` on the target (e.g. for tweening back: `morphSVG: "#originalId"` or the same element).
291
+
292
+ **Tips:** For twisted or inverted morphs, set **shapeIndex** (use `"log"` or findShapeIndex()). For multi-segment paths, **shapeIndex** is an array (one value per segment). Precompile only when the first frame is slow; it does not fix jank during the tween (simplify the SVG or reduce size if needed).
293
+
294
+ **Learn more:** [MorphSVG](https://gsap.com/docs/v3/Plugins/MorphSVGPlugin)
295
+
296
+ ### MotionPath (MotionPathPlugin)
297
+
298
+ Animates an element along an SVG path. Use when moving an object along a path (e.g. a curve or custom route).
299
+
300
+ ```javascript
301
+ gsap.registerPlugin(MotionPathPlugin);
302
+
303
+ gsap.to(".dot", {
304
+ duration: 2,
305
+ motionPath: { path: "#path", align: "#path", alignOrigin: [0.5, 0.5] }
306
+ });
307
+ ```
308
+
309
+ **MotionPath — key config (motionPath object):**
310
+
311
+ | Option | Description |
312
+ |--------|-------------|
313
+ | `path` | SVG path element, selector, or path data string |
314
+ | `align` | Path element or selector to align the target to |
315
+ | `alignOrigin` | `[x, y]` origin (0–1); default `[0.5, 0.5]` |
316
+ | `autoRotate` | Rotate element to follow path tangent |
317
+ | `curviness` | 0–2; path smoothing |
318
+
319
+ ### MotionPathHelper
320
+
321
+ Visual editor for MotionPath (alignment, offset). Use during development to tune path alignment.
322
+
323
+ ```javascript
324
+ gsap.registerPlugin(MotionPathPlugin, MotionPathHelperPlugin);
325
+
326
+ const helper = MotionPathHelper.create(".dot", "#path", { end: 0.5 });
327
+ // adjust in UI, then use helper.path or helper.getProgress() in your animation
328
+ ```
329
+
330
+ ## Easing
331
+
332
+ ### CustomEase
333
+
334
+ Custom easing curves (cubic-bezier or SVG path). Use when a built-in ease is not enough. Basic usage is covered in gsap-core; register when using:
335
+
336
+ ```javascript
337
+ gsap.registerPlugin(CustomEase);
338
+ const ease = CustomEase.create("name", ".17,.67,.83,.67");
339
+ gsap.to(".el", { x: 100, ease: ease, duration: 1 });
340
+ ```
341
+
342
+ ### EasePack
343
+
344
+ Adds more named eases (e.g. SlowMo, RoughEase, ExpoScaleEase). Register and use the ease names in tweens.
345
+
346
+ ### CustomWiggle
347
+
348
+ Wiggle/shake easing. Use when a value should “wiggle” (multiple oscillations).
349
+
350
+ ### CustomBounce
351
+
352
+ Bounce-style easing with configurable strength.
353
+
354
+ ## Physics
355
+
356
+ ### Physics2D (Physics2DPlugin)
357
+
358
+ 2D physics (velocity, angle, gravity). Use when animating with simple physics (e.g. projectiles, bouncing).
359
+
360
+ ```javascript
361
+ gsap.registerPlugin(Physics2DPlugin);
362
+
363
+ gsap.to(".ball", {
364
+ duration: 2,
365
+ physics2D: {
366
+ velocity: 250,
367
+ angle: 80,
368
+ gravity: 500
369
+ }
370
+ });
371
+ ```
372
+
373
+ ### PhysicsProps (PhysicsPropsPlugin)
374
+
375
+ Applies physics to property values. Use for physics-driven property animation.
376
+
377
+ ```javascript
378
+ gsap.registerPlugin(PhysicsPropsPlugin);
379
+
380
+ gsap.to(".obj", {
381
+ duration: 2,
382
+ physicsProps: {
383
+ x: { velocity: 100, end: 300 },
384
+ y: { velocity: -50, acceleration: 200 }
385
+ }
386
+ });
387
+ ```
388
+
389
+ ## Development
390
+
391
+ ### GSDevTools
392
+
393
+ UI for scrubbing timelines, toggling animations, and debugging. Use during development only; do not ship. Register and create an instance with a timeline reference.
394
+
395
+ ```javascript
396
+ gsap.registerPlugin(GSDevTools);
397
+ GSDevTools.create({ animation: tl });
398
+ ```
399
+
400
+ ## Other
401
+
402
+ ### Pixi (PixiPlugin)
403
+
404
+ Integrates GSAP with PixiJS for animating Pixi display objects. Register when animating Pixi objects with GSAP.
405
+
406
+ ```javascript
407
+ gsap.registerPlugin(PixiPlugin);
408
+
409
+ const sprite = new PIXI.Sprite(texture);
410
+ gsap.to(sprite, { pixi: { x: 200, y: 100, scale: 1.5 }, duration: 1 });
411
+ ```
412
+
413
+ ## Best practices
414
+
415
+ - ✅ Register every plugin used with **gsap.registerPlugin()** before first use.
416
+ - ✅ Use **Flip.getState()** → DOM change → **Flip.from()** for layout transitions; use **Draggable** + **InertiaPlugin** for drag with momentum.
417
+ - ✅ Revert plugin instances (e.g. `SplitTextInstance.revert()`) when components unmount or elements are removed.
418
+
419
+ ## Do Not
420
+
421
+ - ❌ Use a plugin in a tween or API without registering it first (**gsap.registerPlugin()**).
422
+ - ❌ Ship GSDevTools or development-only plugins to production.
423
+
424
+ ### Learn More
425
+
426
+ https://gsap.com/docs/v3/Plugins/
427
+
428
+ ---
429
+
430
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
431
+
432
+ **Slash command: `/review` or `/tribunal-full`**
433
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
434
+
435
+ ### ❌ Forbidden AI Tropes
436
+
437
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
438
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
439
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
440
+
441
+ ---
442
+
443
+ ## 🚨 LLM Trap Table
444
+
445
+ |Pattern|What AI Does Wrong|What Is Actually Correct|
446
+ |:---|:---|:---|
447
+ |gsap-plugins|Using premium plugins without club membership|MorphSVG, SplitText, ScrollSmoother require Club GSAP|
448
+ |gsap-plugins|Forgetting gsap.registerPlugin(Plugin)|Register EVERY plugin before its first use|
449
+ |gsap-plugins|SplitText hurting SEO|Always call .revert() after animating SplitText to restore DOM structure|
450
+
451
+ ---
452
+
453
+ ## ✅ Pre-Flight Self-Audit
454
+
455
+ Before producing any output, verify:
456
+ ```
457
+ ✅ Did I read the actual files before making claims about them?
458
+ ✅ Did I verify all method names against official GSAP documentation?
459
+ ✅ Did I add // VERIFY: on any uncertain API calls?
460
+ ✅ Are all imports from packages that actually exist in package.json?
461
+ ✅ Did I test my logic with edge cases (null, empty, 0, max)?
462
+ ✅ Did I avoid generating code for more than one module at a time?
463
+ ✅ Am I working from evidence, not assumption?
464
+ ```
465
+
466
+ ---
467
+
468
+ ## 🔁 VBC Protocol (Verify → Build → Confirm)
469
+
470
+ ```
471
+ VERIFY: Read the actual codebase before writing anything
472
+ BUILD: Generate the smallest meaningful unit of code
473
+ CONFIRM: Verify the output is correct before presenting
474
+ ```