vibes-plug 1.0.0 → 2.11.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/.claude/rules/vibes-plug-core.md +32 -0
- package/.cursor/rules/vibes-plug-core.mdc +51 -0
- package/.cursorrules +42 -0
- package/AGENTS.md +96 -0
- package/BLUEPRINT.md +309 -125
- package/CHANGELOG.md +183 -1
- package/CLAUDE.md +70 -0
- package/LICENSE +1 -1
- package/README.md +641 -263
- package/index.js +19 -0
- package/package.json +61 -25
- package/plugin.json +24 -7
- package/scripts/generate_swarm_gif.py +295 -0
- package/scripts/install.js +201 -0
- package/skills/accessibility-testing-expert/SKILL.md +116 -0
- package/skills/ai-cost-token-optimizer/SKILL.md +82 -0
- package/skills/ai-evals-benchmark-expert/SKILL.md +188 -0
- package/skills/ai-llm-integration-expert/SKILL.md +147 -122
- package/skills/ai-media-generation-expert/SKILL.md +172 -0
- package/skills/ai-prompt-engineering-expert/SKILL.md +84 -0
- package/skills/angular-expert/SKILL.md +148 -0
- package/skills/api-design-expert/SKILL.md +316 -309
- package/skills/api-gateway-proxy-expert/SKILL.md +81 -0
- package/skills/app-analyzer-optimizer/SKILL.md +195 -188
- package/skills/apple-ecosystem-expert/SKILL.md +145 -0
- package/skills/{asisten_ramah → asisten-ramah}/SKILL.md +7 -1
- package/skills/astro-framework-expert/SKILL.md +200 -0
- package/skills/async-queue-temporal-expert/SKILL.md +240 -0
- package/skills/authentication-identity-expert/SKILL.md +279 -45
- package/skills/auto-doc-updater/SKILL.md +219 -203
- package/skills/autonomous-chaos-monkey/SKILL.md +63 -0
- package/skills/autonomous-red-teamer/SKILL.md +203 -0
- package/skills/autonomous-tdd-debugger/SKILL.md +71 -0
- package/skills/background-jobs-queue-expert/SKILL.md +235 -0
- package/skills/biome-linter-formatter-expert/SKILL.md +89 -0
- package/skills/blockchain-web3-expert/SKILL.md +115 -0
- package/skills/bootstrap-to-modern/SKILL.md +93 -86
- package/skills/brainstorming/SKILL.md +381 -353
- package/skills/browser-automation-expert/SKILL.md +222 -0
- package/skills/bun-runtime-expert/SKILL.md +7 -1
- package/skills/chatbot-messaging-expert/SKILL.md +114 -0
- package/skills/ci-cd-devops-architect/SKILL.md +81 -45
- package/skills/cloud-hosting-expert/SKILL.md +249 -243
- package/skills/coderabbit/SKILL.md +197 -191
- package/skills/compliance-gdpr-privacy-expert/SKILL.md +85 -0
- package/skills/cron-scheduler-expert/SKILL.md +304 -0
- package/skills/data-pipeline-etl-expert/SKILL.md +84 -0
- package/skills/data-telemetry-expert/SKILL.md +218 -212
- package/skills/data-visualization-expert/SKILL.md +154 -0
- package/skills/database-migration-versioning-expert/SKILL.md +90 -0
- package/skills/database-orm-expert/SKILL.md +303 -293
- package/skills/dependency-upgrade-migrator/SKILL.md +301 -0
- package/skills/design-system-architect/SKILL.md +278 -242
- package/skills/desktop-electron-expert/SKILL.md +128 -0
- package/skills/documentation-site-expert/SKILL.md +59 -0
- package/skills/doku-mcp-server/SKILL.md +257 -0
- package/skills/doku-payment-gateway/SKILL.md +233 -0
- package/skills/domain-driven-design-expert/SKILL.md +82 -0
- package/skills/e2e-testing-expert/SKILL.md +320 -314
- package/skills/ecommerce-expert/SKILL.md +87 -0
- package/skills/edge-serverless-db-expert/SKILL.md +99 -0
- package/skills/email-notification-expert/SKILL.md +368 -0
- package/skills/error-resilience-expert/SKILL.md +486 -0
- package/skills/event-driven-architect/SKILL.md +86 -80
- package/skills/feature-flag-analytics-expert/SKILL.md +66 -0
- package/skills/file-upload-media-expert/SKILL.md +437 -0
- package/skills/firebase-security-expert/SKILL.md +7 -1
- package/skills/form-validation-expert/SKILL.md +407 -0
- package/skills/fullstack-expert/SKILL.md +260 -201
- 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 +142 -104
- package/skills/geospatial-maps-expert/SKILL.md +80 -0
- package/skills/global-a11y-i18n-expert/SKILL.md +86 -80
- package/skills/glsl-shader-expert/SKILL.md +107 -0
- package/skills/go-programming-expert/SKILL.md +300 -294
- package/skills/graph-rag-knowledge-expert/SKILL.md +159 -0
- package/skills/graphql-apollo-expert/SKILL.md +114 -0
- package/skills/headless-cms-expert/SKILL.md +181 -0
- package/skills/hig/SKILL.md +193 -187
- package/skills/js-backend-expert/SKILL.md +218 -191
- package/skills/legacy-code-translator/SKILL.md +71 -0
- package/skills/local-slm-edge-ai-expert/SKILL.md +167 -0
- package/skills/logging-error-tracking-expert/SKILL.md +344 -0
- package/skills/mcp-client-orchestrator/SKILL.md +76 -0
- package/skills/mcp-server-architect/SKILL.md +226 -126
- package/skills/micro-frontend-architect/SKILL.md +112 -0
- package/skills/mobile-expo-expert/SKILL.md +191 -185
- package/skills/mobile-push-notification-expert/SKILL.md +71 -0
- package/skills/modern-css-native-expert/SKILL.md +189 -0
- package/skills/monday-design-aesthetic/SKILL.md +72 -66
- package/skills/monorepo-architect/SKILL.md +232 -226
- package/skills/mpa-orchestrator/SKILL.md +120 -101
- package/skills/multi-agent-orchestration/SKILL.md +173 -153
- package/skills/multiple-entry-points/SKILL.md +91 -55
- package/skills/mvc-expert/SKILL.md +237 -231
- package/skills/n8n-automation-expert/SKILL.md +89 -0
- package/skills/nextjs-app-router-expert/SKILL.md +148 -0
- package/skills/openapi-swagger-codegen-expert/SKILL.md +67 -0
- package/skills/payment-gateway-expert/SKILL.md +129 -45
- package/skills/pdf-document-generation-expert/SKILL.md +91 -0
- package/skills/performance-web-vitals/SKILL.md +337 -331
- package/skills/post-quantum-crypto-migrator/SKILL.md +57 -0
- package/skills/prd-architect/SKILL.md +206 -190
- package/skills/proactive-background-watcher/SKILL.md +68 -0
- package/skills/production-ready-hardener/PRODUCTION_READINESS_REPORT.md +67 -0
- package/skills/production-ready-hardener/SKILL.md +461 -468
- 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 +85 -0
- package/skills/pwa-offline-first-expert/SKILL.md +185 -0
- package/skills/python-programming-expert/SKILL.md +407 -270
- package/skills/rate-limit-abuse-prevention/SKILL.md +377 -0
- package/skills/realtime-collaboration-expert/SKILL.md +99 -45
- package/skills/rich-text-editor-expert/SKILL.md +177 -0
- package/skills/rust-programming-expert/SKILL.md +240 -234
- package/skills/saas-billing/SKILL.md +382 -376
- package/skills/saas-multi-tenant/SKILL.md +256 -236
- package/skills/saas-mvp-launcher/SKILL.md +30 -1
- package/skills/saas-transformer/SKILL.md +499 -445
- 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 +234 -228
- package/skills/search-engine-expert/SKILL.md +89 -0
- package/skills/secure-fuzz-testing/SKILL.md +7 -1
- package/skills/self-evolving-memory-graph/SKILL.md +91 -0
- package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -0
- package/skills/senior-frontend/SKILL.md +85 -105
- package/skills/seo/SKILL.md +258 -224
- package/skills/session-context-loader/SKILL.md +83 -0
- package/skills/session-handoff-resume/SKILL.md +163 -157
- package/skills/{skill_baru → skill-baru}/SKILL.md +177 -146
- package/skills/solidjs-expert/SKILL.md +80 -0
- package/skills/spa-orchestrator/SKILL.md +306 -287
- package/skills/sse-websocket-streaming-expert/SKILL.md +93 -0
- package/skills/state-management-expert/SKILL.md +277 -271
- package/skills/supabase-migration/SKILL.md +47 -1
- package/skills/supabase-security-expert/SKILL.md +248 -242
- package/skills/svelte-sveltekit-expert/SKILL.md +91 -0
- package/skills/svg-animation-motion-expert/SKILL.md +115 -0
- package/skills/tailwind-expert/SKILL.md +139 -187
- package/skills/tanstack-query-expert/SKILL.md +204 -198
- package/skills/tauri-expert/SKILL.md +7 -1
- package/skills/token-saver/SKILL.md +118 -110
- package/skills/typescript-expert/SKILL.md +329 -278
- package/skills/ui-components-expert/SKILL.md +166 -63
- package/skills/ui-ux-pro-max/SKILL.md +221 -200
- package/skills/vector-db-rag-expert/SKILL.md +208 -0
- package/skills/vibe-code-gardener/SKILL.md +180 -172
- package/skills/visual-qa-vision-agent/SKILL.md +71 -0
- package/skills/voice-ai-realtime-agent/SKILL.md +202 -0
- package/skills/vue-frontend-expert/SKILL.md +132 -0
- package/skills/wasm-edge-computing-expert/SKILL.md +97 -0
- package/skills/web-3d-graphics-expert/SKILL.md +137 -0
- package/skills/web-game-engine-expert/SKILL.md +102 -0
- package/skills/web-scraper/SKILL.md +98 -146
- package/skills/website-design-cloner/SKILL.md +180 -0
- package/skills/webxr-ar-vr-expert/SKILL.md +123 -0
- package/skills/wordpress-headless-expert/SKILL.md +144 -0
- package/skills/zero-to-prod-orchestrator/SKILL.md +231 -180
- package/skills/zero-trust-secret-vault/SKILL.md +88 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/CONTRIBUTING.md +0 -199
- package/SECURITY.md +0 -21
- package/banner.png +0 -0
- package/skills/senior-fullstack/SKILL.md +0 -167
- package/skills/senior-fullstack/references/architecture_patterns.md +0 -160
- package/skills/senior-fullstack/references/development_workflows.md +0 -222
- package/skills/senior-fullstack/references/tech_stack_guide.md +0 -190
- package/skills/senior-fullstack/scripts/code_quality_analyzer.py +0 -114
- package/skills/senior-fullstack/scripts/fullstack_scaffolder.py +0 -114
- package/skills/senior-fullstack/scripts/project_scaffolder.py +0 -114
- package/skills/seo-aeo-landing-page-writer/SKILL.md +0 -97
- package/skills/seo-geo/SKILL.md +0 -188
- package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
- package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
- package/skills/ui_ux_expert/SKILL.md +0 -114
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: web-scraper
|
|
3
|
-
description: "Smart web data extraction
|
|
3
|
+
description: "Smart agentic web data extraction with multi-strategy scraping (Crawl4AI v4, Firecrawl), LLM extraction loops, anti-bot bypass, and structured export / Ekstraksi data web cerdas dan agentic dengan scraping multi-strategi (Crawl4AI v4, Firecrawl), ekstraksi LLM, bypass anti-bot, dan ekspor terstruktur."
|
|
4
4
|
author: "Roedy Rustam"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Web Scraper Expert (2026 Edition)
|
|
7
|
+
# Agentic Web Scraper Expert (2026 Edition)
|
|
8
8
|
|
|
9
9
|
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
10
|
|
|
@@ -13,151 +13,103 @@ 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 like `browser-automation-expert`, `ai-llm-integration-expert`, `brainstorming`, and `zero-to-prod-orchestrator` to ensure cohesive agentic execution.
|
|
18
|
+
|
|
16
19
|
### Description
|
|
17
|
-
|
|
20
|
+
Advanced Agentic Web Scraping utilizing modern multi-strategy data extraction. Leverages **Crawl4AI v4** and **Firecrawl** to convert raw DOMs into LLM-friendly Markdown. Implements Agentic Extraction loops where the LLM guides the scraper dynamically based on page state. Incorporates strategies for bypassing anti-bot measures (Cloudflare Turnstile, Datadome) and navigating dynamic Shadow DOMs.
|
|
18
21
|
|
|
19
22
|
### Trigger Conditions
|
|
20
23
|
- Extracting structured data from websites for analysis, training data, or content pipelines.
|
|
21
|
-
- Scraping dynamic JavaScript-rendered pages
|
|
24
|
+
- Scraping dynamic JavaScript-rendered pages and complex SPAs.
|
|
22
25
|
- Converting web pages to clean Markdown for LLM context or RAG pipelines.
|
|
23
|
-
-
|
|
24
|
-
-
|
|
26
|
+
- Dealing with anti-bot protections or complex Shadow DOM architectures during scraping.
|
|
27
|
+
- Implementing an automated agentic data extraction loop.
|
|
25
28
|
|
|
26
|
-
###
|
|
29
|
+
### Extracting DOM into LLM-Friendly Markdown
|
|
30
|
+
Use **Crawl4AI v4** for high-performance async extraction and **Firecrawl** for seamless LLM-ready conversion.
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
| **Browser Automation** | Playwright | Complex SPAs, auth-required pages | ✅ |
|
|
33
|
-
| **Lightweight HTML** | BeautifulSoup + httpx | Static HTML, fast extraction | ❌ |
|
|
32
|
+
**Crawl4AI v4 (Async Python):**
|
|
33
|
+
```python
|
|
34
|
+
import asyncio
|
|
35
|
+
from crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
async def extract_markdown(url: str):
|
|
38
|
+
config = BrowserConfig(headless=True, bypass_csp=True)
|
|
39
|
+
run_config = CrawlerRunConfig(
|
|
40
|
+
cache_mode=CacheMode.ENABLED,
|
|
41
|
+
remove_overlay_elements=True,
|
|
42
|
+
word_count_threshold=50
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
async with AsyncWebCrawler(config=config) as crawler:
|
|
46
|
+
result = await crawler.arun(url=url, config=run_config)
|
|
47
|
+
# Returns clean, AI-optimized markdown ready for LLM consumption
|
|
48
|
+
return result.markdown.fit_markdown
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Firecrawl (Managed API):**
|
|
37
52
|
```python
|
|
38
53
|
from firecrawl import FirecrawlApp
|
|
54
|
+
from pydantic import BaseModel
|
|
39
55
|
|
|
40
56
|
app = FirecrawlApp(api_key="fc-xxxx")
|
|
41
57
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
only_main_content=True, # removes nav, footer, ads
|
|
47
|
-
)
|
|
48
|
-
print(result.markdown)
|
|
49
|
-
|
|
50
|
-
# Full site crawl
|
|
51
|
-
crawl_result = app.crawl_url(
|
|
52
|
-
"https://docs.example.com",
|
|
53
|
-
limit=50,
|
|
54
|
-
scrape_options={"formats": ["markdown"]},
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
# LLM-powered structured extraction with JSON schema
|
|
58
|
-
from pydantic import BaseModel
|
|
59
|
-
|
|
60
|
-
class ProductInfo(BaseModel):
|
|
61
|
-
name: str
|
|
62
|
-
price: float
|
|
63
|
-
description: str
|
|
64
|
-
in_stock: bool
|
|
58
|
+
class ExtractionSchema(BaseModel):
|
|
59
|
+
title: str
|
|
60
|
+
content: str
|
|
61
|
+
key_metrics: list[str]
|
|
65
62
|
|
|
63
|
+
# Single API call to extract structured data based on JSON schema
|
|
66
64
|
result = app.scrape_url(
|
|
67
|
-
"https://
|
|
68
|
-
formats=["extract"],
|
|
69
|
-
extract={"schema":
|
|
65
|
+
"https://example.com/data",
|
|
66
|
+
formats=["extract", "markdown"],
|
|
67
|
+
extract={"schema": ExtractionSchema.model_json_schema()}
|
|
70
68
|
)
|
|
71
|
-
|
|
69
|
+
print(result.markdown) # Clean markdown
|
|
70
|
+
print(result.extract) # Structured JSON
|
|
72
71
|
```
|
|
73
72
|
|
|
74
|
-
###
|
|
75
|
-
|
|
76
|
-
import httpx
|
|
77
|
-
|
|
78
|
-
async def url_to_markdown(url: str) -> str:
|
|
79
|
-
"""Convert any URL to clean Markdown via Jina Reader API."""
|
|
80
|
-
async with httpx.AsyncClient() as client:
|
|
81
|
-
response = await client.get(
|
|
82
|
-
f"https://r.jina.ai/{url}",
|
|
83
|
-
headers={
|
|
84
|
-
"Accept": "application/json",
|
|
85
|
-
"X-Return-Format": "markdown",
|
|
86
|
-
"Authorization": f"Bearer {JINA_API_KEY}",
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
data = response.json()
|
|
90
|
-
return data["data"]["content"]
|
|
91
|
-
|
|
92
|
-
# Search and get results as Markdown
|
|
93
|
-
async def search_to_markdown(query: str) -> str:
|
|
94
|
-
async with httpx.AsyncClient() as client:
|
|
95
|
-
response = await client.get(
|
|
96
|
-
f"https://s.jina.ai/{query}",
|
|
97
|
-
headers={"Accept": "application/json"}
|
|
98
|
-
)
|
|
99
|
-
return response.json()["data"]
|
|
100
|
-
```
|
|
73
|
+
### Anti-Bot Bypass & Shadow DOMs
|
|
74
|
+
Scraping modern web apps requires bypassing anti-bot measures like Cloudflare Turnstile and Datadome, as well as accessing deeply nested elements.
|
|
101
75
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
76
|
+
1. **Anti-Bot Bypass (Cloudflare Turnstile, Datadome):**
|
|
77
|
+
- **Residential Proxies:** Rotate high-quality residential IPs to avoid datacenter IP bans.
|
|
78
|
+
- **Browser Fingerprinting:** Use tools like `playwright-stealth` or specialized stealth browsers (e.g., Undetected ChromeDriver, Curl-Impersonate) to mask automated fingerprints (WebGL, Canvas, User-Agent).
|
|
79
|
+
- **Human-like Interaction:** Introduce random delays, simulate realistic mouse movements, and handle CAPTCHAs via third-party solving services only when necessary.
|
|
80
|
+
2. **Dynamic Shadow DOMs:**
|
|
81
|
+
- Use CSS piercing selectors or JavaScript execution to penetrate the Shadow Root.
|
|
82
|
+
- Example (Playwright): `await page.locator('my-web-component >> css=.internal-element').text_content()`
|
|
83
|
+
- Recursively traverse the DOM tree injecting scripts to extract content from encapsulated components.
|
|
106
84
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
async with AsyncWebCrawler(config=browser_config) as crawler:
|
|
111
|
-
result = await crawler.arun(
|
|
112
|
-
url="https://news.example.com",
|
|
113
|
-
config=CrawlerRunConfig(
|
|
114
|
-
cache_mode=CacheMode.ENABLED, # cache results
|
|
115
|
-
word_count_threshold=50, # skip short content
|
|
116
|
-
exclude_external_links=True,
|
|
117
|
-
remove_overlay_elements=True, # remove popups/modals
|
|
118
|
-
),
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
print(result.markdown.fit_markdown) # cleaned, AI-optimized Markdown
|
|
122
|
-
print(result.links) # extracted links
|
|
123
|
-
```
|
|
85
|
+
### Agentic Extraction Loops
|
|
86
|
+
Implement an autonomous loop where an LLM guides the scraper based on the current page state, rather than relying on brittle CSS selectors.
|
|
124
87
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
88
|
+
1. **Observe:** The scraper extracts the current DOM into clean Markdown.
|
|
89
|
+
2. **Analyze:** The LLM analyzes the Markdown to identify necessary data or the next interaction step (e.g., "Click the 'Load More' button").
|
|
90
|
+
3. **Act:** The LLM issues a command (extract data, navigate, click, fill form).
|
|
91
|
+
4. **Loop:** Repeat until the extraction goal is met.
|
|
129
92
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
#
|
|
136
|
-
await
|
|
137
|
-
|
|
138
|
-
await page.goto(url, wait_until="networkidle")
|
|
139
|
-
|
|
140
|
-
# Wait for dynamic content
|
|
141
|
-
await page.wait_for_selector("[data-testid='product-list']")
|
|
142
|
-
|
|
143
|
-
# Extract structured data via JavaScript
|
|
144
|
-
products = await page.evaluate("""() => {
|
|
145
|
-
return Array.from(document.querySelectorAll('.product-card')).map(card => ({
|
|
146
|
-
name: card.querySelector('.product-name')?.textContent?.trim(),
|
|
147
|
-
price: card.querySelector('.price')?.textContent?.trim(),
|
|
148
|
-
}));
|
|
149
|
-
}""")
|
|
93
|
+
```python
|
|
94
|
+
async def agentic_scrape_loop(url: str, goal: str):
|
|
95
|
+
current_url = url
|
|
96
|
+
while True:
|
|
97
|
+
markdown_content = await extract_markdown(current_url)
|
|
98
|
+
# LLM analyzes state and decides next action
|
|
99
|
+
action = await llm_decide_action(markdown_content, goal)
|
|
150
100
|
|
|
151
|
-
|
|
152
|
-
|
|
101
|
+
if action.type == "COMPLETE":
|
|
102
|
+
return action.extracted_data
|
|
103
|
+
elif action.type == "CLICK":
|
|
104
|
+
await click_element(action.target_selector)
|
|
105
|
+
elif action.type == "NAVIGATE":
|
|
106
|
+
current_url = action.new_url
|
|
153
107
|
```
|
|
154
108
|
|
|
155
109
|
### Ethical Scraping Checklist
|
|
156
110
|
- [ ] Check `robots.txt` and respect `Disallow` rules.
|
|
157
|
-
- [ ] Implement rate limiting
|
|
158
|
-
- [ ] Use descriptive `User-Agent`
|
|
159
|
-
- [ ] Cache results to avoid repeated requests.
|
|
160
|
-
- [ ] Prefer public APIs or official data feeds when available.
|
|
111
|
+
- [ ] Implement rate limiting.
|
|
112
|
+
- [ ] Use descriptive `User-Agent` headers.
|
|
161
113
|
- [ ] Do not scrape personal/private data without consent.
|
|
162
114
|
|
|
163
115
|
---
|
|
@@ -165,41 +117,41 @@ async def scrape_spa(url: str) -> dict:
|
|
|
165
117
|
<a name="bahasa-indonesia"></a>
|
|
166
118
|
## Bahasa Indonesia
|
|
167
119
|
|
|
120
|
+
### Integrasi Orkestrasi
|
|
121
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `browser-automation-expert`, `ai-llm-integration-expert`, `brainstorming`, dan `zero-to-prod-orchestrator` untuk memastikan eksekusi agentic yang kohesif.
|
|
122
|
+
|
|
168
123
|
### Deskripsi
|
|
169
|
-
|
|
124
|
+
Scraping Web Agentic tingkat lanjut menggunakan ekstraksi data multi-strategi modern. Memanfaatkan **Crawl4AI v4** dan **Firecrawl** untuk mengubah DOM mentah menjadi Markdown yang ramah LLM. Mengimplementasikan loop Ekstraksi Agentic di mana LLM memandu scraper secara dinamis berdasarkan status halaman. Menggabungkan strategi untuk melewati tindakan anti-bot (Cloudflare Turnstile, Datadome) dan menavigasi Shadow DOM yang dinamis.
|
|
170
125
|
|
|
171
126
|
### Kondisi Pemicu
|
|
172
|
-
- Mengekstrak data terstruktur dari
|
|
173
|
-
- Scraping halaman yang dirender JavaScript secara dinamis
|
|
127
|
+
- Mengekstrak data terstruktur dari situs web untuk analisis, data pelatihan, atau pipeline konten.
|
|
128
|
+
- Scraping halaman yang dirender JavaScript secara dinamis dan SPA kompleks.
|
|
174
129
|
- Mengonversi halaman web menjadi Markdown bersih untuk konteks LLM atau pipeline RAG.
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
|
|
178
|
-
### Panduan Pemilihan Strategi
|
|
179
|
-
|
|
180
|
-
| Strategi | Tool | Terbaik Untuk | Perlu JS |
|
|
181
|
-
|---|---|---|---|
|
|
182
|
-
| **API Terkelola** | Firecrawl / Jina Reader | Konten siap LLM, Markdown bersih | Ditangani |
|
|
183
|
-
| **Python Async** | Crawl4AI | Volume tinggi, ekstraksi AI | Opsional |
|
|
184
|
-
| **Otomasi Browser** | Playwright | SPA kompleks, halaman butuh auth | ✅ |
|
|
185
|
-
| **HTML Ringan** | BeautifulSoup + httpx | HTML statis, ekstraksi cepat | ❌ |
|
|
130
|
+
- Menghadapi perlindungan anti-bot atau arsitektur Shadow DOM yang kompleks saat scraping.
|
|
131
|
+
- Mengimplementasikan loop ekstraksi data agentic otomatis.
|
|
186
132
|
|
|
187
|
-
###
|
|
188
|
-
|
|
133
|
+
### Mengekstrak DOM menjadi Markdown Ramah LLM
|
|
134
|
+
Gunakan **Crawl4AI v4** untuk ekstraksi async berperforma tinggi dan **Firecrawl** untuk konversi siap LLM yang mulus. (Lihat contoh kode di bagian bahasa Inggris).
|
|
189
135
|
|
|
190
|
-
###
|
|
191
|
-
|
|
136
|
+
### Bypass Anti-Bot & Shadow DOM
|
|
137
|
+
1. **Bypass Anti-Bot (Cloudflare Turnstile, Datadome):**
|
|
138
|
+
- **Proxy Residensial:** Rotasi IP residensial berkualitas tinggi untuk menghindari pemblokiran IP datacenter.
|
|
139
|
+
- **Browser Fingerprinting:** Gunakan alat seperti `playwright-stealth` atau browser stealth khusus untuk menyembunyikan sidik jari otomatis.
|
|
140
|
+
- **Interaksi Mirip Manusia:** Tambahkan penundaan acak, simulasikan gerakan mouse yang realistis.
|
|
141
|
+
2. **Shadow DOM Dinamis:**
|
|
142
|
+
- Gunakan selektor penembus CSS atau eksekusi JavaScript untuk menembus Shadow Root.
|
|
143
|
+
- Telusuri pohon DOM secara rekursif dengan menyuntikkan skrip untuk mengekstrak konten.
|
|
192
144
|
|
|
193
|
-
###
|
|
194
|
-
|
|
145
|
+
### Loop Ekstraksi Agentic
|
|
146
|
+
Implementasikan loop otonom di mana LLM memandu scraper berdasarkan status halaman saat ini, bukan bergantung pada selektor CSS yang rentan rusak.
|
|
195
147
|
|
|
196
|
-
|
|
197
|
-
|
|
148
|
+
1. **Observasi:** Scraper mengekstrak DOM saat ini menjadi Markdown yang bersih.
|
|
149
|
+
2. **Analisis:** LLM menganalisis Markdown untuk mengidentifikasi data yang diperlukan atau langkah interaksi selanjutnya (misal: "Klik tombol 'Muat Lebih Banyak'").
|
|
150
|
+
3. **Aksi:** LLM mengeluarkan perintah (ekstrak data, navigasi, klik, isi form).
|
|
151
|
+
4. **Loop:** Ulangi hingga tujuan ekstraksi tercapai.
|
|
198
152
|
|
|
199
153
|
### Checklist Scraping Etis
|
|
200
154
|
- [ ] Periksa `robots.txt` dan hormati aturan `Disallow`.
|
|
201
|
-
- [ ] Implementasikan rate limiting
|
|
202
|
-
- [ ] Gunakan header `User-Agent` deskriptif
|
|
203
|
-
- [ ] Cache hasil untuk menghindari permintaan berulang.
|
|
204
|
-
- [ ] Utamakan API publik atau feed data resmi jika tersedia.
|
|
155
|
+
- [ ] Implementasikan rate limiting.
|
|
156
|
+
- [ ] Gunakan header `User-Agent` yang deskriptif.
|
|
205
157
|
- [ ] Jangan scraping data pribadi/privat tanpa izin.
|
|
@@ -0,0 +1,180 @@
|
|
|
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
|
+
### Orchestration & Integration
|
|
17
|
+
Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, and `project-context-mapper` to ensure cohesive execution.
|
|
18
|
+
|
|
19
|
+
### Description
|
|
20
|
+
`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.
|
|
21
|
+
|
|
22
|
+
### Trigger Conditions
|
|
23
|
+
- Replicating or cloning a website layout, landing page, or web application directly from a target URL.
|
|
24
|
+
- Extracting design systems (color palettes, typography scales, container grids, component patterns) from a reference link.
|
|
25
|
+
- Re-creating complex UI components (Hero banners, Bento grids, navbar drawers, pricing tables, footers) based on live URLs.
|
|
26
|
+
- Auditing and reverse-engineering third-party website layouts for component scaffolding.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### 5-Step URL-to-Code Reverse Engineering Methodology
|
|
31
|
+
|
|
32
|
+
```mermaid
|
|
33
|
+
graph TD
|
|
34
|
+
A["Target URL"] --> B["Phase 1: URL Inspection & DOM Scraping"]
|
|
35
|
+
B --> C["Phase 2: Design Tokens & CSS Extraction"]
|
|
36
|
+
C --> D["Phase 3: Component Hierarchy Breakdown"]
|
|
37
|
+
D --> E["Phase 4: 1:1 Code Synthesis (Tailwind v4 + React 19)"]
|
|
38
|
+
E --> F["Phase 5: Visual Verification & Polish"]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### Phase 1: URL Inspection & Asset Discovery
|
|
42
|
+
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.
|
|
43
|
+
2. **Visual Viewport Inspection**: Capture layout snapshots across break-points:
|
|
44
|
+
- Mobile (`375px`)
|
|
45
|
+
- Tablet (`768px`)
|
|
46
|
+
- Desktop (`1440px+`)
|
|
47
|
+
3. **Asset Mining**: Extract SVG icons (Lucide/Heroicons equivalents), image asset URLs, logo vectors, and background gradients.
|
|
48
|
+
|
|
49
|
+
#### Phase 2: Design Tokens & CSS Harvester
|
|
50
|
+
Harvest computed styles and synthesize them into Tailwind CSS v4 `@theme` tokens:
|
|
51
|
+
|
|
52
|
+
| Token Category | Extracted Properties | Tailwind CSS v4 Mapping |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| **Color System** | Primary, Secondary, Background, Neutral slate, Surface, Borders | `--color-primary`, `--color-background`, `--color-surface` |
|
|
55
|
+
| **Typography** | Font Family (Google Fonts link), Headings (`h1`-`h6`), Body, Font Weights | `--font-sans`, `--font-mono`, `--text-4xl`, `--font-bold` |
|
|
56
|
+
| **Spacing Scale** | Section Padding (`py-16`/`py-24`), Container Max-Width (`1280px`), Gap scale | `--spacing-16`, `--max-width-7xl`, `gap-6` |
|
|
57
|
+
| **Borders & Radii** | Card Border Radius (`16px`), Pill Radius (`9999px`), Border Colors | `--radius-xl`, `--color-border` |
|
|
58
|
+
| **Effects** | Backdrop Blur (`backdrop-blur-md`), Glassmorphism, Drop Shadows | `shadow-xl shadow-brand/10`, `backdrop-blur-lg` |
|
|
59
|
+
|
|
60
|
+
#### Phase 3: Component Hierarchy Breakdown
|
|
61
|
+
Deconstruct the target web page into modular, reusable UI components:
|
|
62
|
+
- **`HeaderNav`**: Brand logo, navigation menu links, dynamic CTA button, mobile drawer toggle.
|
|
63
|
+
- **`HeroSection`**: Eye-catching headline, subheading, action buttons, hero image/video/mockup.
|
|
64
|
+
- **`FeatureBento`**: Bento grid containers, icon badges, feature titles, micro-copy.
|
|
65
|
+
- **`TestimonialGrid`**: Avatar image, quote text, author metadata, star ratings.
|
|
66
|
+
- **`PricingSection`**: Tier cards, billing toggle (Monthly/Annual), highlighted popular badge, feature checklists.
|
|
67
|
+
- **`FooterNav`**: Category columns, newsletter subscription form, copyright & social icons.
|
|
68
|
+
|
|
69
|
+
#### Phase 4: 1:1 Code Synthesis (Tailwind v4 + React 19)
|
|
70
|
+
Synthesize clean, accessible, modern code matching the extracted structure.
|
|
71
|
+
|
|
72
|
+
##### Example: Extracted Tailwind CSS v4 Theme (`tokens.css`)
|
|
73
|
+
```css
|
|
74
|
+
@import "tailwindcss";
|
|
75
|
+
|
|
76
|
+
@theme {
|
|
77
|
+
--font-sans: "Outfit", "Inter", system-ui, sans-serif;
|
|
78
|
+
--font-mono: "Fira Code", monospace;
|
|
79
|
+
|
|
80
|
+
/* Extracted OKLCH Palette */
|
|
81
|
+
--color-brand-primary: oklch(58% 0.23 255);
|
|
82
|
+
--color-brand-accent: oklch(68% 0.19 160);
|
|
83
|
+
--color-surface-dark: oklch(14% 0.02 255);
|
|
84
|
+
--color-surface-card: oklch(18% 0.03 255 / 80%);
|
|
85
|
+
|
|
86
|
+
--radius-card: 1.25rem;
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
##### Example: Recreated Hero Component (`HeroSection.tsx`)
|
|
91
|
+
```tsx
|
|
92
|
+
import React from 'react';
|
|
93
|
+
|
|
94
|
+
export function HeroSection() {
|
|
95
|
+
return (
|
|
96
|
+
<section className="relative overflow-hidden bg-surface-dark py-24 text-white">
|
|
97
|
+
{/* Background Glow */}
|
|
98
|
+
<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" />
|
|
99
|
+
|
|
100
|
+
<div className="mx-auto max-w-7xl px-6 text-center">
|
|
101
|
+
<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">
|
|
102
|
+
✨ Replicated Design Template
|
|
103
|
+
</span>
|
|
104
|
+
|
|
105
|
+
<h1 className="mt-6 font-sans text-5xl font-extrabold tracking-tight sm:text-6xl">
|
|
106
|
+
Duplicated Full-Fidelity <span className="bg-gradient-to-r from-brand-primary to-brand-accent bg-clip-text text-transparent">Website Layout</span>
|
|
107
|
+
</h1>
|
|
108
|
+
|
|
109
|
+
<p className="mx-auto mt-6 max-w-2xl text-lg text-slate-300">
|
|
110
|
+
Extracted directly from URL using website-design-cloner. Includes precise typography, exact color tokens, and responsive component structure.
|
|
111
|
+
</p>
|
|
112
|
+
|
|
113
|
+
<div className="mt-8 flex justify-center gap-4">
|
|
114
|
+
<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">
|
|
115
|
+
Get Started
|
|
116
|
+
</button>
|
|
117
|
+
<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">
|
|
118
|
+
View Live Demo
|
|
119
|
+
</button>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</section>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
#### Phase 5: Visual Verification & Polish
|
|
128
|
+
- Ensure color contrast passes WCAG 2.2 AAA standard (4.5:1 ratio).
|
|
129
|
+
- Validate full responsiveness on mobile viewports.
|
|
130
|
+
- Replace broken image assets with synthesized visual placeholders using `generate_image`.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
<a name="bahasa-indonesia"></a>
|
|
135
|
+
## Bahasa Indonesia
|
|
136
|
+
|
|
137
|
+
### Integrasi Orkestrasi
|
|
138
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
|
|
139
|
+
|
|
140
|
+
### Deskripsi
|
|
141
|
+
`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.
|
|
142
|
+
|
|
143
|
+
### Kondisi Pemicu
|
|
144
|
+
- Merekapitulasi atau menduplikasi tata letak situs web, landing page, atau aplikasi web dari URL target.
|
|
145
|
+
- Mengekstrak design system (skema warna, skala tipografi, grid kontainer, pola komponen) dari tautan referensi.
|
|
146
|
+
- Membangun kembali komponen UI kompleks (banner Hero, Bento grid, drawer navigasi, tabel harga, footer) berdasarkan URL langsung.
|
|
147
|
+
- Mempelajari struktur visual dan rekayasa balik situs web pihak ketiga untuk template baru.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### Metodologi 5-Langkah Duplikasi URL-ke-Kode
|
|
152
|
+
|
|
153
|
+
1. **Tahap 1: Inspeksi URL & Penemuan Aset**:
|
|
154
|
+
- 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.
|
|
155
|
+
- Mengambil snapshot tampilan visual pada breakpoint Mobile (`375px`), Tablet (`768px`), dan Desktop (`1440px`).
|
|
156
|
+
- Ekstraksi ikon SVG, URL gambar, logo, dan gradien latar belakang.
|
|
157
|
+
|
|
158
|
+
2. **Tahap 2: Ekstraksi Design Token & CSS**:
|
|
159
|
+
- 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).
|
|
160
|
+
|
|
161
|
+
3. **Tahap 3: Pembongkaran Hierarki Komponen**:
|
|
162
|
+
- Membagi halaman web target menjadi komponen modular: `HeaderNav`, `HeroSection`, `FeatureBento`, `TestimonialGrid`, `PricingSection`, dan `FooterNav`.
|
|
163
|
+
|
|
164
|
+
4. **Tahap 4: Sintesis Kode Presisi 1:1**:
|
|
165
|
+
- Menyusun kode bersih dan modular dalam React 19 / Next.js 15 / HTML+CSS modern yang menggunakan token `@theme` Tailwind CSS v4.
|
|
166
|
+
|
|
167
|
+
5. **Tahap 5: Verifikasi Visual & Polishing**:
|
|
168
|
+
- Memastikan rasio kontras WCAG 2.2, tes responsivitas mobile, dan membuat aset gambar pengganti presisi dengan tool `generate_image`.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### Matriks Orkestrasi & Handoff Skill
|
|
173
|
+
|
|
174
|
+
| Skill Terkait | Peran & Integrasi Handoff |
|
|
175
|
+
|---|---|
|
|
176
|
+
| `web-scraper` | Mengambil HTML mentah, CSS, dan Markdown dari URL via Jina Reader / Firecrawl API. |
|
|
177
|
+
| `design-system-architect` | Menyusun token visual hasil ekstraksi ke dalam design system enterprise berbasis OKLCH & Radix/Base UI. |
|
|
178
|
+
| `ui-ux-pro-max` | Memberikan acuan BM25 visual style, pasangan font Google Fonts, dan checklist aksesibilitas WCAG 2.2. |
|
|
179
|
+
| `senior-frontend` | Mengimplementasikan kode komponen React 19 / Next.js 15 App Router siap produksi. |
|
|
180
|
+
| `tailwind-expert` | Mengatur konfigurasi Tailwind CSS v4 `@theme` dan utilitas responsif. |
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
### Orchestration & Integration
|
|
17
|
+
Connects and orchestrates with relevant domain skills like `brainstorming`, `zero-to-prod-orchestrator`, and `project-context-mapper` to ensure cohesive execution.
|
|
18
|
+
|
|
19
|
+
### Description
|
|
20
|
+
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.
|
|
21
|
+
|
|
22
|
+
### Trigger Conditions
|
|
23
|
+
Activate this skill when the user is:
|
|
24
|
+
- Building AR/VR experiences for Oculus/Meta Quest, Apple Vision Pro, or mobile AR devices.
|
|
25
|
+
- Setting up an `immersive-vr` or `immersive-ar` WebXR session.
|
|
26
|
+
- Implementing controller tracking, hand tracking, or teleportation in 3D space.
|
|
27
|
+
- Using AR Hit-Testing to place digital objects on physical surfaces (floors/tables).
|
|
28
|
+
|
|
29
|
+
### Core Concepts
|
|
30
|
+
|
|
31
|
+
#### 1. Babylon.js WebXR Setup
|
|
32
|
+
Babylon.js provides the most robust default WebXR experience.
|
|
33
|
+
```typescript
|
|
34
|
+
import { Scene, FreeCamera, Vector3, Engine } from '@babylonjs/core';
|
|
35
|
+
|
|
36
|
+
async function setupXR(scene: Scene) {
|
|
37
|
+
// Initialize default WebXR experience
|
|
38
|
+
// This automatically adds the "Enter VR/AR" button, teleportation, and controller models
|
|
39
|
+
const xr = await scene.createDefaultXRExperienceAsync({
|
|
40
|
+
uiOptions: {
|
|
41
|
+
sessionMode: 'immersive-vr', // or 'immersive-ar'
|
|
42
|
+
},
|
|
43
|
+
optionalFeatures: true
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Example: Listen for controller input
|
|
47
|
+
xr.input.onControllerAddedObservable.add((controller) => {
|
|
48
|
+
controller.onMotionControllerInitObservable.add((motionController) => {
|
|
49
|
+
// Handle button presses
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### 2. Three.js / React Three Fiber Setup
|
|
56
|
+
In R3F, use `@react-three/xr`.
|
|
57
|
+
```tsx
|
|
58
|
+
import { Canvas } from '@react-three/fiber';
|
|
59
|
+
import { XR, createXRStore } from '@react-three/xr';
|
|
60
|
+
|
|
61
|
+
const store = createXRStore();
|
|
62
|
+
|
|
63
|
+
export default function App() {
|
|
64
|
+
return (
|
|
65
|
+
<>
|
|
66
|
+
<button onClick={() => store.enterVR()}>Enter VR</button>
|
|
67
|
+
<Canvas>
|
|
68
|
+
<XR store={store}>
|
|
69
|
+
<mesh>
|
|
70
|
+
<boxGeometry />
|
|
71
|
+
<meshBasicMaterial color="red" />
|
|
72
|
+
</mesh>
|
|
73
|
+
</XR>
|
|
74
|
+
</Canvas>
|
|
75
|
+
</>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### 3. AR Hit-Testing
|
|
81
|
+
In AR mode, "Hit-Testing" allows you to detect real-world surfaces.
|
|
82
|
+
- Ensure `immersive-ar` is used.
|
|
83
|
+
- Request the `hit-test` feature when initializing the session.
|
|
84
|
+
- Use the hit-test results (a matrix/position) to place a reticle or object.
|
|
85
|
+
|
|
86
|
+
### Best Practices
|
|
87
|
+
- **Performance is Critical:** VR requires a consistent 72 to 90 FPS (or 120 FPS on Apple Vision Pro). Dropped frames cause motion sickness.
|
|
88
|
+
- **Polycount:** Keep polygon counts and draw calls low.
|
|
89
|
+
- **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).
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### Integration with Other Skills (MANDATORY)
|
|
94
|
+
This skill works best when combined with:
|
|
95
|
+
- `web-3d-graphics-expert` — For building the 3D scene that XR will visualize.
|
|
96
|
+
- `apple-ecosystem-expert` — For optimizing WebXR compatibility with iOS (Safari) and visionOS.
|
|
97
|
+
- `web-game-engine-expert` — For adding physics to VR interactions (e.g., throwing objects).
|
|
98
|
+
|
|
99
|
+
### Referenced By Orchestrators (MANDATORY)
|
|
100
|
+
- `brainstorming` — Add to "3D & Graphics" or "Spatial Computing".
|
|
101
|
+
- `zero-to-prod-orchestrator` — Phase 5 (Frontend / XR Implementation).
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
<a name="bahasa-indonesia"></a>
|
|
106
|
+
## Bahasa Indonesia
|
|
107
|
+
|
|
108
|
+
### Integrasi Orkestrasi
|
|
109
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
|
|
110
|
+
|
|
111
|
+
### Deskripsi
|
|
112
|
+
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*.
|
|
113
|
+
|
|
114
|
+
### Kondisi Pemicu
|
|
115
|
+
- Mengembangkan aplikasi VR/AR untuk Meta Quest, Apple Vision Pro, atau Mobile AR.
|
|
116
|
+
- Mengimplementasikan pelacakan pengontrol (controller), pelacakan tangan (hand tracking), atau teleportasi.
|
|
117
|
+
- Menggunakan AR Hit-Testing untuk meletakkan objek 3D di permukaan dunia nyata.
|
|
118
|
+
|
|
119
|
+
### Panduan Singkat
|
|
120
|
+
- **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*.
|
|
121
|
+
- **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.
|
|
122
|
+
- **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).
|
|
123
|
+
- **Hit-Testing:** Untuk AR, gunakan fitur *Hit-Test* yang disediakan WebXR API untuk mengenali lantai atau meja sebagai tempat menaruh objek.
|