specs-capture-perf-trace

Capture simultaneous .pftrace performance traces from Lens Studio Preview panels via ExecuteEditorCode snippets.

16|2|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/lens-studio-devs/ls-extensions --skill specs-capture-perf-trace-lens-studio-devs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: specs-capture-perf-trace
Source: https://github.com/lens-studio-devs/ls-extensions/tree/main/plugins/ls-clad/skills/specs-capture-perf-trace
Command: npx skills add https://github.com/lens-studio-devs/ls-extensions --skill specs-capture-perf-trace-lens-studio-devs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Recording performance traces from multiple Lens Studio Preview panels at once requires coordinating editor-side profiling sessions without blocking the editor or triggering extra permission prompts, which is error-prone when done manually. ## Core Features & Use Cases - Scheduled Multi-Panel Capture: Start trace sessions on one or more Preview panels back-to-back and finish them automatically after a configurable duration using a setTimeout pattern. - State Management on globalThis: Store capture state under a configurable key so Status and Cleanup snippets can inspect or abort an in-progress capture. - Use Case: While profiling a Lens with two Preview panels open, run the Start snippet with durationMs set to 10000, wait, then verify the generated .pftrace files and hand them to a trace analysis skill. ## Quick Start Ask the agent to capture a 10-second performance trace from all open Lens Studio Preview panels into a performance_traces folder.

Frequently Asked Questions about specs-capture-perf-trace

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I record a performance trace in Lens Studio Preview?▼

Call preview.profiling.startTrace with an Editor.Path pointing to the output file, then call session.finish() after the desired duration. This skill wraps that API in a scheduled setTimeout pattern so multiple Preview panels are captured simultaneously.

How do I capture traces from multiple Preview panels at the same time?▼

Set the previewCount constant in the Start snippet to the number of panels, or null to capture all. The snippet starts all sessions back-to-back and finishes them together after durationMs, storing state on globalThis.

Why should I avoid awaiting a timer inside ExecuteEditorCode?▼

Awaiting a timer, busy-waiting, or loading generated modules inside ExecuteEditorCode can block trace capture or trigger extra filesystem permission prompts. The scheduled setTimeout pattern returns immediately and finishes sessions asynchronously.

What does a 0-byte .pftrace file mean after capture?▼

A 0-byte .pftrace file indicates a failed capture and should be treated as invalid. Non-zero files are the valid capture artifacts; verify sizes with ls -lh or wc -c after waiting slightly longer than durationMs.

Can I analyze the captured .pftrace files afterward?▼

Yes, if the perfetto-trace-analysis skill is installed, use it to analyze the saved .pftrace files. This skill only handles capture; analysis is a separate downstream step.