用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/feliperyba/ralph-orchestra --skill dev-performance-performance-basics命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Complete Developer workflow orchestration - task research sequence, implementation flow, validation gates, PRD synchronization, exit conditions.
Complete Game Designer workflow - skill invocation protocol, GDD creation, playtest flow with GDD review, design sessions. MUST load before starting assignments.
Complete PM Coordinator workflow - task assignment, project orchestration, PRD management, worker coordination. Use proactively when starting PM agent work.
正在显示 SKILL.md
基于 SOC 职业分类
| name | dev-performance-performance-basics |
| description | Core R3F/Three.js performance optimization principles. Use when FPS drops below 60. |
| category | performance |
"Optimize for mobile, scale up for desktop – 60 FPS is the goal."
Use when:
| System | Budget | Notes |
|---|---|---|
| Input | ~1ms | Event handling |
| Physics | ~3ms | Rapier/Cannon updates |
| Game Logic | ~4ms | State, AI, animations |
| Render | ~5ms | Three.js draw calls |
| Buffer | ~3ms | Safety margin |
| Total | 16.67ms | 60 FPS target |
// Performance-optimized Canvas
<Canvas
dpr={[1, 2]} // Limit pixel ratio
performance={{ min: 0.5 }} // Auto-reduce quality
gl={{ antialias: false }} // Disable for mobile
>
<Suspense fallback={null}>
<Scene />
</Suspense>
</Canvas>
| Symptom | Likely Cause | Solution |
|---|---|---|
| Low FPS everywhere | Too many draw calls | Instancing, merging |
| FPS drops on zoom | LOD not implemented | Add LOD system |
| Mobile slow | DPR too high | Limit to 1.5 |
| Memory grows | Dispose missing | Add cleanup |
| Stuttering | GC pressure | Object pooling |
// Limit device pixel ratio
<Canvas dpr={Math.min(window.devicePixelRatio, 2)}>
// Disable expensive features on mobile
const isMobile = /iPhone|iPad|Android/i.test(navigator.userAgent);
<Canvas
shadows={!isMobile}
gl={{
antialias: !isMobile,
powerPreference: 'high-performance',
}}
>
// Reuse Vector3, Quaternion instances
const position = useRef(new THREE.Vector3());
const rotation = useRef(new THREE.Quaternion());
useFrame(() => {
position.current.set(0, 0, 0); // Reuse, don't create
});
// CRITICAL: Dispose of Three.js objects
useEffect(() => {
const geometry = new THREE.BoxGeometry();
const material = new THREE.MeshStandardMaterial();
return () => {
geometry.dispose();
material.dispose();
if (material.map) material.map.dispose();
};
}, []);
import { useFrame } from '@react-three/fiber';
import { useRef } from 'react';
function PerformanceMonitor() {
const frameCount = useRef(0);
const lastTime = useRef(performance.now());
useFrame(() => {
frameCount.current++;
const now = performance.now();
if (now - lastTime.current >= 1000) {
console.log(`FPS: ${frameCount.current}`);
frameCount.current = 0;
lastTime.current = now;
}
});
return null;
}
❌ DON'T:
✅ DO: