Install
openclaw skills install @terrycarter1985/markdown-indexerScan a directory of Markdown files, extract titles/headings/frontmatter, build a searchable index JSON, and output a concise summary report. Use when you need to inventory, catalog, or make a folder of .md files discoverable without reading each file individually.
openclaw skills install @terrycarter1985/markdown-indexerScan Markdown files in a directory and produce a structured index.
.md files (notes, docs, wikis) and need to know what's in them at a glance.jq is installed (used for JSON formatting)# Basic scan — outputs index.json in current directory
find ./docs -name "*.md" -print0 | while IFS= read -r -d '' f; do
title=$(grep -m1 '^# ' "$f" | sed 's/^# //' | tr '\n' ' ')
[ -z "$title" ] && title=$(basename "$f" .md)
headings=$(grep -c '^#' "$f" 2>/dev/null || echo 0)
lines=$(wc -l < "$f")
frontmatter=$(head -20 "$f" | grep -c '^---$' || echo 0)
echo "{\"file\":\"$f\",\"title\":\"$title\",\"headings_count\":$headings,\"lines\":$lines,\"has_frontmatter\":$frontmatter}"
done | jq -s '.' > index.json
jq 'length' index.json # total files
jq 'sort_by(-.lines)[:5]' index.json # top 5 longest
jq '[.[] | select(.has_frontmatter >= 2)] | length' index.json # files with YAML frontmatter
jq -r '.[] | "- **\(.title)** — `\(.file)` (\(.lines) lines, \(.headings_count) headings)"' index.md > catalog.md
index.json: Array of objects with file, title, headings_count, lines, has_frontmattercatalog.md (optional): Human-readable Markdown table of contents# 1. Index the docs folder
bash scan.sh ./docs
# 2. Filter out files without headings
jq '[.[] | select(.headings_count > 0)]' index.json > valid-index.json
# 3. Upload to your knowledge base
curl -X POST https://api.example.com/import -d @valid-index.json