index-docs

索引 Markdown 文档 - 标题、图表、表格、代码块、链接。用于快速概览,无需阅读完整文件。

📖 中文导读:索引 Markdown 文档 - 标题、图表、表格、代码块、链接。用于快速概览,无需阅读完整文件。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: index-docs description: Index markdown documentation - headings, diagrams, tables, code blocks, links. Use for quick overview without reading full files. allowed-tools: Bash, Read

Markdown Documentation Indexer

Extract structure from markdown files without loading full content.

Quick Start

Headings (Most Common)

# H1/H2 headings
find . -name "*.md" -type f -not -path "*/.git/*" | xargs grep -n "^##\? " 2>/dev/null | head -100

# H1/H2/H3 headings
find . -name "*.md" -type f -not -path "*/.git/*" | xargs grep -n "^###\?\? " 2>/dev/null | head -150

Mermaid Diagrams

# Find files with mermaid diagrams
grep -rln 'mermaid' --include="*.md" . 2>/dev/null

# Show mermaid diagram types
grep -rn 'mermaid' --include="*.md" -A1 . 2>/dev/null | grep -E "(flowchart|graph|sequenceDiagram|classDiagram|erDiagram|gantt)"

Code Blocks

# Find all code blocks with language
grep -rn '^```[a-z]' --include="*.md" . 2>/dev/null | head -50

# Count code blocks by language
grep -roh '^```[a-z]*' --include="*.md" . 2>/dev/null | sort | uniq -c | sort -rn

Tables

# Find markdown tables (header lines)
grep -rn "^|.*|.*|$" --include="*.md" . 2>/dev/null | grep -E "\-\-\-" | head -30
# Find all links
grep -ron "\[.*\](.*)" --include="*.md" . 2>/dev/null | head -50

# Find cross-references (relative links)
grep -ron "\[.*\](\.\./.*)" --include="*.md" . 2>/dev/null | head -30

# Find external links
grep -ron "\[.*\](https://.*)" --include="*.md" . 2>/dev/null | head -30

Images

# Find all images
grep -ron "!\[.*\](.*)" --include="*.md" . 2>/dev/null | head -30

YAML Frontmatter

# Find files with frontmatter
grep -rln "^---$" --include="*.md" . 2>/dev/null | head -20

TODOs and FIXMEs

# Find action items in docs
grep -rn "TODO\|FIXME\|XXX\|\[ \]" --include="*.md" . 2>/dev/null | head -30

Filtered Searches

# Specific folder only
find ./4-The-Plan -name "*.md" | xargs grep -n "^##\? " 2>/dev/null

# Exclude archives
find . -name "*.md" -type f -not -path "*/archive/*" -not -path "*/z-*" | xargs grep -n "^##\? " 2>/dev/null | head -100

# Topic-specific (pipe to grep)
find . -name "*.md" | xargs grep -n "^##\? " 2>/dev/null | grep -i "security\|auth"

Pattern Reference

What Command
H1 only grep -rn "^# " --include="*.md"
H2 only grep -rn "^## " --include="*.md"
Mermaid grep -rln "mermaid" --include="*.md"
Code blocks grep -rn '^```[a-z]' --include="*.md"
Tables `grep -rn "^
Links grep -ron "\[.*\](.*)" --include="*.md"
TODOs grep -rn "TODO|FIXME" --include="*.md"

Token Efficiency

All commands return summaries, not full files. A complete doc index typically uses <200 tokens while giving you the map to know what to read next.

  • startup: Full session bootstrap
  • codebase-index: Code architecture discovery
  • search-history: Conversation context