three-kit

/three-kit:perf-pass [area]· in Claude Code, runs only when typed·source

Fit a whole three.js / React Three Fiber frame to the project's budgets, one area at a time. Surveys draws and triangles at every play position, ranks areas by what the frame really draws, and takes the costliest through the cheapest fix that keeps the look, verified by pixel diff. Use when the user asks for a perf pass, or to fit a scene's frame to its triangle or draw-call budget.

npx skills add zkmake/three-kit --skill perf-pass

Perf pass: the frame, one area at a time

Loop: survey → rank → pass → write back, one area per pass, until the frame fits the budgets at every play position. The model-pass skill works on one object; this one works on the frame: what the play camera actually draws, in every pass, from where the player actually stands. Every number is measured in the running app, never estimated; every “looks the same” is a pixel diff and a look at the shots.

Words used below:

The tools are the @zkmake/* packages. This skill names their calls; the installed package’s README (node_modules/@zkmake/<name>/README.md, or https://zkmake.github.io/three-kit/llms-full.txt) is the authority on their signatures. Paths below are relative to this skill’s directory.

0. Style guide, budgets, helpers

Done when the budgets file typechecks with a frame, ledger() answers in the running app, and every play position has a way to reach it.

1. Survey

Follow references/survey.md at every play position: one frame’s draws and triangles per pass and per area, the world’s worth beside it, and heap, requests and bytes where the browser gives them.

Done when the baseline table has a row per play position, each with its frame triangles and draws (both passes), its top areas, and where it stands against frame.

2. Rank

Done when the area for this pass is picked (the area the user named when invoking the skill, if any) and its cause is stated with numbers: “cars: 22 drawn past 170 at 1,250 triangles each, 33% of the city”.

3. Pass

Done when the area’s frame cost is down at every play position where it drew, the play-view diffs read as identical (about 0.1% of pixels or under, and nothing visible in the diff mask or the montage), and no other area’s numbers rose unexplained.

4. Write back

Done when the budgets file, the test, the style guide and the report all carry this pass.

5. Again, or stop

Re-rank from the new survey and take the next area. Stop when the frame fits frame at every play position. Otherwise, when the next fix would cost the look or more than it saves, stop and say what remains, at which positions, and why: the next ranked area, its cost, and the fix it would take.

References

The files the skill reads at the step that names them.