Claude Cursor Skill

optimize-react

Use when a React or Next.js page opens slowly, re-renders too much, ships too much JavaScript, or lags on a click or while scrolling. Measures one route, fixes the main cause and reports the before and after medians. Not for clicking through a flow to check that it works (test-in

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Download heyvhuang-copybook-skills-plugins_skills_skills_optimize-react-c2e4cc2.zip · 3 KB

Install

skills CLI npx skills add https://github.com/Heyvhuang/copybook-skills/tree/main/plugins/skills/skills/optimize-react
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install heyvhuang-copybook-skills@llmmart
Git git clone https://github.com/Heyvhuang/copybook-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole heyvhuang/copybook-skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Speed up React

1. Measure one milestone

Pick one route or action and a user-visible milestone, such as the product list appearing. Use a production build or a fixed preview. Record the build, device profile, fixture, cache state, and measurement method. Run at least three samples per version and record the median.

2. Follow the delay to its cause

Follow the measured delay to its cause:

Evidence First change to try
Requests run in series Start independent reads together and await them at their point of use. Keep auth checks and real data dependencies in order. With streaming, put slow secondary content behind its own Suspense boundary.
Too much script on the first screen Check which imports actually ship. Split large secondary features at their point of use and defer optional third-party scripts. Compare transferred JS and check the delayed feature still opens.
Server work repeats Check for duplicate reads and large serialized props. Deduplicate within the request where possible. Check user and tenant boundaries before sharing a cache across requests.
Typing or clicking feels slow Use the React Profiler or a browser trace to find expensive commits or long tasks. Remove unnecessary derived-state effects or narrow subscriptions before adding memoization.

3. Fix the main cause and measure again

Change the main cause within the requested scope. Run the same measurement again, with the same fixture and cache policy. Check that the original content, permissions, and interactions still work. Report the before/after median, sample count, what changed, and any remaining bottleneck.

See example.md for a timed request waterfall.

Based on vercel-labs/agent-skills (MIT), rewritten by Copybook.

Files (copybook-skills)
  • CHANGES.md 773 B
    Loading…
  • example.md 1.5 KB
    Loading…
  • LICENSE 1.4 KB · in bundle
  • SKILL.md 2.1 KB
    ---
    name: optimize-react
    description: "Use when a React or Next.js page opens slowly, re-renders too much, ships too much JavaScript, or lags on a click or while scrolling. Measures one route, fixes the main cause and reports the before and after medians. Not for clicking through a flow to check that it works (test-in-browser)."
    license: MIT (see LICENSE)
    ---
    
    # Speed up React
    
    ## 1. Measure one milestone
    
    Pick one route or action and a user-visible milestone, such as the product list appearing. Use a production build or a fixed preview. Record the build, device profile, fixture, cache state, and measurement method. Run at least three samples per version and record the median.
    
    ## 2. Follow the delay to its cause
    
    Follow the measured delay to its cause:
    
    | Evidence | First change to try |
    | --- | --- |
    | Requests run in series | Start independent reads together and await them at their point of use. Keep auth checks and real data dependencies in order. With streaming, put slow secondary content behind its own Suspense boundary. |
    | Too much script on the first screen | Check which imports actually ship. Split large secondary features at their point of use and defer optional third-party scripts. Compare transferred JS and check the delayed feature still opens. |
    | Server work repeats | Check for duplicate reads and large serialized props. Deduplicate within the request where possible. Check user and tenant boundaries before sharing a cache across requests. |
    | Typing or clicking feels slow | Use the React Profiler or a browser trace to find expensive commits or long tasks. Remove unnecessary derived-state effects or narrow subscriptions before adding memoization. |
    
    ## 3. Fix the main cause and measure again
    
    Change the main cause within the requested scope. Run the same measurement again, with the same fixture and cache policy. Check that the original content, permissions, and interactions still work. Report the before/after median, sample count, what changed, and any remaining bottleneck.
    
    See [example.md](example.md) for a timed request waterfall.
    
    Based on vercel-labs/agent-skills (MIT), rewritten by Copybook.
    

Comments

Sign in to join the conversation.

No comments yet. Start the conversation.

Reviews (0)

No reviews yet.