vibes-plug 1.0.0 → 2.5.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/.github/workflows/publish.yml +20 -0
- package/AGENTS.md +66 -0
- package/BLUEPRINT.md +152 -60
- package/CHANGELOG.md +50 -0
- package/README.md +346 -194
- package/package.json +25 -25
- package/plugin.json +1 -1
- package/skills/ai-cost-token-optimizer/SKILL.md +52 -0
- package/skills/ai-llm-integration-expert/SKILL.md +180 -162
- package/skills/api-design-expert/SKILL.md +314 -310
- package/skills/app-analyzer-optimizer/SKILL.md +193 -189
- package/skills/apple-ecosystem-expert/SKILL.md +142 -0
- package/skills/async-queue-temporal-expert/SKILL.md +54 -0
- package/skills/authentication-identity-expert/SKILL.md +251 -20
- package/skills/auto-doc-updater/SKILL.md +214 -204
- package/skills/autonomous-chaos-monkey/SKILL.md +63 -0
- package/skills/autonomous-red-teamer/SKILL.md +59 -0
- package/skills/autonomous-swarm-director/SKILL.md +69 -0
- package/skills/autonomous-tdd-debugger/SKILL.md +65 -0
- package/skills/bootstrap-to-modern/SKILL.md +90 -86
- package/skills/brainstorming/SKILL.md +373 -353
- package/skills/browser-automation-expert/SKILL.md +46 -0
- package/skills/ci-cd-devops-architect/SKILL.md +72 -45
- package/skills/cloud-hosting-expert/SKILL.md +244 -244
- package/skills/coderabbit/SKILL.md +192 -192
- package/skills/cron-scheduler-expert/SKILL.md +298 -0
- package/skills/data-telemetry-expert/SKILL.md +213 -213
- package/skills/database-orm-expert/SKILL.md +294 -294
- package/skills/dependency-upgrade-migrator/SKILL.md +295 -0
- package/skills/design-system-architect/SKILL.md +27 -10
- package/skills/doku-mcp-server/SKILL.md +251 -0
- package/skills/doku-payment-gateway/SKILL.md +227 -0
- package/skills/e2e-testing-expert/SKILL.md +315 -315
- package/skills/edge-serverless-db-expert/SKILL.md +43 -0
- package/skills/email-notification-expert/SKILL.md +362 -0
- package/skills/error-resilience-expert/SKILL.md +480 -0
- package/skills/event-driven-architect/SKILL.md +81 -81
- package/skills/feature-flag-analytics-expert/SKILL.md +46 -0
- package/skills/file-upload-media-expert/SKILL.md +431 -0
- package/skills/form-validation-expert/SKILL.md +401 -0
- package/skills/fullstack-expert/SKILL.md +202 -202
- package/skills/fullstack-expert/references/api_design_guide.md +466 -466
- package/skills/fullstack-expert/references/multi_language_backend.md +528 -528
- package/skills/fullstack-expert/scripts/api_contract_validator.py +253 -253
- package/skills/fullstack-expert/scripts/architecture_analyzer.py +326 -326
- package/skills/gemini-agent-booster/SKILL.md +135 -135
- package/skills/global-a11y-i18n-expert/SKILL.md +81 -81
- package/skills/glsl-shader-expert/SKILL.md +101 -0
- package/skills/go-programming-expert/SKILL.md +295 -295
- package/skills/graphql-apollo-expert/SKILL.md +108 -0
- package/skills/hig/SKILL.md +188 -188
- package/skills/hyper-context-synthesizer/SKILL.md +55 -0
- package/skills/js-backend-expert/SKILL.md +34 -9
- package/skills/legacy-code-translator/SKILL.md +65 -0
- package/skills/llm-cost-arbitrage-router/SKILL.md +59 -0
- package/skills/logging-error-tracking-expert/SKILL.md +338 -0
- package/skills/mcp-client-orchestrator/SKILL.md +70 -0
- package/skills/mcp-server-architect/SKILL.md +194 -194
- package/skills/micro-frontend-architect/SKILL.md +106 -0
- package/skills/mobile-expo-expert/SKILL.md +186 -186
- package/skills/mobile-push-notification-expert/SKILL.md +51 -0
- package/skills/monday-design-aesthetic/SKILL.md +67 -67
- package/skills/monorepo-architect/SKILL.md +227 -227
- package/skills/mpa-orchestrator/SKILL.md +101 -101
- package/skills/multi-agent-orchestration/SKILL.md +234 -234
- package/skills/multiple-entry-points/SKILL.md +55 -55
- package/skills/mvc-expert/SKILL.md +231 -231
- package/skills/payment-gateway-expert/SKILL.md +45 -45
- package/skills/performance-web-vitals/SKILL.md +332 -332
- package/skills/post-quantum-crypto-migrator/SKILL.md +57 -0
- package/skills/prd-architect/SKILL.md +201 -191
- package/skills/proactive-background-watcher/SKILL.md +62 -0
- package/skills/production-ready-hardener/PRODUCTION_READINESS_REPORT.md +67 -0
- package/skills/production-ready-hardener/SKILL.md +173 -186
- package/skills/production-ready-hardener/references/production_checklist.md +161 -161
- package/skills/production-ready-hardener/scripts/production_readiness_scanner.py +881 -875
- package/skills/project-context-mapper/SKILL.md +79 -0
- package/skills/python-programming-expert/SKILL.md +263 -132
- package/skills/rate-limit-abuse-prevention/SKILL.md +371 -0
- package/skills/realtime-collaboration-expert/SKILL.md +45 -45
- package/skills/rust-programming-expert/SKILL.md +235 -235
- package/skills/saas-billing/SKILL.md +377 -377
- package/skills/saas-multi-tenant/SKILL.md +251 -237
- package/skills/saas-mvp-launcher/SKILL.md +10 -0
- package/skills/saas-transformer/SKILL.md +187 -144
- package/skills/saas-transformer/references/billing_integration_guide.md +401 -401
- package/skills/saas-transformer/references/feature_gating_patterns.md +137 -137
- package/skills/saas-transformer/references/saas_transformation_checklist.md +121 -121
- package/skills/saas-transformer/scripts/saas_transformation_scanner.py +39 -29
- package/skills/scalability-clean-code/SKILL.md +229 -229
- package/skills/self-evolving-memory-graph/SKILL.md +75 -0
- package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -0
- package/skills/senior-frontend/SKILL.md +161 -161
- package/skills/senior-fullstack/SKILL.md +167 -167
- package/skills/seo/SKILL.md +235 -225
- package/skills/seo-geo/SKILL.md +188 -188
- package/skills/session-context-loader/SKILL.md +77 -0
- package/skills/session-handoff-resume/SKILL.md +158 -158
- package/skills/skill_baru/SKILL.md +172 -147
- package/skills/spa-orchestrator/SKILL.md +288 -288
- package/skills/state-management-expert/SKILL.md +272 -272
- package/skills/supabase-security-expert/SKILL.md +243 -243
- package/skills/tailwind-expert/SKILL.md +188 -188
- package/skills/tanstack-query-expert/SKILL.md +199 -199
- package/skills/token-saver/SKILL.md +119 -111
- package/skills/typescript-expert/SKILL.md +324 -279
- package/skills/ui-components-expert/SKILL.md +263 -46
- package/skills/ui-ux-pro-max/SKILL.md +202 -201
- package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
- package/skills/ui_ux_expert/SKILL.md +17 -6
- package/skills/vector-db-rag-expert/SKILL.md +52 -0
- package/skills/vibe-code-gardener/SKILL.md +181 -173
- package/skills/visual-qa-vision-agent/SKILL.md +65 -0
- package/skills/vue-frontend-expert/SKILL.md +126 -0
- package/skills/web-3d-graphics-expert/SKILL.md +131 -0
- package/skills/web-game-engine-expert/SKILL.md +96 -0
- package/skills/web-scraper/SKILL.md +207 -205
- package/skills/website-design-cloner/SKILL.md +174 -0
- package/skills/webxr-ar-vr-expert/SKILL.md +117 -0
- package/skills/zero-to-prod-orchestrator/SKILL.md +206 -180
- package/skills/zero-trust-secret-vault/SKILL.md +40 -0
- package/vibes-swarm-demo.gif +0 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: website-design-cloner
|
|
3
|
+
description: "Analyzes and reverse-engineers website designs directly from a target URL, extracting layout structures, design tokens (colors, typography, spacing), component hierarchies, visual assets, and responsive behaviors to enable full 1:1 duplication into modern code (Tailwind CSS v4, React/Next.js, HTML/CSS). / Mempelajari dan merekayasa balik desain situs web langsung dari URL target, mengekstrak struktur layout, design token (warna, tipografi, spacing), hierarki komponen, aset visual, dan perilaku responsif untuk duplikasi 1:1 penuh ke kode modern."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Website Design Cloner & Reverse Engineering Expert (2026 Edition)
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
`website-design-cloner` is an advanced URL-to-Code visual reverse engineering skill. It enables AI agents to inspect any target website URL, analyze its visual aesthetic, layout grid, CSS design tokens (OKLCH/HEX colors, typography system, container bounds, shadow tiers, border-radii), DOM structure, and interactive components, and synthesize production-ready code (Tailwind CSS v4, React 19, Next.js 15, HTML5/Vanilla CSS) to achieve a full 1:1 duplication.
|
|
18
|
+
|
|
19
|
+
### Trigger Conditions
|
|
20
|
+
- Replicating or cloning a website layout, landing page, or web application directly from a target URL.
|
|
21
|
+
- Extracting design systems (color palettes, typography scales, container grids, component patterns) from a reference link.
|
|
22
|
+
- Re-creating complex UI components (Hero banners, Bento grids, navbar drawers, pricing tables, footers) based on live URLs.
|
|
23
|
+
- Auditing and reverse-engineering third-party website layouts for component scaffolding.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### 5-Step URL-to-Code Reverse Engineering Methodology
|
|
28
|
+
|
|
29
|
+
```mermaid
|
|
30
|
+
graph TD
|
|
31
|
+
A["Target URL"] --> B["Phase 1: URL Inspection & DOM Scraping"]
|
|
32
|
+
B --> C["Phase 2: Design Tokens & CSS Extraction"]
|
|
33
|
+
C --> D["Phase 3: Component Hierarchy Breakdown"]
|
|
34
|
+
D --> E["Phase 4: 1:1 Code Synthesis (Tailwind v4 + React 19)"]
|
|
35
|
+
E --> F["Phase 5: Visual Verification & Polish"]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### Phase 1: URL Inspection & Asset Discovery
|
|
39
|
+
1. **Content Fetching**: Retrieve raw DOM, inline CSS, stylesheet links (`<link rel="stylesheet">`), and font imports using `read_url_content`, Firecrawl, Jina Reader API (`https://r.jina.ai/<URL>`), or Playwright browser automation.
|
|
40
|
+
2. **Visual Viewport Inspection**: Capture layout snapshots across break-points:
|
|
41
|
+
- Mobile (`375px`)
|
|
42
|
+
- Tablet (`768px`)
|
|
43
|
+
- Desktop (`1440px+`)
|
|
44
|
+
3. **Asset Mining**: Extract SVG icons (Lucide/Heroicons equivalents), image asset URLs, logo vectors, and background gradients.
|
|
45
|
+
|
|
46
|
+
#### Phase 2: Design Tokens & CSS Harvester
|
|
47
|
+
Harvest computed styles and synthesize them into Tailwind CSS v4 `@theme` tokens:
|
|
48
|
+
|
|
49
|
+
| Token Category | Extracted Properties | Tailwind CSS v4 Mapping |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| **Color System** | Primary, Secondary, Background, Neutral slate, Surface, Borders | `--color-primary`, `--color-background`, `--color-surface` |
|
|
52
|
+
| **Typography** | Font Family (Google Fonts link), Headings (`h1`-`h6`), Body, Font Weights | `--font-sans`, `--font-mono`, `--text-4xl`, `--font-bold` |
|
|
53
|
+
| **Spacing Scale** | Section Padding (`py-16`/`py-24`), Container Max-Width (`1280px`), Gap scale | `--spacing-16`, `--max-width-7xl`, `gap-6` |
|
|
54
|
+
| **Borders & Radii** | Card Border Radius (`16px`), Pill Radius (`9999px`), Border Colors | `--radius-xl`, `--color-border` |
|
|
55
|
+
| **Effects** | Backdrop Blur (`backdrop-blur-md`), Glassmorphism, Drop Shadows | `shadow-xl shadow-brand/10`, `backdrop-blur-lg` |
|
|
56
|
+
|
|
57
|
+
#### Phase 3: Component Hierarchy Breakdown
|
|
58
|
+
Deconstruct the target web page into modular, reusable UI components:
|
|
59
|
+
- **`HeaderNav`**: Brand logo, navigation menu links, dynamic CTA button, mobile drawer toggle.
|
|
60
|
+
- **`HeroSection`**: Eye-catching headline, subheading, action buttons, hero image/video/mockup.
|
|
61
|
+
- **`FeatureBento`**: Bento grid containers, icon badges, feature titles, micro-copy.
|
|
62
|
+
- **`TestimonialGrid`**: Avatar image, quote text, author metadata, star ratings.
|
|
63
|
+
- **`PricingSection`**: Tier cards, billing toggle (Monthly/Annual), highlighted popular badge, feature checklists.
|
|
64
|
+
- **`FooterNav`**: Category columns, newsletter subscription form, copyright & social icons.
|
|
65
|
+
|
|
66
|
+
#### Phase 4: 1:1 Code Synthesis (Tailwind v4 + React 19)
|
|
67
|
+
Synthesize clean, accessible, modern code matching the extracted structure.
|
|
68
|
+
|
|
69
|
+
##### Example: Extracted Tailwind CSS v4 Theme (`tokens.css`)
|
|
70
|
+
```css
|
|
71
|
+
@import "tailwindcss";
|
|
72
|
+
|
|
73
|
+
@theme {
|
|
74
|
+
--font-sans: "Outfit", "Inter", system-ui, sans-serif;
|
|
75
|
+
--font-mono: "Fira Code", monospace;
|
|
76
|
+
|
|
77
|
+
/* Extracted OKLCH Palette */
|
|
78
|
+
--color-brand-primary: oklch(58% 0.23 255);
|
|
79
|
+
--color-brand-accent: oklch(68% 0.19 160);
|
|
80
|
+
--color-surface-dark: oklch(14% 0.02 255);
|
|
81
|
+
--color-surface-card: oklch(18% 0.03 255 / 80%);
|
|
82
|
+
|
|
83
|
+
--radius-card: 1.25rem;
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
##### Example: Recreated Hero Component (`HeroSection.tsx`)
|
|
88
|
+
```tsx
|
|
89
|
+
import React from 'react';
|
|
90
|
+
|
|
91
|
+
export function HeroSection() {
|
|
92
|
+
return (
|
|
93
|
+
<section className="relative overflow-hidden bg-surface-dark py-24 text-white">
|
|
94
|
+
{/* Background Glow */}
|
|
95
|
+
<div className="absolute top-1/4 left-1/2 -z-10 h-96 w-96 -translate-x-1/2 rounded-full bg-brand-primary/20 blur-3xl" />
|
|
96
|
+
|
|
97
|
+
<div className="mx-auto max-w-7xl px-6 text-center">
|
|
98
|
+
<span className="inline-block rounded-full bg-brand-primary/10 px-4 py-1.5 text-xs font-semibold text-brand-accent backdrop-blur-md">
|
|
99
|
+
✨ Replicated Design Template
|
|
100
|
+
</span>
|
|
101
|
+
|
|
102
|
+
<h1 className="mt-6 font-sans text-5xl font-extrabold tracking-tight sm:text-6xl">
|
|
103
|
+
Duplicated Full-Fidelity <span className="bg-gradient-to-r from-brand-primary to-brand-accent bg-clip-text text-transparent">Website Layout</span>
|
|
104
|
+
</h1>
|
|
105
|
+
|
|
106
|
+
<p className="mx-auto mt-6 max-w-2xl text-lg text-slate-300">
|
|
107
|
+
Extracted directly from URL using website-design-cloner. Includes precise typography, exact color tokens, and responsive component structure.
|
|
108
|
+
</p>
|
|
109
|
+
|
|
110
|
+
<div className="mt-8 flex justify-center gap-4">
|
|
111
|
+
<button className="rounded-card bg-brand-primary px-6 py-3.5 font-medium text-white shadow-lg shadow-brand-primary/25 transition-all hover:scale-105">
|
|
112
|
+
Get Started
|
|
113
|
+
</button>
|
|
114
|
+
<button className="rounded-card border border-slate-700 bg-slate-800/50 px-6 py-3.5 font-medium text-slate-200 backdrop-blur-md hover:bg-slate-800">
|
|
115
|
+
View Live Demo
|
|
116
|
+
</button>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</section>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Phase 5: Visual Verification & Polish
|
|
125
|
+
- Ensure color contrast passes WCAG 2.2 AAA standard (4.5:1 ratio).
|
|
126
|
+
- Validate full responsiveness on mobile viewports.
|
|
127
|
+
- Replace broken image assets with synthesized visual placeholders using `generate_image`.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
<a name="bahasa-indonesia"></a>
|
|
132
|
+
## Bahasa Indonesia
|
|
133
|
+
|
|
134
|
+
### Deskripsi
|
|
135
|
+
`website-design-cloner` adalah skill rekayasa balik (*reverse engineering*) visual dari URL ke kode. Skill ini memungkinkan agen AI mempelajari situs web target dari URL, mengaudit estetika visual, grid layout, design token CSS (warna OKLCH/HEX, sistem tipografi, batas kontainer, bayangan, radius border), struktur DOM, dan komponen interaktif, lalu merekonstruksi kode siap produksi (Tailwind CSS v4, React 19, Next.js 15, HTML5/CSS3) untuk mencapai duplikasi 1:1 penuh.
|
|
136
|
+
|
|
137
|
+
### Kondisi Pemicu
|
|
138
|
+
- Merekapitulasi atau menduplikasi tata letak situs web, landing page, atau aplikasi web dari URL target.
|
|
139
|
+
- Mengekstrak design system (skema warna, skala tipografi, grid kontainer, pola komponen) dari tautan referensi.
|
|
140
|
+
- Membangun kembali komponen UI kompleks (banner Hero, Bento grid, drawer navigasi, tabel harga, footer) berdasarkan URL langsung.
|
|
141
|
+
- Mempelajari struktur visual dan rekayasa balik situs web pihak ketiga untuk template baru.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### Metodologi 5-Langkah Duplikasi URL-ke-Kode
|
|
146
|
+
|
|
147
|
+
1. **Tahap 1: Inspeksi URL & Penemuan Aset**:
|
|
148
|
+
- Mengambil HTML mentah, inline CSS, tautan stylesheet, dan font melalui `read_url_content`, Firecrawl, Jina Reader API (`https://r.jina.ai/<URL>`), atau otomatisasi browser Playwright.
|
|
149
|
+
- Mengambil snapshot tampilan visual pada breakpoint Mobile (`375px`), Tablet (`768px`), dan Desktop (`1440px`).
|
|
150
|
+
- Ekstraksi ikon SVG, URL gambar, logo, dan gradien latar belakang.
|
|
151
|
+
|
|
152
|
+
2. **Tahap 2: Ekstraksi Design Token & CSS**:
|
|
153
|
+
- Mengekstrak properti CSS computed dan menyintesisnya ke dalam token `@theme` Tailwind CSS v4 (sistem warna OKLCH/HEX, tipografi Google Fonts, skala spacing, border radius, dan efek shadow/glassmorphism).
|
|
154
|
+
|
|
155
|
+
3. **Tahap 3: Pembongkaran Hierarki Komponen**:
|
|
156
|
+
- Membagi halaman web target menjadi komponen modular: `HeaderNav`, `HeroSection`, `FeatureBento`, `TestimonialGrid`, `PricingSection`, dan `FooterNav`.
|
|
157
|
+
|
|
158
|
+
4. **Tahap 4: Sintesis Kode Presisi 1:1**:
|
|
159
|
+
- Menyusun kode bersih dan modular dalam React 19 / Next.js 15 / HTML+CSS modern yang menggunakan token `@theme` Tailwind CSS v4.
|
|
160
|
+
|
|
161
|
+
5. **Tahap 5: Verifikasi Visual & Polishing**:
|
|
162
|
+
- Memastikan rasio kontras WCAG 2.2, tes responsivitas mobile, dan membuat aset gambar pengganti presisi dengan tool `generate_image`.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### Matriks Orkestrasi & Handoff Skill
|
|
167
|
+
|
|
168
|
+
| Skill Terkait | Peran & Integrasi Handoff |
|
|
169
|
+
|---|---|
|
|
170
|
+
| `web-scraper` | Mengambil HTML mentah, CSS, dan Markdown dari URL via Jina Reader / Firecrawl API. |
|
|
171
|
+
| `design-system-architect` | Menyusun token visual hasil ekstraksi ke dalam design system enterprise berbasis OKLCH & Radix/Base UI. |
|
|
172
|
+
| `ui-ux-pro-max` | Memberikan acuan BM25 visual style, pasangan font Google Fonts, dan checklist aksesibilitas WCAG 2.2. |
|
|
173
|
+
| `senior-frontend` | Mengimplementasikan kode komponen React 19 / Next.js 15 App Router siap produksi. |
|
|
174
|
+
| `tailwind-expert` | Mengatur konfigurasi Tailwind CSS v4 `@theme` dan utilitas responsif. |
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: webxr-ar-vr-expert
|
|
3
|
+
description: "Expert guide for WebXR (Web-based Virtual and Augmented Reality) development using Babylon.js and Three.js. Covers device compatibility, immersive sessions, controllers, and hit-testing."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# WebXR AR/VR Expert
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
Production-grade guidance for building immersive **Augmented Reality (AR)** and **Virtual Reality (VR)** experiences in the browser using the **WebXR Device API**. Focuses on implementation via **Babylon.js** (which has industry-leading WebXR support) and **Three.js** / React Three Fiber.
|
|
18
|
+
|
|
19
|
+
### Trigger Conditions
|
|
20
|
+
Activate this skill when the user is:
|
|
21
|
+
- Building AR/VR experiences for Oculus/Meta Quest, Apple Vision Pro, or mobile AR devices.
|
|
22
|
+
- Setting up an `immersive-vr` or `immersive-ar` WebXR session.
|
|
23
|
+
- Implementing controller tracking, hand tracking, or teleportation in 3D space.
|
|
24
|
+
- Using AR Hit-Testing to place digital objects on physical surfaces (floors/tables).
|
|
25
|
+
|
|
26
|
+
### Core Concepts
|
|
27
|
+
|
|
28
|
+
#### 1. Babylon.js WebXR Setup
|
|
29
|
+
Babylon.js provides the most robust default WebXR experience.
|
|
30
|
+
```typescript
|
|
31
|
+
import { Scene, FreeCamera, Vector3, Engine } from '@babylonjs/core';
|
|
32
|
+
|
|
33
|
+
async function setupXR(scene: Scene) {
|
|
34
|
+
// Initialize default WebXR experience
|
|
35
|
+
// This automatically adds the "Enter VR/AR" button, teleportation, and controller models
|
|
36
|
+
const xr = await scene.createDefaultXRExperienceAsync({
|
|
37
|
+
uiOptions: {
|
|
38
|
+
sessionMode: 'immersive-vr', // or 'immersive-ar'
|
|
39
|
+
},
|
|
40
|
+
optionalFeatures: true
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Example: Listen for controller input
|
|
44
|
+
xr.input.onControllerAddedObservable.add((controller) => {
|
|
45
|
+
controller.onMotionControllerInitObservable.add((motionController) => {
|
|
46
|
+
// Handle button presses
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### 2. Three.js / React Three Fiber Setup
|
|
53
|
+
In R3F, use `@react-three/xr`.
|
|
54
|
+
```tsx
|
|
55
|
+
import { Canvas } from '@react-three/fiber';
|
|
56
|
+
import { XR, createXRStore } from '@react-three/xr';
|
|
57
|
+
|
|
58
|
+
const store = createXRStore();
|
|
59
|
+
|
|
60
|
+
export default function App() {
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
<button onClick={() => store.enterVR()}>Enter VR</button>
|
|
64
|
+
<Canvas>
|
|
65
|
+
<XR store={store}>
|
|
66
|
+
<mesh>
|
|
67
|
+
<boxGeometry />
|
|
68
|
+
<meshBasicMaterial color="red" />
|
|
69
|
+
</mesh>
|
|
70
|
+
</XR>
|
|
71
|
+
</Canvas>
|
|
72
|
+
</>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### 3. AR Hit-Testing
|
|
78
|
+
In AR mode, "Hit-Testing" allows you to detect real-world surfaces.
|
|
79
|
+
- Ensure `immersive-ar` is used.
|
|
80
|
+
- Request the `hit-test` feature when initializing the session.
|
|
81
|
+
- Use the hit-test results (a matrix/position) to place a reticle or object.
|
|
82
|
+
|
|
83
|
+
### Best Practices
|
|
84
|
+
- **Performance is Critical:** VR requires a consistent 72 to 90 FPS (or 120 FPS on Apple Vision Pro). Dropped frames cause motion sickness.
|
|
85
|
+
- **Polycount:** Keep polygon counts and draw calls low.
|
|
86
|
+
- **UI in XR:** Standard HTML UI will not work in immersive mode. You must use 3D UI (e.g., Babylon's GUI 3D system or Three.js spatial HTML layers if supported).
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### Integration with Other Skills (MANDATORY)
|
|
91
|
+
This skill works best when combined with:
|
|
92
|
+
- `web-3d-graphics-expert` — For building the 3D scene that XR will visualize.
|
|
93
|
+
- `apple-ecosystem-expert` — For optimizing WebXR compatibility with iOS (Safari) and visionOS.
|
|
94
|
+
- `web-game-engine-expert` — For adding physics to VR interactions (e.g., throwing objects).
|
|
95
|
+
|
|
96
|
+
### Referenced By Orchestrators (MANDATORY)
|
|
97
|
+
- `brainstorming` — Add to "3D & Graphics" or "Spatial Computing".
|
|
98
|
+
- `zero-to-prod-orchestrator` — Phase 5 (Frontend / XR Implementation).
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
<a name="bahasa-indonesia"></a>
|
|
103
|
+
## Bahasa Indonesia
|
|
104
|
+
|
|
105
|
+
### Deskripsi
|
|
106
|
+
Panduan ahli untuk pengembangan *Virtual Reality* (VR) dan *Augmented Reality* (AR) di web menggunakan **WebXR API**. Difokuskan pada implementasi menggunakan **Babylon.js** dan **Three.js** untuk ekosistem *Spatial Computing*.
|
|
107
|
+
|
|
108
|
+
### Kondisi Pemicu
|
|
109
|
+
- Mengembangkan aplikasi VR/AR untuk Meta Quest, Apple Vision Pro, atau Mobile AR.
|
|
110
|
+
- Mengimplementasikan pelacakan pengontrol (controller), pelacakan tangan (hand tracking), atau teleportasi.
|
|
111
|
+
- Menggunakan AR Hit-Testing untuk meletakkan objek 3D di permukaan dunia nyata.
|
|
112
|
+
|
|
113
|
+
### Panduan Singkat
|
|
114
|
+
- **Performa Mutlak:** Jaga FPS tetap stabil di angka 72-90 FPS. *Frame drop* pada VR menyebabkan rasa mual (motion sickness) pada pengguna. Batasi jumlah poligon dan *draw calls*.
|
|
115
|
+
- **Babylon.js sebagai Prioritas:** Untuk proyek XR berskala besar, prioritaskan Babylon.js karena dukungan bawaannya untuk interaksi VR, fisika, dan UI 3D jauh lebih matang dibanding library lain.
|
|
116
|
+
- **UI Spasial:** Ingat bahwa elemen HTML biasa tidak muncul di dalam sesi `immersive-vr` atau `immersive-ar`. Anda harus membuat UI berupa objek 3D (seperti panel yang melayang di udara).
|
|
117
|
+
- **Hit-Testing:** Untuk AR, gunakan fitur *Hit-Test* yang disediakan WebXR API untuk mengenali lantai atau meja sebagai tempat menaruh objek.
|