CtrlK
BlogDocsLog inGet started
Tessl Logo

sort-redirects

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

58

Quality

66%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./.github/skills/sort-redirects/SKILL.md
SKILL.md
Quality
Evals
Security

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 source_path_from_root). Handles both source_path_from_root and source_path properties.

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

ParameterRequiredDescription
RedirectionFileYesThe 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 /).
Repository
dotnet/docs
Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.