All skills
vercel-labs avatar

/vercel-optimize

@583754a official
by Vercel Labsvercel-labs/agent-skills32k stars
2,784

Use for Vercel cost and performance optimization on deployed projects, especially Next.js, SvelteKit, Nuxt, and limited Astro apps. Collect Vercel metrics, usage, project config, and code scan results first; investigate only metric-backed candidates; produce ranked recommendations grounded in verified files and version-aware Vercel/framework docs. Trigger for Vercel bill reduction, slow or expensive routes, caching opportunities, Function Invocations, Build Minutes, Fast Data Transfer, Core Web Vitals, Bot Management, Fluid compute, or cost breakdown requests.

Use this Skill: https://skilld.dev/gh/vercel-labs/agent-skills/vercel-optimize

This session only. Nothing lands on disk.

referencesplaybooksmarketing.md

≈669 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Marketing site

Landing pages, lead-capture forms, A/B-tested variants, region-routed homepages. Traffic is bursty (campaigns drive spikes). Bot traffic can be substantial.

Typical billing shape

Edge Requests dominate. Image Optimization is high (hero images, illustrations, product screenshots). Bandwidth matters for video content. Function Duration is usually low — most pages are static or ISR.

Priority patterns

  1. Aggressive caching at the edge. Marketing pages rarely change between campaign updates. Cache-Control: public, s-maxage=86400, stale-while-revalidate=604800 keeps the CDN warm for 24h and stale-serves for a week.
  2. Bot Protection. Marketing campaigns attract competitor scrapers and bot traffic that inflates edge requests without delivering value. If edge cost is > $100/month and Bot Protection is disabled, this is almost always the top platform rec.
  3. ISR for content-driven sections. Customer logos, testimonials, "latest blog post" widgets, pricing tables — anything coming from a CMS. Revalidate hourly or on webhook.
  4. A/B test logic at the edge, not in the page. Edge Middleware for the variant assignment; cached static page per variant. Don't render the variant choice on every request.
  5. Defer all third-party JS post-hydration. Analytics, chat widgets, marketing pixels, cookie banners. None of them block the LCP. Cite vercel-react-best-practices:bundle-defer-third-party.

Frequent gotchas

  • Hero images served at native resolution. A 4MP hero image on every viewport, including mobile. next/image with sizes is mandatory.
  • Cookie banner blocks first paint. GDPR-compliant cookie banners often render synchronously in the head. Defer; render after hydration; persist consent state via a tiny inline script.
  • Tracking pixel waterfalls. Three different analytics services loaded in a chain. Load them after hydration in parallel; better yet, replace some with server-side tracking via webhook.
  • /api/contact is the only function but runs hot. Marketing sites are mostly static but the contact form gets bot-spammed. Rate limit at middleware; consider a queue for outgoing emails.

Cross-references

  • https://vercel.com/docs/bot-management — almost always the right platform rec
  • https://vercel.com/docs/incremental-static-regeneration — for CMS-driven sections
  • https://nextjs.org/docs/app/api-reference/components/image — hero/illustration optimization
  • vercel-react-best-practices:bundle-defer-third-party — defer analytics/pixels
  • https://nextjs.org/docs/app/building-your-application/routing/middleware — A/B variant routing at the edge

Source: SKILL.md on GitHub

No alerts16d3 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The `vercel-optimize` skill is a robust tool designed for performance and cost auditing of Vercel projects. It implements a 'metrics-first' doctrine, ensuring that any code investigation is preceded by an analysis of production telemetry fetched via the official Vercel CLI. The skill demonstrates high security standards, including deterministic gates to limit AI investigation scope, automated redaction of sensitive telemetry identifiers, and a verification framework to prevent hallucinations.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

Signed by skilld at 583754a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 4 months ago
metadata
{
  "version": "1.2.0"
}
  • Nuxt
  • Performance
  • vercel
  • next.js
  • sveltekit
  • astro
  • optimization
  • cost
  • metrics
  • observability

README badge

README badge for vercel-labs/agent-skills/vercel-optimize

Runs a metrics-first audit of Vercel-deployed projects to identify cost and performance optimization opportunities. Collects production metrics, usage, and code signals, then gates candidates by verified impact before investigating Next.js, SvelteKit, Nuxt, and limited Astro apps. Produces ranked recommendations tied to actual route-level performance data and framework-aware documentation.

Generated from the current SKILL.md.

Does this work with my framework?
Vercel Optimize supports Next.js (App Router and Pages Router), SvelteKit, and Nuxt with full metric-backed recommendations. Astro support is limited. Other frameworks like Hono or Remix can run a code-only audit but may not map route-level metrics back to source files.
What do I need to set up before running an audit?
You need Vercel CLI v53+, an authenticated session (`vercel login`), a linked app directory (`vercel link`), and Node.js 20+. Observability Plus is required for route-level metric-backed recommendations.
Does this require Observability Plus?
Observability Plus is required for route-level recommendations. Without it, the skill can still run a limited code-only audit if you accept the reduced scope.
What metrics does this collect and analyze?
The skill collects Vercel production signals via `vercel metrics`, `vercel usage`, and `vercel contract`, then gates investigations based on metric-backed candidates. It analyzes cost (Function Invocations, Build Minutes, Fast Data Transfer), performance (Core Web Vitals), and caching opportunities on a 14-day window.
Can I run this on unsupported frameworks?
Yes, but with limitations. The skill can run a platform/code-only audit for unsupported frameworks and will prompt you to accept the limited scope before proceeding.

Generated from the current SKILL.md. These answers refresh after source changes.