Skip to content
Skills Library
Programming · Review & audit

room-mobile

/room-mobile

Keep the 3D room light and smooth on phones, tablets and weak laptops. Use for any change to the renderer, post-processing, shadows, textures, per-frame work or what loads at start, and whenever someone says the room is slow, hot or heavy on mobile.

Repository
room ↗
Licence
MPL-2.0
Last repository change
13.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

MPL-2.0, otwarta.

What it does and when to use it

Keep the 3D room light and smooth on phones, tablets and weak laptops. Use for any change to the renderer, post-processing, shadows, textures, per-frame work or what loads at start, and whenever someone says the room is slow, hot or heavy on mobile.

Original author description

Keep the 3D room light and smooth on phones, tablets and weak laptops. Use for any change to the renderer, post-processing, shadows, textures, per-frame work or what loads at start, and whenever someone says the room is slow, hot or heavy on mobile.

How it works

  1. The two looks (src/quality.js)
  2. Rules for a change
  3. Measure
Original SKILL.md headings · 48 lines, 559 words
SKILL.md preview
---
name: room-mobile
description: Keep the 3D room light and smooth on phones, tablets and weak laptops. Use for any change to the renderer, post-processing, shadows, textures, per-frame work or what loads at start, and whenever someone says the room is slow, hot or heavy on mobile.
---

# The room on a phone

A phone draws three device pixels to each CSS pixel, on a GPU that shares its power budget with
the radio and the screen, and it slows itself down when it gets hot. Drawn like a laptop's, the room
was 780×1688 pixels through five passes, 60 times a second. Every rule here comes from that.

## The two looks (`src/quality.js`)

- `pick()` gives `lite` to a touch-only screen, a screen whose short side is 600 CSS px or less, a
  device with 2 GB or 2 cores or fewer, or the data saver; `full` to the rest. `?lite` and `?full`
  force one; `?record` is always `full`, so `just record` films the laptop.
- `lite`: pixel ratio 1.25 at most (stepping down to 0.75), 30 frames a second (`quality.fps`, the
  loop in `src/app.js` skips the others), no GTAO, 2× MSAA, 512 shadow maps with plain PCF,
  anisotropy 2, 150 motes of dust, a frame budget of 1/24 s.
- The adaptive quality in `src/post.js` steps down from where the look starts when the average
  frame passes `quality.budget`: occlusion, then pixel ratio, then bloom, then the grade. It never
  steps back up; a phone that got hot stays cool.
- `document.body.dataset.quality` says which look is on, for CSS and for a screenshot.

## Rules for a change

1. **Price it in pixels × passes.** A full-screen pass on a phone costs as much as the whole scene.
   A new pass is `full` only, or it runs at half resolution, or it replaces one.
2. **Nothing new every frame.** A canvas texture uploaded each frame (`needsUpdate = true`) costs a
   phone a few ms each time: redraw at 10 fps at most, as the drawn city does (`src/outside.js`), or
   on a change only. Shadows draw again only on `redrawShadows()`.
3. **Load what the visitor sees.** Heavy things load on the click that needs them: the tapes
   (`module: () => import(...)`), the grid's MapLibre, Spotify's iframe, the day photo by night
   (`want` in `src/outside.js`). A new asset over 200 kB loads lazily or has a reason in the PR.
4. **A new quality knob goes in both looks**, in `FULL` and `LITE`, with a line in the comment at
   the top of `src/quality.js`, and is read from `quality`, never from `devicePixelRatio` or
   `navigator` directly.
5. **Touch is not hover.** A tap must do what a hover and a click do (invariant 8); buttons are at
   least 44 px tall in an overlay (see `#lock .keys`).

## Measure

`just mobile` opens the built room as a phone (390×844, ratio 3, touch, CPU slowed 4×) and as a
laptop (1280×720, ratio 2) and prints, for each, the look, the bytes and the requests before the
room shows, when its code and its first pictures arrived, the time until it shows and until every
model is in, the size of the drawing buffer and the median time of a frame with the GPU's work in
it (`--load` leaves the frames out, `--net 4g` slows the line; the `room-load` skill). In this container the GPU is software (SwiftShader), so compare builds with each
other on the same machine, never with a phone. Put the before and after lines in the pull request.
`just mobile --device phone` measures one; `--url https://room.piabrota.art/` the live site.

For a real phone, see the `room-phone-test` skill.

Versions

The database has no other skills named room-mobile.

Database snapshot: 13.11.2026 · package version 5b0d449697cd (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90room-threejs-perf
    Find and fix what makes the room's three.js frame slow - draw calls, transparent and double-sided materials, shadows, shader stalls, per-frame work. Use when a shot is slow, a change adds meshes or materials, or `just peek` shows more than 100 draw calls.
  • 100room-load
    Keep the time until the room shows short - what loads before the first frame, what waits, fonts, caching, compression and the device's share. Use when someone says the site is slow to open, or a change adds a file, a font or a dependency that loads at start.
  • 100harmony-performance
    Make a web game load fast and run smoothly - measure first, shrink the download (textures, audio, models, fonts, code splitting), add a real loading screen and shader warm-up, and hold a steady frame rate on low-end laptops and phones with quality presets and a WebGL fallback…
  • 90mobile-storage
    Use this skill when the user asks about mobile local storage, SQLite, Room, Core Data, Hive, Isar, SharedPreferences, UserDefaults, file storage, or database migration.
  • 100webgl-frame-profiling
    Measure and fix frame time, GPU cost, and smoothness of a WebGL/WebGL2 browser game in the live page — GPU timer queries, draw and triangle counts, frame-delta distributions, and on/off experiments for shadows, post-processing, resolution, and materials. Use when a browser game…
  • 100project-room
    Use when building a software project with Project Room so its map, executable components, tests, and history remain inspectable.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.