← ClaudeAtlas

diagram-gen-emergentlisted

Generate a bottom-up diagram of actual code coupling from cross-references — what the code does, not what was intended. Use for structural PR review; pair with diagram-gen-spec for intended-vs-actual drift.
jamestexas/agents · ★ 2 · AI & Automation · score 61
Install: claude install-skill jamestexas/agents
# diagram-gen-emergent — Community-Emergent Structural Diagram Generate a bottom-up diagram from real code coupling. Shows structural reality. ## Arguments `$ARGUMENTS` — `<source-path-or-db> [--compact] [--exclude-tests] [--layout LR|TD]` Defaults: `--compact`, `--exclude-tests`, `--layout LR` ## What To Do ### Step 1: Parse arguments ```bash SOURCE="" COMPACT=true EXCLUDE_TESTS=true LAYOUT="LR" for arg in $ARGUMENTS; do case "$arg" in --no-compact) COMPACT=false ;; --include-tests) EXCLUDE_TESTS=false ;; --layout) ;; # next arg is the value TD|LR|BT|RL) LAYOUT="$arg" ;; --layout=*) LAYOUT="${arg#--layout=}" ;; -*) ;; # unknown flag, ignore *) SOURCE="$arg" ;; esac done if [ -z "$SOURCE" ]; then echo "status: unavailable — no source path provided" exit 0 fi ``` ### Step 2: Ensure server is running on port 7532 ```bash MACHE_BIN=$(which mache 2>/dev/null || echo "$HOME/go/bin/mache") if [ ! -x "$MACHE_BIN" ]; then echo "status: unavailable — mache binary not found" exit 0 fi # Check if server already running on 7532 RUNNING=$(curl -s --max-time 5 -X POST http://localhost:7532/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"check","version":"1"}}}' \ | python3 -c "import sys,json; d=json.load(sys.stdin); print('RUNNING' if 'result' in d and 'e