agent/skills/knowledge/sorting-choice/SKILL.md
Choose the right sorting approach using Python's built-in Timsort, heapq, or custom strategies. Use when sorting arrays, finding top-k elements, or ordering by multiple keys.
npx skillsauth add knoopx/pi sorting-choiceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Python's built-in sorted()/list.sort() is Timsort — O(n log n), stable, and almost always the right choice.
Timsort: O(n log n). heapq.nlargest/nsmallest: O(n log k).
"Top 3 scores" → heapq.nlargest(3, scores) in O(n log 3). "Sort by name then age" → sorted(items, key=lambda x: (x.name, x.age)).
tools
Inform the user what is happening — skip passive lookups
development
Renders markdown to self-contained HTML with a custom dark stylesheet and opens in browser. Use when previewing markdown documents, generating styled HTML from README or report files.
testing
Programmatic hunk selection for Jujutsu — split, commit, or squash specific hunks without interactive prompts. Use when making partial commits or selective squashes.
content-media
Manage version control with Jujutsu (jj) — no staging area, immediate changes, smart rebasing. Use when navigating history, squashing, or pushing to Git remotes.