vibes-plug 2.5.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 +37 -7
- package/BLUEPRINT.md +309 -217
- package/CHANGELOG.md +133 -1
- package/CLAUDE.md +70 -0
- package/LICENSE +1 -1
- package/README.md +641 -415
- package/index.js +19 -0
- package/package.json +44 -8
- 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 -52
- package/skills/ai-evals-benchmark-expert/SKILL.md +188 -0
- package/skills/ai-llm-integration-expert/SKILL.md +185 -178
- 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 +6 -3
- package/skills/api-gateway-proxy-expert/SKILL.md +81 -0
- package/skills/app-analyzer-optimizer/SKILL.md +6 -3
- package/skills/apple-ecosystem-expert/SKILL.md +144 -141
- 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 +210 -24
- package/skills/authentication-identity-expert/SKILL.md +278 -275
- package/skills/auto-doc-updater/SKILL.md +7 -1
- package/skills/autonomous-chaos-monkey/SKILL.md +63 -63
- package/skills/autonomous-red-teamer/SKILL.md +172 -28
- package/skills/autonomous-tdd-debugger/SKILL.md +70 -64
- 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 +9 -6
- package/skills/brainstorming/SKILL.md +58 -50
- package/skills/browser-automation-expert/SKILL.md +197 -21
- 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 +45 -36
- package/skills/cloud-hosting-expert/SKILL.md +7 -1
- package/skills/coderabbit/SKILL.md +7 -1
- package/skills/compliance-gdpr-privacy-expert/SKILL.md +85 -0
- package/skills/cron-scheduler-expert/SKILL.md +303 -297
- package/skills/data-pipeline-etl-expert/SKILL.md +84 -0
- package/skills/data-telemetry-expert/SKILL.md +7 -1
- 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 +13 -3
- package/skills/dependency-upgrade-migrator/SKILL.md +300 -294
- package/skills/design-system-architect/SKILL.md +278 -259
- 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 +7 -1
- package/skills/doku-payment-gateway/SKILL.md +7 -1
- package/skills/domain-driven-design-expert/SKILL.md +82 -0
- package/skills/e2e-testing-expert/SKILL.md +7 -1
- package/skills/ecommerce-expert/SKILL.md +87 -0
- package/skills/edge-serverless-db-expert/SKILL.md +98 -42
- package/skills/email-notification-expert/SKILL.md +367 -361
- package/skills/error-resilience-expert/SKILL.md +485 -479
- package/skills/event-driven-architect/SKILL.md +7 -1
- package/skills/feature-flag-analytics-expert/SKILL.md +65 -45
- package/skills/file-upload-media-expert/SKILL.md +436 -430
- package/skills/firebase-security-expert/SKILL.md +7 -1
- package/skills/form-validation-expert/SKILL.md +406 -400
- package/skills/fullstack-expert/SKILL.md +60 -1
- package/skills/gemini-agent-booster/SKILL.md +173 -135
- package/skills/geospatial-maps-expert/SKILL.md +80 -0
- package/skills/global-a11y-i18n-expert/SKILL.md +7 -1
- package/skills/glsl-shader-expert/SKILL.md +106 -100
- package/skills/go-programming-expert/SKILL.md +21 -15
- package/skills/graph-rag-knowledge-expert/SKILL.md +159 -0
- package/skills/graphql-apollo-expert/SKILL.md +113 -107
- package/skills/headless-cms-expert/SKILL.md +181 -0
- package/skills/hig/SKILL.md +7 -1
- package/skills/js-backend-expert/SKILL.md +218 -216
- package/skills/legacy-code-translator/SKILL.md +70 -64
- package/skills/local-slm-edge-ai-expert/SKILL.md +167 -0
- package/skills/logging-error-tracking-expert/SKILL.md +343 -337
- package/skills/mcp-client-orchestrator/SKILL.md +75 -69
- package/skills/mcp-server-architect/SKILL.md +294 -194
- package/skills/micro-frontend-architect/SKILL.md +111 -105
- package/skills/mobile-expo-expert/SKILL.md +8 -2
- package/skills/mobile-push-notification-expert/SKILL.md +70 -50
- package/skills/modern-css-native-expert/SKILL.md +189 -0
- package/skills/monday-design-aesthetic/SKILL.md +7 -1
- package/skills/monorepo-architect/SKILL.md +7 -1
- package/skills/mpa-orchestrator/SKILL.md +20 -1
- package/skills/multi-agent-orchestration/SKILL.md +254 -234
- package/skills/multiple-entry-points/SKILL.md +37 -1
- package/skills/mvc-expert/SKILL.md +7 -1
- 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 +85 -1
- package/skills/pdf-document-generation-expert/SKILL.md +91 -0
- package/skills/performance-web-vitals/SKILL.md +7 -1
- package/skills/post-quantum-crypto-migrator/SKILL.md +57 -57
- package/skills/prd-architect/SKILL.md +7 -1
- package/skills/proactive-background-watcher/SKILL.md +67 -61
- package/skills/production-ready-hardener/SKILL.md +461 -455
- package/skills/project-context-mapper/SKILL.md +84 -78
- package/skills/pwa-offline-first-expert/SKILL.md +185 -0
- package/skills/python-programming-expert/SKILL.md +407 -401
- package/skills/rate-limit-abuse-prevention/SKILL.md +376 -370
- package/skills/realtime-collaboration-expert/SKILL.md +55 -1
- package/skills/rich-text-editor-expert/SKILL.md +177 -0
- package/skills/rust-programming-expert/SKILL.md +7 -1
- package/skills/saas-billing/SKILL.md +7 -1
- package/skills/saas-multi-tenant/SKILL.md +7 -1
- package/skills/saas-mvp-launcher/SKILL.md +20 -1
- package/skills/saas-transformer/SKILL.md +499 -488
- package/skills/scalability-clean-code/SKILL.md +7 -1
- 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 +90 -74
- package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -57
- package/skills/senior-frontend/SKILL.md +141 -161
- package/skills/seo/SKILL.md +41 -17
- package/skills/session-context-loader/SKILL.md +82 -76
- package/skills/session-handoff-resume/SKILL.md +7 -1
- package/skills/{skill_baru → skill-baru}/SKILL.md +8 -2
- package/skills/solidjs-expert/SKILL.md +80 -0
- package/skills/spa-orchestrator/SKILL.md +20 -1
- package/skills/sse-websocket-streaming-expert/SKILL.md +93 -0
- package/skills/state-management-expert/SKILL.md +7 -1
- package/skills/supabase-migration/SKILL.md +47 -1
- package/skills/supabase-security-expert/SKILL.md +7 -1
- 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 +88 -136
- package/skills/tanstack-query-expert/SKILL.md +7 -1
- package/skills/tauri-expert/SKILL.md +7 -1
- package/skills/token-saver/SKILL.md +1 -1
- package/skills/typescript-expert/SKILL.md +12 -6
- package/skills/ui-components-expert/SKILL.md +165 -279
- package/skills/ui-ux-pro-max/SKILL.md +23 -3
- package/skills/vector-db-rag-expert/SKILL.md +175 -19
- package/skills/vibe-code-gardener/SKILL.md +1 -1
- package/skills/visual-qa-vision-agent/SKILL.md +70 -64
- package/skills/voice-ai-realtime-agent/SKILL.md +202 -0
- package/skills/vue-frontend-expert/SKILL.md +131 -125
- package/skills/wasm-edge-computing-expert/SKILL.md +97 -0
- package/skills/web-3d-graphics-expert/SKILL.md +136 -130
- package/skills/web-game-engine-expert/SKILL.md +101 -95
- package/skills/web-scraper/SKILL.md +157 -207
- package/skills/website-design-cloner/SKILL.md +179 -173
- package/skills/webxr-ar-vr-expert/SKILL.md +122 -116
- package/skills/wordpress-headless-expert/SKILL.md +144 -0
- package/skills/zero-to-prod-orchestrator/SKILL.md +52 -27
- package/skills/zero-trust-secret-vault/SKILL.md +87 -39
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/workflows/publish.yml +0 -20
- package/CONTRIBUTING.md +0 -199
- package/SECURITY.md +0 -21
- package/banner.png +0 -0
- package/skills/autonomous-swarm-director/SKILL.md +0 -69
- package/skills/hyper-context-synthesizer/SKILL.md +0 -55
- package/skills/llm-cost-arbitrage-router/SKILL.md +0 -59
- 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 -125
- package/vibes-swarm-demo.gif +0 -0
|
@@ -1,126 +1,132 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: vue-frontend-expert
|
|
3
|
-
description: "Expert guide for Vue 3 (Composition API), Nuxt 3, and Pinia. Covers advanced reactive state management, `<script setup>` syntax, Vue Router, VueUse, and SPA/SSR architectural patterns in English and Indonesian."
|
|
1
|
+
---
|
|
2
|
+
name: vue-frontend-expert
|
|
3
|
+
description: "Expert guide for Vue 3 (Composition API), Nuxt 3, and Pinia. Covers advanced reactive state management, `<script setup>` syntax, Vue Router, VueUse, and SPA/SSR architectural patterns in English and Indonesian."
|
|
4
4
|
author: "Roedy Rustam"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Vue Frontend Expert (Vue 3 / Nuxt 3)
|
|
8
|
-
|
|
9
|
-
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
<a name="english"></a>
|
|
14
|
-
## English
|
|
15
|
-
|
|
16
|
-
###
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
###
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
###
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Vue Frontend Expert (Vue 3 / Nuxt 3)
|
|
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 highly reactive and scalable frontend applications using **Vue 3 (Composition API)** and **Nuxt 3**. Covers the latest ecosystem tools including **Pinia** for state management, **VueUse** for composables, and **Tailwind CSS v4** integration.
|
|
21
|
+
|
|
22
|
+
### Trigger Conditions
|
|
23
|
+
Activate this skill when the user is:
|
|
24
|
+
- Scaffolding a new Vue 3 or Nuxt 3 project.
|
|
25
|
+
- Writing or refactoring Vue components using `<script setup>` and Composition API.
|
|
26
|
+
- Managing global state with Pinia.
|
|
27
|
+
- Handling client-side routing with Vue Router or Nuxt's file-based routing.
|
|
28
|
+
- Implementing SSR (Server-Side Rendering) or SSG (Static Site Generation) using Nuxt 3.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### Core Concepts
|
|
33
|
+
|
|
34
|
+
#### 1. Vue 3 Composition API & `<script setup>`
|
|
35
|
+
Use the `<script setup>` syntax by default. It provides better type inference, less boilerplate, and superior performance compared to the Options API.
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import { ref, computed, onMounted } from 'vue'
|
|
40
|
+
|
|
41
|
+
const count = ref(0)
|
|
42
|
+
const doubleCount = computed(() => count.value * 2)
|
|
43
|
+
|
|
44
|
+
function increment() {
|
|
45
|
+
count.value++
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
onMounted(() => {
|
|
49
|
+
console.log('Component is mounted!')
|
|
50
|
+
})
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<button @click="increment">Count is: {{ count }} (Double: {{ doubleCount }})</button>
|
|
55
|
+
</template>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### 2. Global State Management (Pinia)
|
|
59
|
+
Pinia is the official state management library for Vue. Avoid Vuex in modern applications.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
// stores/counter.ts
|
|
63
|
+
import { defineStore } from 'pinia'
|
|
64
|
+
import { ref, computed } from 'vue'
|
|
65
|
+
|
|
66
|
+
export const useCounterStore = defineStore('counter', () => {
|
|
67
|
+
const count = ref(0)
|
|
68
|
+
const doubleCount = computed(() => count.value * 2)
|
|
69
|
+
function increment() {
|
|
70
|
+
count.value++
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return { count, doubleCount, increment }
|
|
74
|
+
})
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### 3. Nuxt 3 Architecture
|
|
78
|
+
For SSR, SEO optimization, and file-based routing, use Nuxt 3.
|
|
79
|
+
- Data fetching: Use `useAsyncData` or `useFetch` to prevent hydration mismatches.
|
|
80
|
+
- Server API: Utilize the `server/api/` directory for Nitro API routes.
|
|
81
|
+
|
|
82
|
+
#### 4. The VueUse Collection
|
|
83
|
+
Always leverage [VueUse](https://vueuse.org/) for common composables (e.g., `useWindowSize`, `onClickOutside`, `useStorage`) instead of writing custom composables from scratch.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### Best Practices
|
|
88
|
+
1. **Ref vs Reactive:** Prefer `ref` for primitive values and `reactive` for deeply nested objects. When in doubt, default to `ref`.
|
|
89
|
+
2. **Define Macros:** Use `defineProps` and `defineEmits` in `<script setup>` for typed props and events.
|
|
90
|
+
3. **Avoid Watchers when possible:** Rely on `computed` properties instead of `watch` to derive state. Use `watch` only for side-effects (e.g., API calls, DOM manipulation).
|
|
91
|
+
4. **V-Model:** Use the updated `v-model` binding in Vue 3.4+ with `defineModel()` for cleaner two-way data binding between components.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### Integration with Other Skills (MANDATORY)
|
|
96
|
+
|
|
97
|
+
This skill works best when combined with:
|
|
98
|
+
- `design-system-architect` — To build headless UI components using Radix Vue or VueUse components.
|
|
99
|
+
- `tailwind-expert` — For styling Vue/Nuxt components with Tailwind CSS v4.
|
|
100
|
+
- `performance-web-vitals` — To optimize Nuxt 3 SSR metrics (LCP, INP).
|
|
101
|
+
|
|
102
|
+
### Referenced By Orchestrators (MANDATORY)
|
|
103
|
+
|
|
104
|
+
This skill should be referenced by the following orchestrators:
|
|
105
|
+
- `brainstorming` — Add to "Frontend Frameworks" row in the Matrix.
|
|
106
|
+
- `zero-to-prod-orchestrator` — Phase 5 (Frontend Implementation).
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
<a name="bahasa-indonesia"></a>
|
|
111
|
+
## Bahasa Indonesia
|
|
112
|
+
|
|
113
|
+
### Integrasi Orkestrasi
|
|
114
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
|
|
115
|
+
|
|
116
|
+
### Deskripsi
|
|
117
|
+
Panduan tingkat produksi untuk membangun aplikasi frontend reaktif dan terukur menggunakan **Vue 3 (Composition API)** dan **Nuxt 3**. Mencakup pengelolaan state dengan **Pinia**, utilitas **VueUse**, dan integrasi **Tailwind CSS v4**.
|
|
118
|
+
|
|
119
|
+
### Kondisi Pemicu
|
|
120
|
+
Aktifkan skill ini ketika pengguna sedang:
|
|
121
|
+
- Memulai proyek Vue 3 atau Nuxt 3 baru.
|
|
122
|
+
- Menulis ulang (refactoring) komponen ke `<script setup>` dan Composition API.
|
|
123
|
+
- Mengelola state global dengan Pinia (bukan Vuex).
|
|
124
|
+
- Menerapkan SSR (Server-Side Rendering) dengan Nuxt 3.
|
|
125
|
+
|
|
126
|
+
### Panduan Singkat
|
|
127
|
+
|
|
128
|
+
- **Composition API Default:** Selalu gunakan sintaks `<script setup lang="ts">`. Lebih ringkas, type-safe, dan efisien.
|
|
129
|
+
- **Pinia:** Gunakan Pinia dengan pola *Setup Store* (mirip Composition API) alih-alih pola Options (state, getters, actions).
|
|
130
|
+
- **Nuxt 3 Fetching:** Gunakan `useFetch` atau `useAsyncData` di dalam komponen Nuxt untuk pengambilan data saat SSR, bukan `onMounted` dengan `fetch` biasa.
|
|
131
|
+
- **Reaktivitas:** Gunakan `ref` untuk nilai primitif (string, number) dan `reactive` untuk objek bersarang yang kompleks. Utamakan `computed` daripada `watch` untuk state turunan.
|
|
132
|
+
- **VueUse:** Jangan menulis fungsi utilitas dari nol jika sudah ada di *library* VueUse (contoh: `useIntersectionObserver`, `useLocalStorage`).
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wasm-edge-computing-expert
|
|
3
|
+
description: "Expert guide for WebAssembly (WASM) and Edge Computing. Covers WASI preview 2, Spin/Fermyon, Cloudflare Workers WASM, and high-performance browser computing / Panduan ahli untuk WebAssembly (WASM) dan Edge Computing. Mencakup WASI preview 2, Spin/Fermyon, Cloudflare Workers WASM, dan komputasi performa tinggi di browser."
|
|
4
|
+
author: "Roedy Rustam"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# WASM & Edge Computing Expert
|
|
8
|
+
|
|
9
|
+
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a name="english"></a>
|
|
14
|
+
## English
|
|
15
|
+
|
|
16
|
+
### Description
|
|
17
|
+
A specialized guide for writing, compiling, and deploying WebAssembly (WASM) modules both on the Edge and in the browser. Covers the new WebAssembly System Interface (WASI) Preview 2, serverless execution environments (Spin, Cloudflare Workers, Fastly Compute), and bidirectional JavaScript-to-WASM interop.
|
|
18
|
+
|
|
19
|
+
### Trigger Conditions
|
|
20
|
+
- When porting heavy computational tasks (image processing, video encoding, cryptography) from JavaScript to Rust/Go via WASM.
|
|
21
|
+
- When deploying ultra-fast, cold-start-free serverless functions on Cloudflare Workers or Fermyon Spin.
|
|
22
|
+
- When the user asks about "WASI", "WebAssembly", or "Edge computing performance".
|
|
23
|
+
- When bridging legacy C/C++ libraries to run in the browser using Emscripten.
|
|
24
|
+
|
|
25
|
+
### Core Architectural Guidelines
|
|
26
|
+
|
|
27
|
+
#### 1. Language Choice & Toolchain
|
|
28
|
+
- **Rust (Recommended)**: Use `wasm-pack` for browser modules and `cargo component` for WASI Preview 2. Rust offers the smallest binary sizes and no garbage collector overhead.
|
|
29
|
+
- **Go**: Go 1.21+ has native WASI support (`GOOS=wasip1 GOARCH=wasm`), but binaries are larger due to the included runtime. Use TinyGo for smaller binaries.
|
|
30
|
+
- **AssemblyScript**: Use when the team only knows TypeScript, though performance is slightly less than Rust.
|
|
31
|
+
|
|
32
|
+
#### 2. Browser Integration (`wasm-bindgen`)
|
|
33
|
+
When writing Rust for the browser, minimize crossings between JS and WASM, as serialization is expensive.
|
|
34
|
+
```rust
|
|
35
|
+
use wasm_bindgen::prelude::*;
|
|
36
|
+
|
|
37
|
+
#[wasm_bindgen]
|
|
38
|
+
pub fn compute_heavy_task(input: &[u8]) -> Vec<u8> {
|
|
39
|
+
// Process data entirely in WASM before returning
|
|
40
|
+
input.iter().map(|&b| b.wrapping_add(1)).collect()
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
#### 3. Edge & WASI Preview 2
|
|
45
|
+
WASI Preview 2 introduces the Component Model, allowing WASM modules to securely access system resources (HTTP, Filesystem) without being tied to a specific language.
|
|
46
|
+
- Deploying to Cloudflare Workers:
|
|
47
|
+
```toml
|
|
48
|
+
# wrangler.toml
|
|
49
|
+
main = "./build/worker.js"
|
|
50
|
+
[wasm_modules]
|
|
51
|
+
MODULE = "./build/module.wasm"
|
|
52
|
+
```
|
|
53
|
+
- Deploying to Fermyon Spin: Use the `spin` CLI to build microservices entirely in WASM that start in under 1 millisecond.
|
|
54
|
+
|
|
55
|
+
#### 4. Shared Memory & Atomics
|
|
56
|
+
For multi-threaded browser WASM, use `SharedArrayBuffer` and Web Workers. Ensure your server sends the correct headers:
|
|
57
|
+
- `Cross-Origin-Opener-Policy: same-origin`
|
|
58
|
+
- `Cross-Origin-Embedder-Policy: require-corp`
|
|
59
|
+
|
|
60
|
+
## Orchestration & Integration
|
|
61
|
+
- Enhances `api-gateway-proxy-expert` for running custom logic at the edge (Cloudflare/Kong).
|
|
62
|
+
- Integrates with `rust-programming-expert` or `go-programming-expert` for module compilation.
|
|
63
|
+
- Pairs with `performance-web-vitals` to offload main-thread blocking tasks.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
<a name="bahasa-indonesia"></a>
|
|
68
|
+
## Bahasa Indonesia
|
|
69
|
+
|
|
70
|
+
### Deskripsi
|
|
71
|
+
Panduan khusus untuk menulis, mengompilasi, dan mendeploy modul WebAssembly (WASM) baik di Edge maupun di browser. Mencakup WebAssembly System Interface (WASI) Preview 2, lingkungan serverless (Spin, Cloudflare Workers), dan interoperabilitas JavaScript-ke-WASM dua arah.
|
|
72
|
+
|
|
73
|
+
### Kondisi Pemicu
|
|
74
|
+
- Saat memindahkan tugas komputasi berat (pemrosesan gambar, kriptografi) dari JavaScript ke Rust/Go melalui WASM.
|
|
75
|
+
- Saat mendeploy fungsi serverless ultra-cepat tanpa *cold start* di Cloudflare Workers atau Fermyon Spin.
|
|
76
|
+
- Saat menjembatani library C/C++ lama untuk dijalankan di browser menggunakan Emscripten.
|
|
77
|
+
|
|
78
|
+
### Panduan Arsitektur Inti
|
|
79
|
+
|
|
80
|
+
#### 1. Pilihan Bahasa & Toolchain
|
|
81
|
+
- **Rust (Direkomendasikan)**: Menghasilkan ukuran biner terkecil. Gunakan `wasm-pack` untuk web dan `cargo component` untuk WASI.
|
|
82
|
+
- **Go**: Gunakan TinyGo untuk ukuran modul yang lebih kecil, atau Go native `GOOS=wasip1` untuk dukungan WASI penuh (namun biner akan lebih besar).
|
|
83
|
+
- **AssemblyScript**: Jika tim hanya menguasai TypeScript.
|
|
84
|
+
|
|
85
|
+
#### 2. Integrasi Browser
|
|
86
|
+
Minimalkan pertukaran data (crossing) antara JavaScript dan WASM karena biaya serialisasinya tinggi. Kirim array besar (seperti `Uint8Array`) sekali, proses seluruhnya di WASM, lalu kembalikan hasilnya.
|
|
87
|
+
|
|
88
|
+
#### 3. Edge & WASI Preview 2 (Component Model)
|
|
89
|
+
WASI Preview 2 memungkinkan modul WASM mengakses resource sistem (HTTP, File) secara aman. Anda dapat mendeploy service WASM murni ke infrastruktur edge seperti Fermyon Spin atau Fastly dengan waktu mulai (startup time) di bawah 1 milidetik, jauh lebih cepat daripada container Docker tradisional.
|
|
90
|
+
|
|
91
|
+
#### 4. Shared Memory & Web Workers
|
|
92
|
+
Untuk performa multi-threading sejati di browser menggunakan WASM, gunakan `SharedArrayBuffer`. Pastikan server Anda mengirimkan header keamanan COOP dan COEP yang diwajibkan oleh browser modern.
|
|
93
|
+
|
|
94
|
+
## Integrasi Orkestrasi
|
|
95
|
+
- Memperkuat `api-gateway-proxy-expert` untuk logika kustom di edge.
|
|
96
|
+
- Terintegrasi dengan `rust-programming-expert` untuk kompilasi modul.
|
|
97
|
+
- Melengkapi `performance-web-vitals` dengan memindahkan komputasi berat dari *main thread* JavaScript.
|
|
@@ -1,131 +1,137 @@
|
|
|
1
|
-
---
|
|
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."
|
|
1
|
+
---
|
|
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
4
|
author: "Roedy Rustam"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Web 3D Graphics Expert (Three.js & Babylon.js)
|
|
8
|
-
|
|
9
|
-
[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
<a name="english"></a>
|
|
14
|
-
## English
|
|
15
|
-
|
|
16
|
-
###
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
###
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
###
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Web 3D Graphics Expert (Three.js & Babylon.js)
|
|
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-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.
|
|
21
|
+
|
|
22
|
+
### Trigger Conditions
|
|
23
|
+
Activate this skill when the user is:
|
|
24
|
+
- Initializing a WebGL/WebGPU 3D scene.
|
|
25
|
+
- Using `three`, `@react-three/fiber`, `@babylonjs/core`, or `@tresjs/core`.
|
|
26
|
+
- Loading 3D models (`.glb`, `.gltf`, `.obj`).
|
|
27
|
+
- Adding advanced lighting, shadows, or Post-Processing effects (Bloom, Depth of Field).
|
|
28
|
+
- Asking about framerate drops, memory leaks, or rendering performance in 3D apps.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### Core Concepts & Framework Selection
|
|
33
|
+
|
|
34
|
+
#### 1. React Three Fiber (R3F) vs Vanilla Three.js
|
|
35
|
+
When building with React, always use **React Three Fiber**. It manages the scene graph, object lifecycles, and `requestAnimationFrame` natively within the React component tree.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { Canvas } from '@react-three/fiber'
|
|
39
|
+
import { OrbitControls, Environment, useGLTF } from '@react-three/drei'
|
|
40
|
+
|
|
41
|
+
export default function App() {
|
|
42
|
+
const { scene } = useGLTF('/model.glb')
|
|
43
|
+
return (
|
|
44
|
+
<Canvas camera={{ position: [0, 2, 5] }}>
|
|
45
|
+
<ambientLight intensity={0.5} />
|
|
46
|
+
<directionalLight position={[10, 10, 5]} castShadow />
|
|
47
|
+
<primitive object={scene} />
|
|
48
|
+
<Environment preset="city" />
|
|
49
|
+
<OrbitControls />
|
|
50
|
+
</Canvas>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
*Note: Always use `@react-three/drei` for common helpers (OrbitControls, Text, Environment).*
|
|
55
|
+
|
|
56
|
+
#### 2. Babylon.js vs Three.js
|
|
57
|
+
- **Three.js**: Lighter, more flexible, vast community, excellent for creative coding, landing page animations, and React/Vue integrations.
|
|
58
|
+
- **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.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// Basic Babylon.js Setup
|
|
62
|
+
import { Engine, Scene, FreeCamera, Vector3, MeshBuilder, HemisphericLight } from '@babylonjs/core'
|
|
63
|
+
|
|
64
|
+
const canvas = document.getElementById('renderCanvas') as HTMLCanvasElement
|
|
65
|
+
const engine = new Engine(canvas, true)
|
|
66
|
+
const scene = new Scene(engine)
|
|
67
|
+
|
|
68
|
+
const camera = new FreeCamera('camera1', new Vector3(0, 5, -10), scene)
|
|
69
|
+
camera.setTarget(Vector3.Zero())
|
|
70
|
+
camera.attachControl(canvas, true)
|
|
71
|
+
|
|
72
|
+
const light = new HemisphericLight('light', new Vector3(0, 1, 0), scene)
|
|
73
|
+
const sphere = MeshBuilder.CreateSphere('sphere', { diameter: 2 }, scene)
|
|
74
|
+
|
|
75
|
+
engine.runRenderLoop(() => {
|
|
76
|
+
scene.render()
|
|
77
|
+
})
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### 3. Asset Loading & Optimization
|
|
81
|
+
- **Format:** ALWAYS use `.glb` or `.gltf`. Avoid `.obj` or `.fbx` in the browser as they are unoptimized.
|
|
82
|
+
- **Compression:** Use Draco compression (`glTF-Transform` or `gltf-pipeline`) to dramatically reduce file sizes.
|
|
83
|
+
- **Loading:** Preload models if they are critical to the first paint.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### Best Practices for Performance
|
|
88
|
+
|
|
89
|
+
1. **Geometry and Material Reuse:**
|
|
90
|
+
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.
|
|
91
|
+
2. **Memory Management (Disposing):**
|
|
92
|
+
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.
|
|
93
|
+
*(Note: R3F handles this automatically when components unmount).*
|
|
94
|
+
3. **Shadows & Lighting:**
|
|
95
|
+
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.
|
|
96
|
+
4. **Post-Processing:**
|
|
97
|
+
Post-processing requires rendering the scene multiple times. Use it sparingly. Group passes together when possible.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### Integration with Other Skills (MANDATORY)
|
|
102
|
+
|
|
103
|
+
This skill works best when combined with:
|
|
104
|
+
- `senior-frontend` — When integrating React Three Fiber into Next.js/React applications.
|
|
105
|
+
- `vue-frontend-expert` — When integrating TresJS into Vue 3/Nuxt 3 applications.
|
|
106
|
+
- `performance-web-vitals` — To optimize the bundle size of 3D libraries and reduce Total Blocking Time (TBT).
|
|
107
|
+
|
|
108
|
+
### Referenced By Orchestrators (MANDATORY)
|
|
109
|
+
|
|
110
|
+
This skill should be referenced by the following orchestrators:
|
|
111
|
+
- `brainstorming` — Add to "UI/UX & Design Systems" or create a "3D & Graphics" category.
|
|
112
|
+
- `zero-to-prod-orchestrator` — Phase 5 (Frontend Implementation).
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
<a name="bahasa-indonesia"></a>
|
|
117
|
+
## Bahasa Indonesia
|
|
118
|
+
|
|
119
|
+
### Integrasi Orkestrasi
|
|
120
|
+
Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
|
|
121
|
+
|
|
122
|
+
### Deskripsi
|
|
123
|
+
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.
|
|
124
|
+
|
|
125
|
+
### Kondisi Pemicu
|
|
126
|
+
Aktifkan skill ini ketika pengguna sedang:
|
|
127
|
+
- Menginisialisasi *scene* WebGL 3D.
|
|
128
|
+
- Menggunakan library `three`, `@react-three/fiber`, atau `@babylonjs/core`.
|
|
129
|
+
- Memuat model 3D (terutama format `.glb`/`.gltf`).
|
|
130
|
+
- Mengoptimalkan FPS (frame-rate) atau menangani masalah *memory leak* pada aplikasi 3D.
|
|
131
|
+
|
|
132
|
+
### Panduan Singkat
|
|
133
|
+
- **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).
|
|
134
|
+
- **Format Aset:** Selalu gunakan format `.glb` dengan kompresi Draco.
|
|
135
|
+
- **Performa:** Jangan membuat *Geometry* atau *Material* baru di dalam *render loop* (`requestAnimationFrame`).
|
|
136
|
+
- **Manajemen Memori:** Panggil method `.dispose()` pada geometry, material, dan texture yang sudah tidak digunakan di vanilla Three.js/Babylon.js untuk mencegah kebocoran memori.
|
|
137
|
+
- **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.
|