vercel-static-config
Skill1 starsChanged 28 days agoMITView on GitHub
Writes and checks vercel.json for static and mostly static sites. Covers one URL per page (trailingSlash, cleanUrls, redirects for /index.html, the apex domain and the project's own vercel.app domain), cache headers per file type, noindex on preview hosts, basic security headers and the 404 page, in the modern format or the legacy routes format, and keeping a generated config generated; scripts/check-headers.mjs checks a live deployment's caching, compression, duplicate URLs and preview noindex. Use it when creating or editing vercel.json, choosing cache headers, fixing duplicate URLs or slow repeat visits, keeping *.vercel.app out of search, or when a deployment fails on a route pattern.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/geo-ai-search/assets/llms.txtllms.txt
- geo-ai-searchSkill
- seo-geo-vercel-playbookSkill
- seo-metadataSkill
- seo-technical-auditSkill
- site-migrationSkill
- structured-dataSkill
- vercel-cost-optimizationSkill
- vercel-firewallSkill
- web-performanceSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Legacy
routes: when you need route-level features such as host-conditioned headers with continue, or firewall mitigate rules in the file. - Very specific: line 64
Generated config stays generated: If a script writes vercel.json (redirect maps, routes), change the script and run it again.
- Very specific: line 69
A long cache needs changing names: Only content-hashed files get immutable.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
vercel.json for static sites
Three jobs: one URL per page, the right cache lifetime per file type, and only the real domain in search. Everything else is optional.
Steps
- Pick the format (details: references/config-formats.md):
- Modern (
trailingSlash,cleanUrls,redirects,headers): the default for new projects. Template: assets/vercel.static.json. - Legacy
routes: when you need route-level features such as host-conditioned headers withcontinue, or firewallmitigaterules in the file. It can't be mixed with the modern keys. Template: assets/vercel.routes.json.
- Modern (
- One URL per page. Choose trailing slash or not, and make the other form redirect with 308
(
trailingSlash: truedoes it; paths with a file extension are left alone). Redirect/index.htmlURLs. Redirect the apex domain towww(or the reverse) in Project → Settings → Domains. Link internally only to the canonical form. - Keep the
*.vercel.apphosts out of search. Redirect the project's own productionmy-project.vercel.appdomain to the real domain (a host-scoped redirect naming that exact host), and sendX-Robots-Tag: noindexon every*.vercel.apphost, or keep previews behind Deployment Protection. Cache by file type (references/caching.md):
Files Cache-Control Hashed build files ( /assets/*,/_next/static/*,/_astro/*)public, max-age=31536000, immutableFonts public, max-age=31536000Other static files (images, video, posters, icons, share images) public, max-age=2592000, stale-while-revalidate=86400Data files tools load public, max-age=86400, stale-while-revalidate=604800HTML Vercel's default (revalidated on every view) Deploy a preview and check it:
node <skill>/scripts/check-headers.mjs https://www.example.com --paths /about/,/fonts/inter.woff2 node <skill>/scripts/check-headers.mjs https://www.example.com --preview https://my-project-git-main-team.vercel.appIt collects the home page's scripts, styles, fonts, images and videos, checks each response's cache lifetime and compression, tests
/pageand/page/index.htmlfor duplicates, and checks that previews sendnoindexwhile the production domain doesn't.
Rules
- Generated config stays generated. If a script writes
vercel.json(redirect maps, routes), change the script and run it again; never hand-edit the output. - Route patterns are JavaScript regular expressions. Inline flags such as
(?i)fail the deployment. Validate every pattern withnew RegExp()in the generator. - Never cache HTML for long: a new deployment would show late, and a bad one would linger.
- A long cache needs changing names. Only content-hashed files get
immutable; files whose names stay the same get days to weeks withstale-while-revalidate. - Security headers (
X-Content-Type-Options,Referrer-Policy, a CSP) are worth adding but test them: a strict CSP breaks inline scripts, analytics and embeds. - The 404 page: a
404.htmlat the build root is served with status 404 for unknown URLs.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

