agentleFS
sharabarinilliasharabarinillia/SEO-GEO-Vercel-Playbook-Skill/skills/vercel-static-config/SKILL.md

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.

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
  1. Very specific:

    Legacy routes: when you need route-level features such as host-conditioned headers with continue, or firewall mitigate rules in the file.

    line 30
  2. Very specific:

    Generated config stays generated: If a script writes vercel.json (redirect maps, routes), change the script and run it again.

    line 64
  3. Very specific:

    A long cache needs changing names: Only content-hashed files get immutable.

    line 69

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. 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 with continue, or firewall mitigate rules in the file. It can't be mixed with the modern keys. Template: assets/vercel.routes.json.
  2. One URL per page. Choose trailing slash or not, and make the other form redirect with 308 (trailingSlash: true does it; paths with a file extension are left alone). Redirect /index.html URLs. Redirect the apex domain to www (or the reverse) in Project → Settings → Domains. Link internally only to the canonical form.
  3. Keep the *.vercel.app hosts out of search. Redirect the project's own production my-project.vercel.app domain to the real domain (a host-scoped redirect naming that exact host), and send X-Robots-Tag: noindex on every *.vercel.app host, or keep previews behind Deployment Protection.
  4. Cache by file type (references/caching.md):

    FilesCache-Control
    Hashed build files (/assets/*, /_next/static/*, /_astro/*)public, max-age=31536000, immutable
    Fontspublic, max-age=31536000
    Other static files (images, video, posters, icons, share images)public, max-age=2592000, stale-while-revalidate=86400
    Data files tools loadpublic, max-age=86400, stale-while-revalidate=604800
    HTMLVercel's default (revalidated on every view)
  5. 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.app

    It collects the home page's scripts, styles, fonts, images and videos, checks each response's cache lifetime and compression, tests /page and /page/index.html for duplicates, and checks that previews send noindex while 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 with new 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 with stale-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.html at the build root is served with status 404 for unknown URLs.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.