$npx -y skills add Egonex-AI/Understand-Anything --skill understand-dashboardLaunch the interactive web dashboard to visualize a codebase's knowledge graph
| 1 | # /understand-dashboard |
| 2 | |
| 3 | Start the Understand Anything dashboard to visualize the knowledge graph for the current project. |
| 4 | |
| 5 | ## Instructions |
| 6 | |
| 7 | 1. Determine the project directory and data directory: |
| 8 | - If `$ARGUMENTS` contains a path, use that as the project directory |
| 9 | - Otherwise, use the current working directory |
| 10 | - Prefer the legacy `.understand-anything/` data directory when it exists, otherwise use `.ua/` |
| 11 | |
| 12 | Use the Bash tool to resolve: |
| 13 | ```bash |
| 14 | PROJECT_ARG="$ARGUMENTS" |
| 15 | if [ -n "$PROJECT_ARG" ]; then |
| 16 | PROJECT_DIR=$(cd "$PROJECT_ARG" 2>/dev/null && pwd -P) |
| 17 | else |
| 18 | PROJECT_DIR=$(pwd -P) |
| 19 | fi |
| 20 | |
| 21 | if [ -z "$PROJECT_DIR" ] || [ ! -d "$PROJECT_DIR" ]; then |
| 22 | echo "Error: Project directory not found: ${PROJECT_ARG:-$PWD}" |
| 23 | exit 1 |
| 24 | fi |
| 25 | |
| 26 | if [ -d "$PROJECT_DIR/.understand-anything" ]; then |
| 27 | UA_DIR="$PROJECT_DIR/.understand-anything" |
| 28 | else |
| 29 | UA_DIR="$PROJECT_DIR/.ua" |
| 30 | fi |
| 31 | ``` |
| 32 | |
| 33 | 2. Check that `$UA_DIR/knowledge-graph.json` exists in the project directory. If not, tell the user: |
| 34 | ``` |
| 35 | No knowledge graph found. Run /understand first to analyze this project. |
| 36 | ``` |
| 37 | |
| 38 | Use the Bash tool to check: |
| 39 | ```bash |
| 40 | if [ ! -f "$UA_DIR/knowledge-graph.json" ]; then |
| 41 | echo "No knowledge graph found. Run /understand first to analyze this project." |
| 42 | exit 1 |
| 43 | fi |
| 44 | ``` |
| 45 | |
| 46 | 3. Find the dashboard code. The dashboard is at `packages/dashboard/` relative to this plugin's root directory. Check these paths in order and use the first that exists: |
| 47 | - `${CLAUDE_PLUGIN_ROOT}/packages/dashboard/` (Claude Code runtime root, highest priority) |
| 48 | - `~/.understand-anything-plugin/packages/dashboard/` (universal symlink, all installs) |
| 49 | - Two levels up from `~/.agents/skills/understand-dashboard` real path (self-relative fallback) |
| 50 | - Two levels up from `~/.copilot/skills/understand-dashboard` real path (Copilot personal skills fallback) |
| 51 | - Common clone-based install roots: |
| 52 | - `~/.codex/understand-anything/understand-anything-plugin/packages/dashboard/` |
| 53 | - `~/.opencode/understand-anything/understand-anything-plugin/packages/dashboard/` |
| 54 | - `~/.pi/understand-anything/understand-anything-plugin/packages/dashboard/` |
| 55 | - `~/understand-anything/understand-anything-plugin/packages/dashboard/` |
| 56 | |
| 57 | Use the Bash tool to resolve: |
| 58 | ```bash |
| 59 | SKILL_REAL=$(realpath ~/.agents/skills/understand-dashboard 2>/dev/null || readlink -f ~/.agents/skills/understand-dashboard 2>/dev/null || echo "") |
| 60 | SELF_RELATIVE=$([ -n "$SKILL_REAL" ] && cd "$SKILL_REAL/../.." 2>/dev/null && pwd || echo "") |
| 61 | COPILOT_SKILL_REAL=$(realpath ~/.copilot/skills/understand-dashboard 2>/dev/null || readlink -f ~/.copilot/skills/understand-dashboard 2>/dev/null || echo "") |
| 62 | COPILOT_SELF_RELATIVE=$([ -n "$COPILOT_SKILL_REAL" ] && cd "$COPILOT_SKILL_REAL/../.." 2>/dev/null && pwd || echo "") |
| 63 | |
| 64 | PLUGIN_ROOT="" |
| 65 | for candidate in \ |
| 66 | "${CLAUDE_PLUGIN_ROOT}" \ |
| 67 | "$HOME/.understand-anything-plugin" \ |
| 68 | "$SELF_RELATIVE" \ |
| 69 | "$COPILOT_SELF_RELATIVE" \ |
| 70 | "$HOME/.codex/understand-anything/understand-anything-plugin" \ |
| 71 | "$HOME/.opencode/understand-anything/understand-anything-plugin" \ |
| 72 | "$HOME/.pi/understand-anything/understand-anything-plugin" \ |
| 73 | "$HOME/understand-anything/understand-anything-plugin"; do |
| 74 | if [ -n "$candidate" ] && [ -d "$candidate/packages/dashboard" ]; then |
| 75 | PLUGIN_ROOT="$candidate"; break |
| 76 | fi |
| 77 | done |
| 78 | |
| 79 | if [ -z "$PLUGIN_ROOT" ]; then |
| 80 | echo "Error: Cannot find the understand-anything plugin root." |
| 81 | echo "Checked:" |
| 82 | echo " - ${CLAUDE_PLUGIN_ROOT:-<unset CLAUDE_PLUGIN_ROOT>}" |
| 83 | echo " - $HOME/.understand-anything-plugin" |
| 84 | echo " - ${SELF_RELATIVE:-<unresolved path derived from ~/.agents/skills/understand-dashboard>}" |
| 85 | echo " - ${COPILOT_SELF_RELATIVE:-<unresolved path derived from ~/.copilot/skills/understand-dashboard>}" |
| 86 | echo " - $HOME/.codex/understand-anything/understand-anything-plugin" |
| 87 | echo " - $HOME/.opencode/understand-anything/understand-anything-plugin" |
| 88 | echo " - $HOME/.pi/understand-anything/understand-anything-plugin" |
| 89 | echo " - $HOME/understand-anything/understand-anything-plugin" |
| 90 | echo "Make sure you followed the installation instructions for your platform." |
| 91 | exit 1 |
| 92 | fi |
| 93 | |
| 94 | DASHBOARD_DIR="$PLUGIN_ROOT/packages/dashboard" |
| 95 | ``` |
| 96 | |
| 97 | 4. **Fast path — try the prebuilt viewer first (no install, no build).** Each release ships a self-contained viewer tarball; run it pinned to the installed plugin version: |
| 98 | ```bash |
| 99 | : "${PLUGIN_ROOT:?Run step 3 first so PLUGIN_ROOT is set}" |
| 100 | : "${PROJECT_DIR:?Run step 1 first so PROJECT_DIR is set}" |
| 101 | PLUGIN_VERSION=$(node -p "require('$PLUGIN_ROOT/package.json').version") |
| 102 | VIEWER_URL="https://github.com/Egonex-AI/Understand-Anything/releases/download/v${PLUGIN_VERSION}/understand-anything-viewer.t |