Web performance pass

Measure a reproducible bottleneck and improve the relevant render path.

Customize the recipe

0/1500 characters
Workflow boosters

Prompt preview

# Web performance pass

Measure a reproducible bottleneck and improve the relevant render path.

## Deliverable
A scoped performance patch and reproducible before-and-after measurements.

## Stack and visual direction
- Recommended starting stack: Use the existing stack, browser tooling and the project's test commands. Capture before-and-after evidence.
- Minimalism: Use deliberate spacing, a compact palette and a clear typographic hierarchy. Retain the labels, feedback and affordances people need to act. Use this direction for any new or revised UI within the agreed patch scope.

## Tools and setup · Universal
Use the receiving agent’s documented skill and tool mechanisms. Match setup to the agent and workspace you actually have.

Check available tools first. Propose documented project-level setup only when it materially helps and follow the host's permission prompts. If a tool or integration is unavailable, continue with the workflow below using existing tools, local fixtures or a manual check. Keep secrets in the intended configuration environment.

- [React Best Practices](https://github.com/vercel-labs/agent-skills/tree/main/skills/react-best-practices) (Skill) — Review React and Next.js data loading, rendering and bundle behavior.
  Fallback: Inspect the existing render and data-fetch paths and compare a production baseline using the project's available tooling.
- [Lighthouse](https://github.com/GoogleChrome/lighthouse) (Repository) — Capture comparable page performance, SEO and accessibility diagnostics.
- [Sharp](https://github.com/lovell/sharp) (Repository) — Generate appropriately sized derivatives and preserve originals during asset optimization.

## Workflow
1. Identify a representative route, fix the device and network parameters, and compare repeated baseline and after runs. Use traces to target the largest proven bottleneck.
2. Use the simplest implementation that delivers the stated outcome. Follow the user's project constraints and treat the starting stack as a default. Reuse existing work and ask for essential input only when it would change the result. Use realistic labeled sample data when real inputs are unavailable.
3. Run the applicable checks and report what actually passed along with any checks you could not run.

## Acceptance checks
- [ ] Run baseline and patched builds with matching test settings.
- [ ] Verify the affected user flow still works and report any tradeoffs and variance.
- [ ] Walk the primary journey with keyboard only. Check visible focus, logical order, accessible names, readable contrast, zoom and reduced motion. Use axe where available and manually check behavior that automation cannot assess.
- [ ] Capture a reproducible baseline, validate the changed flow afterward, and report evidence and any findings still open.

Recipe resources

Source, setup, and compatibility details.