vibes-plug 2.5.0 → 2.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/.claude/rules/vibes-plug-core.md +32 -0
  2. package/.cursor/rules/vibes-plug-core.mdc +51 -0
  3. package/.cursorrules +42 -0
  4. package/AGENTS.md +37 -7
  5. package/BLUEPRINT.md +319 -217
  6. package/CHANGELOG.md +170 -1
  7. package/CLAUDE.md +70 -0
  8. package/LICENSE +1 -1
  9. package/README.md +611 -415
  10. package/index.js +19 -0
  11. package/package.json +44 -8
  12. package/plugin.json +24 -7
  13. package/scripts/check-anti-slop.js +53 -0
  14. package/scripts/generate_swarm_gif.py +295 -0
  15. package/scripts/install.js +201 -0
  16. package/skills/accessibility-testing-expert/SKILL.md +116 -0
  17. package/skills/ai-llm-integration-expert/SKILL.md +192 -178
  18. package/skills/ai-media-generation-expert/SKILL.md +172 -0
  19. package/skills/ai-prompt-engineering-expert/SKILL.md +134 -0
  20. package/skills/angular-expert/SKILL.md +148 -0
  21. package/skills/anti-slop/SKILL.md +133 -0
  22. package/skills/api-design-expert/SKILL.md +6 -3
  23. package/skills/api-gateway-proxy-expert/SKILL.md +81 -0
  24. package/skills/app-analyzer-optimizer/SKILL.md +6 -3
  25. package/skills/apple-ecosystem-expert/SKILL.md +144 -141
  26. package/skills/astro-framework-expert/SKILL.md +200 -0
  27. package/skills/async-queue-temporal-expert/SKILL.md +189 -26
  28. package/skills/authentication-identity-expert/SKILL.md +78 -181
  29. package/skills/autonomous-red-teamer/SKILL.md +172 -28
  30. package/skills/autonomous-tdd-debugger/SKILL.md +70 -64
  31. package/skills/biome-linter-formatter-expert/SKILL.md +89 -0
  32. package/skills/blockchain-web3-expert/SKILL.md +115 -0
  33. package/skills/bootstrap-to-modern/SKILL.md +9 -6
  34. package/skills/brainstorming/SKILL.md +60 -52
  35. package/skills/browser-automation-expert/SKILL.md +197 -21
  36. package/skills/bun-runtime-expert/SKILL.md +7 -1
  37. package/skills/chatbot-messaging-expert/SKILL.md +114 -0
  38. package/skills/ci-cd-devops-architect/SKILL.md +45 -36
  39. package/skills/cloud-hosting-expert/SKILL.md +7 -1
  40. package/skills/coderabbit/SKILL.md +7 -1
  41. package/skills/compliance-gdpr-privacy-expert/SKILL.md +85 -0
  42. package/skills/cron-scheduler-expert/SKILL.md +303 -297
  43. package/skills/data-pipeline-etl-expert/SKILL.md +84 -0
  44. package/skills/data-telemetry-expert/SKILL.md +7 -1
  45. package/skills/data-visualization-expert/SKILL.md +154 -0
  46. package/skills/database-orm-expert/SKILL.md +165 -294
  47. package/skills/deep-research-analyst/SKILL.md +136 -0
  48. package/skills/dependency-upgrade-migrator/SKILL.md +300 -294
  49. package/skills/design-system-architect/SKILL.md +309 -260
  50. package/skills/desktop-electron-expert/SKILL.md +128 -0
  51. package/skills/documentation-site-expert/SKILL.md +59 -0
  52. package/skills/doku-mcp-server/SKILL.md +7 -1
  53. package/skills/doku-payment-gateway/SKILL.md +7 -1
  54. package/skills/domain-driven-design-expert/SKILL.md +82 -0
  55. package/skills/e2e-testing-expert/SKILL.md +7 -1
  56. package/skills/ecommerce-expert/SKILL.md +87 -0
  57. package/skills/email-notification-expert/SKILL.md +393 -360
  58. package/skills/error-resilience-expert/SKILL.md +506 -479
  59. package/skills/event-driven-architect/SKILL.md +7 -1
  60. package/skills/feature-flag-analytics-expert/SKILL.md +65 -45
  61. package/skills/file-upload-media-expert/SKILL.md +436 -430
  62. package/skills/firebase-security-expert/SKILL.md +7 -1
  63. package/skills/form-validation-expert/SKILL.md +406 -400
  64. package/skills/fullstack-expert/SKILL.md +184 -202
  65. package/skills/gemini-agent-booster/SKILL.md +173 -135
  66. package/skills/geospatial-maps-expert/SKILL.md +80 -0
  67. package/skills/global-a11y-i18n-expert/SKILL.md +7 -1
  68. package/skills/glsl-shader-expert/SKILL.md +158 -69
  69. package/skills/go-programming-expert/SKILL.md +21 -15
  70. package/skills/graph-rag-knowledge-expert/SKILL.md +200 -0
  71. package/skills/graphql-apollo-expert/SKILL.md +113 -107
  72. package/skills/headless-cms-expert/SKILL.md +181 -0
  73. package/skills/hig/SKILL.md +7 -1
  74. package/skills/js-backend-expert/SKILL.md +218 -216
  75. package/skills/legacy-code-translator/SKILL.md +70 -64
  76. package/skills/local-slm-edge-ai-expert/SKILL.md +167 -0
  77. package/skills/logging-error-tracking-expert/SKILL.md +343 -337
  78. package/skills/mcp-server-architect/SKILL.md +308 -194
  79. package/skills/micro-frontend-architect/SKILL.md +111 -105
  80. package/skills/mobile-expo-expert/SKILL.md +8 -2
  81. package/skills/modern-css-native-expert/SKILL.md +189 -0
  82. package/skills/monorepo-architect/SKILL.md +7 -1
  83. package/skills/mpa-orchestrator/SKILL.md +20 -1
  84. package/skills/multi-agent-orchestration/SKILL.md +254 -234
  85. package/skills/multiple-entry-points/SKILL.md +37 -1
  86. package/skills/mvc-expert/SKILL.md +7 -1
  87. package/skills/n8n-automation-expert/SKILL.md +89 -0
  88. package/skills/nextjs-app-router-expert/SKILL.md +148 -0
  89. package/skills/openapi-swagger-codegen-expert/SKILL.md +67 -0
  90. package/skills/payment-gateway-expert/SKILL.md +85 -1
  91. package/skills/pdf-document-generation-expert/SKILL.md +91 -0
  92. package/skills/performance-web-vitals/SKILL.md +7 -1
  93. package/skills/post-quantum-crypto-migrator/SKILL.md +57 -57
  94. package/skills/prd-architect/SKILL.md +182 -201
  95. package/skills/proactive-background-watcher/SKILL.md +67 -61
  96. package/skills/production-ready-hardener/SKILL.md +459 -456
  97. package/skills/pwa-offline-first-expert/SKILL.md +226 -0
  98. package/skills/pydantic-ai-expert/SKILL.md +161 -0
  99. package/skills/python-programming-expert/SKILL.md +407 -401
  100. package/skills/rate-limit-abuse-prevention/SKILL.md +376 -370
  101. package/skills/realtime-collaboration-expert/SKILL.md +55 -1
  102. package/skills/rich-text-editor-expert/SKILL.md +177 -0
  103. package/skills/rust-programming-expert/SKILL.md +7 -1
  104. package/skills/saas-architect/SKILL.md +154 -0
  105. package/skills/saas-billing/SKILL.md +7 -1
  106. package/skills/saas-multi-tenant/SKILL.md +7 -1
  107. package/skills/scalability-clean-code/SKILL.md +7 -1
  108. package/skills/search-engine-expert/SKILL.md +89 -0
  109. package/skills/secure-fuzz-testing/SKILL.md +7 -1
  110. package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -57
  111. package/skills/senior-frontend/SKILL.md +139 -161
  112. package/skills/senior-frontend/scripts/frontend_scaffolder.py +1 -1
  113. package/skills/seo/SKILL.md +41 -17
  114. package/skills/session-memory-manager/SKILL.md +128 -0
  115. package/skills/solidjs-expert/SKILL.md +80 -0
  116. package/skills/spa-orchestrator/SKILL.md +20 -1
  117. package/skills/sse-websocket-streaming-expert/SKILL.md +93 -0
  118. package/skills/state-management-expert/SKILL.md +7 -1
  119. package/skills/supabase-security-expert/SKILL.md +7 -1
  120. package/skills/svelte-sveltekit-expert/SKILL.md +91 -0
  121. package/skills/svg-animation-motion-expert/SKILL.md +115 -0
  122. package/skills/synthetic-data-finetuning-expert/SKILL.md +155 -0
  123. package/skills/tailwind-expert/SKILL.md +88 -136
  124. package/skills/tanstack-query-expert/SKILL.md +7 -1
  125. package/skills/tauri-expert/SKILL.md +7 -1
  126. package/skills/typescript-expert/SKILL.md +12 -6
  127. package/skills/ui-ux-pro-max/SKILL.md +25 -3
  128. package/skills/vector-db-rag-expert/SKILL.md +175 -19
  129. package/skills/vercel-ai-sdk-expert/SKILL.md +181 -0
  130. package/skills/visual-qa-vision-agent/SKILL.md +70 -64
  131. package/skills/voice-ai-realtime-agent/SKILL.md +242 -0
  132. package/skills/vue-frontend-expert/SKILL.md +131 -125
  133. package/skills/wasm-edge-computing-expert/SKILL.md +97 -0
  134. package/skills/web-3d-graphics-expert/SKILL.md +262 -80
  135. package/skills/web-game-engine-expert/SKILL.md +281 -48
  136. package/skills/web-scraper/SKILL.md +157 -207
  137. package/skills/website-design-cloner/SKILL.md +179 -173
  138. package/skills/webxr-ar-vr-expert/SKILL.md +108 -63
  139. package/skills/wordpress-headless-expert/SKILL.md +144 -0
  140. package/skills/zero-to-prod-orchestrator/SKILL.md +65 -38
  141. package/skills/zero-trust-secret-vault/SKILL.md +87 -39
  142. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  143. package/.github/workflows/publish.yml +0 -20
  144. package/CONTRIBUTING.md +0 -199
  145. package/SECURITY.md +0 -21
  146. package/banner.png +0 -0
  147. package/skills/ai-cost-token-optimizer/SKILL.md +0 -52
  148. package/skills/asisten_ramah/SKILL.md +0 -41
  149. package/skills/auto-doc-updater/SKILL.md +0 -214
  150. package/skills/autonomous-chaos-monkey/SKILL.md +0 -63
  151. package/skills/autonomous-swarm-director/SKILL.md +0 -69
  152. package/skills/edge-serverless-db-expert/SKILL.md +0 -43
  153. package/skills/hyper-context-synthesizer/SKILL.md +0 -55
  154. package/skills/llm-cost-arbitrage-router/SKILL.md +0 -59
  155. package/skills/mcp-client-orchestrator/SKILL.md +0 -70
  156. package/skills/mobile-push-notification-expert/SKILL.md +0 -51
  157. package/skills/monday-design-aesthetic/SKILL.md +0 -67
  158. package/skills/project-context-mapper/SKILL.md +0 -79
  159. package/skills/saas-mvp-launcher/SKILL.md +0 -241
  160. package/skills/saas-transformer/SKILL.md +0 -489
  161. package/skills/saas-transformer/references/billing_integration_guide.md +0 -401
  162. package/skills/self-evolving-memory-graph/SKILL.md +0 -75
  163. package/skills/senior-fullstack/SKILL.md +0 -167
  164. package/skills/senior-fullstack/references/architecture_patterns.md +0 -160
  165. package/skills/senior-fullstack/references/development_workflows.md +0 -222
  166. package/skills/senior-fullstack/references/tech_stack_guide.md +0 -190
  167. package/skills/senior-fullstack/scripts/code_quality_analyzer.py +0 -114
  168. package/skills/senior-fullstack/scripts/fullstack_scaffolder.py +0 -114
  169. package/skills/senior-fullstack/scripts/project_scaffolder.py +0 -114
  170. package/skills/seo-aeo-landing-page-writer/SKILL.md +0 -97
  171. package/skills/seo-geo/SKILL.md +0 -188
  172. package/skills/session-context-loader/SKILL.md +0 -77
  173. package/skills/session-handoff-resume/SKILL.md +0 -158
  174. package/skills/skill_baru/SKILL.md +0 -172
  175. package/skills/supabase-migration/SKILL.md +0 -45
  176. package/skills/token-saver/SKILL.md +0 -119
  177. package/skills/ui-components-expert/SKILL.md +0 -280
  178. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
  179. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
  180. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
  181. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
  182. package/skills/ui_ux_expert/SKILL.md +0 -125
  183. package/skills/vibe-code-gardener/SKILL.md +0 -181
  184. package/vibes-swarm-demo.gif +0 -0
  185. /package/skills/{saas-transformer → saas-architect}/references/feature_gating_patterns.md +0 -0
  186. /package/skills/{saas-transformer → saas-architect}/references/saas_transformation_checklist.md +0 -0
  187. /package/skills/{saas-transformer → saas-architect}/scripts/saas_transformation_scanner.py +0 -0
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: web-3d-graphics-expert
3
- description: "Expert guide for WebGL and 3D graphics in the browser using Three.js, Babylon.js, React Three Fiber (R3F), and TresJS. Covers scene optimization, shaders, lighting, 3D model loading (GLTF/GLB), and performance tuning."
4
- author: "Roedy Rustam"
3
+ description: "Expert guide for modern WebGPU and WebGL 3D graphics in the browser using Three.js (WebGPURenderer + TSL), Babylon.js, PlayCanvas, React Three Fiber (R3F), and TresJS. Covers scene optimization, compute shaders, KTX2/Meshopt compression, and memory management / Panduan ahli grafis 3D web dan WebGPU modern."
4
+ author: "vibes-plug-swarm"
5
5
  ---
6
6
 
7
- # Web 3D Graphics Expert (Three.js & Babylon.js)
7
+ # Web 3D Graphics Expert (WebGPU, Three.js, Babylon.js & PlayCanvas)
8
8
 
9
9
  [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
10
10
 
@@ -13,119 +13,301 @@ author: "Roedy Rustam"
13
13
  <a name="english"></a>
14
14
  ## English
15
15
 
16
+ ### Orchestration & Integration
17
+ Connects and orchestrates with relevant domain skills:
18
+ - `senior-frontend` — Integrating React Three Fiber (R3F) in React 19 / Next.js 15.
19
+ - `vue-frontend-expert` — Integrating TresJS in Vue 3 / Nuxt 3.
20
+ - `svelte-sveltekit-expert` — Integrating Threlte in Svelte 5 (Runes).
21
+ - `web-game-engine-expert` — Physics simulations (Rapier, Jolt, Havok), game loops, and ECS.
22
+ - `glsl-shader-expert` — Shading languages, WGSL compute shaders, and TSL nodes.
23
+ - `webxr-ar-vr-expert` — WebXR immersive VR/AR experiences.
24
+ - `performance-web-vitals` — Minimizing Total Blocking Time (TBT), asset streaming, and bundle sizing.
25
+
16
26
  ### Description
17
- Production-level guidance for developing high-performance 3D graphics in the browser. Covers the raw APIs of **Three.js** and **Babylon.js**, as well as framework-specific wrappers like **React Three Fiber (R3F)** for React and **TresJS** for Vue. Focuses on rendering performance, efficient memory management, and realistic lighting/material setups.
27
+ Production-grade guidance for architecting high-fidelity, high-framerate 3D experiences in the browser. Covers the modern **WebGPU-first** paradigm with automatic WebGL2 fallbacks, **Three.js (r170+) WebGPURenderer** and **TSL (Three Shading Language)**, **Babylon.js WebGPUEngine** with Snapshot Rendering, and **PlayCanvas Engine** for ultra-lightweight, mobile-first commercial applications.
18
28
 
19
29
  ### Trigger Conditions
20
30
  Activate this skill when the user is:
21
- - Initializing a WebGL/WebGPU 3D scene.
22
- - Using `three`, `@react-three/fiber`, `@babylonjs/core`, or `@tresjs/core`.
23
- - Loading 3D models (`.glb`, `.gltf`, `.obj`).
24
- - Adding advanced lighting, shadows, or Post-Processing effects (Bloom, Depth of Field).
25
- - Asking about framerate drops, memory leaks, or rendering performance in 3D apps.
31
+ - Initializing a WebGPU or WebGL 3D scene.
32
+ - Using `three` (`three/webgpu`), `@react-three/fiber`, `@babylonjs/core`, `playcanvas`, `@tresjs/core`, or `@threlte/core`.
33
+ - Writing or refactoring shaders to Three Shading Language (TSL) or WGSL.
34
+ - Loading and optimizing 3D models (`.glb`, `.gltf`) with KTX2 texture compression or Meshopt.
35
+ - Implementing post-processing passes, compute shaders, or particle systems on the GPU.
36
+ - Diagnosing FPS drops, draw call bottlenecks, or VRAM memory leaks.
26
37
 
27
38
  ---
28
39
 
29
- ### Core Concepts & Framework Selection
40
+ ### Modern Web 3D Engine Landscape (2026)
30
41
 
31
- #### 1. React Three Fiber (R3F) vs Vanilla Three.js
32
- When building with React, always use **React Three Fiber**. It manages the scene graph, object lifecycles, and `requestAnimationFrame` natively within the React component tree.
42
+ | Engine / Stack | Best Use Case | Rendering Backend | Key Strengths |
43
+ | :--- | :--- | :--- | :--- |
44
+ | **Three.js (WebGPU + TSL)** | Creative landing pages, interactive portfolios, R3F React ecosystems | WebGPU (primary) + WebGL2 (fallback) | Vast community, huge ecosystem, TSL cross-compiles to WGSL & GLSL, node materials. |
45
+ | **Babylon.js** | Enterprise 3D simulations, CAD viewers, AAA web games with Havok | WebGPU + WebGL2 | Snapshot rendering, native Havok physics, compute shaders, robust GUI & inspector. |
46
+ | **PlayCanvas Engine** | High-performance mobile 3D, instant-load web games, e-commerce configurators | WebGPU + WebGL2 | Tiny runtime (~200KB gzipped), clustered lighting, zero-overhead scene graph. |
47
+ | **Threlte (Svelte 5)** | Svelte 5 apps requiring declarative 3D reactive components | Three.js WebGL/WebGPU | Svelte Runes reactivity (`$state`, `$derived`), lightweight bundle footprint. |
33
48
 
34
- ```tsx
35
- import { Canvas } from '@react-three/fiber'
36
- import { OrbitControls, Environment, useGLTF } from '@react-three/drei'
49
+ ---
37
50
 
38
- export default function App() {
39
- const { scene } = useGLTF('/model.glb')
40
- return (
41
- <Canvas camera={{ position: [0, 2, 5] }}>
42
- <ambientLight intensity={0.5} />
43
- <directionalLight position={[10, 10, 5]} castShadow />
44
- <primitive object={scene} />
45
- <Environment preset="city" />
46
- <OrbitControls />
47
- </Canvas>
48
- )
49
- }
51
+ ### 1. Three.js WebGPU & TSL (Three Shading Language)
52
+
53
+ Starting with modern Three.js, transition from `WebGLRenderer` to `WebGPURenderer`. It natively uses WebGPU when available and falls back cleanly to WebGL2.
54
+
55
+ ```typescript
56
+ // Modern Three.js WebGPU Scene Setup
57
+ import * as THREE from 'three/webgpu';
58
+ import { color, float, positionLocal, time, vec3, Fn } from 'three/tsl';
59
+
60
+ const canvas = document.querySelector('#canvas') as HTMLCanvasElement;
61
+ const renderer = new THREE.WebGPURenderer({ canvas, antialias: true });
62
+ renderer.setSize(window.innerWidth, window.innerHeight);
63
+ renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
64
+
65
+ // Initialize async WebGPU pipeline
66
+ await renderer.init();
67
+
68
+ const scene = new THREE.Scene();
69
+ const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000);
70
+ camera.position.set(0, 2, 5);
71
+
72
+ // TSL (Three Shading Language) Custom Node Material
73
+ // Compiles automatically to WGSL on WebGPU and GLSL on WebGL2!
74
+ const customMaterial = new THREE.MeshStandardNodeMaterial();
75
+
76
+ // Node-based animated color shader function
77
+ const animatedColor = Fn(() => {
78
+ const t = time.mul(2.0);
79
+ const wave = positionLocal.y.add(t).sin().mul(0.5).add(0.5);
80
+ return color(0x00ffff).mul(wave);
81
+ });
82
+
83
+ customMaterial.colorNode = animatedColor();
84
+
85
+ const mesh = new THREE.Mesh(new THREE.TorusKnotGeometry(1, 0.3, 128, 32), customMaterial);
86
+ scene.add(mesh);
87
+
88
+ // Render loop using setAnimationLoop (WebGPU & WebXR compatible)
89
+ renderer.setAnimationLoop(() => {
90
+ mesh.rotation.y += 0.01;
91
+ renderer.render(scene, camera);
92
+ });
50
93
  ```
51
- *Note: Always use `@react-three/drei` for common helpers (OrbitControls, Text, Environment).*
52
94
 
53
- #### 2. Babylon.js vs Three.js
54
- - **Three.js**: Lighter, more flexible, vast community, excellent for creative coding, landing page animations, and React/Vue integrations.
55
- - **Babylon.js**: Robust, game-engine-like architecture, built-in physics, excellent for web-based games, AR/VR (WebXR), and complex interactive simulations. Fully written in TypeScript.
95
+ ---
96
+
97
+ ### 2. Babylon.js WebGPU Engine & Snapshot Rendering
98
+
99
+ For scenes with thousands of static meshes, Babylon.js **Snapshot Rendering** records GPU command buffers once and replays them, bypassing JavaScript CPU draw call overhead.
56
100
 
57
101
  ```typescript
58
- // Basic Babylon.js Setup
59
- import { Engine, Scene, FreeCamera, Vector3, MeshBuilder, HemisphericLight } from '@babylonjs/core'
102
+ import { WebGPUEngine, Scene, ArcRotateCamera, Vector3, HemisphericLight, MeshBuilder } from '@babylonjs/core';
103
+
104
+ async function initBabylonWebGPU() {
105
+ const canvas = document.getElementById('renderCanvas') as HTMLCanvasElement;
106
+ const engine = new WebGPUEngine(canvas, { antialiasing: true });
107
+ await engine.initAsync();
60
108
 
61
- const canvas = document.getElementById('renderCanvas') as HTMLCanvasElement
62
- const engine = new Engine(canvas, true)
63
- const scene = new Scene(engine)
109
+ const scene = new Scene(engine);
110
+ const camera = new ArcRotateCamera('camera', -Math.PI / 2, Math.PI / 2.5, 10, Vector3.Zero(), scene);
111
+ camera.attachControl(canvas, true);
64
112
 
65
- const camera = new FreeCamera('camera1', new Vector3(0, 5, -10), scene)
66
- camera.setTarget(Vector3.Zero())
67
- camera.attachControl(canvas, true)
113
+ const light = new HemisphericLight('light', new Vector3(0, 1, 0), scene);
68
114
 
69
- const light = new HemisphericLight('light', new Vector3(0, 1, 0), scene)
70
- const sphere = MeshBuilder.CreateSphere('sphere', { diameter: 2 }, scene)
115
+ // Enable Snapshot Rendering for extreme draw call reduction
116
+ engine.snapshotRendering = true;
117
+ engine.snapshotRenderingMode = WebGPUEngine.SNAPSHOTRENDERING_FAST;
71
118
 
72
- engine.runRenderLoop(() => {
73
- scene.render()
74
- })
119
+ engine.runRenderLoop(() => {
120
+ scene.render();
121
+ });
122
+ }
75
123
  ```
76
124
 
77
- #### 3. Asset Loading & Optimization
78
- - **Format:** ALWAYS use `.glb` or `.gltf`. Avoid `.obj` or `.fbx` in the browser as they are unoptimized.
79
- - **Compression:** Use Draco compression (`glTF-Transform` or `gltf-pipeline`) to dramatically reduce file sizes.
80
- - **Loading:** Preload models if they are critical to the first paint.
125
+ ---
126
+
127
+ ### 3. PlayCanvas Engine (Ultra-Lightweight & Fast-Loading)
128
+
129
+ When bundle size and instant mobile loading are the primary constraints, use the standalone PlayCanvas Engine:
130
+
131
+ ```typescript
132
+ import * as pc from 'playcanvas';
133
+
134
+ const canvas = document.getElementById('application-canvas') as HTMLCanvasElement;
135
+ const app = new pc.Application(canvas, {
136
+ graphicsDeviceOptions: { alpha: false, antialias: true, preferWebGpu: true }
137
+ });
138
+ app.start();
139
+ app.setCanvasFillMode(pc.FILLMODE_FILL_WINDOW);
140
+ app.setCanvasResolution(pc.RESOLUTION_AUTO);
141
+
142
+ // Create Entity: Camera
143
+ const camera = new pc.Entity('camera');
144
+ camera.addComponent('camera', { clearColor: new pc.Color(0.1, 0.1, 0.15) });
145
+ camera.translate(0, 2, 6);
146
+ camera.lookAt(0, 0, 0);
147
+ app.root.addChild(camera);
148
+
149
+ // Create Entity: Clustered Directional Light
150
+ const light = new pc.Entity('light');
151
+ light.addComponent('light', { type: 'directional', castShadows: true });
152
+ light.setEulerAngles(45, 30, 0);
153
+ app.root.addChild(light);
154
+
155
+ // Create Entity: Box with Standard Material
156
+ const box = new pc.Entity('box');
157
+ box.addComponent('render', { type: 'box' });
158
+ app.root.addChild(box);
159
+
160
+ app.on('update', (dt: number) => {
161
+ box.rotate(10 * dt, 20 * dt, 30 * dt);
162
+ });
163
+ ```
81
164
 
82
165
  ---
83
166
 
84
- ### Best Practices for Performance
167
+ ### 4. React Three Fiber (R3F) with React 19
85
168
 
86
- 1. **Geometry and Material Reuse:**
87
- Never create new Geometries or Materials inside the render loop. Instantiate them once and reuse them. Use `InstancedMesh` (Three.js) or `Thin Instances` (Babylon.js) when rendering hundreds of identical objects.
88
- 2. **Memory Management (Disposing):**
89
- WebGL does not automatically garbage collect textures and geometries. When an object is removed from the scene, you MUST call `.dispose()` on its geometry and material.
90
- *(Note: R3F handles this automatically when components unmount).*
91
- 3. **Shadows & Lighting:**
92
- Limit the number of shadow-casting lights to 1 or 2. Use baked shadows (lightmaps) for static scenes. Use `Environment` maps (HDRI) instead of multiple lights for realistic reflections.
93
- 4. **Post-Processing:**
94
- Post-processing requires rendering the scene multiple times. Use it sparingly. Group passes together when possible.
169
+ ```tsx
170
+ import { Canvas } from '@react-three/fiber';
171
+ import { OrbitControls, Environment, useGLTF, Float } from '@react-three/drei';
172
+
173
+ function ModelViewer() {
174
+ const { scene } = useGLTF('/models/drone.glb');
175
+ return (
176
+ <Float speed={2} rotationIntensity={0.5} floatIntensity={1}>
177
+ <primitive object={scene} />
178
+ </Float>
179
+ );
180
+ }
181
+
182
+ export default function App() {
183
+ return (
184
+ <Canvas
185
+ gl={(canvas) => new THREE.WebGPURenderer({ canvas, antialias: true })}
186
+ camera={{ position: [0, 1.5, 4], fov: 45 }}
187
+ dpr={[1, 2]}
188
+ >
189
+ <ambientLight intensity={0.6} />
190
+ <directionalLight position={[5, 10, 5]} castShadow intensity={1.5} />
191
+ <ModelViewer />
192
+ <Environment preset="city" />
193
+ <OrbitControls makeDefault enableDamping dampingFactor={0.05} />
194
+ </Canvas>
195
+ );
196
+ }
197
+
198
+ // Preload critical assets outside component tree
199
+ useGLTF.preload('/models/drone.glb');
200
+ ```
95
201
 
96
202
  ---
97
203
 
98
- ### Integration with Other Skills (MANDATORY)
204
+ ### Modern Asset Pipeline & GPU Memory Optimization
99
205
 
100
- This skill works best when combined with:
101
- - `senior-frontend` — When integrating React Three Fiber into Next.js/React applications.
102
- - `vue-frontend-expert` — When integrating TresJS into Vue 3/Nuxt 3 applications.
103
- - `performance-web-vitals` — To optimize the bundle size of 3D libraries and reduce Total Blocking Time (TBT).
206
+ #### 1. GPU Texture Compression: KTX2 + Basis Universal (`KHR_texture_basisu`)
207
+ > **CRITICAL RULE**: Never deploy raw PNG or JPG textures for 3D production models.
208
+ - **Why?** PNG/JPG files decompress into uncompressed 32-bit RGBA inside GPU VRAM. A 2048x2048 PNG consumes **16MB of VRAM**; an uncompressed 4K texture consumes **64MB of VRAM**.
209
+ - **KTX2 with Basis Universal** transcodes in real-time into native GPU-compressed formats:
210
+ - Mobile: ASTC / ETC2.
211
+ - Desktop: BC7 / BC1.
212
+ - **Result:** Saves **75% to 85% of GPU VRAM**, prevents mobile browser tab crashes, and eliminates texture upload GPU hitches.
213
+ - **Tooling:** Compress glTF files with `gltf-transform`:
214
+ ```bash
215
+ npx @gltf-transform/cli optimize input.glb output.glb --texture-compress ktx2
216
+ ```
104
217
 
105
- ### Referenced By Orchestrators (MANDATORY)
218
+ #### 2. Geometry Optimization: Meshopt (`EXT_meshopt_compression`)
219
+ - Prefer **Meshopt** over Draco for high-framerate interactive apps and games.
220
+ - **Advantage:** Meshopt WASM decompressor runs at **gigabytes per second** (up to 10x faster decompression than Draco on mobile CPUs) and organizes vertex attributes for maximum GPU vertex cache efficiency.
221
+ ```bash
222
+ npx @gltf-transform/cli meshopt input.glb output.glb
223
+ ```
106
224
 
107
- This skill should be referenced by the following orchestrators:
108
- - `brainstorming` — Add to "UI/UX & Design Systems" or create a "3D & Graphics" category.
109
- - `zero-to-prod-orchestrator` — Phase 5 (Frontend Implementation).
225
+ #### 3. Strict Memory Lifecycle Management (`.dispose()`)
226
+ Garbage collection does NOT clean up WebGL/WebGPU buffers:
227
+ - When removing an object from Three.js or Babylon.js, explicitly traverse and dispose:
228
+ ```typescript
229
+ export function purgeObject(object: THREE.Object3D) {
230
+ object.traverse((child) => {
231
+ if ((child as THREE.Mesh).isMesh) {
232
+ const mesh = child as THREE.Mesh;
233
+ mesh.geometry?.dispose();
234
+ if (Array.isArray(mesh.material)) {
235
+ mesh.material.forEach((m) => disposeMaterial(m));
236
+ } else if (mesh.material) {
237
+ disposeMaterial(mesh.material);
238
+ }
239
+ }
240
+ });
241
+ }
242
+
243
+ function disposeMaterial(material: THREE.Material) {
244
+ Object.keys(material).forEach((prop) => {
245
+ const value = (material as any)[prop];
246
+ if (value && typeof value.dispose === 'function') {
247
+ value.dispose();
248
+ }
249
+ });
250
+ material.dispose();
251
+ }
252
+ ```
253
+
254
+ ---
255
+
256
+ ### Production Checklist
257
+ - [ ] Render with `WebGPURenderer` (Three.js) or `WebGPUEngine` (Babylon.js) with fallback enabled.
258
+ - [ ] Use KTX2 / Basis Universal compressed textures on all `.glb` assets.
259
+ - [ ] Use Meshopt geometry compression to eliminate model loading CPU stalls.
260
+ - [ ] Clamp `devicePixelRatio` to `Math.min(window.devicePixelRatio, 2)` to prevent 4K/Retina mobile GPU thermal throttling.
261
+ - [ ] Use `InstancedMesh` (Three.js) or `Thin Instances` (Babylon.js) for repetitive assets (>10 meshes).
262
+ - [ ] Implement explicit `.dispose()` cleanup in `useEffect` or component unmount hooks.
110
263
 
111
264
  ---
112
265
 
113
266
  <a name="bahasa-indonesia"></a>
114
267
  ## Bahasa Indonesia
115
268
 
269
+ ### Integrasi Orkestrasi
270
+ Terhubung dan mengorkestrasi skill domain yang relevan:
271
+ - `senior-frontend` — Integrasi React Three Fiber (R3F) pada React 19 / Next.js 15.
272
+ - `vue-frontend-expert` — Integrasi TresJS pada Vue 3 / Nuxt 3.
273
+ - `svelte-sveltekit-expert` — Integrasi Threlte pada Svelte 5 (Runes).
274
+ - `web-game-engine-expert` — Simulasi fisika (Rapier, Jolt, Havok), game loop, dan ECS.
275
+ - `glsl-shader-expert` — Bahasa shader, compute shader WGSL, dan node TSL.
276
+ - `webxr-ar-vr-expert` — Pengalaman WebXR VR/AR imersif.
277
+ - `performance-web-vitals` — Meminimalkan TBT (Total Blocking Time) dan optimasi ukuran bundle.
278
+
116
279
  ### Deskripsi
117
- Panduan produksi untuk pengembangan grafis 3D performa tinggi di browser. Mencakup **Three.js** dan **Babylon.js**, serta integrasi framework seperti **React Three Fiber (R3F)** untuk React dan **TresJS** untuk Vue. Fokus pada performa render, manajemen memori, dan pencahayaan realistis.
280
+ Panduan produksi untuk membangun grafis 3D performa tinggi di browser. Mengutamakan paradigma modern **WebGPU-first** dengan fallback otomatis ke WebGL2, **Three.js (r170+) WebGPURenderer** dan **TSL (Three Shading Language)**, **Babylon.js WebGPUEngine** dengan Snapshot Rendering, serta **PlayCanvas Engine** untuk aplikasi komersial mobile yang sangat ringan dan cepat dimuat.
118
281
 
119
282
  ### Kondisi Pemicu
120
- Aktifkan skill ini ketika pengguna sedang:
121
- - Menginisialisasi *scene* WebGL 3D.
122
- - Menggunakan library `three`, `@react-three/fiber`, atau `@babylonjs/core`.
123
- - Memuat model 3D (terutama format `.glb`/`.gltf`).
124
- - Mengoptimalkan FPS (frame-rate) atau menangani masalah *memory leak* pada aplikasi 3D.
125
-
126
- ### Panduan Singkat
127
- - **Pemilihan Alat:** Gunakan **React Three Fiber** jika menggunakan React. Gunakan **TresJS** jika menggunakan Vue. Gunakan **Babylon.js** jika membuat game berbasis web yang membutuhkan mesin fisika kuat (physics engine).
128
- - **Format Aset:** Selalu gunakan format `.glb` dengan kompresi Draco.
129
- - **Performa:** Jangan membuat *Geometry* atau *Material* baru di dalam *render loop* (`requestAnimationFrame`).
130
- - **Manajemen Memori:** Panggil method `.dispose()` pada geometry, material, dan texture yang sudah tidak digunakan di vanilla Three.js/Babylon.js untuk mencegah kebocoran memori.
131
- - **Pencahayaan:** Gunakan *Environment map* (HDRI) untuk pencahayaan realistis yang lebih ringan diproses daripada banyak lampu *directional/point*. Batasi lampu yang memancarkan bayangan maksimal 1-2 saja.
283
+ Aktifkan skill ini ketika pengguna:
284
+ - Menginisialisasi *scene* WebGPU atau WebGL 3D.
285
+ - Menggunakan `three` (`three/webgpu`), `@react-three/fiber`, `@babylonjs/core`, `playcanvas`, `@tresjs/core`, atau `@threlte/core`.
286
+ - Menulis atau merefaktor shader ke Three Shading Language (TSL) atau WGSL.
287
+ - Memuat dan mengoptimalkan model 3D (`.glb`, `.gltf`) menggunakan kompresi tekstur KTX2 atau Meshopt.
288
+ - Mengimplementasikan post-processing, compute shader, atau sistem partikel pada GPU.
289
+ - Mengatasi penurunan FPS (*frame drop*), hambatan *draw call*, atau kebocoran memori VRAM.
290
+
291
+ ---
292
+
293
+ ### Panduan Inti & Rekomendasi Mesin 3D
294
+
295
+ 1. **Three.js WebGPU + TSL**:
296
+ - Gunakan `WebGPURenderer` alih-alih `WebGLRenderer` standar.
297
+ - Manfaatkan TSL (*Three Shading Language*) dan *Node Materials*. Kode shader TSL ditulis secara deklaratif dalam TypeScript/JavaScript dan otomatis dikompilasi menjadi WGSL pada WebGPU dan GLSL pada WebGL2.
298
+
299
+ 2. **Babylon.js Snapshot Rendering**:
300
+ - Untuk skenario dengan ribuan mesh statis, aktifkan `engine.snapshotRendering = true` untuk merekam *command buffer* GPU sekali saja, memotong hampir 100% *overhead* CPU draw call JavaScript.
301
+
302
+ 3. **PlayCanvas Engine (Performa Mobile Ekstrem)**:
303
+ - Jika waktu muat (*initial load*) dan ukuran bundle adalah prioritas utama (misalnya iklan interaktif, 3D e-commerce configurator, game web mobile), PlayCanvas hanya memakan ~200KB gzipped dengan fitur *clustered lighting* yang sangat cepat.
304
+
305
+ 4. **Kompresi Tekstur GPU KTX2 (Wajib)**:
306
+ - Jangan menyajikan file PNG/JPG mentah di produksi. Format PNG/JPG diekspansi menjadi uncompressed RGBA di VRAM GPU (tekstur 4K memakan 64MB VRAM).
307
+ - Gunakan **KTX2 / Basis Universal** yang tetap terkompresi langsung di VRAM GPU (menghemat 75%-85% VRAM dan mencegah browser mobile crash).
308
+
309
+ 5. **Kompresi Geometri Meshopt**:
310
+ - Gunakan kompresi **Meshopt** (`EXT_meshopt_compression`) alih-alih Draco jika membutuhkan dekompresi super cepat di browser (hingga 10x lebih cepat dibanding Draco pada CPU mobile).
311
+
312
+ 6. **Pembersihan Memori Bersih (`.dispose()`)**:
313
+ - Browser garbage collector tidak dapat menghapus buffer GPU secara otomatis. Selalu panggil method `.dispose()` pada geometry, material, dan texture saat komponen di-unmount.