specs-lens-perf-optimize

Applies and validates Lens Studio performance fixes from attribution output on a new git branch.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Pillow, and includes scripts (resource) and references (resource) components.

What problem does it solve? After profiling a Lens Studio project, developers still face the slow, error-prone work of applying each performance recommendation by hand, verifying it did not break visuals, and measuring whether it actually helped. This Skill automates that loop: it consumes the ranked output of /specs-lens-perf-attribution and iteratively applies, validates, and commits or reverts each fix. ## Core Features & Use Cases - Iterative optimization loop: Dispatches a worker per ranked recommendation, applies the fix, checks visual parity (SSIM + histogram cosine) and experiential markers, re-measures with Perfetto, then commits kept fixes or auto-reverts regressions. - Safe git workflow: Always works on a new branch forked from the current HEAD, one commit per kept fix, never pushes, and hard-stops on a dirty tree, MCP failure, or three consecutive reverts. - Configurable stop conditions: Supports max-iterations, target ms/frame, cumulative improvement targets, wall-clock budgets, and minimum predicted-delta filtering. - Use Case: After running /specs-lens-perf-attribution on a Lens that misses its frame budget, invoke this Skill with the attribution directory to automatically halve VFX spawn rates, throttle update loops, and gate tracking — ending with a branch of measured commits and a report tying each commit to its ms/frame gain and parity score. ## Quick Start Run /specs-lens-perf-optimize with attribution-dir pointing at the output directory from /specs-lens-perf-attribution to start the iterative optimization loop.

Frequently Asked Questions about specs-lens-perf-optimize

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

FAQPage Schema
How do I automatically optimize Lens Studio performance after profiling?

Run /specs-lens-perf-attribution first to produce an attribution directory, then invoke /specs-lens-perf-optimize with attribution-dir pointing at it. The skill applies each ranked fix, verifies visual parity and re-measures with Perfetto, committing kept fixes on a new branch.

How does the skill decide whether to keep or revert a performance fix?

A fix is kept only if all gates pass: per-marker SSIM at or above 0.92 (hard floor 0.85), histogram cosine at or above 0.97, all harness markers present and within 25% arrival tolerance, and measured delta at least 50% of the predicted improvement. Any failure triggers an automatic revert.

What do I need before running Lens performance optimization?

You need a clean git working tree, an attribution directory from /specs-lens-perf-attribution containing optimization_candidates.md and the CSV/JSON metrics, the PerfAttributionHarness script installed in the project, MCP connectivity, and a resolvable Perfetto trace processor.

Does the optimization skill commit directly to my current branch?

No. It always creates a new branch forked from the current HEAD, makes one commit per kept fix plus harness setup and cleanup commits, and never pushes. You review the branch and push it yourself.

Why did the optimization run stop after three reverts?

Three consecutive reverts indicate the recipe library has drifted from your project, so the skill hard-stops rather than wasting iterations. The final report lists the failing candidate IDs so you can investigate the mismatched recipes.

Can I limit how long the optimization loop runs?

Yes. Use max-iterations (default 12), wall-clock-budget-min (default 90), target-ms-per-frame, or improvement-target-ms to stop the loop. Soft stops let the in-flight iteration finish and still run the closing full-sweep and report.