mirror of
https://github.com/tiennm99/miti99.git
synced 2026-08-21 00:25:01 +00:00
feat(skills): add list_existing_tags.sh script for future tag normalization
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user