$ show vercel-labs/agent-skills
This repository is a distribution and development monorepo for "Agent Skills" — packaged instruction sets, rule files, and CLI tooling that extend AI coding agents to work more effectively with Vercel, React, Next.js, and React Native. The dominant artifact is the `vercel-optimize` skill, a sophisticated performance/cost audit pipeline. It starts by collecting real signals from the Vercel CLI (metrics, usage, project config, route data), then applies deterministic pure-JS gates and AST-based code scanners to generate candidate investigation targets. LLM sub-agents receive structured investigation briefs with playbooks, citations, and support-topic guardrails; their outputs are collected, mechanically verified, sanitized, deduplicated, graded, and rendered into a customer-safe markdown report. This is not a web service or library in the traditional sense — it is a toolchain of executable scripts plus knowledge artifacts designed to be installed into agent environments via `npx skills add`. The repository also contains curated knowledge bases (`react-best-practices`, `react-native-skills`, `composition-patterns`, `react-view-transitions`, `web-design-guidelines`) stored as markdown rules with YAML frontmatter. A build package (`react-best-practices-build`) parses these rules, validates them, and compiles them into `AGENTS.md` files for consumption by agents. The engineering quality is strongest in `vercel-optimize`: it has extensive `node:test` coverage, real CLI output fixtures, a modular gate/scanner/sanitizer architecture, claim-based verification, and careful handling of Vercel API rate limits. The main risks are external dependency drift — Vercel CLI output schemas, metric IDs, Observability Plus availability, and Next.js/React framework versions all change over time — and the inherent fragility of parsing LLM sub-agent output. Although the repo contains large amounts of markdown knowledge content, the dominant character is application/tooling: it ships executable entry points, has unit tests, CI workflows, and a build pipeline. It is not a data-research repository, and the metric fixtures exist to test the tooling rather than to answer analytical questions.
The LLM identified 5 files worth highlighting for reuse:
Implements a FIFO semaphore for bounded concurrency and a sliding-window rate limiter for sustained request throughput, composed into a reusable Vercel API throttle. It is self-contained, dependency-light, and demonstrates a clean, testable solution to a recurring problem in API-driven pipelines: avoiding 429s while maximizing throughput.
Canonicalizes Next.js segment-tree metric paths, including base64-encoded flags and dynamic segment variants, into a stable route key. This is a sharp, isolated utility that solves a real problem for any observability or analytics tool ingesting Next.js route-level metrics and needing to deduplicate semantically identical paths.
Resolves workspace-package imports to actual source files with bounded expansion: follows pure barrel re-exports to a fixed depth, performs suffix fan-out to another depth, and caps per-specifier expansion. This is a sophisticated, reusable answer to a common agent/analyzer problem: mapping a monorepo import to the physical file that needs editing without exploding into the entire dependency graph.
Deduplicates recommendations by a composite key of bucket, file, primary skill rule, fix shape, and dedup intent, then records merge evidence via `appliesAlsoTo`. The logic is deterministic, independent of LLM output style, and can be extracted to deduplicate findings in any code-analysis or lint-aggregation tool.
Parses structured markdown rule files with YAML frontmatter and labeled Incorrect/Correct code examples into a typed intermediate representation used to compile `AGENTS.md` deliverables. It is a self-contained build-time component that demonstrates a robust pattern for turning human-editable knowledge documents into machine-consumable agent instructions with validation.