/anglesite:redirects [add | remove | list | validate | import | review]from anglesite
Manages URL redirects in public/_redirects: add, remove, list, validate, and bulk-import rules (301/302/308). Useful after page renames, migrations, or broken link fixes.
Ships in anglesite. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Manage redirects in public/_redirects so old URLs keep working when pages are renamed, content is imported from another platform, or the site's URL structure changes. The owner shouldn't have to hand-edit the file or learn the _redirects syntax.
The canonical store is public/_redirects. Imports and SSG conversions add their rules straight to public/_redirects and log the same rules in .anglesite/url-map.csv — an audit trail of what they added, so the owner can review it afterwards.
_redirects is read by Cloudflare Workers Static Assets at the edge (no custom Worker code required)Read EXPLAIN_STEPS from .site-config. If true or not set, explain in plain English before editing files. If false, proceed without pre-announcing.
Cloudflare Workers Static Assets reads public/_redirects. Each non-empty, non-comment line is one rule:
/from /to [status]
* wildcards and :placeholder segments)302. Anglesite uses three redirect values (plus 200 for a rewrite — see Passthrough):
301 — permanent redirect (the right choice for renames; preserves SEO)302 — temporary redirect (the page might come back; default if omitted)308 — permanent, preserves the HTTP method (use only if the source receives POST/PUT requests)Comments start with #. Blank lines are allowed and Anglesite preserves them.
Cloudflare evaluates rules top to bottom and stops at the first match. The hard limits are 2,100 static rules and 100 dynamic (wildcard / placeholder) rules per project — surface a warning to the owner once either category passes 80% of the limit.
Verify public/_redirects exists. If it doesn't, scaffolding never ran — tell the owner: "I can't find public/_redirects. This usually means the site hasn't been scaffolded yet — try /anglesite:start first." Stop.
Read $ARGUMENTS. Map to one of:
| Argument | Action |
|---|---|
add (or empty + the owner says "add") | Add one redirect interactively |
remove / delete | Remove a redirect interactively |
list / show | Print every active rule grouped by status |
validate / check | Run all validation checks, report findings |
import / csv | Bulk import from a CSV file |
review / pending | Walk through the redirects the last import or conversion added (logged in .anglesite/url-map.csv) |
If $ARGUMENTS is empty and there is a non-empty .anglesite/url-map.csv, default to review (the import/convert skills just ran and logged what they added). Otherwise ask: "What would you like to do — add a redirect, remove one, list what's there, validate the file, or import a CSV?"
Parse public/_redirects into rules and preserved lines. Each rule has:
source — the from pathtarget — the to pathstatus — number (301, 302, 308, or 200 for a passthrough rewrite)lineNumber — for editingoriginal — the verbatim line, so comments aligned to a rule are not lostAnything that isn't a rule (blank line, comment line) is preserved verbatim and rewritten in place when the file is updated.
Ask the owner three questions in plain language:
/old-page or /2024/03/launch)"/about, /blog/new-launch, or a full URL like https://example.com/elsewhere)"301, temporary → 302. Only ask about 308 if the owner mentions form submissions or webhooks — most small business sites never need it.Normalize both paths:
/ if missing (unless it's an absolute URL)/ from internal paths unless the path is just /source == target)Run all the validations in Validate against the prospective new rule. If any fire, tell the owner what's wrong and let them adjust before writing. If everything passes, append the rule.
Confirm in plain English: "Done. Anyone visiting /old-page will now land on /about — and search engines will know it's a permanent move."
Show the rules numbered. Ask the owner which to remove (by number or by source path). If they reference a path that has multiple matches (e.g., a wildcard plus a literal), list them and let them pick.
Before deleting, warn if the removal could break inbound links — if the source looks like an old platform path (/wp-content/, /post/, /p/), remind the owner that external sites may still link to it.
Remove the line, preserve surrounding comments, write the file. Confirm what was removed.
Print rules grouped by status, in source order:
Permanent (301) — N rule(s)
/old-page → /about
/2024/03/launch → /blog/launch
/post/* → /blog/:splat
Temporary (302) — N rule(s)
/events → /
Method-preserving (308) — N rule(s)
(none)
If the file has more than ~20 rules, also show the wildcard / placeholder count and the limit utilization (e.g., "12 of 100 dynamic rules used").
Run every check below on the full file. Group findings by severity using the same vocabulary as /anglesite:check:
source. Cloudflare uses the first; the rest are dead. Report all duplicates with their line numbers.source == target. Always an error.target is the source of another rule. Flag chains > 1 hop. Suggest collapsing to a single rule.source matches an existing built page. Build the route set from src/pages/**/*.{astro,md,mdoc,html} and from any directory under src/content/ that has a configured collection. A redirect from /about is shadowed by src/pages/about.astro — Cloudflare serves the static file first, so the redirect never fires. Report and recommend removing or renaming.302) redirects to a clearly-permanent destination (e.g., a renamed slug, no original page in src/pages/) get a hint that 301 would be better for SEO. This is informational only./_astro/*, /pagefind/*, /admin/*, /keystatic/*, /api/*). Always a warning.* or :) rules. Warn at 80% of 2,100 / 100 respectively.301, 302, 308, or 200 (passthrough) are allowed in this skill. Anything else is a typo.For each finding, include the line number and the rule text so the owner can locate it. Offer to fix the auto-fixable ones (duplicates, self-loops, status typos) in place.
Owners migrating from another platform usually have a spreadsheet of old → new URL pairs. Accept any CSV with at least two columns. The first row may or may not be a header — detect by checking whether row 1's first cell parses as a path (starts with / or http).
Recognized columns (case-insensitive):
| Column | Aliases | Required |
|---|---|---|
from | source, old, old_url, old url, path | yes |
to | target, new, new_url, new url, destination | yes |
status | code, type | no — defaults to 301 for bulk migrations |
Ask the owner for the CSV path. Read it, parse with a minimal CSV reader (handle quoted fields, escaped quotes, \r\n, comma or tab separators). Reject the file if any required column is missing.
For each row:
_redirects).Present a summary before writing:
"I read 312 rows from
migrations/redirects.csv:
- 287 look good and will be added
- 18 are already in your redirects file (skipped)
- 5 would create loops or duplicate sources (skipped — listed below)
- 2 point to pages that don't exist yet (added anyway, but you may want to create those pages)"
If the owner approves, append the accepted rules in a single block prefixed with # Imported from <filename> on YYYY-MM-DD so the provenance is obvious in diffs.
/anglesite:import and /anglesite:convertWhen /anglesite:import or /anglesite:convert runs, it appends rules directly to public/_redirects and also drops the same rules — with provenance — into .anglesite/url-map.csv. The CSV format is from,to,status,note,source where:
note describes the reason (platform-rename, wix-opaque-slug, app-page-placeholder, etc.)source is the originating skill (import:wordpress, convert:hugo, etc.)This file is the audit trail for everything those skills added, and it lets /anglesite:redirects review highlight rules the owner may want to revisit (especially app-page-placeholder 302s that should become 301s once a replacement tool is configured).
When this skill is invoked with review (or by default if a non-empty .anglesite/url-map.csv exists):
public/_redirects. Tell the owner: "Your last import added N redirects. Want me to walk through them?"app-page-placeholder (302 → /). Suggest replacing with a 301 once the owner sets up the replacement tool (booking, store, etc.)..anglesite/url-map.csv — overwrite it with an empty file using the Write tool (an empty file counts the same as a missing one) — so the next import starts with a clean audit trail. If the owner skips review, leave the file in place — it'll surface again next run.When updating public/_redirects:
# Added <action> YYYY-MM-DD comment if more than three rules are added at once._redirects, and changing it can change which rule wins.If public/_redirects was modified, suggest the owner run /anglesite:check to verify the build is still clean and /anglesite:deploy to publish.
If 5+ rules were added, also remind the owner that 301s are cached aggressively by browsers — testing should be done in a private window or after clearing the cache.
Cloudflare's _redirects supports * (greedy match) and :name (single-segment placeholder) in from, with :splat and :name available in to. Examples:
/post/* /blog/:splat 301
/u/:user /authors/:user 301
Wildcards count against the 100-rule dynamic limit. Warn if the owner is adding many similar rules that could be collapsed into one wildcard.
/old /new 200 rewrites internally without changing the URL the visitor sees. This is occasionally useful (serving the same content under two paths) but easy to misuse — confirm intent before adding a 200 rule, and only allow it when the owner explicitly asks for "rewrite" or "alias" rather than "redirect."
If to is an absolute URL (https://...), the redirect leaves the site. Confirm the owner intends this, especially for 301 — search engines will transfer authority to the external domain.
If a rule's target doesn't resolve to a built page or another redirect, list it as a warning during validation. Do not auto-delete — the page may be added later.
If _redirects contains a malformed line (not a comment, but doesn't parse as a rule), surface it as an error during validation with the line number. Offer to remove or fix it.
Always re-read public/_redirects at the start of the skill — never cache. The owner may have edited it directly, and the skill should treat the on-disk file as truth.
If the change is significant (5+ rules added, a bulk import, removal of a category of rules), append a one-line note to docs/architecture.md describing what changed and why.
What SKILL.md sets; muted values are Claude Code's defaults
Use when pages have moved or been renamed, old links are broken, or the owner needs to manage URL redirects after a migration.
Three short reads, in order
npx claudepluginhub anglesite/anglesite-skills --plugin anglesite56 skills in this plugin
/bookingEmbed appointment scheduling (Cal.com or Calendly) into the siteOther plugins' skills for the same job