Display comprehensive statistics about the knowledge graph
Displays comprehensive statistics about the knowledge graph including notes, relationships, and tags.
/plugin marketplace add witt3rd/claude-plugins/plugin install azkg@witt3rd-claude-pluginsDisplay comprehensive statistics about the knowledge graph.
Check for AZKG_REPO_PATH environment variable:
if [ -z "$AZKG_REPO_PATH" ]; then REPO_PATH=$(pwd); else REPO_PATH="$AZKG_REPO_PATH"; fiAll file operations must use REPO_PATH:
Read(REPO_PATH/filename.md) or Read("$REPO_PATH/filename.md")Write(REPO_PATH/filename.md) or Write("$REPO_PATH/filename.md")Edit(REPO_PATH/filename.md) or Edit("$REPO_PATH/filename.md")Grep(pattern, path=REPO_PATH) or with explicit pathGlob(pattern, path=REPO_PATH) or with explicit pathExample usage:
# Check environment variable
if [ -z "$AZKG_REPO_PATH" ]; then
REPO_PATH=$(pwd)
else
REPO_PATH="$AZKG_REPO_PATH"
fi
# Then use REPO_PATH for all operations
Read("$REPO_PATH/agents.md")
Concrete examples:
Use Grep and Glob to calculate:
Use Glob to count all markdown files (excluding MOCs):
# Count all .md files
Glob "*.md"
Filter out MOC files (files ending in _moc.md) for pure note count.
Use Glob to find MOC files:
# Find all MOC files
Glob "*_moc.md"
Use Grep to find each relationship type in "Related Concepts" sections:
# Count Prerequisites
Grep "### Prerequisites" --glob="*.md" --output_mode="count"
# Count Related Topics
Grep "### Related Topics" --glob="*.md" --output_mode="count"
# Count Extends
Grep "### Extends" --glob="*.md" --output_mode="count"
# Count Extended By
Grep "### Extended By" --glob="*.md" --output_mode="count"
# Count Alternatives
Grep "### Alternatives" --glob="*.md" --output_mode="count"
# Count Examples
Grep "### Examples" --glob="*.md" --output_mode="count"
For each type, also count individual relationship entries by counting lines starting with - [[ within those sections.
Use Grep to find all tags in YAML frontmatter:
# Find all tags lines
Grep "^tags: \[" --glob="*.md" --output_mode="content"
Parse out individual tags, count occurrences, and sort by frequency.
Graph Statistics
============================================================
Total notes: N
Total MOCs: M
Pure notes (excluding MOCs): X
Relationship counts:
Prerequisites: X notes have prerequisites (Y total relationships)
Related Topics: X notes have related topics (Y total relationships)
Extends: X notes extend others (Y total relationships)
Extended By: X notes are extended by others (Y total relationships)
Alternatives: X notes have alternatives (Y total relationships)
Examples: X notes have examples (Y total relationships)
Total relationships: Z
Tag Statistics:
Unique tags: N
Average tags per note: X.Y
Top 10 tags:
#python: 25 notes
#mcp: 18 notes
#agents: 15 notes
#rust: 12 notes
#typescript: 10 notes
...
Graph Health:
✓ Well-connected notes: X (>3 relationships)
! Sparsely connected: Y (1-2 relationships)
⚠ Orphaned notes: Z (0 relationships)
After displaying stats, provide brief analysis:
Good signs:
Potential issues:
/expand-graph to discover relationshipsAfter displaying stats:
/expand-graph on orphaned notes, add missing relationship types)