vercel-optimize 是什么?
vercel-optimize 是Vercel部署的观测优先审查流程:先收集生产指标、usage、合同与工程扫描信号,通过确定性筛选选出值得调查的对象,再核对限定文件与版本文档,输出按证据排序的建议。它不从全仓grep猜哪些路由最贵。
中文说明由本站依据来源整理;英文原文保留在页面下方。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
vercel-optimize,然后按本页使用示例提供材料。
展开并复制给 Codex 的安装指令
安装并检查 vercel-optimize
请在 Codex 的当前工作环境中安装并检查 vercel-optimize 这个 Skill。
项目身份:vercel-labs/agent-skills / vercel-optimize
来源:https://github.com/vercel-labs/agent-skills/blob/1a2c79d4e6c4a2283dc2c614b6538cbe1ed5ca62/skills/vercel-optimize/SKILL.md
已定位的源文件:skills/vercel-optimize/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 vercel-optimize
请在 Claude Code 的当前工作环境中安装并检查 vercel-optimize 这个 Skill。
项目身份:vercel-labs/agent-skills / vercel-optimize
来源:https://github.com/vercel-labs/agent-skills/blob/1a2c79d4e6c4a2283dc2c614b6538cbe1ed5ca62/skills/vercel-optimize/SKILL.md
已定位的源文件:skills/vercel-optimize/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 vercel-optimize
请在 Cursor Agent 的当前工作环境中安装并检查 vercel-optimize 这个 Skill。
项目身份:vercel-labs/agent-skills / vercel-optimize
来源:https://github.com/vercel-labs/agent-skills/blob/1a2c79d4e6c4a2283dc2c614b6538cbe1ed5ca62/skills/vercel-optimize/SKILL.md
已定位的源文件:skills/vercel-optimize/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 vercel-optimize
请在 当前 Agent 的当前工作环境中安装并检查 vercel-optimize 这个 Skill。
项目身份:vercel-labs/agent-skills / vercel-optimize
来源:https://github.com/vercel-labs/agent-skills/blob/1a2c79d4e6c4a2283dc2c614b6538cbe1ed5ca62/skills/vercel-optimize/SKILL.md
已定位的源文件:skills/vercel-optimize/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。装好以后,具体怎么用?
准备哪些材料
- 需要Node20+、Vercel CLI53+、已认证且关联正确scope的应用。路由级建议依赖可用Observability Plus;Next.js/SvelteKit/Nuxt支持较完整,Astro有限,其他框架需先接受受限范围。
会得到什么
- 有指标与源码/版本依据的优化报告,包含实际调查范围与未调查项。
实际使用顺序
- 在新run目录收集vercel-signals与codebase,再合并为signals.json;stdout JSON与stderr分开。先处理项目/scope不明、权限、配额或观测不可用的问题。
- 运行gate-investigations选择候选并查看budget-summary;需要扩大调查时按实际范围选择,不无声退成代码审查。
- 执行deep-dive与reconcile,将指标不匹配、错误风暴或发布回归等转换为适当观察,再为每条候选生成限定文件与引用的调查brief。
- 收集逐条输出,使用verify-and-regen核查文件、引用、版本和不安全缓存建议;由render-report生成报告,区分建议、观察、无修改建议与本次未调查项。
从一个具体任务开始
本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。
复制一个具体任务
教学示例:请用vercel-optimize检查我已关联的Next.js项目最近14天费用与慢路由。先核对项目/team并收集signals,再调查有指标支持的候选;没有Observability Plus或流量不足时先说明可完成的范围,不先全仓改缓存。预期建议可追溯到同一scope的真实指标;本站未读取Vercel账户数据。
使用条件与边界
- 没有足够流量不能给出可靠路由优先级;代码扫描不能冒充生产使用证据。
- 流式/SSE或Workflow的长墙钟时间本身不能证明浪费,需要额外CPU、重复调用或首字节前工作证据。
- 涉及权限、地域和用户状态的响应不能为了缓存命中率盲目变为共享缓存。
常见问题
能直接算出每月节省多少钱吗?
该流程要求按观测证据解释成本量级,不对客户输出未经验证的固定节省金额;项目流量与合同条件会影响实际结果。
来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
- 中文使用说明
- 已针对下方源文件版本整理用途、用法和常见问题
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料
skills/vercel-optimize/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
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.
查看源文件章节 / Source sections
- 原文:Vercel Optimize
- 前置条件 / Prerequisites
- 原文:Framework Support
- 原文:Run Directory
- 原文:Pipeline
- 原文:1. Collect, scan, and merge signals
- 原文:1.1 Stop on blockers
- 原文:2. Gate candidates
- 原文:2.1 Ask about audit scope when needed
- 原文:2.2 Deep-dive and reconcile
- 原文:2.3 Generate briefs and investigate
- 原文:2.4 Collect outputs
- 原文:3. Verify recommendations
- 原文:4. Render report and final message
- 原文:Recommendation Rules
- 原文:Scanner Rules
- 原文:Final Customer Terms
- 原文:Failure Copy
原文:Vercel Optimize
Run an observability-first Vercel optimization audit. Do not inspect source files until `signals.json` exists and a deterministic gate points to a route, file, or project setting. Core doctrine: read [references/doctrine.md](references/doctrine.md) if any rule is unclear. - Metrics first. Recommendations start from Vercel production signals, not repo-wide grep. - Deterministic gates. `scripts/gate-investigations.mjs` decides what deserves investigation. - Candidate-bound scope. Read only files named by a candidate or a route-local import chain. - Version-aware citations. Use only `references/docs-library.json`; invalid or version-mismatched citations are stripped. - Customer copy. Read [references/voice.md](references/voice.md) before writing report text or chat output.
前置条件 / Prerequisites
- Vercel CLI v53+ with `vercel metrics`, `vercel usage`, `vercel contract`, and `vercel api`. - Authenticated CLI session: `vercel login`. - Linked app directory: `vercel link`. `VERCEL_PROJECT_ID` can help resolve project config, but `vercel metrics` still requires directory linkage. The link or environment must include the intended project org/team/user scope so the collector can resolve a CLI-safe `--scope` and keep `vercel metrics`, `vercel usage`, and `vercel contract` on the same account. - Node.js 20+. - Observability Plus for route-level metric-backed recommendations. Never put auth tokens in shell commands. Do not type `VERCEL_TOKEN=...`, `--token ...`, or `Authorization: Bearer ...` into commands that may be echoed in chat.
原文:Framework Support
The preflight reads `package.json` and sets expectations before metric fan-out. | Framework | Status | Notes | |---|---|---| | Next.js App Router | supported | strongest route mapping, scanners, playbooks, citations | | Next.js Pages Router | supported | scoped to Pages Router idioms when detected | | SvelteKit | supported | route mapping for `src/routes` files and SvelteKit scanner | | Nuxt | supported | route mapping plus generic/platform checks; fewer framework-specific recs | | Astro | limited | route mapping plus generic checks; fewer framework-specific recs | | Hono / Remix / unknown | blocked by default | continue only if the user accepts a limited platform/code-only audit | If unsupported, stop and ask before scanning or gating: ```text This project uses <framework>. Vercel Optimize supports metric-backed code recommendations for Next.js, SvelteKit, and Nuxt. Astro support is limited. For <framework>, I can still run a limited platform/scanner audit, but route-level Vercel metrics may not map back to source files. Do you want me to continue with the limited audit, or stop here? ``` If the user continues, rerun collection with `--continue-unsupported-framework`.
原文:Run Directory
Use a fresh run directory for every audit. Do not reuse briefs, sub-agent outputs, or reports across runs. ```bash RUN_DIR="$(mktemp -d -t vercel-optimize-XXXXXX)" ```
原文:1. Collect, scan, and merge signals
Run from the linked app directory or pass `--cwd` where a script supports it. Keep stdout JSON separate from stderr logs. Do not combine streams. ```bash node scripts/collect-signals.mjs [projectId] > "$RUN_DIR/vercel-signals.json" 2> "$RUN_DIR/collect.stderr" node -e 'JSON.parse(require("fs").readFileSync(process.argv[1], "utf8"))' "$RUN_DIR/vercel-signals.json" node scripts/scan-codebase.mjs <repo-root> > "$RUN_DIR/codebase.json" node scripts/merge-signals.mjs "$RUN_DIR/vercel-signals.json" "$RUN_DIR/codebase.json" --out "$RUN_DIR/signals.json" ``` Collection details, schemas, metric IDs, and degradation behavior live in [references/data-collection.md](references/data-collection.md). The metric registry is [lib/queries.mjs](lib/queries.mjs); keep all queries on the shared 14-day window. `collect-signals.mjs` resolves the linked project owner to `commandScope.cliScope` and verifies that the resolved account can read the resolved project before it checks Observability Plus. Downstream scripts reuse that scope for every Vercel CLI command that accepts `--scope`. Do not run `vercel usage`, `vercel metrics`, or `vercel contract` manually without the same scope; unscoped usage can report the user's personal organization while route metrics come from the team project. If project or scope resolution is ambiguous, stop and ask the user which Vercel project and team/personal scope they want audited. Do not infer the intended scope from the current `vercel whoami` team, and do not proceed with metrics, usage, or contract collection until the link, an exact project match in `.vercel/repo.json`, or `VERCEL_PROJECT_ID` + `VERCEL_ORG_ID` identifies the intended account. Use this prompt for `PROJECT_SCOPE_UNRESOLVED`, `SCOPE_UNRESOLVED`, or `PROJECT_SCOPE_MISMATCH`: ```text I can't safely identify the Vercel project and account for this audit yet. Please confirm the Vercel project name or ID and the team slug/name, or tell me it's under your personal account. Once confirmed, I'll relink or rerun collection against that exact scope before checking metrics. ```
原文:1.1 Stop on blockers
Check blockers before gating: ```bash jq '{frameworkSupportBlocker, observabilityPlus, observabilityPlusUsable, observabilityPlusBlocker, observabilityPlusBlockerDetail}' "$RUN_DIR/signals.json" ``` Required actions: - `frameworkSupportBlocker === "unsupported_framework"`: use the unsupported-framework prompt above. - `PROJECT_SCOPE_UNRESOLVED`, `SCOPE_UNRESOLVED`, or `PROJECT_SCOPE_MISMATCH`: stop and ask which Vercel project and team/personal scope the user wants audited. For team projects, rerun after `vercel link --yes --project <project-name-or-id> --team <team-slug>`; for personal projects, rerun after linking under the intended user account or after setting both `VERCEL_PROJECT_ID` and `VERCEL_ORG_ID`. - `observabilityPlusBlocker === null`: continue. - `no_traffic`: tell the user route metrics are sparse; continue only if they accept limited output. - `payment_required` or `no_oplus_probe`: render [references/observability-plus.md](references/observability-plus.md) verbatim and ask. - `project_disabled`: tell the user to enable Observability Plus for the project or accept a limited audit. - `daily_quota_exceeded`: stop and tell the user the Observability query quota is exhausted; retry after the next UTC midnight reset, or ask whether to continue with a limited code-only audit. - `not_linked`: link the app directory, then rerun Step 1. If app path and project are known: ```bash vercel link --yes --project <project-name-or-id> --cwd <app-dir> # add --team <team-id-or-slug> when known ``` - `forbidden` or `project_not_found`: fix auth/team scope. Do not pitch Observability Plus. - `all_failed_other`: show the raw error code and ask whether to continue in limited code-only mode. Do not silently fall back to code-only mode. If the user accepts a limited audit, rerun collection with: ```bash node scripts/collect-signals.mjs [projectId] --continue-without-observability > "$RUN_DIR/vercel-signals.json" 2> "$RUN_DIR/collect.stderr" ``` Then scan and merge again.
文件 SHA256:95ae2683b30d892d165af92a350c5628b68106f395a59b448857b654e306ed91
仓库许可证记录:未提供;not-established,查看来源。
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.
历史收录数据
| 来源仓库 | vercel-labs/agent-skills |
|---|---|
| Skill源路径 | skills/vercel-optimize/SKILL.md |
安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。
