sort-data

Sorts and deduplicates JSON data files alphabetically for cleaner git diffs.

1|Updated Feb 1, 2025
One-click install
npx skills add https://github.com/TiagoDanin/TiagoDanin.github.io --skill sort-data-tiagodanin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sort-data
Source: https://github.com/TiagoDanin/TiagoDanin.github.io/tree/main/.claude/skills/sort-data
Command: npx skills add https://github.com/TiagoDanin/TiagoDanin.github.io --skill sort-data-tiagodanin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually edited or repeatedly fetched JSON data files end up in inconsistent order, producing noisy git diffs that hide real changes. This Skill reorganizes existing data files alphabetically without calling external APIs. ## Core Features & Use Cases - Alphabetical Sorting: Sorts GitHub projects and NPM packages by name using case-insensitive localeCompare ordering. - Deduplication: Removes duplicate entries by unique ID (GitHub) or name (NPM), keeping the first occurrence. - Selective Scope: Sorts only github.json and npm.json while preserving chronological order in posts, talks, and timeline files. - Use Case: After manually editing src/data/github.json, run the sort to restore consistent ordering, then check git diff to confirm only ordering changed before committing. ## Quick Start Ask the assistant to sort the GitHub and NPM JSON data files alphabetically and remove any duplicate entries.

Frequently Asked Questions about sort-data

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sort JSON data files alphabetically without fetching from an API?

Read the existing JSON files, sort entries by the name field using case-insensitive localeCompare, and write them back with the same indentation. This reorders data locally without any network calls.

How to remove duplicate entries from a JSON array in JavaScript?

Build a Map keyed by a unique field such as id or name, then take its values to keep only the first occurrence of each entry. Combine this with a sort step to produce a clean, ordered array.

Why use case-insensitive sorting for JSON data?

Case-sensitive sorting places all uppercase names before lowercase ones, which looks unnatural. Case-insensitive localeCompare produces true alphabetical order, so names like Add-License-Bot and awesome-nodejs sort as humans expect.

Does sorting JSON data files change the actual content?

No, sorting only reorders entries and removes exact duplicates by ID or name. All data fields and file structure are preserved, which you can verify with git diff after running the sort.

When should I not sort data files alphabetically?

Do not alphabetically sort chronologically ordered collections like blog posts, talks, or timelines, since their newest-first ordering is meaningful. Only apply alphabetical sorting to unordered collections like project or package lists.