Unverified Commit b22e5a29 authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

Rename skill to next-bundle-optimizer and document its usage (#99731)

## Summary

Rename `next-browser-initial-load-optimizer` to `next-bundle-optimizer`
and update the skill directory, metadata, links, and install commands.

Document how to use the skill with Turbopack's bundle analyzer, with
prompts for audits, fixes, and route-specific optimization.

## Verification

- Prettier passed for the skill and both guides.
- Runtime tests not run (docs and skill rename only).

<!-- NEXT_JS_LLM -->
parent 74dc549c
...@@ -191,14 +191,22 @@ Then give the agent this prompt: ...@@ -191,14 +191,22 @@ Then give the agent this prompt:
After every edit, verify the page still works at runtime using the next-dev-loop Skill. After every edit, verify the page still works at runtime using the next-dev-loop Skill.
``` ```
### `next-browser-initial-load-optimizer` ### `next-bundle-optimizer`
For slow route startup, oversized client bundles, duplicate browser dependencies, or features that can wait for interaction, use [`next-browser-initial-load-optimizer`](https://www.skills.sh/vercel/next.js/next-browser-initial-load-optimizer). It audits a route by default; explicitly request fixes to enter its edit, measure, and verify loop. The [`next-bundle-optimizer`](https://www.skills.sh/vercel/next.js/next-bundle-optimizer) uses Turbopack's bundle analyzer to identify sources of large client-side bundles that impact your site's initial load performance.
```bash filename="Terminal" ```bash filename="Terminal"
npx skills add vercel/next.js --skill next-browser-initial-load-optimizer npx skills add vercel/next.js --skill next-bundle-optimizer
``` ```
In audit-only mode, it produces a report without making any changes:
```prompt
Use the next-bundle-optimizer skill to produce a report of the initial load performance of this site.
```
You can also tell your agent to fix any issues, and it will optimize your site based on its findings. Or have it focus on a specific route by providing the route in the prompt.
### `next-cache-components-adoption` ### `next-cache-components-adoption`
The [`next-cache-components-adoption`](https://www.skills.sh/vercel/next.js/next-cache-components-adoption) Skill migrates an app to [Cache Components](/docs/app/getting-started/caching): The [`next-cache-components-adoption`](https://www.skills.sh/vercel/next.js/next-cache-components-adoption) Skill migrates an app to [Cache Components](/docs/app/getting-started/caching):
......
...@@ -98,6 +98,24 @@ cp -r .next/diagnostics/analyze ./analyze-before-refactor ...@@ -98,6 +98,24 @@ cp -r .next/diagnostics/analyze ./analyze-before-refactor
> More options are available for the Bundle Analyzer, see Next.js CLI reference docs for the full list. > More options are available for the Bundle Analyzer, see Next.js CLI reference docs for the full list.
### Give your AI agent access to the bundle analyzer
The [`next-bundle-optimizer`](https://www.skills.sh/vercel/next.js/next-bundle-optimizer) gives your AI agent access to the data powering Turbopack's bundle analyzer to automatically identify sources of large client-side bundles that impact your site's initial load performance.
First, install the skill:
```bash filename="Terminal"
npx skills add vercel/next.js --skill next-bundle-optimizer
```
Then prompt your agent. In audit-only mode, it produces a report without making any changes:
```prompt
Use the next-bundle-optimizer skill to produce a report of the initial load performance of this site.
```
You can also tell your agent to fix any issues, and it will optimize your site based on its findings. Or have it focus on a specific route by providing the route in the prompt.
## `@next/bundle-analyzer` for Webpack ## `@next/bundle-analyzer` for Webpack
The [`@next/bundle-analyzer`](https://www.npmjs.com/package/@next/bundle-analyzer) is a plugin that helps you manage the size of your application bundles. It generates a visual report of the size of each package and their dependencies. You can use the information to remove large dependencies, split, or [lazy-load](/docs/app/guides/lazy-loading) your code. The [`@next/bundle-analyzer`](https://www.npmjs.com/package/@next/bundle-analyzer) is a plugin that helps you manage the size of your application bundles. It generates a visual report of the size of each package and their dependencies. You can use the information to remove large dependencies, split, or [lazy-load](/docs/app/guides/lazy-loading) your code.
......
--- ---
name: next-browser-initial-load-optimizer name: next-bundle-optimizer
description: > description: >
Audit and reduce Next.js browser initial-load work. Use for slow route startup, Audit and reduce Next.js browser initial-load work. Use for slow route startup,
oversized client bundles, duplicate browser dependencies, or features that can oversized client bundles, duplicate browser dependencies, or features that can
wait for interaction. wait for interaction.
--- ---
# Browser initial-load optimizer # Bundle optimizer
## 1. Set the scope ## 1. Set the scope
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment