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.

referencesplaybooksREADME.md

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

Playbooks

Application-profile-specific advice that shapes how recommendations are phrased and ordered. Playbooks never invent claims — every rec still traces to a verified candidate or finding. They tell the recommender what to emphasize when a project matches a profile.

How a playbook gets applied

  1. Step 1 detects the project's stack + dependencies.
  2. The recommender heuristics infer an application profile (best guess from frameworks + dep signals).
  3. The matching playbook(s) are included in the recommender's context.
  4. Recommendations are shaped: ordering tilts toward the profile's priority list; phrasing nods to profile-specific concerns.

Profile detection (best-effort heuristics)

Signals → Profile
@vercel/sandbox, @ai-sdk/*, ai, openai, @anthropic-ai/sdk deps OR AI Gateway / Sandbox SKU active in usage.services ai-application
stripe, @shopify/*, react-stripe-js, "cart"/"checkout" routes ecommerce
next-auth, clerk, dashboard routes, multi-tenant headers saas
Only pages/api/** or app/api/**, no UI routes api-service
Heavy MDX / markdown, mostly static routes content-site
Lots of /(marketing)/ route groups, A/B test deps marketing

ai-application is checked first — AI-shaped customers often share routes with SaaS/ecommerce surfaces, but the billing shape (AI Gateway dominant) and remediation set (provider failover, sandbox reuse, OIDC keyless) belong to this profile.

When detection is uncertain, no playbook is applied. The recommender works fine without one — the playbook is a tilt, not a requirement.

Playbook schema

Each playbook is a Markdown file with a fixed shape so the recommender can parse it reliably. Required sections:

# {Profile name}

## Typical billing shape
(Which dimensions dominate — e.g., "Edge Requests > Function Duration > Image Optimization")

## Priority patterns
(Ordered list of patterns this profile particularly benefits from)

## Frequent gotchas
(Anti-patterns specific to this profile)

## Cross-references
(Rec IDs from recommendations.md or rule names from vercel-react-best-practices)

Contributing a new playbook

  1. Identify a clear application profile and one or two representative project profiles that exemplify it.
  2. Create references/playbooks/<profile>.md matching the schema.
  3. Add detection signals to the table above (the heuristics live in the recommender code; document them here).
  4. Update the playbook selection matrix in references/scoring.md.
  5. Run node --test packages/vercel-optimize-tests/test/support-topics.test.mjs packages/vercel-optimize-tests/test/investigation-brief.test.mjs. No tests directly cover playbooks (they're content), but the schema validator runs in CI.

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.