diff --git a/.claude/skills/mt-add-tags/scripts/list_existing_tags.sh b/.claude/skills/mt-add-tags/scripts/list_existing_tags.sh new file mode 100644 index 0000000..d741b31 --- /dev/null +++ b/.claude/skills/mt-add-tags/scripts/list_existing_tags.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# List existing tags in the repo ranked by frequency. +# Usage: list_existing_tags.sh +# Outputs: tag count and name, sorted most-used first (top 40) +# +# NOTE: This script is NOT currently used by the mt-add-tags skill. +# Tag normalization is disabled until existing posts have standardized tags. +# To enable, uncomment step 4a in SKILL.md. + +set -euo pipefail + +PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd)" +CONTENT_DIR="$PROJECT_ROOT/content/post" + +grep -rh "^tags:" "$CONTENT_DIR" \ + | tr ',' '\n' \ + | grep -oP '(?<=")[^"]+(?=")' \ + | sort \ + | uniq -c \ + | sort -rn \ + | head -40