### buildOnboardingGuide: Generate markdown onboarding guide from knowledge graph Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-14-phase4-implementation.md Defines the buildOnboardingGuide function that takes a KnowledgeGraph and returns a markdown string. It generates sections for project overview, architecture, key concepts, getting started tour, file map, complexity hotspots, and a footer. The output is standalone markdown suitable for README, wiki, or docs. ```typescript // packages/skill/src/onboard-builder.ts import type { KnowledgeGraph } from "@understand-anything/core"; /** * Generate a structured onboarding guide from the knowledge graph. * Output is standalone markdown suitable for a README, wiki, or docs. */ export function buildOnboardingGuide(graph: KnowledgeGraph): string { const { project, nodes, edges, layers, tour } = graph; const lines: string[] = []; // --- Project Overview --- lines.push(`# ${project.name}`); lines.push(""); lines.push(`> ${project.description}`); lines.push(""); lines.push(`| | |`); lines.push(`|---|---|`); lines.push(`| **Languages** | ${project.languages.join(", ")} |`); lines.push(`| **Frameworks** | ${project.frameworks.join(", ")} |`); lines.push(`| **Components** | ${nodes.length} nodes, ${edges.length} relationships |`); lines.push(`| **Last Analyzed** | ${project.analyzedAt} |`); lines.push(""); // --- Architecture --- if (layers.length > 0) { lines.push("## Architecture"); lines.push(""); lines.push("The project is organized into the following layers:"); lines.push(""); for (const layer of layers) { const memberNames = layer.nodeIds .map((id) => nodes.find((n) => n.id === id)?.name) .filter(Boolean); lines.push(`### ${layer.name}`); lines.push(""); lines.push(layer.description); lines.push(""); if (memberNames.length > 0) { lines.push(`Key components: ${memberNames.join(", ")}`); lines.push(""); } } } // --- Key Concepts --- const conceptNodes = nodes.filter((n) => n.type === "concept"); if (conceptNodes.length > 0) { lines.push("## Key Concepts"); lines.push(""); lines.push("Important architectural and domain concepts to understand:"); lines.push(""); for (const concept of conceptNodes) { lines.push(`### ${concept.name}`); lines.push(""); lines.push(concept.summary); lines.push(""); } } // --- Getting Started (Tour) --- if (tour.length > 0) { lines.push("## Getting Started"); lines.push(""); lines.push("Follow this guided tour to understand the codebase:"); lines.push(""); for (const step of tour) { const stepNodes = step.nodeIds .map((id) => nodes.find((n) => n.id === id)) .filter(Boolean); lines.push(`### ${step.order}. ${step.title}`); lines.push(""); lines.push(step.description); lines.push(""); if (stepNodes.length > 0) { lines.push("**Files to look at:**"); for (const node of stepNodes) { if (node!.filePath) { lines.push(`- \`${node!.filePath}\` — ${node!.summary}`); } } lines.push(""); } if (step.languageLesson) { lines.push(`> **Language Tip:** ${step.languageLesson}`); lines.push(""); } } } // --- File Map --- const fileNodes = nodes.filter((n) => n.type === "file" && n.filePath); if (fileNodes.length > 0) { lines.push("## File Map"); lines.push(""); lines.push("| File | Purpose | Complexity |"); lines.push("|------|---------|------------|"); for (const node of fileNodes) { lines.push(`| \`${node.filePath}\` | ${node.summary} | ${node.complexity} |`); } lines.push(""); } // --- Complexity Hotspots --- const complexNodes = nodes.filter((n) => n.complexity === "complex"); if (complexNodes.length > 0) { lines.push("## Complexity Hotspots"); lines.push(""); lines.push("These components are the most complex and deserve extra attention:"); lines.push(""); for (const node of complexNodes) { lines.push(`- **${node.name}** (${node.type}): ${node.summary}`); } lines.push(""); } // --- Footer --- lines.push("---"); lines.push(""); lines.push(`*Generated by [Understand Anything](https://github.com/anthropics/understand-anything) from knowledge graph v${graph.version}*`); lines.push(""); return lines.join("\n"); } ``` -------------------------------- ### Preview homepage with pnpm preview Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-15-homepage-implementation.md Starts a local preview server for the homepage. Use it to verify that Nav, Hero, Showcase, Features, Install CTA, and Footer render correctly, scroll animations trigger, and the Nav becomes solid on scroll. ```bash cd /Users/yuxianglin/Desktop/opensource/Understand-Anything/homepage pnpm preview ``` -------------------------------- ### Install the plugin Source: https://github.com/egonex-ai/understand-anything/blob/main/README.md Install the Understand-Anything plugin for your platform. Use these commands in your terminal or plugin manager. ```bash /plugin marketplace add Egonex-AI/Understand-Anything /plugin install understand-anything ``` -------------------------------- ### Install plugin for Copilot CLI Source: https://github.com/egonex-ai/understand-anything/blob/main/README.md Install the Understand-Anything plugin for Copilot CLI using the plugin install command. ```bash copilot plugin install Egonex-AI/Understand-Anything:understand-anything-plugin ``` -------------------------------- ### Install Understand Anything plugin Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/specs/2026-03-15-homepage-design.md Installation commands for the Understand Anything Claude Code plugin. Run these in Claude Code to add the plugin from the marketplace, install it, and then invoke the /understand command. ```text /plugin marketplace add Egonex-AI/Understand-Anything /plugin install understand-anything /understand ``` -------------------------------- ### Install plugin for Kiro CLI/IDE Source: https://github.com/egonex-ai/understand-anything/blob/main/README.md Install the plugin for Kiro CLI/IDE by passing 'kiro' as the platform argument to the installer. After installation, the skills are symlinked into ~/.kiro/skills/ and the understand agent is written to ~/.kiro/agents/understand.json. ```bash curl -fsSL https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/main/install.sh | bash -s kiro ``` -------------------------------- ### Install and build packages Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-05-24-semantic-batching-and-output-chunking-impl.md Installs dependencies and builds the core and skill packages. Expected result is all commands succeed. ```bash pnpm install pnpm --filter @understand-anything/core build pnpm --filter @understand-anything/skill build ``` -------------------------------- ### Start Dashboard in Development Mode Source: https://github.com/egonex-ai/understand-anything/blob/main/CONTRIBUTING.md Starts the dashboard in development mode (optional). ```bash pnpm dev:dashboard ``` -------------------------------- ### Install dependencies and build Astro project Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-15-homepage-implementation.md Installs dependencies and builds the Astro project. Expected output: build succeeds and a dist/ directory is created. ```bash cd /Users/yuxianglin/Desktop/opensource/Understand-Anything/homepage pnpm install pnpm build ``` -------------------------------- ### Run pnpm install and build Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-14-phase1-implementation.md Command to install dependencies and build the core package. Expected to compile with no errors and create packages/core/dist/. ```bash cd /path/to/project && pnpm install && pnpm --filter @understand-anything/core build ``` -------------------------------- ### One-line install on Windows PowerShell Source: https://github.com/egonex-ai/understand-anything/blob/main/README.md One-line installer for Windows PowerShell. Clones the repo to ~/.understand-anything/repo and creates symlinks for the chosen platform. ```powershell iwr -useb https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/main/install.ps1 | iex ``` -------------------------------- ### Generate starter .understandignore file Source: https://github.com/egonex-ai/understand-anything/blob/main/understand-anything-plugin/skills/understand/SKILL.md Command to generate a starter .understandignore file using the bundled script. Passes PLUGIN_ROOT via env and the project root as an argument. The script reads .gitignore, deduplicates against built-in defaults, and emits language-grouped test-file suggestions. ```bash PLUGIN_ROOT="$PLUGIN_ROOT" node "/generate-ignore.mjs" "$PROJECT_ROOT" ``` -------------------------------- ### TreeSitterPlugin implementation (setup) Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-14-phase1-implementation.md Initial implementation of the TreeSitterPlugin. Sets up parsers for TypeScript and JavaScript, selects the parser based on file extension, and provides a recursive tree traversal helper. This is the start of the plugin that will implement the AnalyzerPlugin interface. ```typescript import Parser from "tree-sitter"; import TypeScript from "tree-sitter-typescript"; import JavaScript from "tree-sitter-javascript"; import type { AnalyzerPlugin, StructuralAnalysis, ImportResolution, CallGraphEntry, } from "../types.js"; const tsParser = new Parser(); tsParser.setLanguage(TypeScript.typescript); const jsParser = new Parser(); jsParser.setLanguage(JavaScript); function getParser(filePath: string): Parser { if (filePath.endsWith(".ts") || filePath.endsWith(".tsx")) return tsParser; return jsParser; } function traverse( node: Parser.SyntaxNode, callback: (node: Parser.SyntaxNode) => void, ): void { callback(node); for (let i = 0; i < node.childCount; i++) { traverse(node.child(i)!, callback); } } ``` -------------------------------- ### Verify all format guides are present Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-04-09-understand-knowledge.md Lists the format guide files in the skill's formats directory. Expected to include obsidian.md, logseq.md, dendron.md, foam.md, karpathy.md, zettelkasten.md, and plain.md. ```bash ls understand-anything-plugin/skills/understand-knowledge/formats/ ``` -------------------------------- ### generateStarterIgnoreFile: Create starter .understandignore file Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-04-10-understandignore-impl.md Generates a starter .understandignore file by scanning the project root for common directories (e.g., __tests__, test, docs) and suggesting them as commented-out exclusions. All suggestions are commented out; the user must uncomment to activate. Always includes generic test file patterns like *.test.*, *.spec.*, and *.snap. ```typescript import { existsSync } from "node:fs"; import { join } from "node:path"; const HEADER = `# .understandignore — patterns for files/dirs to exclude from analysis # Syntax: same as .gitignore (globs, # comments, ! negation, trailing / for dirs) # Lines below are suggestions — uncomment to activate. # Use ! prefix to force-include something excluded by defaults. # # Built-in defaults (always excluded unless negated): # node_modules/, .git/, dist/, build/, bin/, obj/, *.lock, *.min.js, etc. # `; /** Directories to check for and suggest excluding. */ const DETECTABLE_DIRS = [ { dir: "__tests__", pattern: "__tests__/" }, { dir: "test", pattern: "test/" }, { dir: "tests", pattern: "tests/" }, { dir: "fixtures", pattern: "fixtures/" }, { dir: "testdata", pattern: "testdata/" }, { dir: "docs", pattern: "docs/" }, { dir: "examples", pattern: "examples/" }, { dir: "scripts", pattern: "scripts/" }, { dir: "migrations", pattern: "migrations/" }, { dir: ".storybook", pattern: ".storybook/" }, ]; /** Always-included generic suggestions. */ const GENERIC_SUGGESTIONS = [ "*.test.*", "*.spec.*", "*.snap", ]; /** * Generates a starter .understandignore file by scanning the project root * for common directories and suggesting them as commented-out exclusions. * * All suggestions are commented out — the user must uncomment to activate. * Returns the file content as a string. */ export function generateStarterIgnoreFile(projectRoot: string): string { const sections: string[] = [HEADER]; // Detected directory suggestions const detected: string[] = []; for (const { dir, pattern } of DETECTABLE_DIRS) { if (existsSync(join(projectRoot, dir))) { detected.push(pattern); } } if (detected.length > 0) { sections.push("# --- Detected directories (uncomment to exclude) ---\n"); for (const pattern of detected) { sections.push(`# ${pattern}`); } sections.push(""); } // Generic suggestions (always included) sections.push("# --- Test file patterns (uncomment to exclude) ---\n"); for (const pattern of GENERIC_SUGGESTIONS) { sections.push(`# ${pattern}`); } sections.push(""); return sections.join("\n"); } ``` -------------------------------- ### Run dashboard via Vite dev server Source: https://github.com/egonex-ai/understand-anything/blob/main/README.md Run the dashboard via the Vite dev server when working from a clone. First install dependencies and build the core package, then start the dev server with GRAPH_DIR set to the project path. ```bash pnpm install && pnpm --filter @understand-anything/core build ``` ```bash GRAPH_DIR=/path/to/analyzed/project pnpm dev:dashboard ``` -------------------------------- ### Fallback: install dashboard dependencies Source: https://github.com/egonex-ai/understand-anything/blob/main/understand-anything-plugin/skills/understand-dashboard/SKILL.md Installs dashboard dependencies with pnpm, preferring a frozen lockfile. Requires PLUGIN_ROOT to be set. Falls back to a regular install if the frozen install fails. ```bash : "${PLUGIN_ROOT:?Run step 3 first so PLUGIN_ROOT is set}" DASHBOARD_DIR="${DASHBOARD_DIR:-$PLUGIN_ROOT/packages/dashboard}" cd "$DASHBOARD_DIR" && (pnpm install --frozen-lockfile 2>/dev/null || pnpm install) ``` -------------------------------- ### User command to fetch and follow INSTALL.md Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/specs/2026-03-18-multi-platform-simple-design.md One-line command the user tells the agent to fetch and follow installation instructions from the specified URL. ```text Fetch and follow instructions from https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/refs/heads/main/understand-anything-plugin/.codex/INSTALL.md ``` -------------------------------- ### Install Dependencies with pnpm Source: https://github.com/egonex-ai/understand-anything/blob/main/CONTRIBUTING.md Installs all project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Language markdown format example Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/specs/2026-03-21-language-agnostic-design.md Example structure for a language-specific markdown file, showing key concepts, import patterns, notable file patterns, and example summary style. ```markdown # Python ## Key Concepts - Decorators, comprehensions, generators, context managers, type hints, dunder methods ## Import Patterns - `import module`, `from module import name`, relative imports ## Notable File Patterns - `__init__.py` (package initializer), `conftest.py` (pytest), `pyproject.toml` (config) ## Example Summary Style > "FastAPI route handler that accepts a Pydantic model, validates input..." ``` -------------------------------- ### Build and verify core package Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-21-language-agnostic-plan.md Runs the build for the @understand-anything/core package. Expected to succeed with no errors. ```bash cd understand-anything-plugin && pnpm --filter @understand-anything/core build ``` -------------------------------- ### Homepage commands Source: https://github.com/egonex-ai/understand-anything/blob/main/homepage/README.md Commands to run from the repository root: start the local dev server, build the static site, and preview the built site. ```bash pnpm --filter homepage dev ``` ```bash pnpm --filter homepage build ``` ```bash pnpm --filter homepage preview ``` -------------------------------- ### Install @anthropic-ai/sdk Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-14-phase2-implementation.md Installs the Anthropic SDK in the dashboard package. Run from the repository root. ```bash cd packages/dashboard && pnpm add @anthropic-ai/sdk ``` -------------------------------- ### Verify full build with pnpm commands Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-14-phase2-implementation.md Run the full build and test suite for the core and skill packages, then start the dashboard dev server. All commands should pass or run without errors. ```bash pnpm install pnpm --filter @understand-anything/core build pnpm --filter @understand-anything/skill build pnpm --filter @understand-anything/core test pnpm --filter @understand-anything/skill test pnpm dev:dashboard ``` -------------------------------- ### Install fuse.js in core package Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-14-phase2-implementation.md Installs the fuse.js dependency in the core package using pnpm. ```bash cd packages/core && pnpm add fuse.js ``` -------------------------------- ### Install zod in core package Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-14-phase2-implementation.md Command to install zod in the core package using pnpm. ```bash cd packages/core && pnpm add zod ``` -------------------------------- ### Create README.md for Understand Anything Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-14-phase1-implementation.md The README.md file for the project, providing an overview, features, quick start commands, project structure, and tech stack. It is intended to be created as part of the integration task. ```markdown # Understand Anything An open-source tool that combines LLM intelligence with static analysis to help anyone understand any codebase — from junior developers to product managers. ## Features - **Knowledge Graph** — Automatically maps your codebase into an interactive graph of files, functions, classes, and their relationships - **Multi-Panel Dashboard** — Graph view, code viewer, chat, and learn panels in a workspace layout - **Natural Language Search** — Search your codebase with plain English: "which parts handle authentication?" - **Tree-sitter Analysis** — Accurate structural analysis for TypeScript, JavaScript (more languages coming) - **LLM-Powered Summaries** — Every node gets a plain-English description of what it does and why ## Quick Start ```bash # Install dependencies pnpm install # Build the core package pnpm --filter @understand-anything/core build # Start the dashboard dev server pnpm dev:dashboard ``` ## Project Structure ``` packages/ core/ — Analysis engine: types, persistence, tree-sitter, LLM prompts dashboard/ — React + TypeScript web dashboard skill/ — Claude Code skill (coming soon) ``` ## Tech Stack - TypeScript, pnpm workspaces - React 18, Vite, TailwindCSS - React Flow (graph visualization) - Monaco Editor (code viewer) - Zustand (state management) - tree-sitter (static analysis) ``` -------------------------------- ### Create skill directory Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-04-01-business-domain-knowledge-impl.md Creates the directory for the /understand-domain skill. ```bash mkdir -p understand-anything-plugin/skills/understand-domain ``` -------------------------------- ### Install new dependencies with pnpm Source: https://github.com/egonex-ai/understand-anything/blob/main/docs/superpowers/plans/2026-03-28-understand-anything-extension-impl.md Command to install yaml, @iarna/toml, and jsonc-parser in the core package directory. ```bash cd understand-anything-plugin/packages/core pnpm add yaml @iarna/toml jsonc-parser ``` -------------------------------- ### Fast path: run prebuilt viewer with npx Source: https://github.com/egonex-ai/understand-anything/blob/main/understand-anything-plugin/skills/understand-dashboard/SKILL.md Runs the self-contained viewer tarball pinned to the installed plugin version. Requires PLUGIN_ROOT and PROJECT_DIR to be set (steps 1 and 3). Prints the same dashboard URL line as the dev server; if it appears, skip steps 5-6. ```bash : "${PLUGIN_ROOT:?Run step 3 first so PLUGIN_ROOT is set}" : "${PROJECT_DIR:?Run step 1 first so PROJECT_DIR is set}" PLUGIN_VERSION=$(node -p "require('$PLUGIN_ROOT/package.json').version") VIEWER_URL="https://github.com/Egonex-AI/Understand-Anything/releases/download/v${PLUGIN_VERSION}/understand-anything-viewer.tgz" npx --yes "$VIEWER_URL" "$PROJECT_DIR" ``` ```text 🔑 Dashboard URL: http://127.0.0.1:?token= ``` -------------------------------- ### Fallback: build core package Source: https://github.com/egonex-ai/understand-anything/blob/main/understand-anything-plugin/skills/understand-dashboard/SKILL.md Builds the @understand-anything/core package, which the dashboard depends on. Requires PLUGIN_ROOT to be set. ```bash : "${PLUGIN_ROOT:?Run step 3 first so PLUGIN_ROOT is set}" cd "$PLUGIN_ROOT" && pnpm --filter @understand-anything/core build ```