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.

README.md

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

vercel-optimize

Optimize cost and performance for supported projects on Vercel.

This skill uses Vercel metrics to find high-impact improvements in your app. Every recommendation is backed by observed data, scoped code evidence, and version-aware docs.

skills.sh

Install

Install just this skill:

npx skills add vercel-labs/agent-skills --skill vercel-optimize

Manual install: copy skills/vercel-optimize into .agents/skills/vercel-optimize and reference SKILL.md from your project AGENTS.md.

Requirements

  • Node.js 20+
  • Vercel CLI with vercel metrics, vercel usage, vercel contract, and vercel api support (npm i -g vercel@latest). The skill enforces v53+ as its compatibility floor.
  • Authenticated Vercel CLI session (vercel login)
  • Linked Vercel project directory (vercel link) for route metrics. VERCEL_PROJECT_ID can resolve project config, but it does not replace directory linkage for vercel metrics. The project must resolve to a CLI-safe team or personal scope so vercel metrics, vercel usage, and vercel contract all run against the same account.
  • Observability Plus for metric-backed route ranking
  • Code-backed recommendation coverage is strongest for Next.js and SvelteKit, supported for Nuxt route mapping with generic checks, and limited for Astro. Hono, Remix, and unknown frameworks pause up front.

If route-level metrics are unavailable, the skill pauses before scanner-only mode. Scanner-only can catch traffic-independent code issues, but it cannot rank hot routes or prove cost impact.

Use

From the Vercel project directory, ask your coding agent:

optimize this Vercel project

The agent should collect metrics first. If it starts by reading source files or guessing from vercel.json, the skill was not loaded correctly.

Roadmap

Attribute Status
Route-level Vercel Function invocations, duration, TTFB, and cold starts Supported
Vercel Function CPU, memory, and GB-hours Supported
Request volume, cache hit rate, HTTP status, and method distribution Supported
Fast Data Transfer and bot traffic patterns Supported
ISR reads, writes, and over-revalidation Supported
Routing Middleware volume and duration Supported
External API latency, volume, and transfer bytes Supported
Core Web Vitals from Speed Insights Supported
Image Optimization usage, source hosts, and source bytes Supported
Build Minutes fan-out Supported
Usage spikes by billing service Supported
Bot Protection and BotID configuration Supported
Fluid Compute configuration and compute signals Supported
Region pinning and project configuration mismatches Supported
Observability Events cost attribution Supported
Route-to-file recommendations for Next.js and SvelteKit Supported
Nuxt route mapping with generic/platform checks Supported
Generic route mapping and platform checks for Astro Supported
Hono route-to-file mapping Planned
Remix route-to-file mapping Planned
AI Gateway usage and cost optimization Planned
Sandbox usage and cost optimization Planned
Blob, Edge Config, Runtime Cache, Workflows, Queues, Flags, and Microfrontends billing dimensions Planned

What You Get

  • Ranked recommendations tied to observed Vercel metrics
  • Specific route and file references when source changes are justified
  • Before/after code for ready recommendations
  • Citations from a curated, version-aware documentation allow-list
  • Held-back findings when evidence is real but not strong enough for a recommendation
  • A concise final message plus a full Markdown report

Trust Model

  • Metrics come first. Code investigation starts only after signals are collected.
  • Gates are deterministic JavaScript thresholds. No LLM decides whether a metric qualifies.
  • Citations are allow-listed. Unknown URLs and version-mismatched framework docs are stripped.
  • Project config contradictions are rejected. For example, the verifier blocks "enable Fluid Compute" when Fluid Compute is already on.
  • Cost impact uses magnitude framing, not invented exact savings.

Contributing

See CONTRIBUTING.md. New gates, scanners, playbooks, citations, and sanitizers need fixture coverage in packages/vercel-optimize-tests.

License

MIT

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.