nonaxanon/r3f-skills

r3f-debug-profiler

Diagnose and measure a react-three-fiber scene — blank/black canvas triage, resize and mobile bugs, and measured FPS, draw calls, triangles, memory, and leaks via gl.info.

ソースを見る

使い方

  1. インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
  2. 必要なツール、認証情報、対応環境を原文で確認します。
  3. 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/nonaxanon/r3f-skills --skill r3f-debug-profiler

開始前の確認

  • 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
  • スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

r3f-debug-profiler · STUB

State

This skill is a stub. The seam is defined; the harness and checklists are not written yet. Do not present its output as a completed profiling phase. If you must measure now, read gl.info directly from a useFrame and report the raw numbers, and note in the director's risk ledger that this skill was unbuilt.

Intended purpose

Make scene problems measured, not guessed. Two halves:

  1. Correctness triage — a runbook for the blank/black canvas (first console error, render loop

running, canvas drawing-buffer size vs CSS size, camera framing/near-far, lights/material side, asset URLs/CORS) and for resize/mobile/DPR bugs.

  1. Performance profiling — a self-reporting diagnostics global populated from a useFrame

hook (gl.info.render.calls/triangles, gl.info.memory.geometries/textures, frame time, canvas size/DPR) so an out-of-process script can read the scene's vitals, plus a headless canvas inspector that screenshots the <canvas>, proves it isn't blank by pixel variance, captures console/page errors, and waits for real frame progress before asserting.

Intended references / scripts (to author)

  • references/checklists/scene-debugging.md — the black-canvas runbook.
  • references/checklists/performance-profile.md — the measurement recipe and what to capture.
  • scripts/inspect-r3f-canvas.mjs — headless Chromium canvas-pixel + diagnostics-global reader.
  • A useFrame diagnostics-publisher snippet writing window.__R3F_DIAGNOSTICS__.

Dependency

Can run after any frame-budget-moving change (it is "measure now," not a single slot). Pairs with r3f-scene-architect (leak/draw-call findings) and r3f-graphics-builder (perf-safe detail).