tribunal-kit 4.5.0 → 4.6.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 (217) hide show
  1. package/.agent/.shared/ui-ux-pro-max/README.md +4 -4
  2. package/.agent/ARCHITECTURE.md +279 -277
  3. package/.agent/GEMINI.md +127 -121
  4. package/.agent/agents/accessibility-reviewer.md +187 -187
  5. package/.agent/agents/ai-code-reviewer.md +199 -199
  6. package/.agent/agents/api-architect.md +71 -66
  7. package/.agent/agents/backend-specialist.md +219 -215
  8. package/.agent/agents/cloud-engineer.md +98 -0
  9. package/.agent/agents/code-archaeologist.md +168 -161
  10. package/.agent/agents/database-architect.md +184 -184
  11. package/.agent/agents/db-latency-auditor.md +213 -216
  12. package/.agent/agents/debugger.md +198 -191
  13. package/.agent/agents/dependency-reviewer.md +106 -103
  14. package/.agent/agents/devops-engineer.md +218 -218
  15. package/.agent/agents/documentation-writer.md +209 -201
  16. package/.agent/agents/explorer-agent.md +167 -160
  17. package/.agent/agents/frontend-reviewer.md +162 -160
  18. package/.agent/agents/frontend-specialist.md +257 -248
  19. package/.agent/agents/game-developer.md +48 -48
  20. package/.agent/agents/logic-reviewer.md +118 -116
  21. package/.agent/agents/mobile-developer.md +197 -200
  22. package/.agent/agents/mobile-reviewer.md +159 -162
  23. package/.agent/agents/orchestrator.md +187 -181
  24. package/.agent/agents/penetration-tester.md +160 -157
  25. package/.agent/agents/performance-optimizer.md +183 -183
  26. package/.agent/agents/performance-reviewer.md +178 -178
  27. package/.agent/agents/precedence-reviewer.md +251 -250
  28. package/.agent/agents/product-manager.md +149 -142
  29. package/.agent/agents/product-owner.md +81 -80
  30. package/.agent/agents/project-planner.md +152 -142
  31. package/.agent/agents/qa-automation-engineer.md +216 -225
  32. package/.agent/agents/resilience-reviewer.md +88 -88
  33. package/.agent/agents/schema-reviewer.md +67 -67
  34. package/.agent/agents/security-auditor.md +180 -174
  35. package/.agent/agents/seo-specialist.md +188 -193
  36. package/.agent/agents/sql-reviewer.md +159 -161
  37. package/.agent/agents/supervisor-agent.md +173 -184
  38. package/.agent/agents/swarm-worker-contracts.md +170 -166
  39. package/.agent/agents/swarm-worker-registry.md +92 -92
  40. package/.agent/agents/system-architect.md +85 -0
  41. package/.agent/agents/test-coverage-reviewer.md +158 -160
  42. package/.agent/agents/test-engineer.md +118 -118
  43. package/.agent/agents/throughput-optimizer.md +291 -299
  44. package/.agent/agents/type-safety-reviewer.md +182 -175
  45. package/.agent/agents/ui-ux-auditor.md +300 -292
  46. package/.agent/agents/vitals-reviewer.md +223 -223
  47. package/.agent/mcp_config.json +37 -40
  48. package/.agent/patterns/generator.md +11 -9
  49. package/.agent/patterns/inversion.md +14 -12
  50. package/.agent/patterns/pipeline.md +11 -9
  51. package/.agent/patterns/reviewer.md +15 -13
  52. package/.agent/patterns/tool-wrapper.md +11 -9
  53. package/.agent/routing_index.json +654 -0
  54. package/.agent/rules/GEMINI.md +358 -352
  55. package/.agent/scripts/compile_router.py +112 -0
  56. package/.agent/scripts/migrate_skills_frontmatter.py +64 -0
  57. package/.agent/scripts/strengthen_skills.js +1 -1
  58. package/.agent/skills/advanced-rag-pipelines/SKILL.md +56 -0
  59. package/.agent/skills/agent-organizer/SKILL.md +156 -150
  60. package/.agent/skills/agentic-patterns/SKILL.md +313 -315
  61. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +190 -184
  62. package/.agent/skills/api-patterns/SKILL.md +253 -247
  63. package/.agent/skills/api-security-auditor/SKILL.md +195 -193
  64. package/.agent/skills/app-builder/SKILL.md +573 -572
  65. package/.agent/skills/app-builder/templates/SKILL.md +108 -115
  66. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -76
  67. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -92
  68. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -88
  69. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -88
  70. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -83
  71. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -90
  72. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -90
  73. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +126 -122
  74. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +127 -122
  75. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +172 -169
  76. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +139 -134
  77. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -83
  78. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +122 -119
  79. package/.agent/skills/appflow-wireframe/SKILL.md +146 -145
  80. package/.agent/skills/architecture/SKILL.md +226 -219
  81. package/.agent/skills/authentication-best-practices/SKILL.md +197 -189
  82. package/.agent/skills/backend-security-expert/SKILL.md +16 -2
  83. package/.agent/skills/bash-linux/SKILL.md +179 -179
  84. package/.agent/skills/behavioral-modes/SKILL.md +239 -223
  85. package/.agent/skills/brainstorming/SKILL.md +498 -486
  86. package/.agent/skills/browser-native-ai/SKILL.md +57 -4
  87. package/.agent/skills/building-native-ui/SKILL.md +202 -202
  88. package/.agent/skills/cicd-pro/SKILL.md +442 -0
  89. package/.agent/skills/clean-code/SKILL.md +400 -381
  90. package/.agent/skills/cloud-architect/SKILL.md +439 -0
  91. package/.agent/skills/code-review-checklist/SKILL.md +203 -194
  92. package/.agent/skills/config-validator/SKILL.md +165 -165
  93. package/.agent/skills/containerization-pro/SKILL.md +452 -0
  94. package/.agent/skills/csharp-developer/SKILL.md +518 -518
  95. package/.agent/skills/data-validation-schemas/SKILL.md +333 -328
  96. package/.agent/skills/database-design/SKILL.md +247 -240
  97. package/.agent/skills/deployment-procedures/SKILL.md +172 -169
  98. package/.agent/skills/devops-engineer/SKILL.md +345 -345
  99. package/.agent/skills/devops-incident-responder/SKILL.md +143 -137
  100. package/.agent/skills/doc.md +209 -177
  101. package/.agent/skills/documentation-templates/SKILL.md +291 -279
  102. package/.agent/skills/edge-computing/SKILL.md +183 -181
  103. package/.agent/skills/error-resilience/SKILL.md +411 -428
  104. package/.agent/skills/extract-design-system/SKILL.md +160 -158
  105. package/.agent/skills/framer-motion-expert/SKILL.md +253 -244
  106. package/.agent/skills/frontend-design/SKILL.md +208 -201
  107. package/.agent/skills/frontend-security-expert/SKILL.md +16 -3
  108. package/.agent/skills/game-design-expert/SKILL.md +132 -129
  109. package/.agent/skills/game-engineering-expert/SKILL.md +148 -146
  110. package/.agent/skills/generative-ui-expert/SKILL.md +57 -1
  111. package/.agent/skills/geo-fundamentals/SKILL.md +148 -147
  112. package/.agent/skills/git-pro/SKILL.md +435 -0
  113. package/.agent/skills/github-operations/SKILL.md +335 -329
  114. package/.agent/skills/gsap-core/SKILL.md +319 -308
  115. package/.agent/skills/gsap-frameworks/SKILL.md +213 -207
  116. package/.agent/skills/gsap-performance/SKILL.md +139 -133
  117. package/.agent/skills/gsap-plugins/SKILL.md +486 -480
  118. package/.agent/skills/gsap-react/SKILL.md +202 -189
  119. package/.agent/skills/gsap-scrolltrigger/SKILL.md +357 -350
  120. package/.agent/skills/gsap-timeline/SKILL.md +165 -161
  121. package/.agent/skills/gsap-utils/SKILL.md +344 -338
  122. package/.agent/skills/harness-protocol/SKILL.md +48 -0
  123. package/.agent/skills/i18n-localization/SKILL.md +174 -163
  124. package/.agent/skills/intelligent-routing/SKILL.md +202 -246
  125. package/.agent/skills/knowledge-graph/SKILL.md +60 -52
  126. package/.agent/skills/lint-and-validate/SKILL.md +261 -261
  127. package/.agent/skills/llm-engineering/SKILL.md +400 -394
  128. package/.agent/skills/local-first/SKILL.md +178 -178
  129. package/.agent/skills/mcp-builder/SKILL.md +143 -142
  130. package/.agent/skills/mobile-design/SKILL.md +272 -263
  131. package/.agent/skills/monorepo-management/SKILL.md +335 -334
  132. package/.agent/skills/motion-engineering/SKILL.md +266 -234
  133. package/.agent/skills/nextjs-react-expert/SKILL.md +236 -234
  134. package/.agent/skills/nodejs-best-practices/SKILL.md +547 -548
  135. package/.agent/skills/observability/SKILL.md +343 -343
  136. package/.agent/skills/parallel-agents/SKILL.md +143 -146
  137. package/.agent/skills/performance-profiling/SKILL.md +259 -267
  138. package/.agent/skills/plan-writing/SKILL.md +150 -142
  139. package/.agent/skills/platform-engineer/SKILL.md +148 -147
  140. package/.agent/skills/playwright-best-practices/SKILL.md +188 -187
  141. package/.agent/skills/powershell-windows/SKILL.md +162 -162
  142. package/.agent/skills/project-idioms/SKILL.md +137 -137
  143. package/.agent/skills/python-patterns/SKILL.md +260 -259
  144. package/.agent/skills/python-pro/SKILL.md +324 -323
  145. package/.agent/skills/react-specialist/SKILL.md +305 -277
  146. package/.agent/skills/readme-builder/SKILL.md +310 -300
  147. package/.agent/skills/realtime-patterns/SKILL.md +323 -319
  148. package/.agent/skills/red-team-tactics/SKILL.md +231 -218
  149. package/.agent/skills/rust-pro/SKILL.md +671 -673
  150. package/.agent/skills/seo-fundamentals/SKILL.md +179 -179
  151. package/.agent/skills/server-management/SKILL.md +218 -214
  152. package/.agent/skills/shadcn-ui-expert/SKILL.md +231 -231
  153. package/.agent/skills/skill-creator/SKILL.md +87 -86
  154. package/.agent/skills/sql-pro/SKILL.md +629 -629
  155. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +97 -97
  156. package/.agent/skills/swiftui-expert/SKILL.md +204 -201
  157. package/.agent/skills/system-design-pro/SKILL.md +345 -0
  158. package/.agent/skills/systematic-debugging/SKILL.md +153 -142
  159. package/.agent/skills/tailwind-patterns/SKILL.md +610 -566
  160. package/.agent/skills/tdd-workflow/SKILL.md +169 -161
  161. package/.agent/skills/test-result-analyzer/SKILL.md +313 -309
  162. package/.agent/skills/testing-patterns/SKILL.md +566 -579
  163. package/.agent/skills/trend-researcher/SKILL.md +243 -237
  164. package/.agent/skills/typescript-advanced/SKILL.md +336 -335
  165. package/.agent/skills/ui-ux-pro-max/SKILL.md +590 -562
  166. package/.agent/skills/ui-ux-researcher/SKILL.md +244 -244
  167. package/.agent/skills/vue-expert/SKILL.md +294 -275
  168. package/.agent/skills/vulnerability-scanner/SKILL.md +416 -404
  169. package/.agent/skills/web-accessibility-auditor/SKILL.md +219 -218
  170. package/.agent/skills/web-design-guidelines/SKILL.md +192 -186
  171. package/.agent/skills/webapp-testing/SKILL.md +167 -169
  172. package/.agent/skills/webgpu-performance/SKILL.md +56 -2
  173. package/.agent/skills/whimsy-injector/SKILL.md +346 -325
  174. package/.agent/skills/workflow-optimizer/SKILL.md +231 -229
  175. package/.agent/workflows/acf.md +141 -0
  176. package/.agent/workflows/api-tester.md +176 -151
  177. package/.agent/workflows/audit.md +150 -127
  178. package/.agent/workflows/brainstorm.md +134 -110
  179. package/.agent/workflows/changelog.md +140 -112
  180. package/.agent/workflows/create.md +168 -124
  181. package/.agent/workflows/debug.md +190 -165
  182. package/.agent/workflows/deploy.md +201 -180
  183. package/.agent/workflows/enhance.md +154 -128
  184. package/.agent/workflows/fix.md +136 -114
  185. package/.agent/workflows/generate.md +198 -183
  186. package/.agent/workflows/marathon.md +37 -11
  187. package/.agent/workflows/migrate.md +184 -160
  188. package/.agent/workflows/orchestrate.md +192 -168
  189. package/.agent/workflows/performance-benchmarker.md +135 -114
  190. package/.agent/workflows/plan.md +196 -173
  191. package/.agent/workflows/preview.md +103 -80
  192. package/.agent/workflows/refactor.md +192 -161
  193. package/.agent/workflows/review-ai.md +125 -101
  194. package/.agent/workflows/review.md +141 -116
  195. package/.agent/workflows/session.md +122 -94
  196. package/.agent/workflows/status.md +101 -79
  197. package/.agent/workflows/strengthen-skills.md +164 -138
  198. package/.agent/workflows/super-prompt.md +24 -0
  199. package/.agent/workflows/swarm.md +193 -179
  200. package/.agent/workflows/test.md +211 -189
  201. package/.agent/workflows/tribunal-backend.md +136 -105
  202. package/.agent/workflows/tribunal-database.md +122 -95
  203. package/.agent/workflows/tribunal-frontend.md +221 -96
  204. package/.agent/workflows/tribunal-full.md +129 -100
  205. package/.agent/workflows/tribunal-mobile.md +122 -95
  206. package/.agent/workflows/tribunal-performance.md +136 -110
  207. package/.agent/workflows/tribunal-speed.md +209 -183
  208. package/.agent/workflows/ui-ux-pro-max.md +145 -122
  209. package/README.md +107 -55
  210. package/bin/mcp-server.js +159 -0
  211. package/bin/tribunal-kit.js +105 -29
  212. package/bin/wrapper.js +16 -7
  213. package/mcp_config.json +9 -0
  214. package/package.json +94 -86
  215. package/scripts/changelog.js +4 -3
  216. package/scripts/validate-payload.js +6 -1
  217. package/scripts/postinstall.js +0 -127
@@ -1,342 +1,346 @@
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
- **Slash command: `/review` or `/tribunal-full`**
289
- **Active reviewers: `logic-reviewer` · `security-auditor`**
290
-
291
- ### ❌ Forbidden AI Tropes
292
-
293
- 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
294
- 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
295
- 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
296
-
297
- ---
298
-
299
- ## 🚨 LLM Trap Table
300
-
301
- |Pattern|What AI Does Wrong|What Is Actually Correct|
302
- |:---|:---|:---|
303
- |gsap-utils|Using mapRange on units like "100px"|mapRange works only on pure numbers. Use getUnit/unitize|
304
- |gsap-utils|Re-creating random per frame|Pass true as 4th param: random(-10, 10, 1, true) for a reusable fn|
305
- |gsap-utils|Scoping global .box|Use gsap.utils.selector(container) inside components|
306
-
307
- ---
308
-
309
- ## ✅ Pre-Flight Self-Audit
310
-
311
- Before producing any output, verify:
312
- ```
313
- ✅ Did I read the actual files before making claims about them?
314
- ✅ Did I verify all method names against official GSAP documentation?
315
- ✅ Did I add // VERIFY: on any uncertain API calls?
316
- ✅ Are all imports from packages that actually exist in package.json?
317
- ✅ Did I test my logic with edge cases (null, empty, 0, max)?
318
- ✅ Did I avoid generating code for more than one module at a time?
319
- ✅ Am I working from evidence, not assumption?
320
- ```
321
-
322
- ---
323
-
324
- ## 🔁 VBC Protocol (Verify → Build → Confirm)
325
-
326
- ```
327
- VERIFY: Read the actual codebase before writing anything
328
- BUILD: Generate the smallest meaningful unit of code
329
- CONFIRM: Verify the output is correct before presenting
330
- ```
331
-
332
-
333
- ## Pre-Flight Checklist
334
- - [ ] Have I reviewed the user's specific constraints and requests?
335
- - [ ] Have I checked the environment for relevant existing implementations?
336
-
337
- ## VBC Protocol (Verification-Before-Completion)
338
- You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
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
+ routing:
6
+ domain: general
7
+ tier: basic
8
+ ---
9
+
10
+ # gsap.utils
11
+
12
+ ## When to Use This Skill
13
+
14
+ 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).
15
+
16
+ **Related skills:** Use with **gsap-core**, **gsap-timeline**, and **gsap-scrolltrigger** when building animations; CustomEase and other easing utilities are in **gsap-plugins**.
17
+
18
+ ## Overview
19
+
20
+ **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()`).
21
+
22
+ **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()>).
23
+
24
+ ```javascript
25
+ // With value: returns the result
26
+ gsap.utils.clamp(0, 100, 150); // 100
27
+
28
+ // Without value: returns a function you call with the value later
29
+ let c = gsap.utils.clamp(0, 100);
30
+ c(150); // 100
31
+ c(-10); // 0
32
+ ```
33
+
34
+ ## Clamping and Ranges
35
+
36
+ ### clamp(min, max, value?)
37
+
38
+ Constrains a value between min and max. Omit **value** to get a function: `clamp(min, max)(value)`.
39
+
40
+ ```javascript
41
+ gsap.utils.clamp(0, 100, 150); // 100
42
+ gsap.utils.clamp(0, 100, -10); // 0
43
+
44
+ let clampFn = gsap.utils.clamp(0, 100);
45
+ clampFn(150); // 100
46
+ ```
47
+
48
+ ### mapRange(inMin, inMax, outMin, outMax, value?)
49
+
50
+ 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)`.
51
+
52
+ ```javascript
53
+ gsap.utils.mapRange(0, 100, 0, 500, 50); // 250
54
+ gsap.utils.mapRange(0, 1, 0, 360, 0.5); // 180 (progress to degrees)
55
+
56
+ let mapFn = gsap.utils.mapRange(0, 100, 0, 500);
57
+ mapFn(50); // 250
58
+ ```
59
+
60
+ ### normalize(min, max, value?)
61
+
62
+ 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)`.
63
+
64
+ ```javascript
65
+ gsap.utils.normalize(0, 100, 50); // 0.5
66
+ gsap.utils.normalize(100, 300, 200); // 0.5
67
+
68
+ let normFn = gsap.utils.normalize(0, 100);
69
+ normFn(50); // 0.5
70
+ ```
71
+
72
+ ### interpolate(start, end, progress?)
73
+
74
+ 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)`.
75
+
76
+ ```javascript
77
+ gsap.utils.interpolate(0, 100, 0.5); // 50
78
+ gsap.utils.interpolate("#ff0000", "#0000ff", 0.5); // mid color
79
+ gsap.utils.interpolate({ x: 0, y: 0 }, { x: 100, y: 50 }, 0.5); // { x: 50, y: 25 }
80
+
81
+ let lerp = gsap.utils.interpolate(0, 100);
82
+ lerp(0.5); // 50
83
+ ```
84
+
85
+ ## Random and Snap
86
+
87
+ ### random(minimum, maximum[, snapIncrement, returnFunction]) / random(array[, returnFunction])
88
+
89
+ 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.
90
+
91
+ ```javascript
92
+ // immediate value: number in range
93
+ gsap.utils.random(-100, 100); // e.g. 42.7
94
+ gsap.utils.random(0, 500, 5); // 0–500, snapped to nearest 5
95
+
96
+ // reusable function: pass true as last argument
97
+ let randomFn = gsap.utils.random(-200, 500, 10, true);
98
+ randomFn(); // random value in range, snapped to 10
99
+ randomFn(); // another random value
100
+
101
+ // array: pick one value at random
102
+ gsap.utils.random(["red", "blue", "green"]); // "red", "blue", or "green"
103
+ let randomFromArray = gsap.utils.random([0, 100, 200], true);
104
+ randomFromArray(); // 0, 100, or 200
105
+ ```
106
+
107
+ **String form in tween vars:** use `"random(-100, 100)"`, `"random(-100, 100, 5)"`, or `"random([0, 100, 200])"`; GSAP evaluates it per target.
108
+
109
+ ```javascript
110
+ gsap.to(".box", { x: "random(-100, 100, 5)", duration: 1 });
111
+ gsap.to(".item", { backgroundColor: "random([red, blue, green])" });
112
+ ```
113
+
114
+ ### snap(snapTo, value?)
115
+
116
+ 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)`).
117
+
118
+ ```javascript
119
+ gsap.utils.snap(10, 23); // 20
120
+ gsap.utils.snap(0.25, 0.7); // 0.75
121
+ gsap.utils.snap([0, 100, 200], 150); // 100 or 200 (nearest in array)
122
+
123
+ let snapFn = gsap.utils.snap(10);
124
+ snapFn(23); // 20
125
+ ```
126
+
127
+ Use in tweens for grid or step-based animation:
128
+
129
+ ```javascript
130
+ gsap.to(".x", { x: 200, snap: { x: 20 } });
131
+ ```
132
+
133
+ ### shuffle(array)
134
+
135
+ Returns a new array with the same elements in random order. Use for randomizing order (e.g. stagger from "random" with a copy).
136
+
137
+ ```javascript
138
+ gsap.utils.shuffle([1, 2, 3, 4]); // e.g. [3, 1, 4, 2]
139
+ ```
140
+
141
+ ### distribute(config)
142
+
143
+ **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.
144
+
145
+ **Config (all optional):**
146
+
147
+ | Property | Type | Description |
148
+ | -------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
149
+ | `base` | Number | Starting value. Default `0`. |
150
+ | `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. |
151
+ | `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. |
152
+ | `from` | Number \| String \| Array | Where distribution starts: index, or `"start"`, `"center"`, `"edges"`, `"random"`, `"end"`, or ratios like `[0.25, 0.75]`. Default `0`. |
153
+ | `grid` | String \| Array | Use grid position instead of flat index: `[rows, columns]` (e.g. `[5, 10]`) or `"auto"` to detect. Omit for flat array. |
154
+ | `axis` | String | For grid: limit to one axis (`"x"` or `"y"`). |
155
+ | `ease` | Ease | Distribute values along an ease curve (e.g. `"power1.inOut"`). Default `"none"`. |
156
+
157
+ **In a tween:** pass the result of `distribute(config)` as the property value; GSAP calls the function for each target with `(index, target, targets)`.
158
+
159
+ ```javascript
160
+ // Scale: middle elements 0.5, outer edges 3 (amount 2.5 distributed from center)
161
+ gsap.to(".class", {
162
+ scale: gsap.utils.distribute({
163
+ base: 0.5,
164
+ amount: 2.5,
165
+ from: "center",
166
+ }),
167
+ });
168
+ ```
169
+
170
+ **Manual use:** call the returned function with `(index, target, targets)` to get the value for that index.
171
+
172
+ ```javascript
173
+ const distributor = gsap.utils.distribute({
174
+ base: 50,
175
+ amount: 100,
176
+ from: "center",
177
+ ease: "power1.inOut",
178
+ });
179
+ const targets = gsap.utils.toArray(".box");
180
+ const valueForIndex2 = distributor(2, targets[2], targets);
181
+ ```
182
+
183
+ See [distribute()](https://gsap.com/docs/v3/GSAP/UtilityMethods/distribute/) for more.
184
+
185
+ ## Units and Parsing
186
+
187
+ ### getUnit(value)
188
+
189
+ Returns the unit string of a value (e.g. `"px"`, `"%"`, `"deg"`). Use when normalizing or converting values.
190
+
191
+ ```javascript
192
+ gsap.utils.getUnit("100px"); // "px"
193
+ gsap.utils.getUnit("50%"); // "%"
194
+ gsap.utils.getUnit(42); // "" (unitless)
195
+ ```
339
196
 
197
+ ### unitize(value, unit)
198
+
199
+ 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.
200
+
201
+ ```javascript
202
+ gsap.utils.unitize(100, "px"); // "100px"
203
+ gsap.utils.unitize("2rem", "px"); // "2rem" (unchanged)
204
+ ```
205
+
206
+ ### splitColor(color, returnHSL?)
207
+
208
+ 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/).
209
+
210
+ ```javascript
211
+ gsap.utils.splitColor("red"); // [255, 0, 0]
212
+ gsap.utils.splitColor("#6fb936"); // [111, 185, 54]
213
+ gsap.utils.splitColor("rgba(204, 153, 51, 0.5)"); // [204, 153, 51, 0.5] (4 elements)
214
+ gsap.utils.splitColor("#6fb936", true); // [94, 55, 47] (HSL: hue, saturation, lightness)
215
+ ```
216
+
217
+ ## Arrays and Collections
218
+
219
+ ### selector(scope)
220
+
221
+ 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`).
222
+
223
+ ```javascript
224
+ const q = gsap.utils.selector(containerRef);
225
+ q(".box"); // array of .box elements inside container
226
+ gsap.to(q(".circle"), { x: 100 });
227
+ ```
228
+
229
+ ### toArray(value, scope?)
230
+
231
+ 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.
232
+
233
+ ```javascript
234
+ gsap.utils.toArray(".item"); // array of elements
235
+ gsap.utils.toArray(".item", container); // scoped to container
236
+ gsap.utils.toArray(nodeList); // [ ... ] from NodeList
237
+ ```
238
+
239
+ ### pipe(...functions)
240
+
241
+ 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.
242
+
243
+ ```javascript
244
+ const fn = gsap.utils.pipe(
245
+ (v) => gsap.utils.normalize(0, 100, v),
246
+ (v) => gsap.utils.snap(0.1, v),
247
+ );
248
+ fn(50); // normalized then snapped
249
+ ```
250
+
251
+ ### wrap(min, max, value?)
252
+
253
+ 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)`.
254
+
255
+ ```javascript
256
+ gsap.utils.wrap(0, 360, 370); // 10
257
+ gsap.utils.wrap(0, 360, -10); // 350
258
+
259
+ let wrapFn = gsap.utils.wrap(0, 360);
260
+ wrapFn(370); // 10
261
+ ```
262
+
263
+ ### wrapYoyo(min, max, value?)
264
+
265
+ 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)`.
266
+
267
+ ```javascript
268
+ gsap.utils.wrapYoyo(0, 100, 150); // 50 (bounces back)
269
+
270
+ let wrapY = gsap.utils.wrapYoyo(0, 100);
271
+ wrapY(150); // 50
272
+ ```
273
+
274
+ ## Best practices
275
+
276
+ - ✅ 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)`.
277
+ - ✅ 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.
278
+ - ✅ Use **gsap.utils.selector(scope)** in components so selectors are scoped to a container or ref.
279
+
280
+ ## Do Not
281
+
282
+ - ❌ Assume **mapRange** / **normalize** handle units; they work on numbers. Use **getUnit** / **unitize** when units matter.
283
+ - ❌ Override or rely on undocumented behavior; stick to the documented API.
284
+
285
+ ### Learn More
286
+
287
+ https://gsap.com/docs/v3/HelperFunctions
288
+
289
+ ---
290
+
291
+ **Slash command: `/review` or `/tribunal-full`**
292
+ **Active reviewers: `logic-reviewer` · `security-auditor`**
293
+
294
+ ### ❌ Forbidden AI Tropes
295
+
296
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
297
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
298
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
299
+
300
+ ---
301
+
302
+ ## 🚨 LLM Trap Table
303
+
304
+ | Pattern | What AI Does Wrong | What Is Actually Correct |
305
+ | :--------- | :----------------------------------- | :----------------------------------------------------------------- |
306
+ | gsap-utils | Using mapRange on units like "100px" | mapRange works only on pure numbers. Use getUnit/unitize |
307
+ | gsap-utils | Re-creating random per frame | Pass true as 4th param: random(-10, 10, 1, true) for a reusable fn |
308
+ | gsap-utils | Scoping global .box | Use gsap.utils.selector(container) inside components |
309
+
310
+ ---
311
+
312
+ ## ✅ Pre-Flight Self-Audit
313
+
314
+ Before producing any output, verify:
315
+
316
+ ```
317
+ ✅ Did I read the actual files before making claims about them?
318
+ ✅ Did I verify all method names against official GSAP documentation?
319
+ ✅ Did I add // VERIFY: on any uncertain API calls?
320
+ ✅ Are all imports from packages that actually exist in package.json?
321
+ ✅ Did I test my logic with edge cases (null, empty, 0, max)?
322
+ ✅ Did I avoid generating code for more than one module at a time?
323
+ ✅ Am I working from evidence, not assumption?
324
+ ```
325
+
326
+ ---
327
+
328
+ ## 🔁 VBC Protocol (Verify → Build → Confirm)
329
+
330
+ ```
331
+ VERIFY: Read the actual codebase before writing anything
332
+ BUILD: Generate the smallest meaningful unit of code
333
+ CONFIRM: Verify the output is correct before presenting
334
+ ```
335
+
336
+ ## Pre-Flight Checklist
337
+
338
+ - [ ] Have I reviewed the user's specific constraints and requests?
339
+ - [ ] Have I checked the environment for relevant existing implementations?
340
+
341
+ ## VBC Protocol (Verification-Before-Completion)
342
+
343
+ You MUST verify existing code signatures and variables before attempting to modify or call them. No hallucination is permitted.
340
344
 
341
345
  ---
342
346
 
@@ -366,6 +370,7 @@ AI coding assistants often fall into specific bad habits when dealing with this
366
370
  ### ✅ Pre-Flight Self-Audit
367
371
 
368
372
  Review these questions before confirming output:
373
+
369
374
  ```
370
375
  ✅ Did I rely ONLY on real, verified tools and methods?
371
376
  ✅ Is this solution appropriately scoped to the user's constraints?
@@ -376,5 +381,6 @@ Review these questions before confirming output:
376
381
  ### 🛑 Verification-Before-Completion (VBC) Protocol
377
382
 
378
383
  **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
384
+
379
385
  - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
380
386
  - ✅ **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.