skills/thrash-report-analyzer/SKILL.md
Analyze a bye-thrash layout thrashing report array. Parses stack traces, identifies user-code functions causing forced reflows, locates the offending style-write → layout-read pairs in source files, and produces a structured fix-suggestion report.
npx skillsauth add joyco-studio/skills thrash-report-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze a bye-thrash report and produce actionable fix suggestions for every layout thrashing instance found.
/thrash-report-analyzer <path-to-report.json>
The argument is the absolute path to a JSON file containing the bye-thrash report array. If no file path is provided, ask the user to paste the report JSON directly.
Each entry in the report array has at minimum:
prop — the layout property that was read (e.g. offsetWidth, clientHeight)count — how many times this thrash was observedstack — a JavaScript call stack string captured at the moment of the layout readFollow these steps in order for each entry in the report.
Split the stack string into individual frames. For each frame, extract:
<anonymous>)Ignore frames from:
bye-thrash internals — any frame containing Thrash.onLayoutRead, onRead, or anonymous wrappers from the library's property patchesexecuteDispatch, processDispatchQueue, batchedUpdates, dispatchEvent, commitRoot, performSyncWorkOnRoot, renderRootSync, workLoop, and similar scheduler/reconciler framesnext/dist, webpack-internal, turbopack, or __nextWalk the filtered frames top-to-bottom. The first frame whose source file is inside the project (not in node_modules, .next, or dist) is the user-code function responsible for the thrash.
Record:
Use Grep to locate the function definition. Search .tsx, .ts, .jsx, .js files. Exclude node_modules, .next, and dist directories.
If the function name is generic (e.g. onClick, handleResize), use the source file path from the stack trace to narrow the search.
Read the source file around the identified line. Look for:
Style writes (any of these before the read):
el.style.* assignmentsclassList.add(), classList.remove(), classList.toggle(), classList.replace()setAttribute('style', ...) or setAttribute('class', ...)className assignmentinnerHTML or textContent assignment (these invalidate layout)insertBefore, appendChild, removeChild, replaceChildLayout reads (the property from the report's prop field):
offsetWidth, offsetHeight, offsetTop, offsetLeft, clientWidth, clientHeight, clientTop, clientLeftscrollTop, scrollLeft, scrollWidth, scrollHeightgetComputedStyle(), currentStylegetBoundingClientRect()innerText, focus(), scrollTo(), scrollBy(), scrollIntoView()Choose the appropriate fix strategy:
| Scenario | Fix |
|----------|-----|
| Read is only used for comparison/logging | Move the read before the write |
| Read feeds into the write value | Cache the read before the write, or use requestAnimationFrame to defer the write |
| Multiple elements written then read in a loop | Batch all reads first, then batch all writes |
| Write is visual-only and read can be deferred | Wrap the read in requestAnimationFrame |
| Pattern is in a resize/scroll handler | Debounce or throttle the handler; use ResizeObserver instead |
Output findings in this format for each entry:
### Entry: `{prop}` (count: {count})
- **Source file:** `path/to/file.tsx`
- **Function:** `functionName` (line X)
- **Write:** `el.style.fontSize = '24px'` (line Y)
- **Read:** `window.getComputedStyle(el).fontSize` (line Z)
- **Fix suggestion:** [brief actionable suggestion]
After all entries, add a Summary section:
## Summary
- **Total thrash instances:** N
- **Unique locations:** M
- **Most frequent:** `prop` in `functionName` (K occurrences)
- **Highest impact fix:** [which fix would eliminate the most thrash instances]
requestAnimationFrame.tools
Add sound effects, UI audio, and ambient sound to a web app using the @joycostudio/suno library. Use when the user wants to play audio on button clicks, hover states, game events, or ambient loops, and when they mention @joycostudio/suno, Suno, AudioSource, Voice, or Mixer.
tools
Analyze a Chrome DevTools Performance trace JSON file for performance anomalies, producing a structured audit report with critical issues, warnings, metrics, timeline hotspots, and actionable recommendations.
development
Author or refactor a skill in this repo. Use when the user asks to "create a skill", "write a skill", "add a new skill", "document this as a skill", or to restructure an existing SKILL.md (split it up, slim it down, fix the frontmatter). Covers frontmatter conventions, file layout, and the rule for splitting deep reference material into linked docs instead of bloating SKILL.md.
data-ai
Diagnose and resolve git conflicts of any kind — merge, rebase, cherry-pick, stash, revert. Use this skill EVERY time conflicts appear during work, or whenever the user mentions merge conflicts, rebase conflicts, conflict markers, "both modified" files, a failed or conflicted git pull, or asks to "fix conflicts". Use it even when the resolution looks obvious — many conflicts are phantom artifacts of squash merges or rewritten upstream history, and the correct fix is a different git strategy (e.g. git rebase --onto), not editing conflict markers.