tribunal-kit 4.0.1 → 4.3.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.
- package/.agent/ARCHITECTURE.md +21 -14
- package/.agent/GEMINI.md +4 -2
- package/.agent/agents/api-architect.md +66 -0
- package/.agent/agents/db-latency-auditor.md +216 -0
- package/.agent/agents/precedence-reviewer.md +41 -4
- package/.agent/agents/resilience-reviewer.md +88 -0
- package/.agent/agents/schema-reviewer.md +67 -0
- package/.agent/agents/swarm-worker-contracts.md +5 -5
- package/.agent/agents/throughput-optimizer.md +299 -0
- package/.agent/agents/ui-ux-auditor.md +292 -0
- package/.agent/agents/vitals-reviewer.md +223 -0
- package/.agent/history/case-law/cases/case-0001.json +33 -0
- package/.agent/history/case-law/index.json +35 -0
- package/.agent/rules/GEMINI.md +28 -11
- package/.agent/scripts/__pycache__/_colors.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/_utils.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/case_law_manager.cpython-311.pyc +0 -0
- package/.agent/scripts/_colors.js +18 -0
- package/.agent/scripts/_utils.js +42 -0
- package/.agent/scripts/auto_preview.js +197 -0
- package/.agent/scripts/bundle_analyzer.js +290 -0
- package/.agent/scripts/case_law_manager.js +684 -0
- package/.agent/scripts/checklist.js +266 -0
- package/.agent/scripts/colors.js +17 -0
- package/.agent/scripts/compress_skills.js +141 -0
- package/.agent/scripts/consolidate_skills.js +149 -0
- package/.agent/scripts/context_broker.js +609 -0
- package/.agent/scripts/deep_compress.js +150 -0
- package/.agent/scripts/dependency_analyzer.js +272 -0
- package/.agent/scripts/inner_loop_validator.js +465 -0
- package/.agent/scripts/lint_runner.js +187 -0
- package/.agent/scripts/minify_context.js +100 -0
- package/.agent/scripts/patch_skills_meta.js +156 -0
- package/.agent/scripts/patch_skills_output.js +244 -0
- package/.agent/scripts/schema_validator.js +297 -0
- package/.agent/scripts/security_scan.js +303 -0
- package/.agent/scripts/session_manager.js +276 -0
- package/.agent/scripts/skill_evolution.js +644 -0
- package/.agent/scripts/skill_integrator.js +313 -0
- package/.agent/scripts/strengthen_skills.js +193 -0
- package/.agent/scripts/strip_tribunal.js +47 -0
- package/.agent/scripts/swarm_dispatcher.js +360 -0
- package/.agent/scripts/test_runner.js +193 -0
- package/.agent/scripts/utils.js +32 -0
- package/.agent/scripts/verify_all.js +256 -0
- package/.agent/skills/agent-organizer/SKILL.md +42 -0
- package/.agent/skills/agentic-patterns/SKILL.md +42 -0
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +42 -0
- package/.agent/skills/api-patterns/SKILL.md +42 -0
- package/.agent/skills/api-security-auditor/SKILL.md +42 -0
- package/.agent/skills/app-builder/SKILL.md +42 -0
- package/.agent/skills/app-builder/templates/SKILL.md +70 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +1 -1
- package/.agent/skills/appflow-wireframe/SKILL.md +42 -0
- package/.agent/skills/architecture/SKILL.md +42 -0
- package/.agent/skills/authentication-best-practices/SKILL.md +42 -0
- package/.agent/skills/bash-linux/SKILL.md +42 -0
- package/.agent/skills/behavioral-modes/SKILL.md +42 -0
- package/.agent/skills/brainstorming/SKILL.md +42 -0
- package/.agent/skills/building-native-ui/SKILL.md +42 -0
- package/.agent/skills/clean-code/SKILL.md +42 -0
- package/.agent/skills/code-review-checklist/SKILL.md +42 -0
- package/.agent/skills/config-validator/SKILL.md +42 -0
- package/.agent/skills/csharp-developer/SKILL.md +42 -0
- package/.agent/skills/data-validation-schemas/SKILL.md +320 -0
- package/.agent/skills/database-design/SKILL.md +42 -0
- package/.agent/skills/deployment-procedures/SKILL.md +42 -0
- package/.agent/skills/devops-engineer/SKILL.md +42 -0
- package/.agent/skills/devops-incident-responder/SKILL.md +42 -0
- package/.agent/skills/doc.md +1 -1
- package/.agent/skills/documentation-templates/SKILL.md +42 -0
- package/.agent/skills/edge-computing/SKILL.md +42 -0
- package/.agent/skills/error-resilience/SKILL.md +420 -0
- package/.agent/skills/extract-design-system/SKILL.md +42 -0
- package/.agent/skills/framer-motion-expert/SKILL.md +42 -1
- package/.agent/skills/frontend-design/SKILL.md +42 -0
- package/.agent/skills/game-design-expert/SKILL.md +42 -0
- package/.agent/skills/game-engineering-expert/SKILL.md +42 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +42 -0
- package/.agent/skills/github-operations/SKILL.md +42 -0
- package/.agent/skills/gsap-core/SKILL.md +300 -0
- package/.agent/skills/gsap-frameworks/SKILL.md +199 -0
- package/.agent/skills/gsap-performance/SKILL.md +125 -0
- package/.agent/skills/gsap-plugins/SKILL.md +472 -0
- package/.agent/skills/gsap-react/SKILL.md +181 -0
- package/.agent/skills/gsap-scrolltrigger/SKILL.md +342 -0
- package/.agent/skills/gsap-timeline/SKILL.md +153 -0
- package/.agent/skills/gsap-utils/SKILL.md +330 -0
- package/.agent/skills/i18n-localization/SKILL.md +42 -0
- package/.agent/skills/intelligent-routing/SKILL.md +72 -1
- package/.agent/skills/lint-and-validate/SKILL.md +42 -0
- package/.agent/skills/llm-engineering/SKILL.md +42 -0
- package/.agent/skills/local-first/SKILL.md +42 -0
- package/.agent/skills/mcp-builder/SKILL.md +42 -0
- package/.agent/skills/mobile-design/SKILL.md +42 -0
- package/.agent/skills/monorepo-management/SKILL.md +326 -0
- package/.agent/skills/motion-engineering/SKILL.md +42 -0
- package/.agent/skills/nextjs-react-expert/SKILL.md +42 -0
- package/.agent/skills/nodejs-best-practices/SKILL.md +42 -0
- package/.agent/skills/observability/SKILL.md +42 -0
- package/.agent/skills/parallel-agents/SKILL.md +42 -0
- package/.agent/skills/performance-profiling/SKILL.md +42 -0
- package/.agent/skills/plan-writing/SKILL.md +42 -0
- package/.agent/skills/platform-engineer/SKILL.md +42 -0
- package/.agent/skills/playwright-best-practices/SKILL.md +42 -0
- package/.agent/skills/powershell-windows/SKILL.md +42 -0
- package/.agent/skills/project-idioms/SKILL.md +42 -0
- package/.agent/skills/python-patterns/SKILL.md +42 -0
- package/.agent/skills/python-pro/SKILL.md +42 -0
- package/.agent/skills/react-specialist/SKILL.md +42 -0
- package/.agent/skills/readme-builder/SKILL.md +42 -0
- package/.agent/skills/realtime-patterns/SKILL.md +42 -0
- package/.agent/skills/red-team-tactics/SKILL.md +42 -0
- package/.agent/skills/rust-pro/SKILL.md +42 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +42 -0
- package/.agent/skills/server-management/SKILL.md +42 -0
- package/.agent/skills/shadcn-ui-expert/SKILL.md +42 -0
- package/.agent/skills/skill-creator/SKILL.md +42 -0
- package/.agent/skills/sql-pro/SKILL.md +42 -0
- package/.agent/skills/supabase-postgres-best-practices/SKILL.md +42 -0
- package/.agent/skills/swiftui-expert/SKILL.md +42 -0
- package/.agent/skills/systematic-debugging/SKILL.md +42 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +42 -0
- package/.agent/skills/tdd-workflow/SKILL.md +42 -0
- package/.agent/skills/test-result-analyzer/SKILL.md +42 -0
- package/.agent/skills/testing-patterns/SKILL.md +42 -0
- package/.agent/skills/trend-researcher/SKILL.md +42 -0
- package/.agent/skills/typescript-advanced/SKILL.md +327 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +42 -0
- package/.agent/skills/ui-ux-researcher/SKILL.md +42 -0
- package/.agent/skills/vue-expert/SKILL.md +42 -0
- package/.agent/skills/vulnerability-scanner/SKILL.md +42 -0
- package/.agent/skills/web-accessibility-auditor/SKILL.md +42 -0
- package/.agent/skills/web-design-guidelines/SKILL.md +42 -0
- package/.agent/skills/webapp-testing/SKILL.md +42 -0
- package/.agent/skills/whimsy-injector/SKILL.md +42 -0
- package/.agent/skills/workflow-optimizer/SKILL.md +42 -0
- package/.agent/workflows/audit.md +6 -6
- package/.agent/workflows/deploy.md +1 -1
- package/.agent/workflows/generate.md +23 -6
- package/.agent/workflows/session.md +5 -5
- package/.agent/workflows/swarm.md +2 -2
- package/.agent/workflows/tribunal-backend.md +13 -2
- package/.agent/workflows/tribunal-full.md +15 -8
- package/.agent/workflows/tribunal-speed.md +183 -0
- package/README.md +64 -8
- package/bin/tribunal-kit.js +281 -41
- package/package.json +9 -6
- package/scripts/changelog.js +167 -0
- package/scripts/sync-version.js +81 -0
- package/.agent/scripts/__pycache__/auto_preview.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/bundle_analyzer.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/checklist.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/dependency_analyzer.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/security_scan.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/session_manager.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/skill_integrator.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/swarm_dispatcher.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/test_runner.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/verify_all.cpython-311.pyc +0 -0
- package/.agent/scripts/auto_preview.py +0 -180
- package/.agent/scripts/bundle_analyzer.py +0 -259
- package/.agent/scripts/case_law_manager.py +0 -525
- package/.agent/scripts/checklist.py +0 -209
- package/.agent/scripts/compress_skills.py +0 -167
- package/.agent/scripts/consolidate_skills.py +0 -173
- package/.agent/scripts/deep_compress.py +0 -202
- package/.agent/scripts/dependency_analyzer.py +0 -247
- package/.agent/scripts/lint_runner.py +0 -188
- package/.agent/scripts/minify_context.py +0 -80
- package/.agent/scripts/patch_skills_meta.py +0 -177
- package/.agent/scripts/patch_skills_output.py +0 -285
- package/.agent/scripts/schema_validator.py +0 -279
- package/.agent/scripts/security_scan.py +0 -224
- package/.agent/scripts/session_manager.py +0 -261
- package/.agent/scripts/skill_evolution.py +0 -563
- package/.agent/scripts/skill_integrator.py +0 -234
- package/.agent/scripts/strengthen_skills.py +0 -220
- package/.agent/scripts/strip_tribunal.py +0 -41
- package/.agent/scripts/swarm_dispatcher.py +0 -350
- package/.agent/scripts/test_runner.py +0 -192
- package/.agent/scripts/test_swarm_dispatcher.py +0 -163
- package/.agent/scripts/verify_all.py +0 -195
- package/.agent/skills/gsap-expert/SKILL.md +0 -194
|
@@ -0,0 +1,330 @@
|
|
|
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
|
+
```
|
|
@@ -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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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.
|
|
@@ -342,3 +342,45 @@ eventSource.onmessage = (event) => {
|
|
|
342
342
|
```
|
|
343
343
|
|
|
344
344
|
---
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
|
|
352
|
+
|
|
353
|
+
1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
|
|
354
|
+
2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
|
|
355
|
+
3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
|
|
356
|
+
4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
357
|
+
5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
**Slash command: `/review` or `/tribunal-full`**
|
|
364
|
+
**Active reviewers: `logic-reviewer` · `security-auditor`**
|
|
365
|
+
|
|
366
|
+
### ❌ Forbidden AI Tropes
|
|
367
|
+
|
|
368
|
+
1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
|
|
369
|
+
2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
|
|
370
|
+
3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
Review these questions before confirming output:
|
|
375
|
+
```
|
|
376
|
+
✅ Did I rely ONLY on real, verified tools and methods?
|
|
377
|
+
✅ Is this solution appropriately scoped to the user's constraints?
|
|
378
|
+
✅ Did I handle potential failure modes and edge cases?
|
|
379
|
+
✅ Have I avoided generic boilerplate that doesn't add value?
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### 🛑 Verification-Before-Completion (VBC) Protocol
|
|
383
|
+
|
|
384
|
+
**CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
|
|
385
|
+
- ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
|
|
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.
|
|
@@ -126,3 +126,45 @@ const friends = useLiveQuery(() => db.friends.where('age').above(21).toArray());
|
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
---
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
|
|
136
|
+
|
|
137
|
+
1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
|
|
138
|
+
2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
|
|
139
|
+
3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
|
|
140
|
+
4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
141
|
+
5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
**Slash command: `/review` or `/tribunal-full`**
|
|
148
|
+
**Active reviewers: `logic-reviewer` · `security-auditor`**
|
|
149
|
+
|
|
150
|
+
### ❌ Forbidden AI Tropes
|
|
151
|
+
|
|
152
|
+
1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
|
|
153
|
+
2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
|
|
154
|
+
3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
Review these questions before confirming output:
|
|
159
|
+
```
|
|
160
|
+
✅ Did I rely ONLY on real, verified tools and methods?
|
|
161
|
+
✅ Is this solution appropriately scoped to the user's constraints?
|
|
162
|
+
✅ Did I handle potential failure modes and edge cases?
|
|
163
|
+
✅ Have I avoided generic boilerplate that doesn't add value?
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 🛑 Verification-Before-Completion (VBC) Protocol
|
|
167
|
+
|
|
168
|
+
**CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
|
|
169
|
+
- ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
|
|
170
|
+
- ✅ **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.
|
|
@@ -90,3 +90,45 @@ An MCP Server gives an external AI execution capability over your shell or datab
|
|
|
90
90
|
- **Context Size Truncation:** If a tool queries a 5GB text log, the AI context window will instantly overflow and crash the session. The MCP logic MUST forcibly truncate outputs before returning.
|
|
91
91
|
|
|
92
92
|
---
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
|
|
100
|
+
|
|
101
|
+
1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
|
|
102
|
+
2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
|
|
103
|
+
3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
|
|
104
|
+
4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
105
|
+
5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
**Slash command: `/review` or `/tribunal-full`**
|
|
112
|
+
**Active reviewers: `logic-reviewer` · `security-auditor`**
|
|
113
|
+
|
|
114
|
+
### ❌ Forbidden AI Tropes
|
|
115
|
+
|
|
116
|
+
1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
|
|
117
|
+
2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
|
|
118
|
+
3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
Review these questions before confirming output:
|
|
123
|
+
```
|
|
124
|
+
✅ Did I rely ONLY on real, verified tools and methods?
|
|
125
|
+
✅ Is this solution appropriately scoped to the user's constraints?
|
|
126
|
+
✅ Did I handle potential failure modes and edge cases?
|
|
127
|
+
✅ Have I avoided generic boilerplate that doesn't add value?
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 🛑 Verification-Before-Completion (VBC) Protocol
|
|
131
|
+
|
|
132
|
+
**CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
|
|
133
|
+
- ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
|
|
134
|
+
- ✅ **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.
|