@vesviet/agent-skills 5.6.0 → 5.7.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/INDEX.md +5 -5
- package/README.md +1 -1
- package/VERSION +1 -1
- package/adapters/antigravity/a2a-config.template.yaml +1 -1
- package/adapters/antigravity/role-skill-index.json +12 -12
- package/adapters/claude/CLAUDE_ADAPTER.md +1 -1
- package/adapters/cursor/README.md +185 -185
- package/bin/agent-skills.mjs +17 -14
- package/core/contracts/README.md +1 -1
- package/core/contracts/schemas/api-contract-spec.json +191 -191
- package/core/contracts/schemas/data-pipeline-spec.json +1 -1
- package/core/contracts/schemas/design-tokens-spec.json +19 -0
- package/core/contracts/schemas/feature-ticket.json +1293 -1293
- package/core/contracts/schemas/pull-request-spec.json +338 -338
- package/core/contracts/schemas/references/detailed/01-solution-and-governance.md +19 -19
- package/core/contracts/schemas/references/detailed/02-engineering-delivery.md +93 -93
- package/core/contracts/schemas/references/detailed/04-finance-accounting-and-compliance.md +54 -54
- package/core/contracts/schemas/references/detailed/05-design-and-content.md +92 -92
- package/core/contracts/schemas/references/detailed/06-seo-and-publishing.md +48 -48
- package/core/contracts/schemas/references/detailed/07-a2a-protocol.md +85 -85
- package/core/contracts/schemas/security-audit.json +143 -12
- package/core/contracts/schemas/system-design-spec.json +9 -1
- package/core/contracts/schemas/test-report.json +530 -530
- package/core/contracts/schemas/ux-flow-spec.json +66 -0
- package/core/roles/ai-systems-engineer.md +31 -18
- package/core/roles/aws-engineer.md +33 -29
- package/core/roles/backend-developer.md +6 -4
- package/core/roles/content-manager.md +7 -7
- package/core/roles/data-engineer.md +39 -36
- package/core/roles/qa-engineer.md +18 -18
- package/core/roles/references/ai-systems-engineer-review-checklist.md +11 -3
- package/core/roles/references/aws-engineer-review-checklist.md +29 -16
- package/core/roles/references/business-analyst-responsibilities.md +207 -207
- package/core/roles/references/content-manager-governance-standards.md +2 -2
- package/core/roles/references/content-manager-review-checklist.md +7 -1
- package/core/roles/references/data-engineer-review-checklist.md +11 -3
- package/core/roles/references/frontend-developer-responsibilities.md +275 -275
- package/core/roles/references/qa-engineer-review-checklist.md +10 -5
- package/core/roles/references/security-engineer-review-checklist.md +8 -0
- package/core/roles/references/solution-architect-review-checklist.md +6 -1
- package/core/roles/references/system-engineer-review-checklist.md +11 -0
- package/core/roles/references/ui-ux-designer-review-checklist.md +12 -0
- package/core/roles/security-engineer.md +35 -5
- package/core/roles/solution-architect.md +7 -7
- package/core/roles/system-engineer.md +470 -465
- package/core/roles/ui-ux-designer.md +17 -3
- package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +141 -141
- package/core/skills/agent/architect-mcp-server/SKILL.md +3 -3
- package/core/skills/agent/decompose-agentic-system/SKILL.md +1 -1
- package/core/skills/ai/deploy-vllm-inference/SKILL.md +14 -14
- package/core/skills/ai-agent/agent-evaluation/SKILL.md +5 -0
- package/core/skills/ai-agent/context-optimization/SKILL.md +9 -0
- package/core/skills/backend/add-api-endpoint/SKILL.md +1 -0
- package/core/skills/backend/add-event-handler/SKILL.md +1 -0
- package/core/skills/backend/add-service-client/SKILL.md +1 -0
- package/core/skills/backend/build-mcp-server/SKILL.md +101 -100
- package/core/skills/backend/implement-auth/SKILL.md +1 -0
- package/core/skills/backend/implement-structured-outputs/SKILL.md +95 -94
- package/core/skills/backend/optimize-postgres/SKILL.md +1 -0
- package/core/skills/backend/scaffold-new-service/SKILL.md +1 -0
- package/core/skills/business/elicit-requirements/SKILL.md +102 -102
- package/core/skills/business/elicit-requirements/references/elicitation-techniques-and-babok-criteria.md +60 -60
- package/core/skills/business/trace-requirements-impact/SKILL.md +97 -97
- package/core/skills/business/trace-requirements-impact/references/rtm-graph-and-prioritization-models.md +109 -109
- package/core/skills/business/write-use-cases/SKILL.md +106 -106
- package/core/skills/business/write-use-cases/references/cockburn-scoping-and-13-field-template.md +135 -135
- package/core/skills/content/audit-content/SKILL.md +3 -2
- package/core/skills/content/audit-content/references/information-gain-rubric.md +1 -1
- package/core/skills/content/design-content-strategy/SKILL.md +6 -5
- package/core/skills/content/design-content-strategy/references/information-gain-and-decay-triage.md +2 -2
- package/core/skills/content/optimize-seo/SKILL.md +6 -5
- package/core/skills/content/optimize-seo/references/geo-ai-citation-playbook.md +2 -2
- package/core/skills/content/optimize-seo/references/process-and-checklist.md +1 -1
- package/core/skills/content/repurpose-content/SKILL.md +4 -3
- package/core/skills/content/write-article/SKILL.md +6 -5
- package/core/skills/content/write-copy/SKILL.md +3 -2
- package/core/skills/document/pptx/SKILL.md +1 -0
- package/core/skills/document/pptx/scripts/add_slide.py +0 -0
- package/core/skills/document/pptx/scripts/clean.py +0 -0
- package/core/skills/document/pptx/scripts/thumbnail.py +0 -0
- package/core/skills/document/xlsx/scripts/recalc.py +0 -0
- package/core/skills/documentation/write-documentation/SKILL.md +143 -143
- package/core/skills/documentation/write-tech-radar/SKILL.md +149 -149
- package/core/skills/foundation/accessibility-review/SKILL.md +160 -160
- package/core/skills/foundation/design-review/SKILL.md +11 -1
- package/core/skills/foundation/design-ux-flow/SKILL.md +13 -1
- package/core/skills/foundation/performance-profiling/SKILL.md +3 -1
- package/core/skills/foundation/release-notes/SKILL.md +192 -192
- package/core/skills/foundation/webapp-server-runner/scripts/with_server.py +0 -0
- package/core/skills/foundation/write-product-brief/SKILL.md +160 -160
- package/core/skills/foundation/write-tests/SKILL.md +11 -10
- package/core/skills/frontend/anti-ui-slop-finish-gate/SKILL.md +5 -0
- package/core/skills/frontend/design-md-specification/SKILL.md +1 -0
- package/core/skills/frontend/design-system-engineering/SKILL.md +4 -2
- package/core/skills/meetings-analysis/analyze-business-requirements/SKILL.md +1 -1
- package/core/skills/platform/add-telemetry-instrumentation/SKILL.md +2 -1
- package/core/skills/platform/aws-infrastructure/SKILL.md +12 -11
- package/core/skills/platform/cloudflare-email-service/SKILL.md +166 -166
- package/core/skills/platform/cloudflare-email-service/references/routing.md +199 -199
- package/core/skills/platform/debug-runtime-platform/SKILL.md +1 -0
- package/core/skills/platform/debug-workers-edge/SKILL.md +111 -111
- package/core/skills/platform/sandbox-sdk/SKILL.md +183 -183
- package/core/skills/platform/setup-gpu-finops/SKILL.md +111 -107
- package/core/skills/platform/setup-llm-gateway/SKILL.md +110 -108
- package/core/skills/platform/supply-chain-security/SKILL.md +1 -0
- package/core/skills/platform/system-design/SKILL.md +7 -0
- package/core/skills/platform/turnstile-spin/SKILL.md +118 -118
- package/core/skills/platform/turnstile-spin/scripts/auth-probe.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/fetch-secret.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/persist-skill.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/validate.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/widget-create.sh +0 -0
- package/core/skills/platform/turnstile-spin/scripts/worker-deploy.sh +0 -0
- package/core/skills/platform/turnstile-spin/templates/worker/src/index.ts +199 -199
- package/core/skills/platform/turnstile-spin/templates/worker/wrangler.toml +31 -31
- package/core/skills/platform/web-perf/SKILL.md +151 -151
- package/core/skills/platform/workers-best-practices/references/rules.md +463 -463
- package/core/skills/product/build-story-map/SKILL.md +104 -104
- package/core/skills/product/build-story-map/references/story-mapping-and-cpm-scheduling.md +101 -101
- package/core/skills/product/define-product-strategy/SKILL.md +105 -105
- package/core/skills/product/define-product-strategy/references/strategy-frameworks-and-pr-faq.md +142 -142
- package/core/skills/product/model-saas-metrics/SKILL.md +104 -104
- package/core/skills/product/model-saas-metrics/references/saas-unit-economics-and-pricing.md +110 -110
- package/core/skills/product/prioritize-roadmap/SKILL.md +106 -106
- package/core/skills/product/prioritize-roadmap/references/prioritization-scoring-and-kill-criteria.md +105 -105
- package/core/skills/repo-ops/commit-code/SKILL.md +190 -190
- package/core/skills/repo-ops/commit-code/references/multi-repo-and-deployment.md +21 -21
- package/core/skills/repo-ops/navigate-service/SKILL.md +199 -199
- package/core/skills/repo-ops/review-code/references/process-and-format.md +100 -100
- package/core/skills/repo-ops/review-service/SKILL.md +186 -186
- package/core/skills/repo-ops/troubleshoot-service/SKILL.md +127 -127
- package/core/skills/repo-ops/troubleshoot-service/references/failure-modes-and-security.md +22 -22
- package/core/skills/repo-ops/troubleshoot-service/references/suggested-process.md +110 -110
- package/core/skills/security-data/build-data-pipeline/SKILL.md +15 -14
- package/core/skills/security-data/build-data-pipeline/references/producer-contracts-and-lakehouse.md +5 -5
- package/core/skills/security-data/database-maintenance/SKILL.md +1 -0
- package/core/skills/security-data/database-maintenance/references/relational-and-vector-maintenance.md +5 -5
- package/core/skills/security-data/manage-secrets/SKILL.md +3 -0
- package/core/skills/security-data/optimize-olap-database/SKILL.md +14 -13
- package/core/skills/security-data/optimize-olap-database/references/olap-database-guide.md +2 -2
- package/core/skills/security-data/prompt-injection-defense/SKILL.md +3 -0
- package/core/skills/security-data/query-analytical-engine/SKILL.md +8 -7
- package/core/skills/security-data/query-analytical-engine/references/analytical-query-guide.md +3 -3
- package/core/skills/security-data/security-audit/SKILL.md +126 -119
- package/core/workflows/add-new-feature.md +212 -212
- package/core/workflows/agent-a2a-delegation.md +142 -142
- package/core/workflows/bug-fix.md +147 -147
- package/core/workflows/build-deploy.md +208 -208
- package/core/workflows/code-review.md +137 -137
- package/core/workflows/curriculum-delivery.md +1 -1
- package/core/workflows/dependency-upgrade.md +193 -193
- package/core/workflows/feature-delivery.md +149 -149
- package/core/workflows/hotfix-production.md +172 -172
- package/core/workflows/qa-validation.md +231 -231
- package/core/workflows/refactoring.md +154 -154
- package/core/workflows/revert-deployment.md +147 -147
- package/core/workflows/security-incident-response.md +191 -191
- package/core/workflows/seo-content-lifecycle.md +91 -91
- package/core/workflows/service-review-release.md +223 -223
- package/core/workflows/setup-new-service.md +214 -214
- package/core/workflows/tech-repo-review.md +245 -245
- package/core/workflows/troubleshooting.md +241 -241
- package/overlays/astro-cloudflare/README.md +93 -93
- package/overlays/data-analyst-stack/README.md +109 -109
- package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +135 -135
- package/overlays/data-analyst-stack/rules/stack-conventions.md +80 -80
- package/overlays/ecommerce-microservices/README.md +65 -65
- package/overlays/go-microservices/README.md +78 -78
- package/overlays/go-microservices/rules/go-conventions.md +223 -223
- package/overlays/laravel-filament/README.md +90 -90
- package/overlays/laravel-filament/rules/laravel-conventions.md +220 -220
- package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +141 -141
- package/overlays/laravel-filament/workflows/deploy-laravel.md +133 -133
- package/overlays/obj-configurator/rules/obj-project-rules.md +111 -111
- package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +71 -71
- package/overlays/r3f-stack/README.md +89 -89
- package/overlays/r3f-stack/rules/stub.md +43 -43
- package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +166 -166
- package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +159 -159
- package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +128 -128
- package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +52 -52
- package/overlays/ui-design-system/rules/handoff-conventions.md +73 -73
- package/package.json +2 -2
- package/core/README.md +0 -53
|
@@ -1,159 +1,159 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: integrate-r3f-three-legacy
|
|
3
|
-
description: Integrate or migrate between React Three Fiber and legacy imperative Three.js code by controlling scene ownership, render loops, loaders, interaction state, and cleanup boundaries. Use when a 3D web app mixes R3F with older Three.js modules, global bridge state, or imperative scene utilities and needs safe coexistence or staged migration.
|
|
4
|
-
allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_build, run_dev_server, run_tests]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Integrate R3F Three Legacy
|
|
8
|
-
|
|
9
|
-
Use this skill when a 3D frontend mixes React Three Fiber with older imperative Three.js code and the real work is defining safe boundaries between the two systems rather than only fixing one component in isolation.
|
|
10
|
-
|
|
11
|
-
## When to Use
|
|
12
|
-
|
|
13
|
-
- a 3D app mixes R3F with imperative Three.js
|
|
14
|
-
- migrating legacy Three.js into R3F safely
|
|
15
|
-
- managing global bridge state between paradigms
|
|
16
|
-
- controlling scene ownership and cleanup boundaries
|
|
17
|
-
|
|
18
|
-
## Core Rules
|
|
19
|
-
|
|
20
|
-
- define one clear owner for render loop, scene mutation, and disposal in each code path
|
|
21
|
-
- do not let legacy globals and React state mutate the same 3D objects without an explicit contract
|
|
22
|
-
- treat loaders, materials, controls, and decal logic as shared-risk areas when bridging old and new systems
|
|
23
|
-
- preserve current interaction behavior while reducing architectural overlap
|
|
24
|
-
- verify migration or bridge changes against nearby flows, not only the target scene
|
|
25
|
-
|
|
26
|
-
### 2025-2026: AI-Generated 3D Scene Code Review
|
|
27
|
-
|
|
28
|
-
When AI tools generate R3F components or Three.js bridge code, apply these additional checks:
|
|
29
|
-
|
|
30
|
-
- **Context ownership validation:** verify that AI-generated R3F components use `useThree()` context correctly and do not create a second renderer or canvas — AI tools frequently generate standalone `<Canvas>` wrappers that conflict with the existing scene context when dropped into an existing R3F tree.
|
|
31
|
-
- **Disposal and cleanup correctness:** AI-generated 3D components frequently omit `useEffect` cleanup for geometries, materials, and textures — check that every `.dispose()` call is present in the cleanup function to prevent GPU memory leaks.
|
|
32
|
-
- **Animation frame loop ownership:** verify AI-generated `useFrame` callbacks do not accumulate subscriptions across renders — confirm there is only one `useFrame` subscriber per concern, not one added per render cycle.
|
|
33
|
-
- **Generative 3D asset pipeline gate (2025):** for workflows using AI-generated 3D assets (Meshy AI, TripoSR, Rodin), validate generated meshes for polygon density (target ≤10k triangles for interactive use), UV correctness, and material assignment before integrating into the R3F/Three.js scene — AI-generated meshes frequently have inverted normals, missing UVs, or topology errors.
|
|
34
|
-
|
|
35
|
-
## Suggested Process
|
|
36
|
-
|
|
37
|
-
### 1. Map The Split Architecture
|
|
38
|
-
|
|
39
|
-
Identify:
|
|
40
|
-
|
|
41
|
-
- which files own the R3F canvas, scene, controls, and event flow
|
|
42
|
-
- which files still mutate Three.js objects imperatively
|
|
43
|
-
- what global stores, callbacks, or bridge objects connect UI and 3D state
|
|
44
|
-
- which behaviors must remain stable during the change
|
|
45
|
-
|
|
46
|
-
### 2. Classify The Boundary Problem
|
|
47
|
-
|
|
48
|
-
Decide what kind of mixed-system issue exists:
|
|
49
|
-
|
|
50
|
-
- duplicate scene ownership
|
|
51
|
-
- duplicate render/update loops
|
|
52
|
-
- state split across Redux, Zustand, globals, and object instances
|
|
53
|
-
- legacy utilities mutating meshes that R3F also manages
|
|
54
|
-
- loader/material/decal logic duplicated in both systems
|
|
55
|
-
|
|
56
|
-
### 3. Define Safe Ownership
|
|
57
|
-
|
|
58
|
-
For each concern, assign one owner:
|
|
59
|
-
|
|
60
|
-
- scene and camera ownership
|
|
61
|
-
- controls ownership
|
|
62
|
-
- model loading ownership
|
|
63
|
-
- material and texture mutation ownership
|
|
64
|
-
- interaction and raycast ownership
|
|
65
|
-
- cleanup and disposal ownership
|
|
66
|
-
|
|
67
|
-
### 4. Choose The Bridge Strategy
|
|
68
|
-
|
|
69
|
-
Use the smallest safe approach:
|
|
70
|
-
|
|
71
|
-
- **coexistence** when legacy code must remain temporarily but boundaries can be tightened
|
|
72
|
-
- **adapter layer** when legacy modules should be wrapped behind React-safe APIs
|
|
73
|
-
- **staged migration** when imperative scene logic should move gradually into hooks or components
|
|
74
|
-
|
|
75
|
-
### 5. Check High-Risk Shared Paths
|
|
76
|
-
|
|
77
|
-
Review:
|
|
78
|
-
|
|
79
|
-
- texture and material replacement logic
|
|
80
|
-
- decals, text rendering, and merged geometry helpers
|
|
81
|
-
- loaders that behave differently for OBJ versus GLTF/GLB
|
|
82
|
-
- event listeners, drag/drop handlers, and control enable/disable logic
|
|
83
|
-
- teardown for geometries, materials, textures, listeners, and cached assets
|
|
84
|
-
|
|
85
|
-
### 6. Verify Stability
|
|
86
|
-
|
|
87
|
-
Re-check:
|
|
88
|
-
|
|
89
|
-
- original bug or migration target
|
|
90
|
-
- adjacent tools using the same bridge state
|
|
91
|
-
- product switching, undo/redo, share/reload, or restore flows
|
|
92
|
-
- memory growth and duplicate listener/render-loop risk
|
|
93
|
-
|
|
94
|
-
## Output Format
|
|
95
|
-
|
|
96
|
-
```markdown
|
|
97
|
-
# <Change> - R3F Legacy Integration Brief
|
|
98
|
-
|
|
99
|
-
## Architecture Split
|
|
100
|
-
- R3F-owned areas:
|
|
101
|
-
- Legacy-owned areas:
|
|
102
|
-
- Shared bridge state:
|
|
103
|
-
- Preserved behavior:
|
|
104
|
-
|
|
105
|
-
## Boundary Risks
|
|
106
|
-
- Duplicate ownership:
|
|
107
|
-
- Shared mutable objects:
|
|
108
|
-
- Lifecycle or cleanup risks:
|
|
109
|
-
- Asset or material pipeline overlap:
|
|
110
|
-
|
|
111
|
-
## Integration Strategy
|
|
112
|
-
- Chosen approach:
|
|
113
|
-
- Why this approach is safer:
|
|
114
|
-
- What remains legacy for now:
|
|
115
|
-
|
|
116
|
-
## Verification
|
|
117
|
-
- Original issue or migration target checked:
|
|
118
|
-
- Adjacent flows re-checked:
|
|
119
|
-
- Memory / listener / render-loop checks:
|
|
120
|
-
- Residual risk:
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## Failure Modes
|
|
124
|
-
|
|
125
|
-
- **Duplicate scene ownership**: R3F and legacy Three.js both try to own the same scene, causing double-render or material double-mutation. **Mitigation:** the Map The Split Architecture step must declare one owner per concern before any code change; reject integrations that leave ownership ambiguous.
|
|
126
|
-
- **Duplicate render loop**: both R3F and the legacy code register a render/update loop, causing frame duplication. **Mitigation:** the Define Safe Ownership step assigns loop ownership explicitly; verify only one `useFrame` chain is active per concern.
|
|
127
|
-
- **State split across React, Redux, Zustand, and globals**: shared state mutates from multiple owners, producing inconsistent renders. **Mitigation:** define a single source of truth for the bridge state; the Choose The Bridge Strategy step is the gate.
|
|
128
|
-
- **AI-generated Canvas wrapper creates a second renderer**: an AI tool wraps content in its own `<Canvas>` instead of reusing the existing one. **Mitigation:** the AI-Generated 3D Scene Code Review check explicitly tests for this; reject AI components that do not use the existing `useThree()` context.
|
|
129
|
-
- **Disposal missing in AI-generated components**: AI-generated 3D components omit `useEffect` cleanup for geometry, material, and texture. **Mitigation:** the Disposal and cleanup correctness check rejects components that do not dispose every owned resource; verify with a memory profile after merge.
|
|
130
|
-
|
|
131
|
-
## Output Contracts
|
|
132
|
-
|
|
133
|
-
When this skill produces a structured handoff, emit:
|
|
134
|
-
|
|
135
|
-
- **`contracts/schemas/api-contract-spec.json`** when the integration introduces a new public API or props surface that other roles will consume.
|
|
136
|
-
- For human-readable handoff, use the R3F Legacy Integration Brief template in the existing Output Format block.
|
|
137
|
-
|
|
138
|
-
Skip structured emission for trivial wrappers that do not cross a role boundary.
|
|
139
|
-
## Security Guardrails (OWASP ASI)
|
|
140
|
-
|
|
141
|
-
- **ASI04 Supply Chain**: AI-generated 3D components must be schema-validated against the project's 3D component manifest; treat AI generators (v0, Copilot, Lovable-style) as untrusted sources.
|
|
142
|
-
- **ASI05 RCE Guard**: AI-generated 3D assets from external providers (Meshy AI, TripoSR, Rodin) must pass the Polygon budget gate, UV / normal validation, and material attribution check before being loaded; never load unvalidated AI meshes at runtime.
|
|
143
|
-
- **ASI07 Inter-Agent Communication**: the integration brief is consumed by Frontend and 3D roles; do not include asset URLs that point to operator-untrusted domains.
|
|
144
|
-
## Checklist
|
|
145
|
-
|
|
146
|
-
- [ ] R3F and legacy ownership boundaries mapped
|
|
147
|
-
- [ ] duplicate ownership or mutation paths identified
|
|
148
|
-
- [ ] bridge strategy chosen explicitly
|
|
149
|
-
- [ ] shared-risk paths checked
|
|
150
|
-
- [ ] cleanup responsibility verified
|
|
151
|
-
- [ ] original path and nearby regressions re-checked
|
|
152
|
-
|
|
153
|
-
## Related Skills
|
|
154
|
-
|
|
155
|
-
- **debug-3d-scene**: Trace transform, decal, lifecycle, and interaction bugs inside mixed 3D systems
|
|
156
|
-
- **optimize-3d-assets**: Reduce asset and texture cost when migration work exposes pipeline inefficiencies
|
|
157
|
-
- **navigate-service**: Map the 3D codebase before choosing ownership boundaries
|
|
158
|
-
- **frontend-testing**: Add regression coverage around bridge-sensitive interactions
|
|
159
|
-
- **review-code**: Review risky lifecycle, ownership, and cleanup changes
|
|
1
|
+
---
|
|
2
|
+
name: integrate-r3f-three-legacy
|
|
3
|
+
description: Integrate or migrate between React Three Fiber and legacy imperative Three.js code by controlling scene ownership, render loops, loaders, interaction state, and cleanup boundaries. Use when a 3D web app mixes R3F with older Three.js modules, global bridge state, or imperative scene utilities and needs safe coexistence or staged migration.
|
|
4
|
+
allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_build, run_dev_server, run_tests]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Integrate R3F Three Legacy
|
|
8
|
+
|
|
9
|
+
Use this skill when a 3D frontend mixes React Three Fiber with older imperative Three.js code and the real work is defining safe boundaries between the two systems rather than only fixing one component in isolation.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- a 3D app mixes R3F with imperative Three.js
|
|
14
|
+
- migrating legacy Three.js into R3F safely
|
|
15
|
+
- managing global bridge state between paradigms
|
|
16
|
+
- controlling scene ownership and cleanup boundaries
|
|
17
|
+
|
|
18
|
+
## Core Rules
|
|
19
|
+
|
|
20
|
+
- define one clear owner for render loop, scene mutation, and disposal in each code path
|
|
21
|
+
- do not let legacy globals and React state mutate the same 3D objects without an explicit contract
|
|
22
|
+
- treat loaders, materials, controls, and decal logic as shared-risk areas when bridging old and new systems
|
|
23
|
+
- preserve current interaction behavior while reducing architectural overlap
|
|
24
|
+
- verify migration or bridge changes against nearby flows, not only the target scene
|
|
25
|
+
|
|
26
|
+
### 2025-2026: AI-Generated 3D Scene Code Review
|
|
27
|
+
|
|
28
|
+
When AI tools generate R3F components or Three.js bridge code, apply these additional checks:
|
|
29
|
+
|
|
30
|
+
- **Context ownership validation:** verify that AI-generated R3F components use `useThree()` context correctly and do not create a second renderer or canvas — AI tools frequently generate standalone `<Canvas>` wrappers that conflict with the existing scene context when dropped into an existing R3F tree.
|
|
31
|
+
- **Disposal and cleanup correctness:** AI-generated 3D components frequently omit `useEffect` cleanup for geometries, materials, and textures — check that every `.dispose()` call is present in the cleanup function to prevent GPU memory leaks.
|
|
32
|
+
- **Animation frame loop ownership:** verify AI-generated `useFrame` callbacks do not accumulate subscriptions across renders — confirm there is only one `useFrame` subscriber per concern, not one added per render cycle.
|
|
33
|
+
- **Generative 3D asset pipeline gate (2025):** for workflows using AI-generated 3D assets (Meshy AI, TripoSR, Rodin), validate generated meshes for polygon density (target ≤10k triangles for interactive use), UV correctness, and material assignment before integrating into the R3F/Three.js scene — AI-generated meshes frequently have inverted normals, missing UVs, or topology errors.
|
|
34
|
+
|
|
35
|
+
## Suggested Process
|
|
36
|
+
|
|
37
|
+
### 1. Map The Split Architecture
|
|
38
|
+
|
|
39
|
+
Identify:
|
|
40
|
+
|
|
41
|
+
- which files own the R3F canvas, scene, controls, and event flow
|
|
42
|
+
- which files still mutate Three.js objects imperatively
|
|
43
|
+
- what global stores, callbacks, or bridge objects connect UI and 3D state
|
|
44
|
+
- which behaviors must remain stable during the change
|
|
45
|
+
|
|
46
|
+
### 2. Classify The Boundary Problem
|
|
47
|
+
|
|
48
|
+
Decide what kind of mixed-system issue exists:
|
|
49
|
+
|
|
50
|
+
- duplicate scene ownership
|
|
51
|
+
- duplicate render/update loops
|
|
52
|
+
- state split across Redux, Zustand, globals, and object instances
|
|
53
|
+
- legacy utilities mutating meshes that R3F also manages
|
|
54
|
+
- loader/material/decal logic duplicated in both systems
|
|
55
|
+
|
|
56
|
+
### 3. Define Safe Ownership
|
|
57
|
+
|
|
58
|
+
For each concern, assign one owner:
|
|
59
|
+
|
|
60
|
+
- scene and camera ownership
|
|
61
|
+
- controls ownership
|
|
62
|
+
- model loading ownership
|
|
63
|
+
- material and texture mutation ownership
|
|
64
|
+
- interaction and raycast ownership
|
|
65
|
+
- cleanup and disposal ownership
|
|
66
|
+
|
|
67
|
+
### 4. Choose The Bridge Strategy
|
|
68
|
+
|
|
69
|
+
Use the smallest safe approach:
|
|
70
|
+
|
|
71
|
+
- **coexistence** when legacy code must remain temporarily but boundaries can be tightened
|
|
72
|
+
- **adapter layer** when legacy modules should be wrapped behind React-safe APIs
|
|
73
|
+
- **staged migration** when imperative scene logic should move gradually into hooks or components
|
|
74
|
+
|
|
75
|
+
### 5. Check High-Risk Shared Paths
|
|
76
|
+
|
|
77
|
+
Review:
|
|
78
|
+
|
|
79
|
+
- texture and material replacement logic
|
|
80
|
+
- decals, text rendering, and merged geometry helpers
|
|
81
|
+
- loaders that behave differently for OBJ versus GLTF/GLB
|
|
82
|
+
- event listeners, drag/drop handlers, and control enable/disable logic
|
|
83
|
+
- teardown for geometries, materials, textures, listeners, and cached assets
|
|
84
|
+
|
|
85
|
+
### 6. Verify Stability
|
|
86
|
+
|
|
87
|
+
Re-check:
|
|
88
|
+
|
|
89
|
+
- original bug or migration target
|
|
90
|
+
- adjacent tools using the same bridge state
|
|
91
|
+
- product switching, undo/redo, share/reload, or restore flows
|
|
92
|
+
- memory growth and duplicate listener/render-loop risk
|
|
93
|
+
|
|
94
|
+
## Output Format
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
# <Change> - R3F Legacy Integration Brief
|
|
98
|
+
|
|
99
|
+
## Architecture Split
|
|
100
|
+
- R3F-owned areas:
|
|
101
|
+
- Legacy-owned areas:
|
|
102
|
+
- Shared bridge state:
|
|
103
|
+
- Preserved behavior:
|
|
104
|
+
|
|
105
|
+
## Boundary Risks
|
|
106
|
+
- Duplicate ownership:
|
|
107
|
+
- Shared mutable objects:
|
|
108
|
+
- Lifecycle or cleanup risks:
|
|
109
|
+
- Asset or material pipeline overlap:
|
|
110
|
+
|
|
111
|
+
## Integration Strategy
|
|
112
|
+
- Chosen approach:
|
|
113
|
+
- Why this approach is safer:
|
|
114
|
+
- What remains legacy for now:
|
|
115
|
+
|
|
116
|
+
## Verification
|
|
117
|
+
- Original issue or migration target checked:
|
|
118
|
+
- Adjacent flows re-checked:
|
|
119
|
+
- Memory / listener / render-loop checks:
|
|
120
|
+
- Residual risk:
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Failure Modes
|
|
124
|
+
|
|
125
|
+
- **Duplicate scene ownership**: R3F and legacy Three.js both try to own the same scene, causing double-render or material double-mutation. **Mitigation:** the Map The Split Architecture step must declare one owner per concern before any code change; reject integrations that leave ownership ambiguous.
|
|
126
|
+
- **Duplicate render loop**: both R3F and the legacy code register a render/update loop, causing frame duplication. **Mitigation:** the Define Safe Ownership step assigns loop ownership explicitly; verify only one `useFrame` chain is active per concern.
|
|
127
|
+
- **State split across React, Redux, Zustand, and globals**: shared state mutates from multiple owners, producing inconsistent renders. **Mitigation:** define a single source of truth for the bridge state; the Choose The Bridge Strategy step is the gate.
|
|
128
|
+
- **AI-generated Canvas wrapper creates a second renderer**: an AI tool wraps content in its own `<Canvas>` instead of reusing the existing one. **Mitigation:** the AI-Generated 3D Scene Code Review check explicitly tests for this; reject AI components that do not use the existing `useThree()` context.
|
|
129
|
+
- **Disposal missing in AI-generated components**: AI-generated 3D components omit `useEffect` cleanup for geometry, material, and texture. **Mitigation:** the Disposal and cleanup correctness check rejects components that do not dispose every owned resource; verify with a memory profile after merge.
|
|
130
|
+
|
|
131
|
+
## Output Contracts
|
|
132
|
+
|
|
133
|
+
When this skill produces a structured handoff, emit:
|
|
134
|
+
|
|
135
|
+
- **`contracts/schemas/api-contract-spec.json`** when the integration introduces a new public API or props surface that other roles will consume.
|
|
136
|
+
- For human-readable handoff, use the R3F Legacy Integration Brief template in the existing Output Format block.
|
|
137
|
+
|
|
138
|
+
Skip structured emission for trivial wrappers that do not cross a role boundary.
|
|
139
|
+
## Security Guardrails (OWASP ASI)
|
|
140
|
+
|
|
141
|
+
- **ASI04 Supply Chain**: AI-generated 3D components must be schema-validated against the project's 3D component manifest; treat AI generators (v0, Copilot, Lovable-style) as untrusted sources.
|
|
142
|
+
- **ASI05 RCE Guard**: AI-generated 3D assets from external providers (Meshy AI, TripoSR, Rodin) must pass the Polygon budget gate, UV / normal validation, and material attribution check before being loaded; never load unvalidated AI meshes at runtime.
|
|
143
|
+
- **ASI07 Inter-Agent Communication**: the integration brief is consumed by Frontend and 3D roles; do not include asset URLs that point to operator-untrusted domains.
|
|
144
|
+
## Checklist
|
|
145
|
+
|
|
146
|
+
- [ ] R3F and legacy ownership boundaries mapped
|
|
147
|
+
- [ ] duplicate ownership or mutation paths identified
|
|
148
|
+
- [ ] bridge strategy chosen explicitly
|
|
149
|
+
- [ ] shared-risk paths checked
|
|
150
|
+
- [ ] cleanup responsibility verified
|
|
151
|
+
- [ ] original path and nearby regressions re-checked
|
|
152
|
+
|
|
153
|
+
## Related Skills
|
|
154
|
+
|
|
155
|
+
- **debug-3d-scene**: Trace transform, decal, lifecycle, and interaction bugs inside mixed 3D systems
|
|
156
|
+
- **optimize-3d-assets**: Reduce asset and texture cost when migration work exposes pipeline inefficiencies
|
|
157
|
+
- **navigate-service**: Map the 3D codebase before choosing ownership boundaries
|
|
158
|
+
- **frontend-testing**: Add regression coverage around bridge-sensitive interactions
|
|
159
|
+
- **review-code**: Review risky lifecycle, ownership, and cleanup changes
|
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: optimize-3d-assets
|
|
3
|
-
description: Optimize 3D assets and rendering inputs by reviewing model formats, geometry density, texture memory, material strategy, compression, and loading behavior. Use when a 3D web experience suffers from heavy OBJ/GLTF assets, texture bloat, long load times, frame drops, or unnecessary GPU and memory pressure.
|
|
4
|
-
allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_build, run_dev_server, run_tests]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Optimize 3D Assets
|
|
8
|
-
|
|
9
|
-
Use this skill when the main problem is not scene logic alone, but the cost or quality of the 3D assets flowing into the runtime.
|
|
10
|
-
|
|
11
|
-
## When to Use
|
|
12
|
-
|
|
13
|
-
- heavy GLTF/OBJ assets slow the experience
|
|
14
|
-
- texture bloat or long load times
|
|
15
|
-
- frame drops or GPU/memory pressure
|
|
16
|
-
- reviewing geometry density and compression
|
|
17
|
-
|
|
18
|
-
## Core Rules
|
|
19
|
-
|
|
20
|
-
- optimize the biggest asset bottlenecks first instead of micro-tuning unrelated code
|
|
21
|
-
- measure format, memory, and loading assumptions before reducing quality
|
|
22
|
-
- prefer stable, production-safe asset improvements over ad hoc runtime hacks
|
|
23
|
-
- make visual trade-offs explicit before lowering fidelity
|
|
24
|
-
- check downstream effects on materials, decals, UVs, and interaction anchors when assets change
|
|
25
|
-
|
|
26
|
-
### 2025-2026: GenAI 3D Asset Pipeline Validation
|
|
27
|
-
|
|
28
|
-
AI-generated 3D assets (Meshy AI, TripoSR, Rodin, Luma AI, Stability AI 3D) require additional validation before entering the production pipeline:
|
|
29
|
-
|
|
30
|
-
- **Polygon budget gate:** AI-generated meshes frequently output excessive polygon counts (200k-2M triangles) suited for rendering, not real-time use — validate that the target polygon count is ≤10k triangles for interactive web use; reduce via Blender Decimate or `gltf-transform optimize` before committing.
|
|
31
|
-
- **UV and normal validation:** AI-generated meshes frequently have inverted normals, missing UV islands, or overlapping UVs that cause incorrect lighting and texture baking — run `gltf-validator` or Blender's mesh analysis before using the asset.
|
|
32
|
-
- **Texture format compliance:** AI-generated textures are often 4K or 8K PNG/JPEG — convert to WebP or KTX2 (with Basis Universal compression) and resize to ≤1K for mobile, ≤2K for desktop before committing to the repository.
|
|
33
|
-
- **Material attribution check:** verify AI-generated textures are licensed for commercial use — some AI asset generators train on copyrighted assets; check the provider's output license before shipping.
|
|
34
|
-
- **LOD requirement for AI assets:** high-detail AI-generated meshes should have a simplified LOD variant generated at 10%-25% of the original polygon count for mobile and distance rendering — do not ship a single ultra-high-detail mesh without LOD when the target platform includes mobile browsers.
|
|
35
|
-
|
|
36
|
-
## Suggested Process
|
|
37
|
-
|
|
38
|
-
### 1. Identify The Asset Bottleneck
|
|
39
|
-
|
|
40
|
-
Clarify whether the pressure comes from:
|
|
41
|
-
|
|
42
|
-
- raw model format such as OBJ instead of GLB/GLTF
|
|
43
|
-
- excessive polycount or duplicated geometry
|
|
44
|
-
- large diffuse/normal/roughness textures
|
|
45
|
-
- too many material instances or draw calls
|
|
46
|
-
- slow decode, parse, or network load path
|
|
47
|
-
|
|
48
|
-
### 2. Inspect Current Asset Strategy
|
|
49
|
-
|
|
50
|
-
Review:
|
|
51
|
-
|
|
52
|
-
- file formats in use
|
|
53
|
-
- texture resolutions and counts
|
|
54
|
-
- material model and normal-map usage
|
|
55
|
-
- compression or lack of compression
|
|
56
|
-
- whether asset loading matches target device constraints
|
|
57
|
-
|
|
58
|
-
### 3. Choose The Right Optimization Path
|
|
59
|
-
|
|
60
|
-
Prefer the narrowest useful improvement:
|
|
61
|
-
|
|
62
|
-
- convert OBJ to GLB/GLTF when runtime and pipeline support it
|
|
63
|
-
- reduce texture size or format cost
|
|
64
|
-
- consolidate materials when visually acceptable
|
|
65
|
-
- remove unnecessary geometry detail or hidden parts
|
|
66
|
-
- add LOD or simplified mobile variants when required
|
|
67
|
-
|
|
68
|
-
### 4. Check Runtime Assumptions
|
|
69
|
-
|
|
70
|
-
Verify:
|
|
71
|
-
|
|
72
|
-
- texture flip and color-space expectations
|
|
73
|
-
- normals, UVs, and decal targets remain valid
|
|
74
|
-
- material replacement will not break shading or overlays
|
|
75
|
-
- camera fit and interaction anchors survive asset changes
|
|
76
|
-
|
|
77
|
-
### 5. Produce A Safe Optimization Summary
|
|
78
|
-
|
|
79
|
-
Leave behind:
|
|
80
|
-
|
|
81
|
-
- what was heavy
|
|
82
|
-
- what changed
|
|
83
|
-
- what visual trade-offs were accepted
|
|
84
|
-
- what scenes or devices need re-checking
|
|
85
|
-
|
|
86
|
-
## Output Format
|
|
87
|
-
|
|
88
|
-
Outputs must conform to the `contracts/schemas/performance-audit.json` schema. Provide this structured JSON instead of a raw Markdown block. Ensure `verdict`, `metrics` (like bundle size and frame rate expectations), and `findings` are explicitly populated.
|
|
89
|
-
|
|
90
|
-
## Failure Modes
|
|
91
|
-
|
|
92
|
-
- **Optimization targets wrong bottleneck**: time is spent on texture compression when the real bottleneck is polycount. **Mitigation:** the Identify The Asset Bottleneck step must classify the pressure source (format, polycount, texture, material, decode) before any optimization; reject premature micro-tuning.
|
|
93
|
-
- **AI-generated mesh polycount exceeds budget**: an AI-generated mesh ships at 200k-2M triangles. **Mitigation:** the Polygon budget gate requires ≤10k triangles for interactive web use; reduce via Blender Decimate or gltf-transform optimize before commit.
|
|
94
|
-
- **UV / normal corruption from AI generator**: an AI mesh has inverted normals or missing UVs, breaking lighting. **Mitigation:** the UV and normal validation step runs gltf-validator or Blender mesh analysis; reject assets that fail.
|
|
95
|
-
- **Texture format bloat (4K-8K PNG)**: a large PNG ships without conversion. **Mitigation:** the Texture format compliance step requires WebP or KTX2 conversion with Basis Universal compression; mobile ≤ 1K, desktop ≤ 2K before commit.
|
|
96
|
-
- **Unverified AI asset license**: an AI-generated asset ships without license verification. **Mitigation:** the Material attribution check verifies the provider's output license for commercial use; reject assets that fail.
|
|
97
|
-
- **No LOD for high-detail AI mesh**: a 200k-triangle mesh ships without a simplified LOD for mobile. **Mitigation:** the LOD requirement check rejects assets that lack a 10%-25% polygon-count LOD for mobile browsers.
|
|
98
|
-
|
|
99
|
-
## Output Contracts
|
|
100
|
-
|
|
101
|
-
When this skill produces a structured handoff, emit:
|
|
102
|
-
|
|
103
|
-
- **`contracts/schemas/performance-audit.json`** — required, since the existing Output Format already mandates this schema. Populate `verdict`, `metrics` (bundle size, frame rate expectations, draw calls), and `findings`.
|
|
104
|
-
|
|
105
|
-
Skip the JSON contract only when the optimization is read-only and the result does not cross a role boundary.
|
|
106
|
-
## Security Guardrails (OWASP ASI)
|
|
107
|
-
|
|
108
|
-
- **ASI04 Supply Chain**: every dependency (gltf-transform, draco, meshoptimizer, basis-universal) must be schema-validated against the expected manifest; treat unknown versions as untrusted.
|
|
109
|
-
- **ASI05 RCE Guard**: AI-generated asset loader scripts must be schema-validated; never construct loader configs from external content without strict parameterization.
|
|
110
|
-
- **ASI07 Inter-Agent Communication**: the audit is consumed by Frontend and 3D roles; do not include asset URLs pointing to operator-untrusted domains.
|
|
111
|
-
- **ASI09 Human-Agent Trust Exploitation**: do not present an optimization as "shipping-ready" without the before-and-after metrics; surface the actual delta honestly.
|
|
112
|
-
## Checklist
|
|
113
|
-
|
|
114
|
-
- [ ] main asset bottleneck identified
|
|
115
|
-
- [ ] current format and memory strategy inspected
|
|
116
|
-
- [ ] narrowest useful optimization path chosen
|
|
117
|
-
- [ ] runtime assumptions and visual constraints preserved
|
|
118
|
-
- [ ] impacted scenes or overlays identified
|
|
119
|
-
- [ ] verification expectations and residual risk captured
|
|
120
|
-
|
|
121
|
-
## Related Skills
|
|
122
|
-
|
|
123
|
-
- **debug-3d-scene**: Diagnose scene issues when the bottleneck is not purely asset weight
|
|
124
|
-
- **navigate-service**: Locate asset-loading and material-wiring code paths
|
|
125
|
-
- **frontend-testing**: Re-check UI and interaction behavior after asset changes
|
|
126
|
-
- **review-code**: Review material, loader, or runtime trade-offs
|
|
127
|
-
- **troubleshoot-service**: Investigate delivery or environment issues affecting asset loading
|
|
128
|
-
- **commit-code**: Prepare optimized assets for delivery
|
|
1
|
+
---
|
|
2
|
+
name: optimize-3d-assets
|
|
3
|
+
description: Optimize 3D assets and rendering inputs by reviewing model formats, geometry density, texture memory, material strategy, compression, and loading behavior. Use when a 3D web experience suffers from heavy OBJ/GLTF assets, texture bloat, long load times, frame drops, or unnecessary GPU and memory pressure.
|
|
4
|
+
allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_build, run_dev_server, run_tests]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Optimize 3D Assets
|
|
8
|
+
|
|
9
|
+
Use this skill when the main problem is not scene logic alone, but the cost or quality of the 3D assets flowing into the runtime.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- heavy GLTF/OBJ assets slow the experience
|
|
14
|
+
- texture bloat or long load times
|
|
15
|
+
- frame drops or GPU/memory pressure
|
|
16
|
+
- reviewing geometry density and compression
|
|
17
|
+
|
|
18
|
+
## Core Rules
|
|
19
|
+
|
|
20
|
+
- optimize the biggest asset bottlenecks first instead of micro-tuning unrelated code
|
|
21
|
+
- measure format, memory, and loading assumptions before reducing quality
|
|
22
|
+
- prefer stable, production-safe asset improvements over ad hoc runtime hacks
|
|
23
|
+
- make visual trade-offs explicit before lowering fidelity
|
|
24
|
+
- check downstream effects on materials, decals, UVs, and interaction anchors when assets change
|
|
25
|
+
|
|
26
|
+
### 2025-2026: GenAI 3D Asset Pipeline Validation
|
|
27
|
+
|
|
28
|
+
AI-generated 3D assets (Meshy AI, TripoSR, Rodin, Luma AI, Stability AI 3D) require additional validation before entering the production pipeline:
|
|
29
|
+
|
|
30
|
+
- **Polygon budget gate:** AI-generated meshes frequently output excessive polygon counts (200k-2M triangles) suited for rendering, not real-time use — validate that the target polygon count is ≤10k triangles for interactive web use; reduce via Blender Decimate or `gltf-transform optimize` before committing.
|
|
31
|
+
- **UV and normal validation:** AI-generated meshes frequently have inverted normals, missing UV islands, or overlapping UVs that cause incorrect lighting and texture baking — run `gltf-validator` or Blender's mesh analysis before using the asset.
|
|
32
|
+
- **Texture format compliance:** AI-generated textures are often 4K or 8K PNG/JPEG — convert to WebP or KTX2 (with Basis Universal compression) and resize to ≤1K for mobile, ≤2K for desktop before committing to the repository.
|
|
33
|
+
- **Material attribution check:** verify AI-generated textures are licensed for commercial use — some AI asset generators train on copyrighted assets; check the provider's output license before shipping.
|
|
34
|
+
- **LOD requirement for AI assets:** high-detail AI-generated meshes should have a simplified LOD variant generated at 10%-25% of the original polygon count for mobile and distance rendering — do not ship a single ultra-high-detail mesh without LOD when the target platform includes mobile browsers.
|
|
35
|
+
|
|
36
|
+
## Suggested Process
|
|
37
|
+
|
|
38
|
+
### 1. Identify The Asset Bottleneck
|
|
39
|
+
|
|
40
|
+
Clarify whether the pressure comes from:
|
|
41
|
+
|
|
42
|
+
- raw model format such as OBJ instead of GLB/GLTF
|
|
43
|
+
- excessive polycount or duplicated geometry
|
|
44
|
+
- large diffuse/normal/roughness textures
|
|
45
|
+
- too many material instances or draw calls
|
|
46
|
+
- slow decode, parse, or network load path
|
|
47
|
+
|
|
48
|
+
### 2. Inspect Current Asset Strategy
|
|
49
|
+
|
|
50
|
+
Review:
|
|
51
|
+
|
|
52
|
+
- file formats in use
|
|
53
|
+
- texture resolutions and counts
|
|
54
|
+
- material model and normal-map usage
|
|
55
|
+
- compression or lack of compression
|
|
56
|
+
- whether asset loading matches target device constraints
|
|
57
|
+
|
|
58
|
+
### 3. Choose The Right Optimization Path
|
|
59
|
+
|
|
60
|
+
Prefer the narrowest useful improvement:
|
|
61
|
+
|
|
62
|
+
- convert OBJ to GLB/GLTF when runtime and pipeline support it
|
|
63
|
+
- reduce texture size or format cost
|
|
64
|
+
- consolidate materials when visually acceptable
|
|
65
|
+
- remove unnecessary geometry detail or hidden parts
|
|
66
|
+
- add LOD or simplified mobile variants when required
|
|
67
|
+
|
|
68
|
+
### 4. Check Runtime Assumptions
|
|
69
|
+
|
|
70
|
+
Verify:
|
|
71
|
+
|
|
72
|
+
- texture flip and color-space expectations
|
|
73
|
+
- normals, UVs, and decal targets remain valid
|
|
74
|
+
- material replacement will not break shading or overlays
|
|
75
|
+
- camera fit and interaction anchors survive asset changes
|
|
76
|
+
|
|
77
|
+
### 5. Produce A Safe Optimization Summary
|
|
78
|
+
|
|
79
|
+
Leave behind:
|
|
80
|
+
|
|
81
|
+
- what was heavy
|
|
82
|
+
- what changed
|
|
83
|
+
- what visual trade-offs were accepted
|
|
84
|
+
- what scenes or devices need re-checking
|
|
85
|
+
|
|
86
|
+
## Output Format
|
|
87
|
+
|
|
88
|
+
Outputs must conform to the `contracts/schemas/performance-audit.json` schema. Provide this structured JSON instead of a raw Markdown block. Ensure `verdict`, `metrics` (like bundle size and frame rate expectations), and `findings` are explicitly populated.
|
|
89
|
+
|
|
90
|
+
## Failure Modes
|
|
91
|
+
|
|
92
|
+
- **Optimization targets wrong bottleneck**: time is spent on texture compression when the real bottleneck is polycount. **Mitigation:** the Identify The Asset Bottleneck step must classify the pressure source (format, polycount, texture, material, decode) before any optimization; reject premature micro-tuning.
|
|
93
|
+
- **AI-generated mesh polycount exceeds budget**: an AI-generated mesh ships at 200k-2M triangles. **Mitigation:** the Polygon budget gate requires ≤10k triangles for interactive web use; reduce via Blender Decimate or gltf-transform optimize before commit.
|
|
94
|
+
- **UV / normal corruption from AI generator**: an AI mesh has inverted normals or missing UVs, breaking lighting. **Mitigation:** the UV and normal validation step runs gltf-validator or Blender mesh analysis; reject assets that fail.
|
|
95
|
+
- **Texture format bloat (4K-8K PNG)**: a large PNG ships without conversion. **Mitigation:** the Texture format compliance step requires WebP or KTX2 conversion with Basis Universal compression; mobile ≤ 1K, desktop ≤ 2K before commit.
|
|
96
|
+
- **Unverified AI asset license**: an AI-generated asset ships without license verification. **Mitigation:** the Material attribution check verifies the provider's output license for commercial use; reject assets that fail.
|
|
97
|
+
- **No LOD for high-detail AI mesh**: a 200k-triangle mesh ships without a simplified LOD for mobile. **Mitigation:** the LOD requirement check rejects assets that lack a 10%-25% polygon-count LOD for mobile browsers.
|
|
98
|
+
|
|
99
|
+
## Output Contracts
|
|
100
|
+
|
|
101
|
+
When this skill produces a structured handoff, emit:
|
|
102
|
+
|
|
103
|
+
- **`contracts/schemas/performance-audit.json`** — required, since the existing Output Format already mandates this schema. Populate `verdict`, `metrics` (bundle size, frame rate expectations, draw calls), and `findings`.
|
|
104
|
+
|
|
105
|
+
Skip the JSON contract only when the optimization is read-only and the result does not cross a role boundary.
|
|
106
|
+
## Security Guardrails (OWASP ASI)
|
|
107
|
+
|
|
108
|
+
- **ASI04 Supply Chain**: every dependency (gltf-transform, draco, meshoptimizer, basis-universal) must be schema-validated against the expected manifest; treat unknown versions as untrusted.
|
|
109
|
+
- **ASI05 RCE Guard**: AI-generated asset loader scripts must be schema-validated; never construct loader configs from external content without strict parameterization.
|
|
110
|
+
- **ASI07 Inter-Agent Communication**: the audit is consumed by Frontend and 3D roles; do not include asset URLs pointing to operator-untrusted domains.
|
|
111
|
+
- **ASI09 Human-Agent Trust Exploitation**: do not present an optimization as "shipping-ready" without the before-and-after metrics; surface the actual delta honestly.
|
|
112
|
+
## Checklist
|
|
113
|
+
|
|
114
|
+
- [ ] main asset bottleneck identified
|
|
115
|
+
- [ ] current format and memory strategy inspected
|
|
116
|
+
- [ ] narrowest useful optimization path chosen
|
|
117
|
+
- [ ] runtime assumptions and visual constraints preserved
|
|
118
|
+
- [ ] impacted scenes or overlays identified
|
|
119
|
+
- [ ] verification expectations and residual risk captured
|
|
120
|
+
|
|
121
|
+
## Related Skills
|
|
122
|
+
|
|
123
|
+
- **debug-3d-scene**: Diagnose scene issues when the bottleneck is not purely asset weight
|
|
124
|
+
- **navigate-service**: Locate asset-loading and material-wiring code paths
|
|
125
|
+
- **frontend-testing**: Re-check UI and interaction behavior after asset changes
|
|
126
|
+
- **review-code**: Review material, loader, or runtime trade-offs
|
|
127
|
+
- **troubleshoot-service**: Investigate delivery or environment issues affecting asset loading
|
|
128
|
+
- **commit-code**: Prepare optimized assets for delivery
|