luckiest-co 1.0.13 → 1.0.15
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/.claude-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/skills/luckiest-ab-testing/SKILL.md +1 -1
- package/skills/luckiest-ad-creative/SKILL.md +1 -1
- package/skills/luckiest-ads/SKILL.md +1 -1
- package/skills/luckiest-advisors/SKILL.md +1 -1
- package/skills/luckiest-aeo-grader/SKILL.md +1 -1
- package/skills/luckiest-ai-seo/SKILL.md +1 -1
- package/skills/luckiest-analytics/SKILL.md +1 -1
- package/skills/luckiest-aso/SKILL.md +1 -1
- package/skills/luckiest-churn-prevention/SKILL.md +1 -1
- package/skills/luckiest-co-marketing/SKILL.md +1 -1
- package/skills/luckiest-coder/SKILL.md +1 -1
- package/skills/luckiest-coder-brainstorming/SKILL.md +1 -1
- package/skills/luckiest-coder-consistency/SKILL.md +1 -1
- package/skills/luckiest-coder-constitution/SKILL.md +1 -1
- package/skills/luckiest-coder-debugging/SKILL.md +1 -1
- package/skills/luckiest-coder-dispatching-parallel-agents/SKILL.md +1 -1
- package/skills/luckiest-coder-executing-plans/SKILL.md +1 -1
- package/skills/luckiest-coder-finishing-a-branch/SKILL.md +1 -1
- package/skills/luckiest-coder-git-worktrees/SKILL.md +1 -1
- package/skills/luckiest-coder-guard/SKILL.md +1 -1
- package/skills/luckiest-coder-qa/SKILL.md +1 -1
- package/skills/luckiest-coder-receiving-code-review/SKILL.md +1 -1
- package/skills/luckiest-coder-requesting-code-review/SKILL.md +1 -1
- package/skills/luckiest-coder-shipping/SKILL.md +1 -1
- package/skills/luckiest-coder-subagent-driven-development/SKILL.md +1 -1
- package/skills/luckiest-coder-tdd/SKILL.md +1 -1
- package/skills/luckiest-coder-verification/SKILL.md +1 -1
- package/skills/luckiest-coder-writing-plans/SKILL.md +1 -1
- package/skills/luckiest-coder-writing-skills/SKILL.md +1 -1
- package/skills/luckiest-cold-email/SKILL.md +1 -1
- package/skills/luckiest-community-marketing/SKILL.md +1 -1
- package/skills/luckiest-competitor-profiling/SKILL.md +1 -1
- package/skills/luckiest-competitors/SKILL.md +1 -1
- package/skills/luckiest-content-strategy/SKILL.md +1 -1
- package/skills/luckiest-copy-editing/SKILL.md +1 -1
- package/skills/luckiest-copywriting/SKILL.md +1 -1
- package/skills/luckiest-cro/SKILL.md +1 -1
- package/skills/luckiest-customer-research/SKILL.md +1 -1
- package/skills/luckiest-directory-submissions/SKILL.md +1 -1
- package/skills/luckiest-emails/SKILL.md +1 -1
- package/skills/luckiest-extract-design-system/SKILL.md +1 -1
- package/skills/luckiest-free-tools/SKILL.md +1 -1
- package/skills/luckiest-image/SKILL.md +1 -1
- package/skills/luckiest-launch/SKILL.md +1 -1
- package/skills/luckiest-lead-magnets/SKILL.md +1 -1
- package/skills/luckiest-marketing-ideas/SKILL.md +1 -1
- package/skills/luckiest-marketing-plan/SKILL.md +1 -1
- package/skills/luckiest-marketing-psychology/SKILL.md +1 -1
- package/skills/luckiest-model-router/SKILL.md +1 -1
- package/skills/luckiest-offers/SKILL.md +1 -1
- package/skills/luckiest-onboarding/SKILL.md +1 -1
- package/skills/luckiest-paywalls/SKILL.md +1 -1
- package/skills/luckiest-popups/SKILL.md +1 -1
- package/skills/luckiest-pricing/SKILL.md +1 -1
- package/skills/luckiest-product-marketing/SKILL.md +1 -1
- package/skills/luckiest-programmatic-seo/SKILL.md +1 -1
- package/skills/luckiest-prompt-rewrite/SKILL.md +1 -1
- package/skills/luckiest-prospecting/SKILL.md +1 -1
- package/skills/luckiest-public-relations/SKILL.md +1 -1
- package/skills/luckiest-referrals/SKILL.md +1 -1
- package/skills/luckiest-revops/SKILL.md +1 -1
- package/skills/luckiest-sales-enablement/SKILL.md +1 -1
- package/skills/luckiest-schema/SKILL.md +1 -1
- package/skills/luckiest-seo-audit/SKILL.md +1 -1
- package/skills/luckiest-session-handoff/SKILL.md +1 -1
- package/skills/luckiest-signup/SKILL.md +1 -1
- package/skills/luckiest-site-architecture/SKILL.md +1 -1
- package/skills/luckiest-sms/SKILL.md +1 -1
- package/skills/luckiest-social/SKILL.md +1 -1
- package/skills/luckiest-thinker/SKILL.md +1 -1
- package/skills/luckiest-trends/SKILL.md +1 -1
- package/skills/luckiest-video/SKILL.md +1 -1
- package/skills/luckiest-website-cloner/ATTRIBUTION.md +29 -0
- package/skills/luckiest-website-cloner/CHANGELOG.md +8 -0
- package/skills/luckiest-website-cloner/LICENSE +21 -0
- package/skills/luckiest-website-cloner/SKILL.md +289 -0
- package/skills/luckiest-website-cloner/references/builtin-browser-recipes.md +74 -0
- package/skills/luckiest-website-cloner/references/compositing.md +65 -0
- package/skills/luckiest-website-cloner/references/fidelity-fast-path.md +92 -0
- package/skills/luckiest-website-cloner/references/playwright-cli-recipes.md +68 -0
- package/skills/luckiest-website-cloner/references/teardown.md +142 -0
- package/skills/luckiest-website-cloner/references/visual-qa.md +102 -0
- package/skills/luckiest-website-cloner/scripts/build-bundle.cjs +12 -0
- package/skills/luckiest-website-cloner/scripts/motion-probe.js +423 -0
- package/skills/luckiest-website-cloner/scripts/surface-map.js +392 -0
- package/skills/luckiest-website-cloner/scripts/tokens-probe.js +178 -0
- package/skills/luckiest-website-cloner-dom/ATTRIBUTION.md +4 -0
- package/skills/luckiest-website-cloner-dom/CHANGELOG.md +8 -0
- package/skills/luckiest-website-cloner-dom/LICENSE +21 -0
- package/skills/luckiest-website-cloner-dom/SKILL.md +170 -0
- package/skills/luckiest-website-cloner-dom/references/asset-resolution.md +93 -0
- package/skills/luckiest-website-cloner-dom/references/interaction-fingerprints.md +85 -0
- package/skills/luckiest-website-cloner-remix/ATTRIBUTION.md +4 -0
- package/skills/luckiest-website-cloner-remix/CHANGELOG.md +8 -0
- package/skills/luckiest-website-cloner-remix/LICENSE +21 -0
- package/skills/luckiest-website-cloner-remix/SKILL.md +202 -0
- package/skills/luckiest-website-cloner-remix/references/directions.md +82 -0
- package/skills/luckiest-website-cloner-remix/references/reskin.md +84 -0
- package/skills/luckiest-website-cloner-remix/references/tweak-panel.md +72 -0
- package/skills/luckiest-website-cloner-remix/scripts/apply-overrides.cjs +105 -0
- package/skills/luckiest-website-cloner-remix/scripts/gallery.cjs +71 -0
- package/skills/luckiest-website-cloner-remix/scripts/tokenize-css.cjs +127 -0
- package/skills/luckiest-website-cloner-remix/scripts/tweak-panel.js +169 -0
- package/skills/luckiest-website-cloner-shaders/ATTRIBUTION.md +11 -0
- package/skills/luckiest-website-cloner-shaders/CHANGELOG.md +8 -0
- package/skills/luckiest-website-cloner-shaders/LICENSE +21 -0
- package/skills/luckiest-website-cloner-shaders/SKILL.md +129 -0
- package/skills/luckiest-website-cloner-shaders/references/capture-backends.md +89 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/SKILL.md +123 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/capture-backends.md +201 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/evidence-policy.md +93 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/operating-contract.md +82 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/qa-failure-policy.md +100 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/recon-kernel.md +206 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/replay-policy.md +145 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/shaders-com.md +212 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/source-analysis.md +112 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/surface-discovery.md +113 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/target-lock.md +205 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/three-shader-reconstruction.md +155 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/tool-capability-matrix.md +57 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/unicorn-studio.md +387 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/scripts/fetch-rendered-dom.mjs +178 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/scripts/scan-bundle.sh +80 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/templates/extraction-report.md +41 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/templates/known-gaps.md +14 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/templates/qa-report.md +74 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/templates/replay-manifest.json +147 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/templates/run-state.json +75 -0
- package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/templates/scout-card.json +106 -0
package/skills/luckiest-website-cloner-shaders/vendor/web-shader-extractor/references/target-lock.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Target Lock
|
|
2
|
+
|
|
3
|
+
`TARGET_LOCKED` is an evidence gate.
|
|
4
|
+
After it passes, source tracing and capture can focus on one target surface group.
|
|
5
|
+
Use `attributed` when visual causality is proven but owner or source is still unresolved.
|
|
6
|
+
|
|
7
|
+
## Required Fields
|
|
8
|
+
|
|
9
|
+
`TARGET_ATTRIBUTED` means:
|
|
10
|
+
|
|
11
|
+
- the target surface or surface group is visually attributed
|
|
12
|
+
- ablation, frame comparison, interaction response, or equivalent evidence proves causality
|
|
13
|
+
- context, owner, framework, or source may still be incomplete
|
|
14
|
+
- only owner probes, backend probes, or narrow source probes tied to `nextProbe` are allowed
|
|
15
|
+
|
|
16
|
+
`TARGET_LOCKED` requires:
|
|
17
|
+
|
|
18
|
+
- target is a surface or surface group
|
|
19
|
+
- visual attribution evidence exists
|
|
20
|
+
- context type is known
|
|
21
|
+
- owner thread/frame/worker is known or reliably located
|
|
22
|
+
- framework, platform, runtime, or source clues are bound to the target
|
|
23
|
+
- effect boundary is classified
|
|
24
|
+
- exactly one primary trace route is selected
|
|
25
|
+
- alternatives and exclusion reasons are recorded
|
|
26
|
+
|
|
27
|
+
Do not set `lockStatus` to `locked` until these fields are present in `scout-card.json` with evidence paths.
|
|
28
|
+
Conversation text is not enough.
|
|
29
|
+
If owner/source is still unresolved but the visual target is proven, set `lockStatus` to `attributed`.
|
|
30
|
+
Make the next action an owner or backend probe.
|
|
31
|
+
|
|
32
|
+
## Scout Card v3
|
|
33
|
+
|
|
34
|
+
Write a small card before the full Manifest:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"schemaVersion": 3,
|
|
39
|
+
"source": {
|
|
40
|
+
"url": "https://example.com/",
|
|
41
|
+
"route": "/",
|
|
42
|
+
"viewport": { "width": 1440, "height": 900, "dpr": 2 }
|
|
43
|
+
},
|
|
44
|
+
"candidates": [
|
|
45
|
+
{
|
|
46
|
+
"id": "surface-1",
|
|
47
|
+
"selector": "canvas#hero",
|
|
48
|
+
"frame": "main",
|
|
49
|
+
"context": "webgl2",
|
|
50
|
+
"owner": "unknown",
|
|
51
|
+
"visualCoverage": "high",
|
|
52
|
+
"temporalActivity": "high",
|
|
53
|
+
"ablationImpact": "major",
|
|
54
|
+
"evidence": ["evidence/scout/surface-1.json"]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"lockStatus": "provisional",
|
|
58
|
+
"targetSet": [],
|
|
59
|
+
"alternatives": [],
|
|
60
|
+
"effectBoundary": "surface-only|surface-plus-dom|page-coupled|route-coupled",
|
|
61
|
+
"frameworkHypotheses": [],
|
|
62
|
+
"platformHypotheses": [],
|
|
63
|
+
"interactions": [],
|
|
64
|
+
"scopeRisk": "low|medium|high",
|
|
65
|
+
"blockingUnknowns": [],
|
|
66
|
+
"nextProbe": {
|
|
67
|
+
"type": "surface-ablation|runtime-owner|platform-api|frame-capture|preload|source-map|bundle-slice",
|
|
68
|
+
"target": "surface-1",
|
|
69
|
+
"resolves": ["owner", "framework"]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Target-Bound Evidence
|
|
75
|
+
|
|
76
|
+
Weak evidence can form hypotheses only:
|
|
77
|
+
|
|
78
|
+
- `window.THREE` exists
|
|
79
|
+
- a bundle contains `three`, `babylon`, `pixi`, `regl`, or shader keywords
|
|
80
|
+
- the domain resembles a known platform
|
|
81
|
+
- a global variable contains a renderer
|
|
82
|
+
- another canvas on the page uses a framework
|
|
83
|
+
|
|
84
|
+
Promote a hypothesis only when at least one strong target binding exists:
|
|
85
|
+
|
|
86
|
+
- `renderer.domElement === targetCanvas`
|
|
87
|
+
- engine rendering canvas equals the target canvas
|
|
88
|
+
- target context creation stack comes from the framework/platform
|
|
89
|
+
- target draw calls, programs, or state are associated with framework objects
|
|
90
|
+
- public platform definition instance ID matches the target embed/canvas
|
|
91
|
+
- source map or module path initializes the target surface
|
|
92
|
+
|
|
93
|
+
## Route Selection
|
|
94
|
+
|
|
95
|
+
Pick the next route from the strongest current target-bound clue:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
strong platform feature
|
|
99
|
+
-> platform structured definition or public API
|
|
100
|
+
|
|
101
|
+
target renderer object accessible
|
|
102
|
+
-> runtime object and framework version
|
|
103
|
+
|
|
104
|
+
generic WebGL
|
|
105
|
+
-> frame capture or shader/runtime capture
|
|
106
|
+
|
|
107
|
+
WebGPU / TSL
|
|
108
|
+
-> platform source, TSL definition, WebGPU capture
|
|
109
|
+
|
|
110
|
+
owner or timeline unclear
|
|
111
|
+
-> preload hooks
|
|
112
|
+
|
|
113
|
+
source/config still missing
|
|
114
|
+
-> source map or targeted bundle slice
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Adapter Interface
|
|
118
|
+
|
|
119
|
+
Each platform/framework adapter should answer:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
detect(context) target-bound evidence
|
|
123
|
+
preferredEvidence(context) highest-authority entry with lowest collection cost
|
|
124
|
+
capture(context) facts needed for replay
|
|
125
|
+
replay(context) recommended baseline route
|
|
126
|
+
validationHints(context) known failure cases and QA focus
|
|
127
|
+
fallback(context) next route if primary fails
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Initial adapters: Unicorn Studio, shaders.com / TSL, generic WebGL, generic WebGPU, Canvas2D, and Three.js target binding.
|
|
131
|
+
|
|
132
|
+
## Three.js Target Binding
|
|
133
|
+
|
|
134
|
+
Use this only after a target surface exists. Three.js on the page is not enough.
|
|
135
|
+
|
|
136
|
+
Accept Three.js as the target framework when one is true:
|
|
137
|
+
|
|
138
|
+
- `renderer.domElement === targetCanvas`
|
|
139
|
+
- target canvas `data-engine` or dataset is corroborated by runtime renderer object
|
|
140
|
+
- target context creation stack includes Three.js renderer initialization
|
|
141
|
+
- target draw calls/programs correspond to Three.js material/program records
|
|
142
|
+
- source map/module that creates the target surface imports Three.js renderer/material code
|
|
143
|
+
|
|
144
|
+
Capture runtime facts:
|
|
145
|
+
|
|
146
|
+
- `THREE.REVISION`
|
|
147
|
+
- renderer output color space/tone mapping
|
|
148
|
+
- renderer size and pixel ratio
|
|
149
|
+
- scene/camera relationship for the target pass
|
|
150
|
+
- material type, shader chunks, `onBeforeCompile` hooks
|
|
151
|
+
- render targets and composer passes
|
|
152
|
+
- clock/time update rule
|
|
153
|
+
|
|
154
|
+
Three.js r170+ may use TSL and WebGPU.
|
|
155
|
+
Do not expect GLSL strings from `shaderSource()`.
|
|
156
|
+
Route to `references/three-shader-reconstruction.md` or `references/capture-backends.md` when node graphs or WebGPU backend are target-bound.
|
|
157
|
+
|
|
158
|
+
## Scope Gate
|
|
159
|
+
|
|
160
|
+
Default scope is `effect`.
|
|
161
|
+
|
|
162
|
+
Scope values:
|
|
163
|
+
|
|
164
|
+
- `effect`: independent visual effect
|
|
165
|
+
- `page`: current page DOM/CSS/interaction plus renderer cooperation
|
|
166
|
+
- `site`: main public visual routes, unique visual templates, shared renderer, and transitions; not backend, accounts, private data, or bulk same-template content pages
|
|
167
|
+
|
|
168
|
+
Ask a scope question only when all are true:
|
|
169
|
+
|
|
170
|
+
- the user did not specify scope
|
|
171
|
+
- WebGL/WebGPU is the overall experience skeleton
|
|
172
|
+
- it is coupled with DOM, scroll, navigation, or route
|
|
173
|
+
- extracting one surface would lose the main target experience
|
|
174
|
+
|
|
175
|
+
A fullscreen background canvas alone is not a reason to ask.
|
|
176
|
+
|
|
177
|
+
Question template:
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
I have locked the main rendering system.
|
|
181
|
+
The site's WebGL/WebGPU also participates in layout, scroll, interaction feedback, or route transitions.
|
|
182
|
+
Extracting one effect would omit part of the main experience.
|
|
183
|
+
|
|
184
|
+
Choose the reproduction scope:
|
|
185
|
+
A. Core effect (default, fastest) - first build it as an independently runnable local effect.
|
|
186
|
+
B. Current page - also reproduce the DOM/CSS, scroll, interaction, and renderer cooperation.
|
|
187
|
+
C. Main site visual experience - inspect public visual routes and templates.
|
|
188
|
+
Reproduce the shared renderer, key visual pages, and route transitions.
|
|
189
|
+
Do not reproduce backend, accounts, private data, or bulk same-template content pages.
|
|
190
|
+
|
|
191
|
+
Reply with A, B, or C. If you reply "continue" or provide no scope, proceed with A.
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Ask separately only for login, CAPTCHA, private pages, paid resources, or permission/license uncertainty.
|
|
195
|
+
Combine blockers into one note.
|
|
196
|
+
|
|
197
|
+
## Gate Rules
|
|
198
|
+
|
|
199
|
+
- Before attribution completes, `lockStatus` can only be `unlocked` or `provisional`.
|
|
200
|
+
- `attributed` allows owner/backend/source probes bound to `nextProbe`; it does not allow deep source or bundle work.
|
|
201
|
+
- `locked` requires a non-empty `gateDecision.requiredEvidence` checklist in `scout-card.json`; every item must be an evidence item with `status`, `evidenceId`, `path`, `truth`, and `notes`.
|
|
202
|
+
- `frameworkHypotheses` and `platformHypotheses` are candidates, not conclusions.
|
|
203
|
+
- `nextProbe` has one main action.
|
|
204
|
+
- Raw DOM, screenshots, network logs, and frame captures go into files and are referenced by path.
|
|
205
|
+
- After lock, fill `targetSet`, excluded alternatives, lock evidence, and primary route.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Three.js Shader Reconstruction
|
|
2
|
+
|
|
3
|
+
Use this reference when target-bound evidence shows Three.js shader customization.
|
|
4
|
+
Applies to `material.onBeforeCompile`, Three.js TSL, WebGPU node graphs, or material systems that must preserve recorded source behavior.
|
|
5
|
+
|
|
6
|
+
## onBeforeCompile Failure Cases
|
|
7
|
+
|
|
8
|
+
### Built-In Function Signatures Vary By Version
|
|
9
|
+
|
|
10
|
+
Three.js shader chunk signatures change across versions:
|
|
11
|
+
|
|
12
|
+
```glsl
|
|
13
|
+
// r166 and earlier
|
|
14
|
+
vec4 getIBLVolumeRefraction(n, v, roughness, diffuseColor, specularColor, specularF90,
|
|
15
|
+
pos, modelMatrix, viewMatrix, projectionMatrix, ior, thickness,
|
|
16
|
+
attenuationColor, attenuationDistance)
|
|
17
|
+
|
|
18
|
+
// r167+ adds dispersion
|
|
19
|
+
vec4 getIBLVolumeRefraction(n, v, roughness, diffuseColor, specularColor, specularF90,
|
|
20
|
+
pos, modelMatrix, viewMatrix, projectionMatrix, dispersion, ior, thickness,
|
|
21
|
+
attenuationColor, attenuationDistance)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Always check the target version's actual signature:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
curl -s "https://cdn.jsdelivr.net/npm/three@0.167.0/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js" \
|
|
28
|
+
| tr '\n' ' ' | grep -oE 'vec4 getIBLVolumeRefraction\([^)]+\)'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### GLSL Does Not Allow Nested Function Definitions
|
|
32
|
+
|
|
33
|
+
```glsl
|
|
34
|
+
// Wrong.
|
|
35
|
+
void main() {
|
|
36
|
+
float myRand(vec2 co) { return fract(sin(...)); }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Correct.
|
|
40
|
+
float myRand(vec2 co) { return fract(sin(...)); }
|
|
41
|
+
void main() {
|
|
42
|
+
float r = myRand(uv);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Preserve Conditional Compilation Guards
|
|
47
|
+
|
|
48
|
+
Some variables exist only under specific macros:
|
|
49
|
+
|
|
50
|
+
- `vWorldPosition` requires `USE_TRANSMISSION`
|
|
51
|
+
- `vTransmissionMapUv` requires `USE_TRANSMISSIONMAP`
|
|
52
|
+
- `roughnessFactor` is available after `lights_physical_fragment`
|
|
53
|
+
|
|
54
|
+
If replacing `#include <transmission_fragment>`, keep the source guard pattern.
|
|
55
|
+
|
|
56
|
+
### Avoid Name Collisions
|
|
57
|
+
|
|
58
|
+
Injected global functions and variables can collide with Three.js internals:
|
|
59
|
+
|
|
60
|
+
- avoid generic names such as `hash`, `random`, and `noise`
|
|
61
|
+
- prefix custom helper names when needed
|
|
62
|
+
- prefix uniforms consistently, for example `uDistortion` and `uNoiseTime`
|
|
63
|
+
|
|
64
|
+
## Preferred Injection Pattern
|
|
65
|
+
|
|
66
|
+
Modify normals before the existing chunk when the target evidence supports it:
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
material.onBeforeCompile = (shader) => {
|
|
70
|
+
shader.uniforms.uDistortion = { value: 0 };
|
|
71
|
+
shader.uniforms.uNoiseTime = { value: 0 };
|
|
72
|
+
|
|
73
|
+
shader.fragmentShader = `
|
|
74
|
+
uniform float uDistortion;
|
|
75
|
+
uniform float uNoiseTime;
|
|
76
|
+
${noiseGLSL}
|
|
77
|
+
` + shader.fragmentShader;
|
|
78
|
+
|
|
79
|
+
shader.fragmentShader = shader.fragmentShader.replace(
|
|
80
|
+
'#include <transmission_fragment>',
|
|
81
|
+
`
|
|
82
|
+
#ifdef USE_TRANSMISSION
|
|
83
|
+
{
|
|
84
|
+
if (uDistortion > 0.0) {
|
|
85
|
+
normal = normalize(normal + uDistortion * vec3(
|
|
86
|
+
snoiseFractal(vWorldPosition * 0.08 + vec3(uNoiseTime)),
|
|
87
|
+
snoiseFractal(vWorldPosition.zxy * 0.08 - vec3(uNoiseTime)),
|
|
88
|
+
snoiseFractal(vWorldPosition.yxz * 0.08)
|
|
89
|
+
));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
#endif
|
|
93
|
+
#include <transmission_fragment>
|
|
94
|
+
`
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
When target evidence shows grain from low sample counts and chromatic aberration, a full `#include <transmission_fragment>` replacement may be required.
|
|
100
|
+
Keep the `#ifdef USE_TRANSMISSION` wrapper.
|
|
101
|
+
Preserve transmission and thickness map blocks.
|
|
102
|
+
Use the correct `getIBLVolumeRefraction` signature.
|
|
103
|
+
Pass evidence-derived dispersion/IOR values.
|
|
104
|
+
|
|
105
|
+
## Effect Source Mapping
|
|
106
|
+
|
|
107
|
+
| Effect | Source | Implementation |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| Glass refraction | `MeshPhysicalMaterial` `transmission` | Three.js built-in |
|
|
110
|
+
| Chromatic aberration | different IOR values for R/G/B | replace `transmission_fragment` |
|
|
111
|
+
| Film grain | low sample count plus per-pixel random direction | replace `transmission_fragment` |
|
|
112
|
+
| Organic distortion | simplex noise perturbing normal/refraction direction | `onBeforeCompile` injection |
|
|
113
|
+
| Color offset | `dispersion` property in r167+ | `MeshPhysicalMaterial` built-in |
|
|
114
|
+
|
|
115
|
+
## TSL Identification
|
|
116
|
+
|
|
117
|
+
Three.js r170+ TSL composes shader node graphs through JavaScript function chains and compiles them at runtime.
|
|
118
|
+
|
|
119
|
+
Identification signals:
|
|
120
|
+
|
|
121
|
+
1. Bundles contain many `uniform` or `shader` terms but very little `precision` or `gl_FragColor`.
|
|
122
|
+
2. The target canvas `data-engine` or runtime evidence indicates Three.js r170+.
|
|
123
|
+
3. The target-bound source contains chained calls such as `.mul()`, `.add()`, `.toVar()`, or `.assign()`.
|
|
124
|
+
|
|
125
|
+
## TSL To GLSL Mapping
|
|
126
|
+
|
|
127
|
+
| TSL | GLSL |
|
|
128
|
+
|---|---|
|
|
129
|
+
| `screenUV` | `gl_FragCoord.xy / resolution` |
|
|
130
|
+
| `viewportSize` | `uniform vec2 resolution` |
|
|
131
|
+
| `float()` / `vec2()` / `vec3()` / `vec4()` | same GLSL constructors, though TSL uses JavaScript functions |
|
|
132
|
+
| `.mul()` / `.add()` / `.sub()` / `.div()` | `*` / `+` / `-` / `/` |
|
|
133
|
+
| `sin()` / `cos()` / `mix()` / `smoothstep()` | same names |
|
|
134
|
+
| `clamp()` / `abs()` / `fract()` / `floor()` | same names |
|
|
135
|
+
| `pow()` / `exp()` / `sqrt()` / `dot()` / `length()` | same names |
|
|
136
|
+
| `Fn()` | shader function wrapper; inline it into GLSL |
|
|
137
|
+
| `uniform()` | `uniform <type> name` |
|
|
138
|
+
| `convertToTexture()` | RTT or FBO pass |
|
|
139
|
+
| `.sample(uv)` | `texture(sampler, uv)` |
|
|
140
|
+
| `.toVar()` / `.assign()` | mutable variable declaration/assignment |
|
|
141
|
+
| `.oneMinus()` | `1.0 - x` |
|
|
142
|
+
|
|
143
|
+
## TSL Reconstruction Steps
|
|
144
|
+
|
|
145
|
+
1. Locate `fragmentNode` near the target component name or target-bound module.
|
|
146
|
+
2. Build the mapping from minified imports to TSL function names using bundle import statements.
|
|
147
|
+
```javascript
|
|
148
|
+
import { A as screenUV, W as sin, ... } from "three-module"
|
|
149
|
+
```
|
|
150
|
+
3. Translate chained calls into GLSL expressions.
|
|
151
|
+
```javascript
|
|
152
|
+
// TSL: screenUV.x.sub(center.x).mul(aspect)
|
|
153
|
+
// GLSL: (uv.x - center.x) * aspect
|
|
154
|
+
```
|
|
155
|
+
4. Convert `convertToTexture(childNode)` into an independent FBO pass and sample it with `texture()` in the consuming shader.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Tool Capability Matrix
|
|
2
|
+
|
|
3
|
+
The skill depends on capabilities, not specific tool names. Probe available tools first, then choose the smallest sufficient profile.
|
|
4
|
+
|
|
5
|
+
## Capability Names
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
navigate
|
|
9
|
+
runtime-eval
|
|
10
|
+
preload-script
|
|
11
|
+
network-metadata
|
|
12
|
+
network-body
|
|
13
|
+
source-map
|
|
14
|
+
canvas-screenshot
|
|
15
|
+
interaction
|
|
16
|
+
frame-capture-webgl
|
|
17
|
+
frame-capture-webgpu
|
|
18
|
+
local-run
|
|
19
|
+
multi-frame-compare
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Profiles
|
|
23
|
+
|
|
24
|
+
### Profile A: Light Scout
|
|
25
|
+
|
|
26
|
+
Use for navigation, runtime eval, canvas inventory, screenshots, pointer/scroll/resize, and network overview.
|
|
27
|
+
A browser CLI, browser MCP, or host browser automation can satisfy this profile.
|
|
28
|
+
|
|
29
|
+
If Playwright is already installed, `scripts/fetch-rendered-dom.mjs` can serve as an optional inventory helper for DOM/canvas/network observations.
|
|
30
|
+
It does not perform Surface Attribution, Target Lock, Replay Ready, or QA gates.
|
|
31
|
+
Treat its output as inventory and hypothesis evidence only.
|
|
32
|
+
|
|
33
|
+
### Profile B: Chrome Deep Diagnostics
|
|
34
|
+
|
|
35
|
+
Use for pre-navigation init scripts, source-mapped stacks, response bodies, performance traces, and existing Chrome sessions.
|
|
36
|
+
CLI fits batch work. MCP fits continued interaction.
|
|
37
|
+
|
|
38
|
+
### Profile C: GPU Capture
|
|
39
|
+
|
|
40
|
+
Use WebGL frame capture or WebGPU recorders only after target and backend are known. GPU tools are optional adapters, not first-strike requirements.
|
|
41
|
+
|
|
42
|
+
### Profile D: Static Fallback
|
|
43
|
+
|
|
44
|
+
Use HTML, public API, source maps, dynamic chunk graph, and narrow bundle slices. Do not default to full deobfuscation.
|
|
45
|
+
|
|
46
|
+
`scripts/scan-bundle.sh` may be used on a target-bound slice to count shader/framework keywords.
|
|
47
|
+
Treat every result as a hypothesis that still needs target-bound evidence.
|
|
48
|
+
Do not infer GPGPU from generic `RenderTarget`, generic `DataTexture`, or post-processing hits.
|
|
49
|
+
Require feedback-loop, ping-pong pair, data-texture simulation, or compute-like update evidence.
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
|
|
53
|
+
- Do not require a single MCP before starting.
|
|
54
|
+
- Do not silently install large dependencies.
|
|
55
|
+
- If a tool is missing, downgrade to the closest capability and record the gap.
|
|
56
|
+
- If connecting to an existing logged-in browser, warn that credentials/page data may be visible to the agent and avoid persisting sensitive material.
|
|
57
|
+
- Store variable tool/version observations in run artifacts, not hard-coded skill instructions.
|