pocket-nexus/pocketjs/pocketjs-devtools
Claude Code and agent skill by pocket-nexus/pocketjs
- community
Checking that the SKILL.md file is still in the repository.
Debug PocketJS apps with Pocket DevTools — deterministic input-tape time travel, component-tree inspection with on-device highlight, pause/step, REPL eval and console on real PSP hardware over PSPLINK, on-demand screenshots, and headless tape replay for regression evidence. Use when asked to debug UI behavior, reproduce or bisect a visual regression, inspect the component tree, capture device screenshots, or verify a fix against a recorded session.
Install
npx vskill@latest install pocket-nexus/pocketjs/pocketjs-devtoolsSKILL.md
The same SKILL.md was published earlier as pocket-nexus/pocketjs/pocketjs-devtools.
Pocket DevTools
Overview
PocketJS is fixed-dt deterministic and its entire per-frame input is one button bitmask, so a recorded input tape replays any session byte-exactly. DevTools (design: repo docs/DEVTOOLS.md) is built into every bundle: a flight recorder is ALWAYS on (36 000-frame ring), and a JSON-line debug channel connects the runtime to a desktop panel over WebSocket (browser host) or the PSPLINK USB mailbox (real PSP).
Prefer the headless tape workflow for agent debugging — every question is answerable from the terminal. Use the panel when a human is co-driving.
Headless workflow (no screen needed)
Keep per-run tapes, hashes, captures, and logs in ignored output. For example:
- Input masks are contracts/spec/spec.ts
BTNvalues (CIRCLE=0x2000=8192,DOWN=0x40=64). - A regression workflow: record/obtain a tape on the OLD build →
--hashes→
switch builds → --assert names the exact first frame that changed → --png <that frame> on both builds to see the difference.
- Tapes exported from ANY host (panel "Export", or
__pocketDevtools.dumpTape()
in the REPL) replay headlessly. startFrame > 0 means the ring wrapped — replay is then an approximation (warned automatically).
- Committed session goldens live in
tests/tapes/; regenerate hashes only when
a visual change is intended.
- A replay capture or exported session is temporary validation output. Promote
it to a committed fixture only when a named regression test consumes it. Put selected screenshots in PR attachments and keep raw captures, logs and receipts outside the tracked tree, following AGENTS.md/CLAUDE.md.
Panel workflow (one command)
Panel at http://127.0.0.1:8130/devtools. bun run devtools auto-detects an already-running bun run psp:switch / bun run hw usbhostfs session and bridges into it instead of fighting for the cable (relaunch the app there so it probes the mailbox at boot). Shortcuts: o open panel, r rebuild+relaunch (managed sessions), q quit.
Panel capabilities: hover tree → highlight ON THE DEVICE SCREEN (core-drawn overlay, works on real PSP); click pins; pause/step/resume freeze the whole world; tape strip with click-to-seek (browser host reloads and deterministically fast-forwards); REPL evals in the app global scope between frames; 📷 screenshot button downloads a PNG (browser: canvas; PSP: raw VRAM dump over usbhostfs, converted by the bridge — pixels never cross the JSON channel).
Widget and Pocket3D embedding specifics
pocket-ui-wgpuhosts (OpenStrike desktop,engine/pocket3d/examples/uihost)
carry the same file-mailbox transport as the PSP, pointed at $POCKETJS_DBG_DIR (else the process cwd). Workflow: bun run devtools --dir <root> --port 8131 FIRST (explicit --dir wins over a running PSPLINK session, so a PSP panel and a desktop panel can run side by side), then launch the app with that cwd — e.g. cargo run -p openstrike from the open-strike repo root. The app probes pocketjs-dbg/enable once at mount, like the PSP boot probe.
- Everything except 📷 screenshots works identically (desktop
__dbgShot
is unimplemented; the panel button logs a warning). hello reports host:"desktop" via ui.__host.
Real-PSP specifics
- Transport =
pocketjs-dbg/{enable,in,out}.jsonlon the usbhostfs share
(host0:). The app probes enable ONCE at boot — start the bridge before launching the app, or relaunch after. No PSPLINK → zero cost.
- Shim polls every 10 frames on PSP (~166 ms hover latency); every frame on
other hosts.
console.logon PSP: the shim installs a safe no-op console at mount
(QuickJS has none) and upgrades it to a channel mirror when a transport attaches.
- PPSSPP finds the mailbox via
host0:= the EBOOT's own directory (so
bun run devtools <app> bridging the target dir works for PPSSPP loading that EBOOT too); the ms0: fallback also exists (memstick root).
Protocol quick reference (JSON lines)
Panel→device: inspect{id} (0 clears) · pause · resume · step · getTree · eval{id,code} · dumpTape · screenshot · seek{frame} / replay{tape} (browser host-level). Device→panel: hello{app,host,frame} · tree{root:{i,t,n,c,x,k}} · inspect{id,rect|null} · stats{frame,nodes,tapeLen,paused} · log · error{frame,message} · evalResult{id,ok,value} · tape{tape} · screenshot{frame,data}.
Gotchas
rect: null/debugRectXY() === -1= the node is never painted
(display:none, detached, or inside a paint_3d perspective subtree — 3D interiors aren't captured; the perspective ROOT is).
- Adding spec ops: edit
contracts/spec/spec.ts→bun contracts/spec/gen-rust.ts→ implement
on Ui + BOTH hosts (programs/psp/src/service_bindings.rs, programs/web/wasm/src/lib.rs) + programs/web/dev/ wasm-ops.js + HostOps (optional members) — tests/contract.ts locks the spec halves together.
debugName/<Named>are JS-mirror-only: provably zero pixel impact
(goldens + tape hashes unchanged). Name every function component's root element; the tree panel and tape tree output read like the source.
- Shim tests live in
tests/devtools.test.ts(mock ops + in-process
transport; --conditions=browser required). Core pause/inspect tests in engine/core/src/tests.rs.
- Missing QuickJS symbols (vendored libquickjs-sys is minimal): declare a
local extern "C" block — precedent in programs/psp/src/main.rs and ffi.rs.
- NEVER hand VRAM addresses (
0x4xxxxxxxuncached mirror) to usbhostfs IO:
its send path runs dcache writeback + USB bulk DMA on the caller's buffer and hangs the device on the first 64 KB block (frozen PSP, 0-byte file). Bounce through a cached-RAM buffer in chunks (dbg::shot). ms0: (Memory Stick driver) tolerates VRAM-direct writes — that's why cap_dump_frame gets away with it and why PPSSPP won't reproduce the hang.
- The GE writes framebuffer alpha as 0: any raw-framebuffer consumer must
force alpha opaque (bridge convertShot, e2e's -alpha off) or the PNG renders fully transparent.
- When hardware behavior "mysteriously regresses" after running e2e scripts,
check WHICH build is on disk before debugging anything else: e2e capture specs rebuild the EBOOT/PRX in place, and capture builds sceKernelExitGame() after their window — reloading one on the PSP looks exactly like a freeze/hang a few seconds after boot. Rebuild your intended feature set first; only then trust symptoms. (Cost an hour on the OpenStrike bring-up: a phantom "mailbox freeze" was a self-exiting e2e build the whole time.)
- The whole device-side path (eval, console, screenshot) is testable
without hardware, at host0: fidelity: PPSSPP maps the EBOOT's own directory as `host0:`, so a mailbox in programs/psp/target/mipsel-sony-psp/debug/pocketjs-dbg/ is found by the SAME probe hardware uses. Create enable/in/out there, run PPSSPPHeadless with a timeout, append commands to in.jsonl mid-run, read out.jsonl. (This also means a stale hardware-session mailbox hijacks emulator runs — tests/e2e/ppsspp.ts removes it before each golden run.)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/pocketjs-devtools/SKILL.md
Popularity
- Repository stars
- 1,692
- Repository forks
- 98
- Repository npm downloads, 7 days
- 58
- 7-day trend score
- 50
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 5 Oct 2026, a month ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/pocket-nexus/pocketjs/pocketjs-devtools)