{"id":"understand-dashboard","name":"understand-dashboard","summary":"インタラクティブなウェブダッシュボードを起動して、コードベースのナレッジグラフを可視化します","body":"# /understand-dashboard\n\nStart the Understand Anything dashboard to visualize the knowledge graph for the current project.\n\n## Instructions\n\n1. Determine the project directory and data directory:\n   - If `$ARGUMENTS` contains a path, use that as the project directory\n   - Otherwise, use the current working directory\n   - Prefer the legacy `.understand-anything/` data directory when it exists, otherwise use `.ua/`\n\n   Use the Bash tool to resolve:\n   ```bash\n   PROJECT_ARG=\"$ARGUMENTS\"\n   if [ -n \"$PROJECT_ARG\" ]; then\n     PROJECT_DIR=$(cd \"$PROJECT_ARG\" 2>/dev/null && pwd -P)\n   else\n     PROJECT_DIR=$(pwd -P)\n   fi\n\n   if [ -z \"$PROJECT_DIR\" ] || [ ! -d \"$PROJECT_DIR\" ]; then\n     echo \"Error: Project directory not found: ${PROJECT_ARG:-$PWD}\"\n     exit 1\n   fi\n\n   if [ -d \"$PROJECT_DIR/.understand-anything\" ]; then\n     UA_DIR=\"$PROJECT_DIR/.understand-anything\"\n   else\n     UA_DIR=\"$PROJECT_DIR/.ua\"\n   fi\n   ```\n\n2. Check that `$UA_DIR/knowledge-graph.json` exists in the project directory. If not, tell the user:\n   ```\n   No knowledge graph found. Run /understand first to analyze this project.\n   ```\n\n   Use the Bash tool to check:\n   ```bash\n   if [ ! -f \"$UA_DIR/knowledge-graph.json\" ]; then\n     echo \"No knowledge graph found. Run /understand first to analyze this project.\"\n     exit 1\n   fi\n   ```\n\n3. 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:\n   - `${CLAUDE_PLUGIN_ROOT}/packages/dashboard/` (Claude Code runtime root, highest priority)\n   - `~/.understand-anything-plugin/packages/dashboard/` (universal symlink, all installs)\n   - Two levels up from `~/.agents/skills/understand-dashboard` real path (self-relative fallback)\n   - Two levels up from `~/.copilot/skills/understand-dashboard` real path (Copilot personal skills fallback)\n   - Common clone-based install roots:\n     - `~/.codex/understand-anything/understand-anything-plugin/packages/dashboard/`\n     - `~/.opencode/understand-anything/understand-anything-plugin/packages/dashboard/`\n     - `~/.pi/understand-anything/understand-anything-plugin/packages/dashboard/`\n     - `~/understand-anything/understand-anything-plugin/packages/dashboard/`\n\n   Use the Bash tool to resolve:\n   ```bash\n   SKILL_REAL=$(realpath ~/.agents/skills/understand-dashboard 2>/dev/null || readlink -f ~/.agents/skills/understand-dashboard 2>/dev/null || echo \"\")\n   SELF_RELATIVE=$([ -n \"$SKILL_REAL\" ] && cd \"$SKILL_REAL/../..\" 2>/dev/null && pwd || echo \"\")\n   COPILOT_SKILL_REAL=$(realpath ~/.copilot/skills/understand-dashboard 2>/dev/null || readlink -f ~/.copilot/skills/understand-dashboard 2>/dev/null || echo \"\")\n   COPILOT_SELF_RELATIVE=$([ -n \"$COPILOT_SKILL_REAL\" ] && cd \"$COPILOT_SKILL_REAL/../..\" 2>/dev/null && pwd || echo \"\")\n\n   PLUGIN_ROOT=\"\"\n   for candidate in \\\n     \"${CLAUDE_PLUGIN_ROOT}\" \\\n     \"$HOME/.understand-anything-plugin\" \\\n     \"$SELF_RELATIVE\" \\\n     \"$COPILOT_SELF_RELATIVE\" \\\n     \"$HOME/.codex/understand-anything/understand-anything-plugin\" \\\n     \"$HOME/.opencode/understand-anything/understand-anything-plugin\" \\\n     \"$HOME/.pi/understand-anything/understand-anything-plugin\" \\\n     \"$HOME/understand-anything/understand-anything-plugin\"; do\n     if [ -n \"$candidate\" ] && [ -d \"$candidate/packages/dashboard\" ]; then\n       PLUGIN_ROOT=\"$candidate\"; break\n     fi\n   done\n\n   if [ -z \"$PLUGIN_ROOT\" ]; then\n     echo \"Error: Cannot find the understand-anything plugin root.\"\n     echo \"Checked:\"\n     echo \"  - ${CLAUDE_PLUGIN_ROOT:-<unset CLAUDE_PLUGIN_ROOT>}\"\n     echo \"  - $HOME/.understand-anything-plugin\"\n     echo \"  - ${SELF_RELATIVE:-<unresolved path derived from ~/.agents/skills/understand-dashboard>}\"\n     echo \"  - ${COPILOT_SELF_RELATIVE:-<unresolved path derived from ~/.copilot/skills/understand-dashboard>}\"\n     echo \"  - $HOME/.codex/understand-anything/understand-anything-plugin\"\n     echo \"  - $HOME/.opencode/understand-anything/understand-anything-plugin\"\n     echo \"  - $HOME/.pi/understand-anything/understand-anything-plugin\"\n     echo \"  - $HOME/understand-anything/understand-anything-plugin\"\n     echo \"Make sure you followed the installation instructions for your platform.\"\n     exit 1\n   fi\n\n   DASHBOARD_DIR=\"$PLUGIN_ROOT/packages/dashboard\"\n   ```\n\n4. **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:\n   ```bash\n   : \"${PLUGIN_ROOT:?Run step 3 first so PLUGIN_ROOT is set}\"\n   : \"${PROJECT_DIR:?Run step 1 first so PROJECT_DIR is set}\"\n   PLUGIN_VERSION=$(node -p \"require('$PLUGIN_ROOT/package.json').version\")\n   VIEWER_URL=\"https://github.com/Egonex-AI/Understand-Anything/releases/download/v${PLUGIN_VERSION}/understand-anything-viewer.tgz\"\n   npx --yes \"$VIEWER_URL\" \"$PROJECT_DIR\"\n   ```\n   Run this in the background. It prints the same `🔑  Dashboard URL` line as the dev server:\n   - If the line appears, **skip steps 5-6** and continue at step 7.\n   - If the process exits without printing it (no release asset for this version, or no network), fall back to steps 5-6.\n\n5. Fallback: install dependencies and build if needed:\n   ```bash\n   : \"${PLUGIN_ROOT:?Run step 3 first so PLUGIN_ROOT is set}\"\n   DASHBOARD_DIR=\"${DASHBOARD_DIR:-$PLUGIN_ROOT/packages/dashboard}\"\n   cd \"$DASHBOARD_DIR\" && (pnpm install --frozen-lockfile 2>/dev/null || pnpm install)\n   ```\n   Then ensure the core package is built (the dashboard depends on it):\n   ```bash\n   : \"${PLUGIN_ROOT:?Run step 3 first so PLUGIN_ROOT is set}\"\n   cd \"$PLUGIN_ROOT\" && pnpm --filter @understand-anything/core build\n   ```\n\n6. Fallback: start the Vite dev server pointing at the project's knowledge graph:\n   ```bash\n   : \"${PROJECT_DIR:?Run step 1 first so PROJECT_DIR is set}\"\n   : \"${DASHBOARD_DIR:?Run step 5 first so DASHBOARD_DIR is set}\"\n   cd \"$DASHBOARD_DIR\" && GRAPH_DIR=\"$PROJECT_DIR\" npx vite --host 127.0.0.1\n   ```\n   Run this in the background so the user can continue working.\n\n7. **Capture the access token URL from the server output.** The server (viewer or Vite) prints a line like:\n   ```\n   🔑  Dashboard URL: http://127.0.0.1:<PORT>?token=<TOKEN>\n   ```\n   Extract the full URL including the `?token=` parameter. The token is required to access the knowledge graph data — without it the dashboard will show an \"Access Token Required\" gate.\n\n8. Report to the user, including the full tokenized URL:\n   ```\n   Dashboard started at http://127.0.0.1:<PORT>?token=<TOKEN>\n   Viewing: $UA_DIR/knowledge-graph.json\n\n   The dashboard is running in the background. Press Ctrl+C in the terminal to stop it.\n   ```\n   **Important:** Always include the `?token=` parameter in the URL you share. If you omit it, the user will be blocked by the token gate and have to manually find the token in the terminal output.\n\n## Notes\n\n- The fast path (step 4) downloads a version-pinned, self-contained viewer from the GitHub release — nothing is installed into the plugin directory and no build runs\n- The dashboard auto-opens in the default browser (both the viewer and Vite's `--open`)\n- If port 5173 is already in use, the next available port is picked (both paths)\n- In the fallback, the `GRAPH_DIR` environment variable tells the dev server where to find the knowledge graph","author":"@Egonex-AI","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/Egonex-AI/Understand-Anything/tree/main/understand-anything-plugin/skills/understand-dashboard","license":"MIT","category":"coding","lang":"en","tokens":1921,"stars":0,"calls30d":2,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":[]}}