From 4e7820f70fe6ebdb2c867496009453767dd25728 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Tue, 17 Mar 2026 21:40:05 +0700 Subject: [PATCH] feat(skills): add list_existing_tags.sh script for future tag normalization --- .../mt-add-tags/scripts/list_existing_tags.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .claude/skills/mt-add-tags/scripts/list_existing_tags.sh 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