dotnet/docs · Archived

sort-redirects

Sorts redirect entries in Open Publishing redirection JSON files alphabetically by path. Use after adding redirects or when the file becomes unsorted.

First seen Feb 25, 2026

Installation

$ npx skills add dotnet/docs --skill sort-redirects

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Also in this package

Other skills from dotnet/docs.

npx skills add dotnet/docs

Browse all from dotnet/docs

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 4.8K
License LICENSE
Default branch main
Open issues 876
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,549 B
  • docs SUMMARY.md 172 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 26 installs

SKILL.md

Sort Redirects

Sort redirect entries in Open Publishing redirection JSON files alphabetically by path. This ensures consistency and makes the redirect files easier to maintain.

When to Use

  • After adding redirect entries to a JSON file
  • When the redirect file has become unsorted
  • After merging branches that may have caused unsorted entries

Steps

  1. Identify the redirection file - Determine which .openpublishing.redirection.*.json file needs sorting.
  2. Run the sort script - Use the sort-redirects.ps1 script with the file path.

Scripts

sort-redirects.ps1

Sorts all entries in the JSON file alphabetically by path (ignoring leading / for sourcepathfromroot). Handles both sourcepathfromroot and source_path properties.

Location (relative to this skill file): ./scripts/sort-redirects.ps1

Parameter Required Description
RedirectionFile Yes The path to a redirection JSON file (e.g., .openpublishing.redirection.csharp.json)

Example:

.\scripts\sort-redirects.ps1 -RedirectionFile ".openpublishing.redirection.csharp.json"

Important Notes

  • The script preserves all existing redirect entries, only changing their order.
  • Sorting is case-sensitive and alphabetical by the normalized path (without leading /).