[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72T2PB4GYYGX17H9E4KEGAV":3,"skill-same:01M72T2PB4GYYGX17H9E4KEGAV":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M72T2PB4GYYGX17H9E4KEGAV","garage3d-webgpu-engine",null,"Build or change the GARA-G 3D garage engine (three.js r186 WebGPURenderer + TSL, WebGL2 fallback) at a steady 60 fps on mid-range phones. Use when touching packages\u002Fapp-pwa\u002Fsrc\u002Fgarage\u002Fengine\u002F, the garage scene, camera, part picking, health\u002Fx-ray view modes, adaptive quality, or the Svelte\u002FAstro mounting of the canvas.","iberi22\u002Fskills","iberi22","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10615454?v=4","01M72SQ2NXAA3GW0FSH053A5ES","Brahyan Belalcazar","01M72SQ2PYCH0SSA1K61NGEHDV",0,"MIT","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgeneral\u002Fgarage3d-webgpu-engine\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: garage3d-webgpu-engine\ndescription: Build or change the GARA-G 3D garage engine (three.js r186 WebGPURenderer + TSL, WebGL2 fallback) at a steady 60 fps on mid-range phones. Use when touching packages\u002Fapp-pwa\u002Fsrc\u002Fgarage\u002Fengine\u002F, the garage scene, camera, part picking, health\u002Fx-ray view modes, adaptive quality, or the Svelte\u002FAstro mounting of the canvas.\n---\n\n# Garage 3D engine (WebGPU, 60 fps)\n\nThe engine is a facade (`GarageEngineApi` in `src\u002Fgarage\u002Fcontracts.ts`). The UI talks only to\nthat interface; nothing outside `src\u002Fgarage\u002Fengine\u002F` imports `three` except templates and the lab.\n\n## Stack facts (verified on three 0.186.1)\n\n- `import { WebGPURenderer, MeshPhysicalNodeMaterial, PMREMGenerator, ... } from 'three\u002Fwebgpu'`\n  and TSL from `'three\u002Ftsl'`. Addons: `three\u002Faddons\u002Fcontrols\u002FOrbitControls.js`,\n  `three\u002Faddons\u002Fenvironments\u002FRoomEnvironment.js`, `three\u002Faddons\u002Ftsl\u002Fdisplay\u002FOutlineNode.js`,\n  `three\u002Faddons\u002Ftsl\u002Fdisplay\u002FBloomNode.js`.\n- `new WebGPURenderer({ canvas, antialias: true })` picks WebGPU and falls back to WebGL2 by\n  itself; `forceWebGL: true` forces the fallback (use it for `?gl=1`). **`await renderer.init()`\n  before the first render** (r186 throws on an uninitialized renderer).\n- Backend: `(renderer.backend as any).isWebGPUBackend ? 'webgpu' : 'webgl2'`.\n- Stats: `renderer.info.render.drawCalls`, `renderer.info.render.triangles`.\n- Headless Chromium in this repo **does** get WebGPU (verified: lab reports `backend: \"webgpu\"`).\n- Post-processing: `new RenderPipeline(renderer)` (r186 name; `PostProcessing` is the old alias)\n  with `pass(scene, camera)` nodes. Only on the `high` tier.\n\n## Frame budget (60 fps = 16.7 ms; mid-range Android ≈ Adreno 610 \u002F Mali-G57)\n\n| Item | Budget |\n|---|---|\n| Scene draw calls | ≤ 120 (`RENDER_BUDGET.sceneDrawCalls`) |\n| Vehicle triangles | ≤ 90k high \u002F ≤ 35k low LOD |\n| Pixel ratio | start `min(dpr, 1.5)` on touch devices, `min(dpr, 2)` desktop; governor may drop to 1.0 |\n| Shadows | one directional shadow map, 1024 (medium) \u002F 2048 (high), **off on low** (use the blob contact shadow) |\n| Shadow updates | `light.shadow.autoUpdate = false`; set `needsUpdate = true` only when the vehicle or its pose changes |\n| Environment | PMREM from `RoomEnvironment` once, sigma 0.04; never regenerate per frame |\n| Post | none on low\u002Fmedium; on high at most outline (selection) + light bloom on emissive strips |\n| Materials | from the shared kit only (`templates\u002Fcommon\u002Fmaterials.ts`); each new material = a new pipeline compile |\n\n## Rules\n\n1. **Render on demand.** Run `setAnimationLoop` while something moves (controls damping, camera\n   tween, carousel transition, pulsing overdue part); after ~1.5 s with no change, stop the loop\n   and re-arm it on input\u002Fresize\u002Fstate change. Idle garages must not burn battery.\n2. **Adaptive quality governor**: exponential moving average of frame time; if EMA > 18.5 ms for\n   ~45 frames step down (dpr → shadows → tier), if \u003C 12 ms for ~120 frames step up. Hysteresis\n   both ways, never oscillate faster than every 2 s. Expose the tier in `getStats()`.\n3. **Disposal is mandatory.** On vehicle switch dispose geometries of the outgoing vehicle (the\n   material kit is shared and survives); on `dispose()` free everything: renderer, PMREM target,\n   controls, listeners, ResizeObserver. Svelte remounts the page on SPA navigation (Astro\n   ClientRouter): leaks show up as GPU memory growth after 5 navigations.\n4. **Picking** with a single `Raycaster` against the vehicle root only; read `object.userData.slotId`\n   walking up parents. Ignore drags (pointerdown→pointerup moved > 6 px). Hover highlight only on\n   devices with `matchMedia('(hover: hover)')`.\n5. **View modes**\n   - `beauty`: original materials; slots marked `internal` in `src\u002Fgarage\u002Fparts.ts` hidden.\n   - `health`: every part gets one of 5 shared status materials (ok\u002Fwarn\u002Fcritical\u002Foverdue\u002Funknown);\n     keep the original in `mesh.userData.baseMaterial` and restore it. `overdue` pulses\n     (TSL `sin(time)` on emissive) – this is the only thing allowed to keep the loop alive.\n   - `xray`: body panels (`category: 'carroceria'`) switch to one shared translucent fresnel\n     material (TSL: `normalView`\u002F`positionView` dot → alpha), internals become visible.\n6. **Carousel transition** for `showVehicle(spec, { direction })`: outgoing slides\u002Frotates out on\n   the turntable while the incoming one slides in (≈450 ms, ease-in-out). Build the incoming model\n   *before* starting the animation so the build cost is not inside the transition. Respect\n   `prefers-reduced-motion` (cut instead of slide).\n7. **Camera**: `OrbitControls` with damping, polar angle clamped (no going under the floor),\n   distance clamped to the vehicle size. `focusPart(slot)` tweens target and distance to the\n   template's `focusPoints[slot]` (fallback: bounding-box center of the part). Double-tap\u002F`null`\n   resets.\n8. **Never block the main thread > 50 ms**: building a template is ~5–30 ms; precompile with\n   `await renderer.compileAsync(scene, camera)` after adding a new vehicle when available.\n9. **SSR safety**: the engine module must only be imported in the browser (dynamic `import()` from\n   `onMount`, component rendered with `client:only=\"svelte\"`). Contracts\u002Fparts are SSR-safe.\n\n## Garage scene look (\"game\" garage, not a CAD viewer)\n\nDark-to-mid neutral room: polished concrete floor (roughness ~0.35 with subtle noise), a raised\ncircular turntable with a thin emissive rim, two or three emissive light strips on the back wall\n(they also read well with bloom on high tier), a soft key light + hemisphere fill. The vehicle\nmust read clearly against the background in both light and dark UI themes — test with the lab\nbackgrounds `#dfe3e8` and `#0e1116`.\n\n> **Dev server en paralelo (obligatorio):** Astro 7 detecta que lo corre un agente y fuerza UN servidor de fondo\n> global por usuario: `pnpm astro dev` en tu worktree puede quedar conectado al servidor de OTRO agente, y\n> `astro dev stop` o `--force` apagan el de otro. Arranca el tuyo aislado y en primer plano:\n> `ASTRO_DEV_BACKGROUND=0 npx astro dev --port \u003Cpuerto-unico> --host 127.0.0.1 --ignore-lock & echo $! > \u002Ftmp\u002F\u003Ctu-id>.pid`\n> y paralo solo con `kill $(cat \u002Ftmp\u002F\u003Ctu-id>.pid)`. PROHIBIDO `pkill`\u002F`killall`\u002F`astro dev stop`\u002F`--force`.\n\n## Verify (all three, every change)\n\n```bash\n# 1. types (scoped)\ncd packages\u002Fapp-pwa && npx tsc --noEmit -p tsconfig.json 2>&1 | grep src\u002Fgarage\n# 2. unit tests of the island\nnpx vitest run src\u002Fgarage\n# 3. real render: dev server + screenshot, then LOOK at the png\nASTRO_DEV_BACKGROUND=0 npx astro dev --port \u003Cport> --host 127.0.0.1 --ignore-lock &   # ver nota\nnode scripts\u002Fgarage-shot.mjs --base http:\u002F\u002F127.0.0.1:\u003Cport> --path \u002Ffleet\u002Fgarage --out \u002Ftmp\u002Fg.png\n```\nReading the PNG is part of the job: \"tests green\" says nothing about whether the scene looks right.\nReport backend, fps sample, draw calls and triangles from `window.__garage.stats` in your REPORT.\n","# Garage 3D engine (WebGPU, 60 fps)\n\nThe engine is a facade (`GarageEngineApi` in `src\u002Fgarage\u002Fcontracts.ts`). The UI talks only to\nthat interface; nothing outside `src\u002Fgarage\u002Fengine\u002F` imports `three` except templates and the lab.\n\n## Stack facts (verified on three 0.186.1)\n\n- `import { WebGPURenderer, MeshPhysicalNodeMaterial, PMREMGenerator, ... } from 'three\u002Fwebgpu'`\n  and TSL from `'three\u002Ftsl'`. Addons: `three\u002Faddons\u002Fcontrols\u002FOrbitControls.js`,\n  `three\u002Faddons\u002Fenvironments\u002FRoomEnvironment.js`, `three\u002Faddons\u002Ftsl\u002Fdisplay\u002FOutlineNode.js`,\n  `three\u002Faddons\u002Ftsl\u002Fdisplay\u002FBloomNode.js`.\n- `new WebGPURenderer({ canvas, antialias: true })` picks WebGPU and falls back to WebGL2 by\n  itself; `forceWebGL: true` forces the fallback (use it for `?gl=1`). **`await renderer.init()`\n  before the first render** (r186 throws on an uninitialized renderer).\n- Backend: `(renderer.backend as any).isWebGPUBackend ? 'webgpu' : 'webgl2'`.\n- Stats: `renderer.info.render.drawCalls`, `renderer.info.render.triangles`.\n- Headless Chromium in this repo **does** get WebGPU (verified: lab reports `backend: \"webgpu\"`).\n- Post-processing: `new RenderPipeline(renderer)` (r186 name; `PostProcessing` is the old alias)\n  with `pass(scene, camera)` nodes. Only on the `high` tier.\n\n## Frame budget (60 fps = 16.7 ms; mid-range Android ≈ Adreno 610 \u002F Mali-G57)\n\n| Item | Budget |\n|---|---|\n| Scene draw calls | ≤ 120 (`RENDER_BUDGET.sceneDrawCalls`) |\n| Vehicle triangles | ≤ 90k high \u002F ≤ 35k low LOD |\n| Pixel ratio | start `min(dpr, 1.5)` on touch devices, `min(dpr, 2)` desktop; governor may drop to 1.0 |\n| Shadows | one directional shadow map, 1024 (medium) \u002F 2048 (high), **off on low** (use the blob contact shadow) |\n| Shadow updates | `light.shadow.autoUpdate = false`; set `needsUpdate = true` only when the vehicle or its pose changes |\n| Environment | PMREM from `RoomEnvironment` once, sigma 0.04; never regenerate per frame |\n| Post | none on low\u002Fmedium; on high at most outline (selection) + light bloom on emissive strips |\n| Materials | from the shared kit only (`templates\u002Fcommon\u002Fmaterials.ts`); each new material = a new pipeline compile |\n\n## Rules\n\n1. **Render on demand.** Run `setAnimationLoop` while something moves (controls damping, camera\n   tween, carousel transition, pulsing overdue part); after ~1.5 s with no change, stop the loop\n   and re-arm it on input\u002Fresize\u002Fstate change. Idle garages must not burn battery.\n2. **Adaptive quality governor**: exponential moving average of frame time; if EMA > 18.5 ms for\n   ~45 frames step down (dpr → shadows → tier), if \u003C 12 ms for ~120 frames step up. Hysteresis\n   both ways, never oscillate faster than every 2 s. Expose the tier in `getStats()`.\n3. **Disposal is mandatory.** On vehicle switch dispose geometries of the outgoing vehicle (the\n   material kit is shared and survives); on `dispose()` free everything: renderer, PMREM target,\n   controls, listeners, ResizeObserver. Svelte remounts the page on SPA navigation (Astro\n   ClientRouter): leaks show up as GPU memory growth after 5 navigations.\n4. **Picking** with a single `Raycaster` against the vehicle root only; read `object.userData.slotId`\n   walking up parents. Ignore drags (pointerdown→pointerup moved > 6 px). Hover highlight only on\n   devices with `matchMedia('(hover: hover)')`.\n5. **View modes**\n   - `beauty`: original materials; slots marked `internal` in `src\u002Fgarage\u002Fparts.ts` hidden.\n   - `health`: every part gets one of 5 shared status materials (ok\u002Fwarn\u002Fcritical\u002Foverdue\u002Funknown);\n     keep the original in `mesh.userData.baseMaterial` and restore it. `overdue` pulses\n     (TSL `sin(time)` on emissive) – this is the only thing allowed to keep the loop alive.\n   - `xray`: body panels (`category: 'carroceria'`) switch to one shared translucent fresnel\n     material (TSL: `normalView`\u002F`positionView` dot → alpha), internals become visible.\n6. **Carousel transition** for `showVehicle(spec, { direction })`: outgoing slides\u002Frotates out on\n   the turntable while the incoming one slides in (≈450 ms, ease-in-out). Build the incoming model\n   *before* starting the animation so the build cost is not inside the transition. Respect\n   `prefers-reduced-motion` (cut instead of slide).\n7. **Camera**: `OrbitControls` with damping, polar angle clamped (no going under the floor),\n   distance clamped to the vehicle size. `focusPart(slot)` tweens target and distance to the\n   template's `focusPoints[slot]` (fallback: bounding-box center of the part). Double-tap\u002F`null`\n   resets.\n8. **Never block the main thread > 50 ms**: building a template is ~5–30 ms; precompile with\n   `await renderer.compileAsync(scene, camera)` after adding a new vehicle when available.\n9. **SSR safety**: the engine module must only be imported in the browser (dynamic `import()` from\n   `onMount`, component rendered with `client:only=\"svelte\"`). Contracts\u002Fparts are SSR-safe.\n\n## Garage scene look (\"game\" garage, not a CAD viewer)\n\nDark-to-mid neutral room: polished concrete floor (roughness ~0.35 with subtle noise), a raised\ncircular turntable with a thin emissive rim, two or three emissive light strips on the back wall\n(they also read well with bloom on high tier), a soft key light + hemisphere fill. The vehicle\nmust read clearly against the background in both light and dark UI themes — test with the lab\nbackgrounds `#dfe3e8` and `#0e1116`.\n\n> **Dev server en paralelo (obligatorio):** Astro 7 detecta que lo corre un agente y fuerza UN servidor de fondo\n> global por usuario: `pnpm astro dev` en tu worktree puede quedar conectado al servidor de OTRO agente, y\n> `astro dev stop` o `--force` apagan el de otro. Arranca el tuyo aislado y en primer plano:\n> `ASTRO_DEV_BACKGROUND=0 npx astro dev --port \u003Cpuerto-unico> --host 127.0.0.1 --ignore-lock & echo $! > \u002Ftmp\u002F\u003Ctu-id>.pid`\n> y paralo solo con `kill $(cat \u002Ftmp\u002F\u003Ctu-id>.pid)`. PROHIBIDO `pkill`\u002F`killall`\u002F`astro dev stop`\u002F`--force`.\n\n## Verify (all three, every change)\n\n```bash\n# 1. types (scoped)\ncd packages\u002Fapp-pwa && npx tsc --noEmit -p tsconfig.json 2>&1 | grep src\u002Fgarage\n# 2. unit tests of the island\nnpx vitest run src\u002Fgarage\n# 3. real render: dev server + screenshot, then LOOK at the png\nASTRO_DEV_BACKGROUND=0 npx astro dev --port \u003Cport> --host 127.0.0.1 --ignore-lock &   # ver nota\nnode scripts\u002Fgarage-shot.mjs --base http:\u002F\u002F127.0.0.1:\u003Cport> --path \u002Ffleet\u002Fgarage --out \u002Ftmp\u002Fg.png\n```\nReading the PNG is part of the job: \"tests green\" says nothing about whether the scene looks right.\nReport backend, fps sample, draw calls and triangles from `window.__garage.stats` in your REPORT.\n",{"name":5,"description":7},"main","688810f2886d212632acf81e532b24e483dd8b98","skills\u002Fgeneral\u002Fgarage3d-webgpu-engine","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills","https:\u002F\u002Fgithub.com\u002Fiberi22","Senior WEB Full-Stack","2026-10-12 02:46:21",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add iberi22\u002Fskills --skill garage3d-webgpu-engine",{"tool":37,"command":38},"bunx","bunx skills add iberi22\u002Fskills --skill garage3d-webgpu-engine",{"tool":40,"command":41},"pnpm","pnpm dlx skills add iberi22\u002Fskills --skill garage3d-webgpu-engine","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgeneral\u002Fgarage3d-webgpu-engine\u002FSKILL.md",true,[],[46,52,59,65,71,77],{"skillNo":47,"name":48,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M72TWQEQD46ZC9TRBAABF78P","web-design-guidelines","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M72TWMQFTYD08DGXVAXRPPEB","blocked-page-recovery","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall. Recovers the page via archives and provenance-checked fallbacks.","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M72TVQMS3HCTX18C8T97WTQQ","studio-coach","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fstudio-coach\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M72TVNA2PR9RZW0ZAXYP1G6J","src-generator","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fsrc-generator\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M72TVEJHHB6SAT3R3TY9MJKS","sqlite-pro","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fsqlite-pro\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M72TVC2EVBHQHCX96VTTYKB8","rigor-evaluator","Use when you need a quick heuristic rigor score (10 criteria, 0-2 each) for the features in a .gitcore\u002Ffeatures.json file, to decide which features are ready to ship.","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Frigor-evaluator\u002FSKILL.md",[],[]]