Skills / web-performance
web-performance
Keep a Next.js site fast while building or changing pages, components, images, fonts and animation, and check each route's JavaScript against a budget. Use when adding or editing pages, media or motion in a Next.js App Router project, or when asked to speed a site up. Do not use for backend-only work, non-Next.js stacks or visual design decisions.
- Author
- agentsaisle
- Latest
- v1.0.0
- Aisle
- web, performance
- Works with
- Claude Code, Codex, Cursor
- Source
- HazemSalah29/agentsaisle
- Stars
- 2
Install
Install web-performance
npx @agentsaisle/cli add web-performanceInstalls into your project's skills folder. Add --global to install it for every project.
Runs scriptsThis skill includes scripts
Your agent may run these scripts on your machine. A maintainer has read every one in full, and the CLI lists the files when you install. You can read them on GitHub first.
Read the files on GitHubAudit
- Critical
- 0
- High
- 0
- Medium
- 1
- Low
- 0
6 files · audited 2026-10-29 · rules 1.0.0
MediumAA-P02Can write files and run interpreters without disable-model-invocation
SKILL.md:6
Read Grep Glob Edit Write Bash(node *) Bash(npm run *) Bash(pnpm *) Bash(yarn *) Bash(bun *)Why The agent may load this skill on its own and then write files and run code in one go.
Fix Set disable-model-invocation: true so the user starts it, or narrow the Bash patterns.
What this skill can use
Tools
- Read
- Grep
- Glob
- Edit
- Write
- Bash(node *)
- Bash(npm run *)
- Bash(pnpm *)
- Bash(yarn *)
- Bash(bun *)
Scripts
- scripts/perf-budget.mjs
Domains mentioned
None
Automated checks found the patterns listed here. An audit reduces risk; it is not a guarantee of safety. How audits work · Read the rules
Show this grade in a README
The badge updates when the registry is rebuilt. Paste this Markdown into the README:
[](https://agentsaisle-vercel.vercel.app/skills/web-performance)SKILL.md
Rendered from commit 4036c95
Web performance
Use when
- You add or change pages, components, images, fonts or animation in a Next.js App Router project.
- The user asks to make a page faster, smaller or smoother.
- A build is about to be called done.
Don't use when
- The work is backend-only, or the project does not use Next.js.
- The question is about how something should look, not how fast it is.
Targets
- Largest Contentful Paint under 2.5 s, Cumulative Layout Shift under 0.1, Interaction to Next Paint under 200 ms.
- First-load JavaScript per route within the budget in
perf.config.json(default 180 kB gzip). Create that file to setbudgetKb, per-route limits inroutes, or routes to skip inignore.
Rules
- Server Components by default. Add
"use client"only to the small leaf that needs state or browser APIs, never to a whole page for convenience. - Images through
next/imagewith dimensions and a correctsizes;priorityonly on the largest above-the-fold image. Seereferences/images-fonts.md. - Fonts through
next/font, two families at most, only the weights in use. - Animate only
transformandopacity. Reserve space so nothing shifts. Seereferences/animation-performance.md. - Lazy-load below the fold:
next/dynamicfor heavy client components, lazy images and iframes,preload="none"video with a poster. - No request waterfalls. Start independent fetches together (
Promise.all) and stream slow parts with Suspense instead of blocking the page on them. - Mind every dependency. Before adding a client-side library, check what it costs; prefer a native API or a smaller library. Import only the functions you use.
- Memoize only measured hot paths.
useMemoandmemoeverywhere add cost and noise.
Steps
- Read the page or component you are changing and its imports; search for similar patterns before inventing one.
- Apply the rules. Open a reference file only for the area you touch (motion, or images and fonts).
- Build for production with the project's build script.
- Run
node <this skill's folder>/scripts/perf-budget.mjs. It reads the build output and prints only routes over budget. - If a route is over budget, find what it pulls in (client components, heavy imports), fix the biggest one first, rebuild and run the check again.
Budget
- Search first (grep, glob, symbol search). Read line ranges, not whole files.
- Read at most 8 files per step. If you need more, write down what you learned and narrow the question.
- Do not re-read a file you just wrote or edited.
- Prefer the smallest command output that answers the question: head, tail, quiet flags, filtered lists.
- Never read files inside
.next/yourself; the script summarizes them.
Output
- Changed files, and the result line from the budget check, for example
perf-budget: 9 routes within budget (180 kB gzip). - Any rule you broke on purpose, with the reason.
Done when
perf-budget.mjsexits 0 on a fresh production build.- Images have dimensions and the hero image has
priority; fonts come fromnext/font. - Nothing you added animates
width,height,toporleft, and reduced-motion users get no movement.
Version history
| Version | Commit | Install |
|---|---|---|
| 1.0.0latest | 4036c95 | add web-performance |