agentleFS
ZmokiZmoki/zmoki-astro-starter/.claude/skills/redirects/SKILL.md

redirects

Skill4 starsChanged 5 months agoMITView on GitHub

Add or edit URL redirects. Use when the user wants to redirect a legacy/old URL, moved page, or external link — anything that should return a 301/302 on the site's host (Cloudflare, Netlify, Vercel, or Amplify).

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Anglesite/anglesite-skills★ 4same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository9 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Commit both the CSV and the regenerated artifact together.

    line 53
  2. Very specific:

    301 vs 302: use 301 (permanent) for slugs that moved for good — this passes SEO signal.

    line 75
  3. Distinctive:

    Do not add redirects at the CDN/DNS layer (e.g.

    line 78

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Redirects

URL redirects. Authored once as platform-neutral CSV in src/redirects/, compiled to the host's redirect format (see Platform below).

Model

  • Source of truth: src/redirects/*.csv — platform-neutral, one file per group (blog.csv, other.csv, …). Add new files freely; they're merged in filename order.
  • Generated output: depends on site.platform.deploy (see below) — never edit by hand. Overwritten on every build.
  • Builder: scripts/generate-redirects.ts, run via npm run build:redirects. Also runs automatically before npm run build (the prebuild npm hook), so CI keeps the output in sync.

Platform

The output artifact is chosen by platform.deploy in src/site.config.ts:

platformGenerated artifactFormat
"cloudflare" (default)public/_redirects/old /new 301
"netlify"public/_redirectssame _redirects format
"vercel"vercel.jsonredirects[] merged in ({source,destination,statusCode})
"amplify"redirects.json[{source,target,status}] — paste into console / IaC

The CSV format is the same regardless of platform; only the emitted artifact changes. Vercel accepts 3xx redirects only — a 200 row is skipped with a warning (a 200 is a rewrite/proxy, configured separately on Vercel). Switching platforms warns about the stale artifact left behind by the previous one; delete it.

CSV format

Columns: source,destination,code — one redirect per row.

source,destination,code
/feed/old-slug/,/blog/1-new-slug/,301
/resources/something/,https://external.example.com/,302
/legacy/,/blog/,
  • source — the incoming path (required)
  • destination — where to send it: a site path or a full external URL (required)
  • code — HTTP status (optional, defaults to 301). Allowed: 200, 301, 302, 303, 307, 308
  • Lines starting with # and blank lines are ignored — use them for comments

Pick the file by kind: blog-post moves → blog.csv; resources, external links, and one-offs → other.csv; or create a new grouping CSV.

Add a redirect

  1. Edit the relevant CSV under src/redirects/ (choose an existing group or add a new *.csv).
  2. Rebuild:
    npm run build:redirects
  3. Commit both the CSV and the regenerated artifact together.

Commit & CI

  • The generated artifact is committed to git (not gitignored) — so redirect changes show in PR diffs and Vercel reads vercel.json from the repo source.
  • CI runs npm run check:redirects, which regenerates the artifact and fails if it drifts from what's committed. So a CSV edit without a rebuild is caught before merge — always rebuild and commit the result.

Platform limits

Each host caps how many redirects the artifact may hold. The build warns at ≥90% of the cap and fails the build once it's exceeded (so you find out before deploy, not after silent drops):

platformCapBeyond the cap
cloudflare2,100 (2,000 static + 100 dynamic)Cloudflare Bulk Redirects (silently drops rules past the cap)
vercel1,024 (shared with rewrites + headers)Edge Middleware + Edge Config
netlifyno hard count (file-size bound)wildcards/placeholders; Edge Functions past ~10k
amplifyno documented quota—

For a personal site you'll be far under these, but the guard means a runaway generator or a bulk import can't silently blow the ceiling.

Notes

  • 301 vs 302: use 301 (permanent) for slugs that moved for good — this passes SEO signal. Use 302 (temporary) only when the move is provisional.
  • Trailing slashes matter — this site's URLs end in /. Match the real path.
  • Validation: an invalid code, or a row missing source/destination, fails the build with a line-numbered error (e.g. blog.csv:2: invalid code "999"). Fix the CSV and rebuild.
  • Do not add redirects at the CDN/DNS layer (e.g. Terraform-managed zone rules) or edit the generated artifact directly — both are wrong paths for this. Author them as CSV here and let the build compile the artifact.

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.