tribunal-kit 4.0.0 → 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 +17 -10
  107. package/package.json +5 -2
  108. package/.agent/skills/gsap-expert/SKILL.md +0 -194
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: gsap-timeline
3
+ description: Official GSAP skill for timelines — gsap.timeline(), position parameter, nesting, playback. Use when sequencing animations, choreographing keyframes, or when the user asks about animation sequencing, timelines, or animation order (in GSAP or when recommending a library that supports timelines).
4
+ license: MIT
5
+ ---
6
+
7
+ # GSAP Timeline
8
+
9
+ ## When to Use This Skill
10
+
11
+ Apply when building multi-step animations, coordinating several tweens in sequence or parallel, or when the user asks about timelines, sequencing, or keyframe-style animation in GSAP.
12
+
13
+ **Related skills:** For single tweens and eases use **gsap-core**; for scroll-driven timelines use **gsap-scrolltrigger**; for React use **gsap-react**.
14
+
15
+ ## Creating a Timeline
16
+
17
+ ```javascript
18
+ const tl = gsap.timeline();
19
+ tl.to(".a", { x: 100, duration: 1 })
20
+ .to(".b", { y: 50, duration: 0.5 })
21
+ .to(".c", { opacity: 0, duration: 0.3 });
22
+ ```
23
+
24
+ By default, tweens are **appended** one after another. Use the **position parameter** to place tweens at specific times or relative to other tweens.
25
+
26
+ ## Position Parameter
27
+
28
+ Third argument (or position property in vars) controls placement:
29
+
30
+ - **Absolute**: `1` — start at 1 second.
31
+ - **Relative (default)**: `"+=0.5"` — 0.5s after end; `"-=0.2"` — 0.2s before end.
32
+ - **Label**: `"labelName"` — at that label; `"labelName+=0.3"` — 0.3s after label.
33
+ - **Placement**: `"<"` — start when recently-added animation starts; `">"` — start when recently-added animation ends (default); `"<0.2"` — 0.2s after recently-added animation start.
34
+
35
+ Examples:
36
+
37
+ ```javascript
38
+ tl.to(".a", { x: 100 }, 0); // at 0
39
+ tl.to(".b", { y: 50 }, "+=0.5"); // 0.5s after last end
40
+ tl.to(".c", { opacity: 0 }, "<"); // same start as previous
41
+ tl.to(".d", { scale: 2 }, "<0.2"); // 0.2s after previous start
42
+ ```
43
+
44
+ ## Timeline Defaults
45
+
46
+ Pass defaults into the timeline so all child tweens inherit:
47
+
48
+ ```javascript
49
+ const tl = gsap.timeline({ defaults: { duration: 0.5, ease: "power2.out" } });
50
+ tl.to(".a", { x: 100 }).to(".b", { y: 50 }); // both use 0.5s and power2.out
51
+ ```
52
+
53
+ ## Timeline Options (constructor)
54
+
55
+ - **paused: true** — create paused; call `.play()` to start.
56
+ - **repeat**, **yoyo** — same as tweens; apply to whole timeline.
57
+ - **onComplete**, **onStart**, **onUpdate** — timeline-level callbacks.
58
+ - **defaults** — vars merged into every child tween.
59
+
60
+ ## Labels
61
+
62
+ Add and use labels for readable, maintainable sequencing:
63
+
64
+ ```javascript
65
+ tl.addLabel("intro", 0);
66
+ tl.to(".a", { x: 100 }, "intro");
67
+ tl.addLabel("outro", "+=0.5");
68
+ tl.to(".b", { opacity: 0 }, "outro");
69
+ tl.play("outro"); // start from "outro"
70
+ tl.tweenFromTo("intro", "outro"); // pauses the timeline and returns a new Tween that animates the timeline's playhead from intro to outro with no ease.
71
+ ```
72
+
73
+ ## Nesting Timelines
74
+
75
+ Timelines can contain other timelines.
76
+
77
+ ```javascript
78
+ const master = gsap.timeline();
79
+ const child = gsap.timeline();
80
+ child.to(".a", { x: 100 }).to(".b", { y: 50 });
81
+ master.add(child, 0);
82
+ master.to(".c", { opacity: 0 }, "+=0.2");
83
+ ```
84
+
85
+ ## Controlling Playback
86
+
87
+ - **tl.play()** / **tl.pause()**
88
+ - **tl.reverse()** / **tl.progress(1)** then **tl.reverse()**
89
+ - **tl.restart()** — from start.
90
+ - **tl.time(2)** — seek to 2 seconds.
91
+ - **tl.progress(0.5)** — seek to 50%.
92
+ - **tl.kill()** — kill timeline and (by default) its children.
93
+
94
+ ## Official GSAP Best practices
95
+
96
+ - ✅ Prefer timelines for sequencing
97
+ - ✅ Use the **position parameter** (third argument) to place tweens at specific times or relative to labels.
98
+ - ✅ Add **labels** with `addLabel()` for readable, maintainable sequencing.
99
+ - ✅ Pass **defaults** into the timeline constructor so child tweens inherit duration, ease, etc.
100
+ - ✅ Put ScrollTrigger on the timeline (or top-level tween), not on tweens inside a timeline.
101
+
102
+ ## Do Not
103
+
104
+ - ❌ Chain animations with **delay** when a **timeline** can sequence them; prefer `gsap.timeline()` and the position parameter for multi-step animation.
105
+ - ❌ Forget to pass **defaults** (e.g. `defaults: { duration: 0.5, ease: "power2.out" }`) when many child tweens share the same duration or ease.
106
+ - ❌ Forget that **duration** on the timeline constructor is not the same as tween duration; timeline “duration” is determined by its children.
107
+ - ❌ Nest animations that contain a ScrollTrigger; ScrollTriggers should only be on top-level Tweens/Timelines.
108
+
109
+ ---
110
+
111
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
112
+
113
+ **Slash command: `/review` or `/tribunal-full`**
114
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
115
+
116
+ ### ❌ Forbidden AI Tropes
117
+
118
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
119
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
120
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
121
+
122
+ ---
123
+
124
+ ## 🚨 LLM Trap Table
125
+
126
+ |Pattern|What AI Does Wrong|What Is Actually Correct|
127
+ |:---|:---|:---|
128
+ |gsap-timeline|Position parameter as 2nd arg|Position parameter is the 3rd arg: tl.to(el, {x: 100}, "<")|
129
+ |gsap-timeline|tl.add(gsap.to(...))|tl.to(...) (just chain the tween directly)|
130
+ |gsap-timeline|Hardcoded delays (delay: 1)|Use position parameter (<, >, +=1) for relative timing|
131
+
132
+ ---
133
+
134
+ ## ✅ Pre-Flight Self-Audit
135
+
136
+ Before producing any output, verify:
137
+ ```
138
+ ✅ Did I read the actual files before making claims about them?
139
+ ✅ Did I verify all method names against official GSAP documentation?
140
+ ✅ Did I add // VERIFY: on any uncertain API calls?
141
+ ✅ Are all imports from packages that actually exist in package.json?
142
+ ✅ Did I test my logic with edge cases (null, empty, 0, max)?
143
+ ✅ Did I avoid generating code for more than one module at a time?
144
+ ✅ Am I working from evidence, not assumption?
145
+ ```
146
+
147
+ ---
148
+
149
+ ## 🔁 VBC Protocol (Verify → Build → Confirm)
150
+
151
+ ```
152
+ VERIFY: Read the actual codebase before writing anything
153
+ BUILD: Generate the smallest meaningful unit of code
154
+ CONFIRM: Verify the output is correct before presenting
155
+ ```
@@ -0,0 +1,332 @@
1
+ ---
2
+ name: gsap-utils
3
+ description: Official GSAP skill for gsap.utils — clamp, mapRange, normalize, interpolate, random, snap, toArray, wrap, pipe. Use when the user asks about gsap.utils, clamp, mapRange, random, snap, toArray, wrap, or helper utilities in GSAP.
4
+ license: MIT
5
+ ---
6
+
7
+ # gsap.utils
8
+
9
+ ## When to Use This Skill
10
+
11
+ Apply when writing or reviewing code that uses **gsap.utils** for math, array/collection handling, unit parsing, or value mapping in animations (e.g. mapping scroll to a value, randomizing, snapping to a grid, or normalizing inputs).
12
+
13
+ **Related skills:** Use with **gsap-core**, **gsap-timeline**, and **gsap-scrolltrigger** when building animations; CustomEase and other easing utilities are in **gsap-plugins**.
14
+
15
+ ## Overview
16
+
17
+ **gsap.utils** provides pure helpers; no need to register. Use in tween vars (e.g. function-based values), in ScrollTrigger or Observer callbacks, or in any JS that drives GSAP. All are on **gsap.utils** (e.g. `gsap.utils.clamp()`).
18
+
19
+ **Omitting the value: function form.** Many utils accept the value to transform as the **last** argument. If you omit that argument, the util returns a **function** that accepts the value later. Use the function form when you need to clamp, map, normalize, or snap many values with the same config (e.g. in a mousemove handler or tween callback). **Exception: random()** — pass **true** as the last argument to get a reusable function (do not omit the value); see [random()](https://gsap.com/docs/v3/GSAP/UtilityMethods/random()).
20
+
21
+ ```javascript
22
+ // With value: returns the result
23
+ gsap.utils.clamp(0, 100, 150); // 100
24
+
25
+ // Without value: returns a function you call with the value later
26
+ let c = gsap.utils.clamp(0, 100);
27
+ c(150); // 100
28
+ c(-10); // 0
29
+ ```
30
+
31
+ ## Clamping and Ranges
32
+
33
+ ### clamp(min, max, value?)
34
+
35
+ Constrains a value between min and max. Omit **value** to get a function: `clamp(min, max)(value)`.
36
+
37
+ ```javascript
38
+ gsap.utils.clamp(0, 100, 150); // 100
39
+ gsap.utils.clamp(0, 100, -10); // 0
40
+
41
+ let clampFn = gsap.utils.clamp(0, 100);
42
+ clampFn(150); // 100
43
+ ```
44
+
45
+ ### mapRange(inMin, inMax, outMin, outMax, value?)
46
+
47
+ Maps a value from one range to another. Use when converting scroll position, progress (0–1), or input range to an animation range. Omit **value** to get a function: `mapRange(inMin, inMax, outMin, outMax)(value)`.
48
+
49
+ ```javascript
50
+ gsap.utils.mapRange(0, 100, 0, 500, 50); // 250
51
+ gsap.utils.mapRange(0, 1, 0, 360, 0.5); // 180 (progress to degrees)
52
+
53
+ let mapFn = gsap.utils.mapRange(0, 100, 0, 500);
54
+ mapFn(50); // 250
55
+ ```
56
+
57
+ ### normalize(min, max, value?)
58
+
59
+ Returns a value normalized to 0–1 for the given range. Inverse of mapping when the target range is 0–1. Omit **value** to get a function: `normalize(min, max)(value)`.
60
+
61
+ ```javascript
62
+ gsap.utils.normalize(0, 100, 50); // 0.5
63
+ gsap.utils.normalize(100, 300, 200); // 0.5
64
+
65
+ let normFn = gsap.utils.normalize(0, 100);
66
+ normFn(50); // 0.5
67
+ ```
68
+
69
+ ### interpolate(start, end, progress?)
70
+
71
+ Interpolates between two values at a given progress (0–1). Handles numbers, colors, and objects with matching keys. Omit **progress** to get a function: `interpolate(start, end)(progress)`.
72
+
73
+ ```javascript
74
+ gsap.utils.interpolate(0, 100, 0.5); // 50
75
+ gsap.utils.interpolate("#ff0000", "#0000ff", 0.5); // mid color
76
+ gsap.utils.interpolate({ x: 0, y: 0 }, { x: 100, y: 50 }, 0.5); // { x: 50, y: 25 }
77
+
78
+ let lerp = gsap.utils.interpolate(0, 100);
79
+ lerp(0.5); // 50
80
+ ```
81
+
82
+ ## Random and Snap
83
+
84
+ ### random(minimum, maximum[, snapIncrement, returnFunction]) / random(array[, returnFunction])
85
+
86
+ Returns a random number in the range **minimum**–**maximum**, or a random element from an **array**. Optional **snapIncrement** snaps the result to the nearest multiple (e.g. `5` → multiples of 5). **To get a reusable function**, pass **true** as the last argument (**returnFunction**); the returned function takes no args and returns a new random value each time. This is the only util that uses `true` for the function form instead of omitting the value.
87
+
88
+ ```javascript
89
+ // immediate value: number in range
90
+ gsap.utils.random(-100, 100); // e.g. 42.7
91
+ gsap.utils.random(0, 500, 5); // 0–500, snapped to nearest 5
92
+
93
+ // reusable function: pass true as last argument
94
+ let randomFn = gsap.utils.random(-200, 500, 10, true);
95
+ randomFn(); // random value in range, snapped to 10
96
+ randomFn(); // another random value
97
+
98
+ // array: pick one value at random
99
+ gsap.utils.random(["red", "blue", "green"]); // "red", "blue", or "green"
100
+ let randomFromArray = gsap.utils.random([0, 100, 200], true);
101
+ randomFromArray(); // 0, 100, or 200
102
+ ```
103
+
104
+ **String form in tween vars:** use `"random(-100, 100)"`, `"random(-100, 100, 5)"`, or `"random([0, 100, 200])"`; GSAP evaluates it per target.
105
+
106
+ ```javascript
107
+ gsap.to(".box", { x: "random(-100, 100, 5)", duration: 1 });
108
+ gsap.to(".item", { backgroundColor: "random([red, blue, green])" });
109
+ ```
110
+
111
+ ### snap(snapTo, value?)
112
+
113
+ Snaps a value to the nearest multiple of **snapTo**, or to the nearest value in an array of allowed values. Omit **value** to get a function: `snap(snapTo)(value)` (or `snap(snapArray)(value)`).
114
+
115
+ ```javascript
116
+ gsap.utils.snap(10, 23); // 20
117
+ gsap.utils.snap(0.25, 0.7); // 0.75
118
+ gsap.utils.snap([0, 100, 200], 150); // 100 or 200 (nearest in array)
119
+
120
+ let snapFn = gsap.utils.snap(10);
121
+ snapFn(23); // 20
122
+ ```
123
+
124
+ Use in tweens for grid or step-based animation:
125
+
126
+ ```javascript
127
+ gsap.to(".x", { x: 200, snap: { x: 20 } });
128
+ ```
129
+
130
+ ### shuffle(array)
131
+
132
+ Returns a new array with the same elements in random order. Use for randomizing order (e.g. stagger from "random" with a copy).
133
+
134
+ ```javascript
135
+ gsap.utils.shuffle([1, 2, 3, 4]); // e.g. [3, 1, 4, 2]
136
+ ```
137
+
138
+ ### distribute(config)
139
+
140
+ **Returns a function** that assigns a value to each target based on its position in the array (or in a grid). Used internally for advanced staggers; use it whenever you need values spread across many elements (e.g. scale, opacity, x, delay). The returned function receives `(index, target, targets)` — either call it manually or pass the result directly into a tween; GSAP will call it per target with index, element, and array.
141
+
142
+ **Config (all optional):**
143
+
144
+ | Property | Type | Description |
145
+ |----------|------|-------------|
146
+ | `base` | Number | Starting value. Default `0`. |
147
+ | `amount` | Number | Total to distribute across all targets (added to base). E.g. `amount: 1` with 100 targets → 0.01 between each. Use **each** instead to set a fixed step per target. |
148
+ | `each` | Number | Amount to add between each target (added to base). E.g. `each: 1` with 4 targets → 0, 1, 2, 3. Use **amount** instead to split a total. |
149
+ | `from` | Number \| String \| Array | Where distribution starts: index, or `"start"`, `"center"`, `"edges"`, `"random"`, `"end"`, or ratios like `[0.25, 0.75]`. Default `0`. |
150
+ | `grid` | String \| Array | Use grid position instead of flat index: `[rows, columns]` (e.g. `[5, 10]`) or `"auto"` to detect. Omit for flat array. |
151
+ | `axis` | String | For grid: limit to one axis (`"x"` or `"y"`). |
152
+ | `ease` | Ease | Distribute values along an ease curve (e.g. `"power1.inOut"`). Default `"none"`. |
153
+
154
+ **In a tween:** pass the result of `distribute(config)` as the property value; GSAP calls the function for each target with `(index, target, targets)`.
155
+
156
+ ```javascript
157
+ // Scale: middle elements 0.5, outer edges 3 (amount 2.5 distributed from center)
158
+ gsap.to(".class", {
159
+ scale: gsap.utils.distribute({
160
+ base: 0.5,
161
+ amount: 2.5,
162
+ from: "center"
163
+ })
164
+ });
165
+ ```
166
+
167
+ **Manual use:** call the returned function with `(index, target, targets)` to get the value for that index.
168
+
169
+ ```javascript
170
+ const distributor = gsap.utils.distribute({
171
+ base: 50,
172
+ amount: 100,
173
+ from: "center",
174
+ ease: "power1.inOut"
175
+ });
176
+ const targets = gsap.utils.toArray(".box");
177
+ const valueForIndex2 = distributor(2, targets[2], targets);
178
+ ```
179
+
180
+ See [distribute()](https://gsap.com/docs/v3/GSAP/UtilityMethods/distribute/) for more.
181
+
182
+ ## Units and Parsing
183
+
184
+ ### getUnit(value)
185
+
186
+ Returns the unit string of a value (e.g. `"px"`, `"%"`, `"deg"`). Use when normalizing or converting values.
187
+
188
+ ```javascript
189
+ gsap.utils.getUnit("100px"); // "px"
190
+ gsap.utils.getUnit("50%"); // "%"
191
+ gsap.utils.getUnit(42); // "" (unitless)
192
+ ```
193
+
194
+ ### unitize(value, unit)
195
+
196
+ Appends a unit to a number, or returns the value as-is if it already has a unit. Use when building CSS values or tween end values.
197
+
198
+ ```javascript
199
+ gsap.utils.unitize(100, "px"); // "100px"
200
+ gsap.utils.unitize("2rem", "px"); // "2rem" (unchanged)
201
+ ```
202
+
203
+ ### splitColor(color, returnHSL?)
204
+
205
+ Converts a color string into an array: **[red, green, blue]** (0–255), or **[red, green, blue, alpha]** (4 elements for RGBA when alpha is present or required). Pass **true** as the second argument (**returnHSL**) to get **[hue, saturation, lightness]** or **[hue, saturation, lightness, alpha]** (HSL/HSLA) instead. Works with `"rgb()"`, `"rgba()"`, `"hsl()"`, `"hsla()"`, hex, and named colors (e.g. `"red"`). Use when animating color components or building gradients. See [splitColor()](https://gsap.com/docs/v3/GSAP/UtilityMethods/splitColor/).
206
+
207
+ ```javascript
208
+ gsap.utils.splitColor("red"); // [255, 0, 0]
209
+ gsap.utils.splitColor("#6fb936"); // [111, 185, 54]
210
+ gsap.utils.splitColor("rgba(204, 153, 51, 0.5)"); // [204, 153, 51, 0.5] (4 elements)
211
+ gsap.utils.splitColor("#6fb936", true); // [94, 55, 47] (HSL: hue, saturation, lightness)
212
+ ```
213
+
214
+ ## Arrays and Collections
215
+
216
+ ### selector(scope)
217
+
218
+ Returns a scoped selector function that finds elements only within the given element (or ref). Use in components so selectors like `".box"` match only descendants of that component, not the whole document. Accepts a DOM element or a ref (e.g. React ref; handles `.current`).
219
+
220
+ ```javascript
221
+ const q = gsap.utils.selector(containerRef);
222
+ q(".box"); // array of .box elements inside container
223
+ gsap.to(q(".circle"), { x: 100 });
224
+ ```
225
+
226
+ ### toArray(value, scope?)
227
+
228
+ Converts a value to an array: selector string (scoped to element), NodeList, HTMLCollection, single element, or array. Use when passing mixed inputs to GSAP (e.g. targets) and a true array is needed.
229
+
230
+ ```javascript
231
+ gsap.utils.toArray(".item"); // array of elements
232
+ gsap.utils.toArray(".item", container); // scoped to container
233
+ gsap.utils.toArray(nodeList); // [ ... ] from NodeList
234
+ ```
235
+
236
+ ### pipe(...functions)
237
+
238
+ Composes functions: **pipe(f1, f2, f3)(value)** returns f3(f2(f1(value))). Use when applying a chain of transforms (e.g. normalize → mapRange → snap) in a tween or callback.
239
+
240
+ ```javascript
241
+ const fn = gsap.utils.pipe(
242
+ (v) => gsap.utils.normalize(0, 100, v),
243
+ (v) => gsap.utils.snap(0.1, v)
244
+ );
245
+ fn(50); // normalized then snapped
246
+ ```
247
+
248
+ ### wrap(min, max, value?)
249
+
250
+ Wraps a value into the range min–max (inclusive min, exclusive max). Use for infinite scroll or cyclic values. Omit **value** to get a function: `wrap(min, max)(value)`.
251
+
252
+ ```javascript
253
+ gsap.utils.wrap(0, 360, 370); // 10
254
+ gsap.utils.wrap(0, 360, -10); // 350
255
+
256
+ let wrapFn = gsap.utils.wrap(0, 360);
257
+ wrapFn(370); // 10
258
+ ```
259
+
260
+ ### wrapYoyo(min, max, value?)
261
+
262
+ Wraps value in range with a yoyo (bounces at ends). Use for back-and-forth within a range. Omit **value** to get a function: `wrapYoyo(min, max)(value)`.
263
+
264
+ ```javascript
265
+ gsap.utils.wrapYoyo(0, 100, 150); // 50 (bounces back)
266
+
267
+ let wrapY = gsap.utils.wrapYoyo(0, 100);
268
+ wrapY(150); // 50
269
+ ```
270
+
271
+ ## Best practices
272
+
273
+ - ✅ Omit the value argument to get a reusable function when the same range/config is used many times (e.g. scroll handler, tween callback): `let mapFn = gsap.utils.mapRange(0, 1, 0, 360); mapFn(progress)`.
274
+ - ✅ Use **snap** for grid-aligned or step-based values; use **toArray** when GSAP or your code needs a real array from a selector or NodeList.
275
+ - ✅ Use **gsap.utils.selector(scope)** in components so selectors are scoped to a container or ref.
276
+
277
+ ## Do Not
278
+
279
+ - ❌ Assume **mapRange** / **normalize** handle units; they work on numbers. Use **getUnit** / **unitize** when units matter.
280
+ - ❌ Override or rely on undocumented behavior; stick to the documented API.
281
+
282
+ ### Learn More
283
+
284
+ https://gsap.com/docs/v3/HelperFunctions
285
+
286
+ ---
287
+
288
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
289
+
290
+ **Slash command: `/review` or `/tribunal-full`**
291
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
292
+
293
+ ### ❌ Forbidden AI Tropes
294
+
295
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
296
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
297
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
298
+
299
+ ---
300
+
301
+ ## 🚨 LLM Trap Table
302
+
303
+ |Pattern|What AI Does Wrong|What Is Actually Correct|
304
+ |:---|:---|:---|
305
+ |gsap-utils|Using mapRange on units like "100px"|mapRange works only on pure numbers. Use getUnit/unitize|
306
+ |gsap-utils|Re-creating random per frame|Pass true as 4th param: random(-10, 10, 1, true) for a reusable fn|
307
+ |gsap-utils|Scoping global .box|Use gsap.utils.selector(container) inside components|
308
+
309
+ ---
310
+
311
+ ## ✅ Pre-Flight Self-Audit
312
+
313
+ Before producing any output, verify:
314
+ ```
315
+ ✅ Did I read the actual files before making claims about them?
316
+ ✅ Did I verify all method names against official GSAP documentation?
317
+ ✅ Did I add // VERIFY: on any uncertain API calls?
318
+ ✅ Are all imports from packages that actually exist in package.json?
319
+ ✅ Did I test my logic with edge cases (null, empty, 0, max)?
320
+ ✅ Did I avoid generating code for more than one module at a time?
321
+ ✅ Am I working from evidence, not assumption?
322
+ ```
323
+
324
+ ---
325
+
326
+ ## 🔁 VBC Protocol (Verify → Build → Confirm)
327
+
328
+ ```
329
+ VERIFY: Read the actual codebase before writing anything
330
+ BUILD: Generate the smallest meaningful unit of code
331
+ CONFIRM: Verify the output is correct before presenting
332
+ ```
@@ -111,3 +111,45 @@ In Next.js Middleware:
111
111
  3. Rewrite URL to the detected locale (e.g., `/ja/dashboard`).
112
112
 
113
113
  ---
114
+
115
+
116
+ ---
117
+
118
+ ## 🤖 LLM-Specific Traps
119
+
120
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
121
+
122
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
123
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
124
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
125
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
126
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
127
+
128
+ ---
129
+
130
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
131
+
132
+ **Slash command: `/review` or `/tribunal-full`**
133
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
134
+
135
+ ### ❌ Forbidden AI Tropes
136
+
137
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
138
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
139
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
140
+
141
+ ### ✅ Pre-Flight Self-Audit
142
+
143
+ Review these questions before confirming output:
144
+ ```
145
+ ✅ Did I rely ONLY on real, verified tools and methods?
146
+ ✅ Is this solution appropriately scoped to the user's constraints?
147
+ ✅ Did I handle potential failure modes and edge cases?
148
+ ✅ Have I avoided generic boilerplate that doesn't add value?
149
+ ```
150
+
151
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
152
+
153
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
154
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
155
+ - ✅ **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.
@@ -164,4 +164,75 @@ This file contains all available skills and workflows as a condensed index for t
164
164
  |`web-design-guidelines`|Review UI code for Next-Generation Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".|
165
165
  |`webapp-testing`|Web application testing principles. E2E, Playwright, deep audit strategies.|
166
166
  |`whimsy-injector`|Micro-delight generator for frontend interfaces. Suggests and implements subtle animations, playful transitions, and interaction polish across any frontend stack.|
167
- |`workflow-optimizer`|Analyzes agent tool-calling patterns and task execution efficiency to suggest process improvements.|
167
+ |`workflow-optimizer`|Analyzes agent tool-calling patterns and task execution efficiency to suggest process improvements.|
168
+ |`api-architect`|API contract design agent. Builds robust REST/GraphQL/tRPC endpoints with RFC 9457 error formats, idempotency, pagination, and versioning. Use when designing new API routes or reviewing API contracts.|
169
+ |`resilience-reviewer`|Fault tolerance reviewer. Audits for swallowed errors, naked Promises, missing retries/timeouts, absent circuit breakers, and missing React error boundaries. Use when reviewing backend or full-stack code for reliability.|
170
+ |`schema-reviewer`|Input validation reviewer. Enforces strict Zod/Pydantic validation at all trust boundaries (API, env, query params). Catches `z.any()`, missing `.parse()`, and unvalidated external data. Use when reviewing data ingestion or API input handling.|
171
+ |`gsap-core`|GSAP core animation API — gsap.to(), from(), fromTo(), easing, stagger, defaults, matchMedia(). Use for JavaScript animation with GSAP.|
172
+ |`gsap-scrolltrigger`|GSAP ScrollTrigger plugin — scroll-driven animations, pinning, snapping. Use when building scroll-linked animation.|
173
+ |`gsap-timeline`|GSAP timeline sequencing — Timeline API, position parameters, labels, nesting. Use for multi-step animation choreography.|
174
+ |`gsap-react`|GSAP in React — useGSAP hook, ref-based targeting, cleanup, context scoping. Use when animating React components with GSAP.|
175
+ |`gsap-plugins`|GSAP plugins — Flip, Draggable, MorphSVG, SplitText, MotionPath, DrawSVG. Use for advanced GSAP effects.|
176
+ |`gsap-performance`|GSAP performance — will-change, GPU compositing, lazy MediaQuery, reduced motion. Use when optimizing GSAP animations.|
177
+ |`gsap-utils`|GSAP utility methods — toArray, clamp, mapRange, interpolate, distribute. Use for GSAP helper functions.|
178
+ |`gsap-frameworks`|GSAP framework integration — Vue, Svelte, Astro, Angular, Webflow. Use when integrating GSAP outside React.|
179
+ |`error-resilience`|Error resilience patterns. Retry strategies, circuit breakers, graceful degradation, timeout policies.|
180
+ |`data-validation-schemas`|Data validation with Zod, Pydantic, and JSON Schema. Use when building validation layers.|
181
+ |`monorepo-management`|Monorepo tooling and workspace management. Turborepo, Nx, pnpm workspaces.|
182
+ |`typescript-advanced`|Advanced TypeScript patterns. Generics, conditional types, template literals, discriminated unions.|
183
+ |`game-developer`|Game development orchestrator. Routes to platform-specific skills (Unity/C#, Godot/GDScript, WebGL). Use when building games or game engines.|
184
+ |`documentation-writer`|Technical documentation specialist. README files, API docs, code comments, architecture docs, and AI-friendly documentation. Use when writing or reviewing documentation.|
185
+ |`test-engineer`|Test generation and strategy specialist. Creates tests using the Testing Trophy (unit → integration → E2E). Use when generating tests or designing test architecture.|
186
+ |`qa-automation-engineer`|QA automation specialist. End-to-end testing pipelines, Playwright/Cypress configuration, CI test integration, visual regression. Use when building automated QA systems.|
187
+ |`code-archaeologist`|Legacy code exploration specialist. Navigates unfamiliar codebases, identifies patterns, maps dependencies, documents tribal knowledge. Use when exploring or understanding legacy code.|
188
+ |`project-planner`|Project planning specialist. 4-phase methodology (Analyze → Plan → Solution → Implement). Use when planning features, roadmaps, or multi-step implementations.|
189
+ |`product-manager`|Product strategy specialist. Feature prioritization, roadmap planning, stakeholder alignment, competitive analysis. Use when making product decisions or prioritizing features.|
190
+ |`product-owner`|User story and backlog management specialist. Writing acceptance criteria, sprint planning, backlog grooming. Use when defining user stories or managing backlogs.|
191
+ |`seo-specialist`|SEO optimization specialist. Technical SEO, meta tags, structured data (JSON-LD), Core Web Vitals impact on search ranking, sitemap/robots configuration. Use when optimizing search visibility.|
192
+ |`throughput-optimizer`|Throughput and latency optimization specialist. Load testing, connection pooling, queue management, batch processing, caching strategies. Use when optimizing system throughput or reducing latency.|
193
+ |`vitals-reviewer`|Core Web Vitals specialist. LCP, CLS, INP measurement and optimization, Lighthouse auditing, real user monitoring. Use when auditing or improving web performance metrics.|
194
+ |`penetration-tester`|Penetration testing and red team specialist. MITRE ATT&CK mapping, attack surface analysis, exploitation paths, vulnerability chaining. Use when pen testing applications or assessing attack surfaces.|
195
+ |`db-latency-auditor`|Database performance specialist. Slow query analysis, EXPLAIN ANALYZE, index optimization, N+1 detection, connection pool tuning. Use when debugging database performance issues.|
196
+ |`ai-code-reviewer`|AI/LLM integration code reviewer. Hallucinated model names, invented API parameters, prompt injection vulnerabilities, missing rate limits, streaming error handling. Use when reviewing code that calls LLM APIs.|
197
+
198
+
199
+ ---
200
+
201
+ ## 🤖 LLM-Specific Traps
202
+
203
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
204
+
205
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
206
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
207
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
208
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
209
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
210
+
211
+ ---
212
+
213
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
214
+
215
+ **Slash command: `/review` or `/tribunal-full`**
216
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
217
+
218
+ ### ❌ Forbidden AI Tropes
219
+
220
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
221
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
222
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
223
+
224
+ ### ✅ Pre-Flight Self-Audit
225
+
226
+ Review these questions before confirming output:
227
+ ```
228
+ ✅ Did I rely ONLY on real, verified tools and methods?
229
+ ✅ Is this solution appropriately scoped to the user's constraints?
230
+ ✅ Did I handle potential failure modes and edge cases?
231
+ ✅ Have I avoided generic boilerplate that doesn't add value?
232
+ ```
233
+
234
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
235
+
236
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
237
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
238
+ - ✅ **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.
@@ -209,3 +209,45 @@ Evidence: [test output / lint pass / compile success]
209
209
  Do not mark status as VERIFIED until concrete terminal evidence is provided.
210
210
 
211
211
  ---
212
+
213
+
214
+ ---
215
+
216
+ ## 🤖 LLM-Specific Traps
217
+
218
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
219
+
220
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
221
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
222
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
223
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
224
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
225
+
226
+ ---
227
+
228
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
229
+
230
+ **Slash command: `/review` or `/tribunal-full`**
231
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
232
+
233
+ ### ❌ Forbidden AI Tropes
234
+
235
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
236
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
237
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
238
+
239
+ ### ✅ Pre-Flight Self-Audit
240
+
241
+ Review these questions before confirming output:
242
+ ```
243
+ ✅ Did I rely ONLY on real, verified tools and methods?
244
+ ✅ Is this solution appropriately scoped to the user's constraints?
245
+ ✅ Did I handle potential failure modes and edge cases?
246
+ ✅ Have I avoided generic boilerplate that doesn't add value?
247
+ ```
248
+
249
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
250
+
251
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
252
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
253
+ - ✅ **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.