Skill
Xây 3D web scene có thể xác minh với ak:threejs
Dùng tri thức Three.js đóng gói và example có thể search để triển khai, profile và validate trải nghiệm 3D có giới hạn.
Dùng ak:threejs để lập kế hoạch, triển khai hoặc review Three.js scene có
WebGL hay WebGPU, model, material, interaction, animation, post-processing,
physics hoặc XR. Skill kết hợp reference theo cấp độ với local search index của
example, API summary, category và use case đã đóng gói.
Chọn ak:threejs cho 3D trên browser
Dùng Skill khi
- Bạn cần product configurator, game, visualization, panorama, architectural scene, particle system, custom shader hoặc WebXR experience.
- Bạn cần load GLTF, FBX, OBJ, texture, animation clip hoặc environment map.
- Bạn đang profile draw call, geometry, texture, material, shadow, post-processing hoặc WebGPU compute work.
- Bạn muốn tìm example local trước khi điều chỉnh code cho Three.js version đã cài.
Chọn workflow khác khi
- Bạn cần 3D frame-deterministic trong video lập trình. Dùng
ak:remotioncùng rule Three.js riêng cho Remotion. - Bạn cần UI styling hoặc product UX thông thường thay vì 3D scene được render.
- Bạn chỉ cần API fact chính thức hiện tại. Kiểm tra version đã cài cùng primary Three.js documentation; reference đóng gói có thể cũ.
Chuẩn bị scene contract
- Nêu framework và exact Three.js version, browser cùng thiết bị đích, WebGL/WebGPU fallback policy, canvas size, interaction model, asset format và performance budget.
- Cung cấp model, texture, HDR map, audio và font có license. Xác định remote URL, CORS requirement, decoder hoặc transcoder file và download size tối đa.
- Xác định accessibility alternative cho thông tin hay action chỉ có trong canvas, gồm keyboard control, label, reduced motion và fallback không 3D khi cần.
- Chỉ cài Python nếu dùng search CLI đóng gói. Search đọc CSV đóng gói và không fetch live example được liệt kê trong result.
| Runtime | Cách gọi | Ranh giới bằng chứng |
|---|---|---|
| Claude Code | /ak:threejs ... | Phân phối native có thể dùng Claude Hook được hỗ trợ; GPU, browser và asset tool vẫn phụ thuộc project. |
| Cursor | /ak:threejs ... | Cách gọi slash đã được người dùng xác minh, không phải bằng chứng về profiling hay browser tooling tương đương. |
| Codex | $ak:threejs ... | Hỗ trợ native discovery với Hook projection một phần và rendering tool phụ thuộc session. |
Chạy Skill
/ak:threejs "Add an accessible GLTF product viewer with OrbitControls, loading and error states, WebGL fallback, keyboard alternatives, disposal on unmount, and a 60 fps target on mid-range mobile"/ak:threejs "Add an accessible GLTF product viewer with OrbitControls, loading and error states, WebGL fallback, keyboard alternatives, disposal on unmount, and a 60 fps target on mid-range mobile"$ak:threejs "Add an accessible GLTF product viewer with OrbitControls, loading and error states, WebGL fallback, keyboard alternatives, disposal on unmount, and a 60 fps target on mid-range mobile"Skill không có top-level mode được tài liệu hóa. Local search helper hỗ trợ:
| Input | Mục đích | Effect |
|---|---|---|
| Chỉ query | Auto-select packaged domain và trả tối đa năm match | Terminal output chỉ đọc. |
| `--domain examples | api | use-cases |
--use-case | Resolve một packaged use-case row thành packaged example được đề xuất | Không tải example source. |
--category <name> | Lọc packaged example theo category | Chỉ đọc. |
| `--complexity low | medium | high` |
Theo dõi các stage có thể quan sát
- Kiểm tra renderer boundary. Xác nhận version đã cài, browser support, canvas ownership, scene lifecycle, asset, fallback và budget.
- Search và chọn pattern. Dùng packaged example cùng progressive reference, rồi đối chiếu import và API với release đã cài.
- Xây minimum scene. Thiết lập scene, camera, renderer, resize handling, loading/error feedback, color space, lighting và cleanup trước effect.
- Thêm interaction và content. Load asset, cung cấp control cùng accessible alternative và giữ state transition có thể quan sát.
- Tối ưu từ measurement. Profile draw call, triangle, texture memory, frame time, loading, layout shift và target-device behavior trước khi chọn instancing, LOD, compression, pass resolution thấp hoặc WebGPU.
- Xác minh và report. Ghi file, asset, browser, device, fallback, performance measurement, visual check, accessibility evidence và gap.
Làm rõ asset, device và experimental API
Scene compile không phải runtime proof
WebGPU, XR, codec, GPU limit, CORS và model complexity thay đổi theo browser và device. Test target thật và giữ fallback hoặc unsupported state rõ ràng khi experience quan trọng.
- URL model, texture, font, audio, decoder và environment map có thể tạo network request và lộ user IP hoặc referrer data cho host.
- WebXR có thể yêu cầu immersive session, controller, hand tracking, spatial audio, hit testing hoặc room-scale feature. Xin user intent cùng browser permission; không giả định hardware support.
- Physics cần library bên ngoài. WebGPU compute và node-material feature có thể cần WebGPU renderer; cung cấp WebGL path đã test khi được yêu cầu.
- Dispose geometry, material, texture, control, listener, render target và renderer khi hết ownership. Giữ nguyên source asset.
- Shader và remote asset là code hoặc content input. Review license, provenance, CORS, memory và failure behavior trước khi ship.
Xác minh output và giới hạn
Một lần chạy hoàn tất nên có source diff, asset manifest, loading cùng error state, renderer fallback, cleanup evidence, keyboard và pointer behavior, reduced-motion handling cùng kết quả đo trên target device. Kiểm tra visual, color space, material và light behavior, resize, pixel ratio, mobile orientation, focus, canvas alternative, draw call, frame time, memory và lỗi asset thiếu hay không decode được.
| Triệu chứng | Bước tiếp theo an toàn |
|---|---|
| Example import không compile | Kiểm tra Three.js release đã cài và addon import path; điều chỉnh packaged pattern thay vì đổi version mù quáng. |
| Scene màu đen | Xác minh camera framing, light requirement của material, renderer size, color space, asset load và shader error. |
| Frame rate giảm | Đo renderer info cùng frame time, rồi giảm draw call, polygon, texture size, light, shadow, pixel ratio hoặc post-processing từng biến một. |
| WebGPU hoặc XR không khả dụng | Hiển thị WebGL hoặc non-immersive fallback đã test và report capability không được hỗ trợ. |
| Memory tăng sau navigation | Dispose GPU resource sở hữu và gỡ animation loop, control cùng event listener khi unmount. |
| Canvas interaction không accessible | Thêm semantic control, keyboard alternative, visible focus, label và text hoặc DOM path tương đương cho content quan trọng. |
Packaged example, API summary, browser note và reference code là guidance tại
một thời điểm, không phải live Three.js documentation. Stable và beta chứa cùng
resource ak:threejs trong các release được tài liệu hóa. Tiếp tục với
Runtime adapter hoặc
Tổng quan Engineer Kit.
Audit web UI với ak:web-design-guidelines
Review tệp đã chọn theo Web Interface Guidelines vừa fetch và giữ finding truy vết được tới dòng source.
Tạo mã video xác định với ak:remotion
Xây dựng composition Remotion theo frame, quản lý media và điều kiện package, đồng thời xác minh bằng chứng preview và render.