measure-react-renders
Skill246 starsChanged 5 months agoMITView on GitHub
Compare React component render counts between origin/main and the current branch during a user-defined UI scenario (e.g. panel resize, navigation). Use when verifying that performance changes actually reduced re-renders.
- Installs packages
In this repository23 other files it gives its agents.
- openhost-agent/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- address-commentsSkill
- auto-qa-changesSkill
- auto-qa-iphoneSkill
- batch-claude-runnerSkill
- code-review-checklistSkill
- cut-releaseSkill
- debug-integration-testSkill
- frontend-design-tokensSkill
- manually-qa-branchSkill
- openhost-frontend-previewSkill
- openhost-sculptorSkill
- post-pr-to-slackSkill
- profile-sculptor-backendSkill
- promote-releaseSkill
- run-integration-testSkill
- storybook-screenshotSkill
- update-help-docsSkill
- update-review-rulesSkill
- update-specsSkill
- write-integration-testSkill
- write-release-notesSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
If the user provides one, use it.
- Very specific: line 44
Use --skip-build if frontends are already built.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Render Performance Comparison
Step 1: Create the baseline worktree
git fetch origin main
git worktree add /tmp/sculptor_baseline origin/main
cd /tmp/sculptor_baseline/sculptor/frontend && npm install --silentStep 2: Write the scenario file
If the user provides one, use it. Otherwise write a Python file exporting:
DESCRIPTION: str— what is being measuredTARGET_COMPONENTS: list[str]— component names to highlightsetup(page, base_url, workspace_id, task_id)— navigate + waitaction(page)— perform the action to measure
Component names must be unminified source names (e.g. SplittableSectionComponent
for the memo-wrapped SplittableSection export, AlphaChatInterface if not wrapped).
See scenarios/panel_resize.py for an example.
Step 3: Run the comparison
uv run --project sculptor python \
.claude/skills/measure-react-renders/scripts/perf_compare.py \
--baseline-dir /tmp/sculptor_baseline \
--current-dir "$(pwd)" \
--scenario path/to/scenario.pyUse --skip-build if frontends are already built.
The script builds both frontends with --minify false (preserves component
names), starts two isolated backends, injects __REACT_DEVTOOLS_GLOBAL_HOOK__
via Playwright's addInitScript before React loads, runs the scenario, and
prints a comparison table.
Step 4: Cleanup
git worktree remove /tmp/sculptor_baselineScenario example
import time
DESCRIPTION = "Section resize render cascade"
TARGET_COMPONENTS = ["AlphaChatInterface", "SectionGrid", "SplittableSectionComponent"]
def setup(page, base_url, workspace_id, task_id):
page.goto(f"{base_url}/#/ws/{workspace_id}/agent/{task_id}")
page.wait_for_load_state("networkidle")
time.sleep(5)
def action(page):
handles = page.locator('[role="separator"]').all()
handle = handles[-1]
handle.focus()
time.sleep(0.3)
for _ in range(5):
page.keyboard.press("ArrowLeft")
time.sleep(0.15)
for _ in range(5):
page.keyboard.press("ArrowRight")
time.sleep(0.15)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

