Update Redirects Skill
Arguments
- --old: Old file path (required with --new)
- --new: New file path (required with --old)
- --scan: Scan directory for moved files needing redirects
- --validate: Check for circular redirects, broken targets, orphaned redirects
- --cleanup: Suggest unnecessary/consolidatable redirects
- --redirects-file: Path to redirects file (default:
../redirects.jsonc)
Process
Add redirect (--old + --new): Validates no existing redirect for old path, new path exists, no circular redirect created, then updates redirects.jsonc.
Scan (--scan): Checks git history for renamed/moved files, reports which need redirects, which already have them.
Validate (--validate): Detects circular redirects (A→B→A), broken targets (file doesn't exist), redirect chains (A→B→C when A→C is better), orphaned redirects.
Cleanup (--cleanup): Finds unnecessary redirects (old age, low/no traffic), consolidation opportunities for chains.
Format: Maintains JSONC format, preserves comments, keeps consistent formatting.
Redirect entry format
{
"source": "/well-architected-framework/old-path",
"destination": "/well-architected-framework/new-path",
"permanent": true
}