benchflow-ai/skillsbench/browser-testing
- community
Checking that the SKILL.md file is still in the repository.
VERIFY your changes work. Measure CLS, detect theme flicker, test visual stability, check performance. Use BEFORE and AFTER making changes to confirm fixes. Includes ready-to-run scripts: measure-cls.ts, detect-flicker.ts
Install
npx vskill@latest install benchflow-ai/skillsbench/browser-testingSKILL.md
Performance Measurement with Playwright CDP
Diagnose performance issues by measuring actual load times and network activity.
Playwright is pre-installed. Just use the measurement script.
Quick Start
A measure.ts script is included in this skill's directory. Find it and run:
The script is in the same directory as this SKILL.md file.
Understanding the Output
The script outputs JSON with:
Reading the Waterfall
The requests array shows network timing. Look for sequential patterns:
Key Metrics
| Metric | What it means | Red flag | |
|---|---|---|---|
totalMs | Total page load time | > 1000ms | |
JSHeapUsedSize | Memory used by JS | Growing over time | |
LayoutCount | Layout recalculations | > 50 per page | |
ScriptDuration | Time in JS execution | > 0.5s |
What to Look For
| Symptom | Likely Cause | Fix | |
|---|---|---|---|
| Requests in sequence | Sequential await statements | Use Promise.all() | |
| Same URL requested twice | Fetch before cache check | Check cache first | |
| Long time before response starts | Blocking operation before sending | Make it async/non-blocking | |
| High LayoutCount | Components re-rendering | Add React.memo, useMemo |
Measuring API Endpoints Directly
For quick API timing without browser overhead:
How the Measurement Script Works
The script uses Chrome DevTools Protocol (CDP) to intercept browser internals:
- Network.requestWillBeSent - Event fired when request starts, we record timestamp
- Network.responseReceived - Event fired when response arrives, we calculate duration
- Performance.getMetrics - Returns Chrome's internal counters (memory, layout, script time)
This gives you the same data as Chrome DevTools Network tab, but programmatically.
Visual Stability Measurement
Measure CLS (Cumulative Layout Shift)
Output:
CLS Thresholds
| CLS Score | Rating | Action | |
|---|---|---|---|
| < 0.1 | Good | No action needed | |
| 0.1 - 0.25 | Needs Improvement | Review shift sources | |
| > 0.25 | Poor | Fix immediately |
Detect Theme Flicker
Detects if dark theme flashes white before loading. Sets localStorage theme before navigation and checks background color at first paint.
Accurate CLS Measurement
CLS only measures shifts within the viewport. Content that loads below the fold doesn't contribute until you scroll. For accurate measurement:
Recommended testing sequence:
- Load page
- Wait 3 seconds (let late-loading content appear)
- Scroll to bottom
- Wait 2 seconds
- Trigger 1-2 UI actions (theme toggle, filter click, etc.)
- Wait 2 seconds
- Read final CLS
Why measurements vary:
- Production vs development builds have different timing
- Viewport size affects what's "in view" during shifts
- setTimeout delays vary slightly between runs
- Network conditions affect when content loads
The relative difference (before/after fix) matters more than absolute values.
Common CLS Causes
| Shift Source | Likely Cause | Fix | |
|---|---|---|---|
<img> elements | Missing width/height | Add dimensions or use next/image | |
| Theme wrapper | Hydration flicker | Use inline script before React | |
| Skeleton loaders | Size mismatch | Match skeleton to final content size | |
| Dynamic banners | No reserved space | Add min-height to container | |
| Late-loading sidebars | Content appears and pushes main content | Reserve space with CSS or show placeholder | |
| Pagination/results bars | UI element appears after data loads | Show immediately with loading state | |
| Font loading | Custom fonts cause text reflow | Use font-display: swap or preload fonts |
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 repositoryCheckingtasks/fix-visual-stability/environment/skills/browser-testing/SKILL.md
Popularity
- Repository stars
- 1,474
- Repository forks
- 325
- 7-day trend score
- 36
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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/benchflow-ai/skillsbench/browser-testing)